parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"g5IB":[function(require,module,exports) { var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}; },{}],"HlZQ":[function(require,module,exports) { var global = arguments[3]; var process = require("process"); var define; var e,t=arguments[3],n=require("process");!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(t,n){"use strict";var r=[],i=Object.getPrototypeOf,o=r.slice,a=r.flat?function(e){return r.flat.call(e)}:function(e){return r.concat.apply([],e)},s=r.push,u=r.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},v=function(e){return null!=e&&e===e.window},y=t.document,m={type:!0,src:!0,nonce:!0,noModule:!0};function x(e,t,n){var r,i,o=(n=n||y).createElement("script");if(o.text=e,t)for(r in m)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function b(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var w=function(e,t){return new w.fn.init(e,t)};function T(e){var t=!!e&&"length"in e&&e.length,n=b(e);return!g(e)&&!v(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}w.fn=w.prototype={jquery:"3.5.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(w.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(w.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:r.sort,splice:r.splice},w.extend=w.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||w.isPlainObject(n)?n:{},i=!1,a[t]=w.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},w.extend({expando:"jQuery"+("3.5.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){x(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(T(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(T(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,s=[];if(T(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a(s)},guid:1,support:h}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=r[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});var C=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,v,y,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ue(),S=ue(),k=ue(),A=ue(),N=function(e,t){return e===t&&(f=!0),0},D={}.hasOwnProperty,j=[],q=j.pop,L=j.push,H=j.push,O=j.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){p()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(j=O.call(w.childNodes),w.childNodes),j[w.childNodes.length].nodeType}catch(Se){H={apply:j.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var o,s,l,c,f,h,y,m=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(p(t),t=t||d,g)){if(11!==w&&(f=Z.exec(e)))if(o=f[1]){if(9===w){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return H.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return H.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!A[e+" "]&&(!v||!v.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(y=e,m=t,1===w&&(U.test(e)||z.test(e))){for((m=ee.test(e)&&ye(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,ie):t.setAttribute("id",c=b)),s=(h=a(e)).length;s--;)h[s]=(c?"#"+c:":scope")+" "+xe(h[s]);y=h.join(",")}try{return H.apply(r,m.querySelectorAll(y)),r}catch(T){A(e,!0)}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace($,"$1"),t,r,i)}function ue(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function le(e){return e[b]=!0,e}function ce(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(Se){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ge(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ve(e){return le(function(t){return t=+t,le(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},p=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=d&&9===a.nodeType&&a.documentElement?(h=(d=a).documentElement,g=!o(d),w!=d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce(function(e){return h.appendChild(e).appendChild(d.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(d.getElementsByClassName),n.getById=ce(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],v=[],(n.qsa=K.test(d.querySelectorAll))&&(ce(function(e){var t;h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+b+"-]").length||v.push("~="),(t=d.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(n.matchesSelector=K.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),y.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),t=K.test(h.compareDocumentPosition),x=t||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},N=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==d||e.ownerDocument==w&&x(w,e)?-1:t==d||t.ownerDocument==w&&x(w,t)?1:c?P(c,e)-P(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==d?-1:t==d?1:i?-1:o?1:c?P(c,e)-P(c,t):0;if(i===o)return pe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?pe(a[r],s[r]):a[r]==w?-1:s[r]==w?1:0},d):d},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&g&&!A[t+" "]&&(!y||!y.test(t))&&(!v||!v.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(Se){A(t,!0)}return se(t,d,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=d&&p(e),x(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&D.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(N),f){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=se.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=se.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(B," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",v=t.parentNode,y=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(v){if(o){for(;g;){for(p=t;p=p[g];)if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?v.firstChild:v.lastChild],a&&m){for(x=(d=(l=(c=(f=(p=v)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&v.childNodes[d];p=++d&&p&&p[g]||(x=d=0)||h.pop();)if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)for(;(p=++d&&p&&p[g]||(x=d=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++x||(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=P(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:le(function(e){var t=[],n=[],r=s(e.replace($,"$1"));return r[b]?le(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:le(function(e){return function(t){return se(e,t).length>0}}),contains:le(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}}),lang:le(function(e){return V.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=de(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=he(t);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=C++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,p=[T,s];if(u){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(c=(f=t[b]||(t[b]={}))[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===T&&l[1]===s)return p[2]=l[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function we(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(e,t,n,r,i,o){return r&&!r[b]&&(r=Ce(r)),i&&!i[b]&&(i=Ce(i,o)),le(function(o,a,s,u){var l,c,f,p=[],d=[],h=a.length,g=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),v=!e||!o&&t?g:Te(g,p,e,s,u),y=n?i||(o?e:h||r)?[]:a:v;if(n&&n(v,y,s,u),r)for(l=Te(y,d),r(l,[],s,u),c=l.length;c--;)(f=l[c])&&(y[d[c]]=!(v[d[c]]=f));if(o){if(i||e){if(i){for(l=[],c=y.length;c--;)(f=y[c])&&l.push(v[c]=f);i(null,y=[],l,u)}for(c=y.length;c--;)(f=y[c])&&(l=i?P(o,f):p[c])>-1&&(o[l]=!(a[l]=f))}}else y=Te(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function Ee(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=be(function(e){return e===t},s,!0),f=be(function(e){return P(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])p=[be(we(p),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[b]){for(i=++u;i<o&&!r.relative[e[i].type];i++);return Ce(u>1&&we(p),u>1&&xe(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace($,"$1"),n,u<i&&Ee(e.slice(u,i)),i<o&&Ee(e=e.slice(i)),i<o&&xe(e))}p.push(n)}return we(p)}return me.prototype=r.filters=r.pseudos,r.setFilters=new me,a=se.tokenize=function(e,t){var n,i,o,a,s,u,l,c=S[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=r.preFilter;s;){for(a in n&&!(i=_.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),n=!1,(i=z.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace($," ")}),s=s.slice(n.length)),r.filter)!(i=G[a].exec(s))||l[a]&&!(i=l[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?se.error(e):S(e,u).slice(0)},s=se.compile=function(e,t){var n,i=[],o=[],s=k[e+" "];if(!s){for(t||(t=a(e)),n=t.length;n--;)(s=Ee(t[n]))[b]?i.push(s):o.push(s);(s=k(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,u,c){var f,h,v,y=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,S=C.length;for(c&&(l=a==d||a||c);m!==S&&null!=(f=C[m]);m++){if(i&&f){for(h=0,a||f.ownerDocument==d||(p(f),s=!g);v=e[h++];)if(v(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!v&&f)&&y--,o&&x.push(f))}if(y+=m,n&&m!==y){for(h=0;v=t[h++];)v(x,b,a,s);if(o){if(y>0)for(;m--;)x[m]||b[m]||(b[m]=q.call(u));b=Te(b)}H.apply(u,b),c&&!o&&b.length>0&&y+t.length>1&&se.uniqueSort(u)}return c&&(T=E,l=w),x};return n?le(o):o}(o,i))).selector=e}return s},u=se.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=G.needsContext.test(e)?0:u.length;o--&&(l=u[o],!r.relative[c=l.type]);)if((f=r.find[c])&&(i=f(l.matches[0].replace(te,ne),ee.test(u[0].type)&&ye(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&xe(u)))return H.apply(n,i),n;break}}return(p||s(e,d))(i,t,!g,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},n.sortStable=b.split("").sort(N).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(t);w.find=C,w.expr=C.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=C.uniqueSort,w.text=C.getText,w.isXMLDoc=C.isXML,w.contains=C.contains,w.escapeSelector=C.escape;var E=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=w.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t<r;t++)if(w.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)w.find(e,i[t],n);return r>1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&k.test(e)?w(e):e||[],!1).length}});var j,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:y,!0)),N.test(r[1])&&w.isPlainObject(t))for(r in t)g(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=y.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,j=w(y);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&w(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return E(e,"parentNode")},parentsUntil:function(e,t,n){return E(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return E(e,"nextSibling")},prevAll:function(e){return E(e,"previousSibling")},nextUntil:function(e,t,n){return E(e,"nextSibling",n)},prevUntil:function(e,t,n){return E(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return null!=e.contentDocument&&i(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(H[e]||w.uniqueSort(i),L.test(e)&&i.reverse()),this.pushStack(i)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return w.each(e.match(P)||[],function(e,n){t[n]=!0}),t}(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<o.length;)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){w.each(n,function(n,r){g(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==b(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return w.each(arguments,function(e,t){for(var n;(n=w.inArray(t,o,n))>-1;)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},w.extend({Deferred:function(e){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,r,i){var o=0;function a(e,n,r,i){return function(){var s=this,u=arguments,l=function(){var t,l;if(!(e<o)){if((t=r.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");l=t&&("object"==typeof t||"function"==typeof t)&&t.then,g(l)?i?l.call(t,a(o,n,R,i),a(o,n,M,i)):(o++,l.call(t,a(o,n,R,i),a(o,n,M,i),a(o,n,R,n.notifyWith))):(r!==R&&(s=void 0,u=[t]),(i||n.resolveWith)(s,u))}},c=i?l:function(){try{l()}catch(t){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(t,c.stackTrace),e+1>=o&&(r!==M&&(s=void 0,u=[t]),n.rejectWith(s,u))}};e?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),t.setTimeout(c))}}return w.Deferred(function(t){n[0][3].add(a(0,t,g(i)?i:R,t.notifyWith)),n[1][3].add(a(0,t,g(e)?e:R)),n[2][3].add(a(0,t,g(r)?r:M))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&(I(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();for(;n--;)I(i[n],s(n),a.reject);return a.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(e,n){t.console&&t.console.warn&&e&&W.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,n)},w.readyException=function(e){t.setTimeout(function(){throw e})};var F=w.Deferred();function B(){y.removeEventListener("DOMContentLoaded",B),t.removeEventListener("load",B),w.ready()}w.fn.ready=function(e){return F.then(e).catch(function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(y,[w]))}}),w.ready.then=F.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?t.setTimeout(w.ready):(y.addEventListener("DOMContentLoaded",B),t.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===b(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=w.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||w.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!w.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:J.test(e)?JSON.parse(e):e)}(n)}catch(i){}Q.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){Q.set(this,e)}):$(this,function(t){var n;if(o&&void 0===t)return void 0!==(n=Q.get(o,e))?n:void 0!==(n=Z(o,e))?n:void 0;this.each(function(){Q.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){w.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:w.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each(function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)})},dequeue:function(e){return this.each(function(){w.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=w.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=y.documentElement,ie=function(e){return w.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return w.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===w.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return w.css(e,t,"")},u=s(),l=n&&n[3]||(w.cssNumber[t]?"":"px"),c=e.nodeType&&(w.cssNumber[t]||"px"!==l&&+u)&&te.exec(w.css(e,t));if(c&&c[3]!==l){for(u/=2,l=l||c[3],c=+u||1;a--;)w.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,w.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e){var t,n=e.ownerDocument,r=e.nodeName,i=ue[r];return i||(t=n.body.appendChild(n.createElement(r)),i=w.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),ue[r]=i,i)}function ce(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=Y.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[o]=le(r))):"none"!==n&&(i[o]="none",Y.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}w.fn.extend({show:function(){return ce(this,!0)},hide:function(){return ce(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?w(this).show():w(this).hide()})}});var fe,pe,de=/^(?:checkbox|radio)$/i,he=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ge=/^$|^module$|\/(?:java|ecma)script/i;fe=y.createDocumentFragment().appendChild(y.createElement("div")),(pe=y.createElement("input")).setAttribute("type","radio"),pe.setAttribute("checked","checked"),pe.setAttribute("name","t"),fe.appendChild(pe),h.checkClone=fe.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.innerHTML="<textarea>x</textarea>",h.noCloneChecked=!!fe.cloneNode(!0).lastChild.defaultValue,fe.innerHTML="<option></option>",h.option=!!fe.lastChild;var ve={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ye(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?w.merge([e],n):n}function me(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ve.tbody=ve.tfoot=ve.colgroup=ve.caption=ve.thead,ve.th=ve.td,h.option||(ve.optgroup=ve.option=[1,"<select multiple='multiple'>","</select>"]);var xe=/<|&#?\w+;/;function be(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===b(o))w.merge(p,o.nodeType?[o]:o);else if(xe.test(o)){for(a=a||f.appendChild(t.createElement("div")),s=(he.exec(o)||["",""])[1].toLowerCase(),u=ve[s]||ve._default,a.innerHTML=u[1]+w.htmlPrefilter(o)+u[2],c=u[0];c--;)a=a.lastChild;w.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));for(f.textContent="",d=0;o=p[d++];)if(r&&w.inArray(o,r)>-1)i&&i.push(o);else if(l=ie(o),a=ye(f.appendChild(o),"script"),l&&me(a),n)for(c=0;o=a[c++];)ge.test(o.type||"")&&n.push(o);return f}var we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function Se(){return!1}function ke(e,t){return e===function(){try{return y.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}function Ne(e,t,n){n?(Y.set(e,t,!1),w.event.add(e,t,{namespace:!1,handler:function(e){var r,i,a=Y.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(w.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=o.call(arguments),Y.set(this,t,a),r=n(this,t),this[t](),a!==(i=Y.get(this,t))||r?Y.set(this,t,!1):i={},a!==i)return e.stopImmediatePropagation(),e.preventDefault(),i.value}else a.length&&(Y.set(this,t,{value:w.event.trigger(w.extend(a[0],w.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,t)&&w.event.add(e,t,Ee)}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(e);if(V(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(re,i),n.guid||(n.guid=w.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(t){return void 0!==w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(P)||[""]).length;l--;)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){for(l=(t=(t||"").match(P)||[""]).length;l--;)if(d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){for(f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||w.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=w.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=w.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(a=w.event.handlers.call(this,u,l),t=0;(i=a[t++])&&!u.isPropagationStopped();)for(u.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((w.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?w(i,this).index(l)>-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:g(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return de.test(t.type)&&t.click&&A(t,"input")&&Ne(t,"click",Ee),!1},trigger:function(e){var t=this||e;return de.test(t.type)&&t.click&&A(t,"input")&&Ne(t,"click"),!0},_default:function(e){var t=e.target;return de.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ee:Se,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:Se,isPropagationStopped:Se,isImmediatePropagationStopped:Se,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ee,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ee,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ee,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&we.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Te.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},w.event.addProp),w.each({focus:"focusin",blur:"focusout"},function(e,t){w.event.special[e]={setup:function(){return Ne(this,e,ke),!1},trigger:function(){return Ne(this,e),!0},delegateType:t}}),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||w.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),w.fn.extend({on:function(e,t,n,r){return Ae(this,e,t,n,r)},one:function(e,t,n,r){return Ae(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,w(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Se),this.each(function(){w.event.remove(this,e,n,t)})}});var De=/<script|<style|<link/i,je=/checked\s*(?:[^=]|=\s*.checked.)/i,qe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Le(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)w.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=w.extend({},o),Q.set(t,a))}}function Re(e,t,n,r){t=a(t);var i,o,s,u,l,c,f=0,p=e.length,d=p-1,v=t[0],y=g(v);if(y||p>1&&"string"==typeof v&&!h.checkClone&&je.test(v))return e.each(function(i){var o=e.eq(i);y&&(t[0]=v.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(o=(i=be(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f<p;f++)l=i,f!==d&&(l=w.clone(l,!0,!0),u&&w.merge(s,ye(l,"script"))),n.call(e[f],l,f);if(u)for(c=s[s.length-1].ownerDocument,w.map(s,Oe),f=0;f<u;f++)l=s[f],ge.test(l.type||"")&&!Y.access(l,"globalEval")&&w.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?w._evalUrl&&!l.noModule&&w._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")},c):x(l.textContent.replace(qe,""),l,c))}return e}function Me(e,t,n){for(var r,i=t?w.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||w.cleanData(ye(r)),r.parentNode&&(n&&ie(r)&&me(ye(r,"script")),r.parentNode.removeChild(r));return e}w.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(c),r=0,i=(o=ye(e)).length;r<i;r++)s=o[r],u=a[r],l=void 0,"input"===(l=u.nodeName.toLowerCase())&&de.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ye(e),a=a||ye(c),r=0,i=o.length;r<i;r++)Pe(o[r],a[r]);else Pe(e,c);return(a=ye(c,"script")).length>0&&me(a,!f&&ye(e,"script")),c},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Me(this,e,!0)},remove:function(e){return Me(this,e)},text:function(e){return $(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!De.test(e)&&!ve[(he.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(ye(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),w(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}});var Ie=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),We=function(e){var n=e.ownerDocument.defaultView;return n&&n.opener||(n=t),n.getComputedStyle(e)},Fe=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Be=new RegExp(ne.join("|"),"i");function $e(e,t,n){var r,i,o,a,s=e.style;return(n=n||We(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=w.style(e,t)),!h.pixelBoxStyles()&&Ie.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(l).appendChild(c);var e=t.getComputedStyle(c);r="1%"!==e.top,u=12===n(e.marginLeft),c.style.right="60%",a=36===n(e.right),i=36===n(e.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),re.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var r,i,o,a,s,u,l=y.createElement("div"),c=y.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(h,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),a},pixelPosition:function(){return e(),r},reliableMarginLeft:function(){return e(),u},scrollboxSize:function(){return e(),o},reliableTrDimensions:function(){var e,n,r,i;return null==s&&(e=y.createElement("table"),n=y.createElement("tr"),r=y.createElement("div"),e.style.cssText="position:absolute;left:-11111px",n.style.height="1px",r.style.height="9px",re.appendChild(e).appendChild(n).appendChild(r),i=t.getComputedStyle(n),s=parseInt(i.height)>3,re.removeChild(e)),s}}))}();var ze=["Webkit","Moz","ms"],Ue=y.createElement("div").style,Xe={};function Ve(e){var t=w.cssProps[e]||Xe[e];return t||(e in Ue?e:Xe[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=ze.length;n--;)if((e=ze[n]+t)in Ue)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Ye=/^--/,Qe={position:"absolute",visibility:"hidden",display:"block"},Je={letterSpacing:"0",fontWeight:"400"};function Ke(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ze(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=w.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=w.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=w.css(e,"border"+ne[a]+"Width",!0,i))):(u+=w.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=w.css(e,"border"+ne[a]+"Width",!0,i):s+=w.css(e,"border"+ne[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function et(e,t,n){var r=We(e),i=(!h.boxSizingReliable()||n)&&"border-box"===w.css(e,"boxSizing",!1,r),o=i,a=$e(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Ie.test(a)){if(!n)return a;a="auto"}return(!h.boxSizingReliable()&&i||!h.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===w.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===w.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ze(e,t,n||(i?"border":"content"),o,r,a)+"px"}function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=$e(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ye.test(t),l=e.style;if(u||(t=Ve(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Ye.test(t)||(t=Ve(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=$e(e,t,r)),"normal"===i&&t in Je&&(i=Je[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!Ge.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):Fe(e,Qe,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=We(e),a=!h.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===w.css(e,"boxSizing",!1,o),u=r?Ze(e,t,r,s,o):0;return s&&a&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),u&&(i=te.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(0,n,u)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat($e(e,"marginLeft"))||e.getBoundingClientRect().left-Fe(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+ne[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=We(e),i=t.length;a<i;a++)o[t[a]]=w.css(e,t[a],!1,r);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)},e,t,arguments.length>1)}}),w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||!w.cssHooks[e.prop]&&null==e.elem.style[Ve(e.prop)]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===y.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(at):t.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return t.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(ct.tweeners[t]||[]).concat(ct.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ct(e,t,n){var r,i,o=0,a=ct.prefilters.length,s=w.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=nt||st(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,a=l.tweens.length;o<a;o++)l.tweens[o].run(r);return s.notifyWith(e,[l,r,n]),r<1&&a?n:(a||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:nt||st(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=w.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);o<a;o++)if(r=ct.prefilters[o].call(l,e,c,l.opts))return g(r.stop)&&(w._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,lt,l),g(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),w.fx.timer(w.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}w.Animation=w.extend(ct,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){g(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ct.tweeners[n]=ct.tweeners[n]||[],ct.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=w._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,w.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],it.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||w.style(e,r)}if((u=!w.isEmptyObject(t))||!w.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=w.css(e,"display"))&&(l?c=l:(ce([e],!0),l=e.style.display||l,c=w.css(e,"display"),ce([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===w.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&ce([e],!0),p.done(function(){for(r in g||ce([e]),Y.remove(e,"fxshow"),d)w.style(e,r,d[r])})),u=lt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ct.prefilters.unshift(e):ct.prefilters.push(e)}}),w.speed=function(e,t,n){var r=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||g(e)&&e,duration:e,easing:n&&t||t&&!g(t)&&t};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){g(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),o=w.speed(t,n,r),a=function(){var t=ct(this,w.extend({},e),o);(i||Y.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=w.timers,a=Y.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&ot.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||w.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=Y.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=w.timers,a=r?r.length:0;for(n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),w.each(["toggle","show","hide"],function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ut(t,!0),e,r,i)}}),w.each({slideDown:ut("show"),slideUp:ut("hide"),slideToggle:ut("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(nt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),nt=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){rt||(rt=!0,at())},w.fx.stop=function(){rt=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(e,n){return e=w.fx&&w.fx.speeds[e]||e,n=n||"fx",this.queue(n,function(n,r){var i=t.setTimeout(n,e);r.stop=function(){t.clearTimeout(i)}})},function(){var e=y.createElement("input"),t=y.createElement("select").appendChild(y.createElement("option"));e.type="checkbox",h.checkOn=""!==e.value,h.optSelected=t.selected,(e=y.createElement("input")).value="t",e.type="radio",h.radioValue="t"===e.value}();var ft,pt=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return $(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?ft:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),ft={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=pt[t]||w.find.attr;pt[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=pt[a],pt[a]=i,i=null!=n(e,t,r)?a:null,pt[a]=o),i}});var dt=/^(?:input|select|textarea|button)$/i,ht=/^(?:a|area)$/i;function gt(e){return(e.match(P)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function yt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}w.fn.extend({prop:function(e,t){return $(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||ht.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this}),w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,vt(this)))});if((t=yt(e)).length)for(;n=this[u++];)if(i=vt(n),r=1===n.nodeType&&" "+gt(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=gt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,vt(this)))});if(!arguments.length)return this.attr("class","");if((t=yt(e)).length)for(;n=this[u++];)if(i=vt(n),r=1===n.nodeType&&" "+gt(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=gt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,vt(this),t),t)}):this.each(function(){var t,i,o,a;if(r)for(i=0,o=w(this),a=yt(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=vt(this))&&Y.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+gt(vt(n))+" ").indexOf(t)>-1)return!0;return!1}});var mt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(mt,""):null==n?"":n:void 0}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:gt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=w(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=w.makeArray(t),a=i.length;a--;)((r=i[a]).selected=w.inArray(w.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in t;var xt=/^(?:focusinfocus|focusoutblur)$/,bt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(e,n,r,i){var o,a,s,u,l,c,p,d,h=[r||y],m=f.call(e,"type")?e.type:e,x=f.call(e,"namespace")?e.namespace.split("."):[];if(a=d=s=r=r||y,3!==r.nodeType&&8!==r.nodeType&&!xt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(x=m.split("."),m=x.shift(),x.sort()),l=m.indexOf(":")<0&&"on"+m,(e=e[w.expando]?e:new w.Event(m,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=x.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),n=null==n?[e]:w.makeArray(n,[e]),p=w.event.special[m]||{},i||!p.trigger||!1!==p.trigger.apply(r,n))){if(!i&&!p.noBubble&&!v(r)){for(u=p.delegateType||m,xt.test(u+m)||(a=a.parentNode);a;a=a.parentNode)h.push(a),s=a;s===(r.ownerDocument||y)&&h.push(s.defaultView||s.parentWindow||t)}for(o=0;(a=h[o++])&&!e.isPropagationStopped();)d=a,e.type=o>1?u:p.bindType||m,(c=(Y.get(a,"events")||Object.create(null))[e.type]&&Y.get(a,"handle"))&&c.apply(a,n),(c=l&&a[l])&&c.apply&&V(a)&&(e.result=c.apply(a,n),!1===e.result&&e.preventDefault());return e.type=m,i||e.isDefaultPrevented()||p._default&&!1!==p._default.apply(h.pop(),n)||!V(r)||l&&g(r[m])&&!v(r)&&((s=r[l])&&(r[l]=null),w.event.triggered=m,e.isPropagationStopped()&&d.addEventListener(m,bt),r[m](),e.isPropagationStopped()&&d.removeEventListener(m,bt),w.event.triggered=void 0,s&&(r[l]=s)),e.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=Y.access(r,t);i||r.addEventListener(e,n,!0),Y.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=Y.access(r,t)-1;i?Y.access(r,t,i):(r.removeEventListener(e,n,!0),Y.remove(r,t))}}});var wt=t.location,Tt={guid:Date.now()},Ct=/\?/;w.parseXML=function(e){var n;if(!e||"string"!=typeof e)return null;try{n=(new t.DOMParser).parseFromString(e,"text/xml")}catch(r){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+e),n};var Et=/\[\]$/,St=/\r?\n/g,kt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function Nt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||Et.test(e)?r(e,i):Nt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==b(t))r(e,t);else for(i in t)Nt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)Nt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!kt.test(e)&&(this.checked||!de.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(St,"\r\n")}}):{name:t.name,value:n.replace(St,"\r\n")}}).get()}});var Dt=/%20/g,jt=/#.*$/,qt=/([?&])_=[^&]*/,Lt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ht=/^(?:GET|HEAD)$/,Ot=/^\/\//,Pt={},Rt={},Mt="*/".concat("*"),It=y.createElement("a");function Wt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(P)||[];if(g(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Ft(e,t,n,r){var i={},o=e===Rt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Bt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}It.href=wt.href,w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:wt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(wt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Mt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Bt(Bt(e,w.ajaxSettings),t):Bt(w.ajaxSettings,e)},ajaxPrefilter:Wt(Pt),ajaxTransport:Wt(Rt),ajax:function(e,n){"object"==typeof e&&(n=e,e=void 0),n=n||{};var r,i,o,a,s,u,l,c,f,p,d=w.ajaxSetup({},n),h=d.context||d,g=d.context&&(h.nodeType||h.jquery)?w(h):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=d.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(l){if(!a)for(a={};t=Lt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(e,t){return null==l&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==l&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return r&&r.abort(t),S(0,t),this}};if(v.promise(E),d.url=((e||d.url||wt.href)+"").replace(Ot,wt.protocol+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(P)||[""],null==d.crossDomain){u=y.createElement("a");try{u.href=d.url,u.href=u.href,d.crossDomain=It.protocol+"//"+It.host!=u.protocol+"//"+u.host}catch(k){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=w.param(d.data,d.traditional)),Ft(Pt,d,n,E),l)return E;for(f in(c=w.event&&d.global)&&0==w.active++&&w.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Ht.test(d.type),i=d.url.replace(jt,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Dt,"+")):(p=d.url.slice(i.length),d.data&&(d.processData||"string"==typeof d.data)&&(i+=(Ct.test(i)?"&":"?")+d.data,delete d.data),!1===d.cache&&(i=i.replace(qt,"$1"),p=(Ct.test(i)?"&":"?")+"_="+Tt.guid+++p),d.url=i+p),d.ifModified&&(w.lastModified[i]&&E.setRequestHeader("If-Modified-Since",w.lastModified[i]),w.etag[i]&&E.setRequestHeader("If-None-Match",w.etag[i])),(d.data&&d.hasContent&&!1!==d.contentType||n.contentType)&&E.setRequestHeader("Content-Type",d.contentType),E.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Mt+"; q=0.01":""):d.accepts["*"]),d.headers)E.setRequestHeader(f,d.headers[f]);if(d.beforeSend&&(!1===d.beforeSend.call(h,E,d)||l))return E.abort();if(C="abort",m.add(d.complete),E.done(d.success),E.fail(d.error),r=Ft(Rt,d,n,E)){if(E.readyState=1,c&&g.trigger("ajaxSend",[E,d]),l)return E;d.async&&d.timeout>0&&(s=t.setTimeout(function(){E.abort("timeout")},d.timeout));try{l=!1,r.send(b,S)}catch(k){if(l)throw k;S(-1,k)}}else S(-1,"No Transport");function S(e,n,a,u){var f,p,y,b,T,C=n;l||(l=!0,s&&t.clearTimeout(s),r=void 0,o=u||"",E.readyState=e>0?4:0,f=e>=200&&e<300||304===e,a&&(b=function(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(d,E,a)),!f&&w.inArray("script",d.dataTypes)>-1&&(d.converters["text script"]=function(){}),b=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(k){return{state:"parsererror",error:a?k:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(d,b,E,f),f?(d.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[i]=T),(T=E.getResponseHeader("etag"))&&(w.etag[i]=T)),204===e||"HEAD"===d.type?C="nocontent":304===e?C="notmodified":(C=b.state,p=b.data,f=!(y=b.error))):(y=C,!e&&C||(C="error",e<0&&(e=0))),E.status=e,E.statusText=(n||C)+"",f?v.resolveWith(h,[p,C,E]):v.rejectWith(h,[E,C,y]),E.statusCode(x),x=void 0,c&&g.trigger(f?"ajaxSuccess":"ajaxError",[E,d,f?p:y]),m.fireWith(h,[E,C]),c&&(g.trigger("ajaxComplete",[E,d]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),w._evalUrl=function(e,t,n){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){w.globalEval(e,t,n)}})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(e){}};var $t={0:200,1223:204},_t=w.ajaxSettings.xhr();h.cors=!!_t&&"withCredentials"in _t,h.ajax=_t=!!_t,w.ajaxTransport(function(e){var n,r;if(h.cors||_t&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o($t[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&t.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(e.hasContent&&e.data||null)}catch(u){if(n)throw u}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=w("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),y.head.appendChild(t[0])},abort:function(){n&&n()}}});var zt,Ut=[],Xt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Ut.pop()||w.expando+"_"+Tt.guid++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(e,n,r){var i,o,a,s=!1!==e.jsonp&&(Xt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Xt.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=g(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Xt,"$1"+i):!1!==e.jsonp&&(e.url+=(Ct.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=t[i],t[i]=function(){a=arguments},r.always(function(){void 0===o?w(t).removeProp(i):t[i]=o,e[i]&&(e.jsonpCallback=n.jsonpCallback,Ut.push(i)),a&&g(o)&&o(a[0]),a=o=void 0}),"script"}),h.createHTMLDocument=((zt=y.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===zt.childNodes.length),w.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(h.createHTMLDocument?((r=(t=y.implementation.createHTMLDocument("")).createElement("base")).href=y.location.href,t.head.appendChild(r)):t=y),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=be([e],t,o),o&&o.length&&w(o).remove(),w.merge([],i.childNodes)));var r,i,o},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=gt(e.slice(s)),e=e.slice(0,s)),g(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&w.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?w("<div>").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=w.css(e,"position"),c=w(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=w.css(e,"top"),u=w.css(e,"left"),("absolute"===l||"fixed"===l)&&(o+u).indexOf("auto")>-1?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),g(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===w.css(e,"position");)e=e.offsetParent;return e||re})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return $(this,function(e,r,i){var o;if(v(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=_e(h.pixelPosition,function(e,n){if(n)return n=$e(e,t),Ie.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return $(this,function(t,n,i){var o;return v(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var Vt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),g(e))return r=o.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(o.call(arguments)))}).guid=e.guid=e.guid||w.guid++,i},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=A,w.isFunction=g,w.isWindow=v,w.camelCase=X,w.type=b,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},w.trim=function(e){return null==e?"":(e+"").replace(Vt,"")},"function"==typeof e&&e.amd&&e("jquery",[],function(){return w});var Gt=t.jQuery,Yt=t.$;return w.noConflict=function(e){return t.$===w&&(t.$=Yt),e&&t.jQuery===w&&(t.jQuery=Gt),w},void 0===n&&(t.jQuery=t.$=w),w}); },{"process":"g5IB"}],"v5IM":[function(require,module,exports) { var global = arguments[3]; var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,n=function(){for(var e=["Edge","Trident","Firefox"],n=0;n<e.length;n+=1)if(t&&navigator.userAgent.indexOf(e[n])>=0)return 1;return 0}();function r(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}function o(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},n))}}var i=t&&window.Promise,a=i?r:o;function s(e){return e&&"[object Function]"==={}.toString.call(e)}function f(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function p(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function l(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=f(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?e:l(p(e))}function u(e){return e&&e.referenceNode?e.referenceNode:e}var d=t&&!(!window.MSInputMethodContext||!document.documentMode),c=t&&/MSIE 10/.test(navigator.userAgent);function h(e){return 11===e?d:10===e?c:d||c}function m(e){if(!e)return document.documentElement;for(var t=h(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===f(n,"position")?m(n):n:e?e.ownerDocument.documentElement:document.documentElement}function v(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||m(e.firstElementChild)===e)}function g(e){return null!==e.parentNode?g(e.parentNode):e}function b(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,o=n?t:e,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a=i.commonAncestorContainer;if(e!==a&&t!==a||r.contains(o))return v(a)?a:m(a);var s=g(e);return s.host?b(s.host,t):b(e,g(t).host)}function w(e){var t="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=e.nodeName;if("BODY"===n||"HTML"===n){var r=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||r)[t]}return e[t]}function y(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=w(t,"top"),o=w(t,"left"),i=n?-1:1;return e.top+=r*i,e.bottom+=r*i,e.left+=o*i,e.right+=o*i,e}function E(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function x(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],h(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function O(e){var t=e.body,n=e.documentElement,r=h(10)&&getComputedStyle(n);return{height:x("Height",t,n,r),width:x("Width",t,n,r)}}var L=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},T=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),M=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function C(e){return N({},e,{right:e.left+e.width,bottom:e.top+e.height})}function D(e){var t={};try{if(h(10)){t=e.getBoundingClientRect();var n=w(e,"top"),r=w(e,"left");t.top+=n,t.left+=r,t.bottom+=n,t.right+=r}else t=e.getBoundingClientRect()}catch(d){}var o={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},i="HTML"===e.nodeName?O(e.ownerDocument):{},a=i.width||e.clientWidth||o.width,s=i.height||e.clientHeight||o.height,p=e.offsetWidth-a,l=e.offsetHeight-s;if(p||l){var u=f(e);p-=E(u,"x"),l-=E(u,"y"),o.width-=p,o.height-=l}return C(o)}function F(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=h(10),o="HTML"===t.nodeName,i=D(e),a=D(t),s=l(e),p=f(t),u=parseFloat(p.borderTopWidth),d=parseFloat(p.borderLeftWidth);n&&o&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var c=C({top:i.top-a.top-u,left:i.left-a.left-d,width:i.width,height:i.height});if(c.marginTop=0,c.marginLeft=0,!r&&o){var m=parseFloat(p.marginTop),v=parseFloat(p.marginLeft);c.top-=u-m,c.bottom-=u-m,c.left-=d-v,c.right-=d-v,c.marginTop=m,c.marginLeft=v}return(r&&!n?t.contains(s):t===s&&"BODY"!==s.nodeName)&&(c=y(c,t)),c}function S(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=F(e,n),o=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:w(n),s=t?0:w(n,"left");return C({top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:o,height:i})}function W(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===f(e,"position"))return!0;var n=p(e);return!!n&&W(n)}function k(e){if(!e||!e.parentElement||h())return document.documentElement;for(var t=e.parentElement;t&&"none"===f(t,"transform");)t=t.parentElement;return t||document.documentElement}function H(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={top:0,left:0},a=o?k(e):b(e,u(t));if("viewport"===r)i=S(a,o);else{var s=void 0;"scrollParent"===r?"BODY"===(s=l(p(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var f=F(s,a,o);if("HTML"!==s.nodeName||W(a))i=f;else{var d=O(e.ownerDocument),c=d.height,h=d.width;i.top+=f.top-f.marginTop,i.bottom=c+f.top,i.left+=f.left-f.marginLeft,i.right=h+f.left}}var m="number"==typeof(n=n||0);return i.left+=m?n:n.left||0,i.top+=m?n:n.top||0,i.right-=m?n:n.right||0,i.bottom-=m?n:n.bottom||0,i}function P(e){return e.width*e.height}function B(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=H(n,r,i,o),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},f=Object.keys(s).map(function(e){return N({key:e},s[e],{area:P(s[e])})}).sort(function(e,t){return t.area-e.area}),p=f.filter(function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight}),l=p.length>0?p[0].key:f[0].key,u=e.split("-")[1];return l+(u?"-"+u:"")}function A(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return F(n,r?k(t):b(t,u(n)),r)}function I(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function j(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function R(e,t,n){n=n.split("-")[0];var r=I(e),o={width:r.width,height:r.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",s=i?"left":"top",f=i?"height":"width",p=i?"width":"height";return o[a]=t[a]+t[f]/2-r[f]/2,o[s]=n===s?t[s]-r[p]:t[j(s)],o}function U(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function Y(e,t,n){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===n});var r=U(e,function(e){return e[t]===n});return e.indexOf(r)}function V(e,t,n){return(void 0===n?e:e.slice(0,Y(e,"name",n))).forEach(function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&s(n)&&(t.offsets.popper=C(t.offsets.popper),t.offsets.reference=C(t.offsets.reference),t=n(t,e))}),t}function q(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=A(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=B(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=R(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=V(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function K(e,t){return e.some(function(e){var n=e.name;return e.enabled&&n===t})}function _(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var o=t[r],i=o?""+o+n:e;if(void 0!==document.body.style[i])return i}return null}function z(){return this.state.isDestroyed=!0,K(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[_("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function G(e){var t=e.ownerDocument;return t?t.defaultView:window}function X(e,t,n,r){var o="BODY"===e.nodeName,i=o?e.ownerDocument.defaultView:e;i.addEventListener(t,n,{passive:!0}),o||X(l(i.parentNode),t,n,r),r.push(i)}function J(e,t,n,r){n.updateBound=r,G(e).addEventListener("resize",n.updateBound,{passive:!0});var o=l(e);return X(o,"scroll",n.updateBound,n.scrollParents),n.scrollElement=o,n.eventsEnabled=!0,n}function Q(){this.state.eventsEnabled||(this.state=J(this.reference,this.options,this.state,this.scheduleUpdate))}function Z(e,t){return G(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function $(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=Z(this.reference,this.state))}function ee(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function te(e,t){Object.keys(t).forEach(function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&ee(t[n])&&(r="px"),e.style[n]=t[n]+r})}function ne(e,t){Object.keys(t).forEach(function(n){!1!==t[n]?e.setAttribute(n,t[n]):e.removeAttribute(n)})}function re(e){return te(e.instance.popper,e.styles),ne(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&te(e.arrowElement,e.arrowStyles),e}function oe(e,t,n,r,o){var i=A(o,t,e,n.positionFixed),a=B(n.placement,i,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),te(t,{position:n.positionFixed?"fixed":"absolute"}),n}function ie(e,t){var n=e.offsets,r=n.popper,o=n.reference,i=Math.round,a=Math.floor,s=function(e){return e},f=i(o.width),p=i(r.width),l=-1!==["left","right"].indexOf(e.placement),u=-1!==e.placement.indexOf("-"),d=t?l||u||f%2==p%2?i:a:s,c=t?i:s;return{left:d(f%2==1&&p%2==1&&!u&&t?r.left-1:r.left),top:c(r.top),bottom:c(r.bottom),right:d(r.right)}}var ae=t&&/Firefox/i.test(navigator.userAgent);function se(e,t){var n=t.x,r=t.y,o=e.offsets.popper,i=U(e.instance.modifiers,function(e){return"applyStyle"===e.name}).gpuAcceleration;void 0!==i&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==i?i:t.gpuAcceleration,s=m(e.instance.popper),f=D(s),p={position:o.position},l=ie(e,window.devicePixelRatio<2||!ae),u="bottom"===n?"top":"bottom",d="right"===r?"left":"right",c=_("transform"),h=void 0,v=void 0;if(v="bottom"===u?"HTML"===s.nodeName?-s.clientHeight+l.bottom:-f.height+l.bottom:l.top,h="right"===d?"HTML"===s.nodeName?-s.clientWidth+l.right:-f.width+l.right:l.left,a&&c)p[c]="translate3d("+h+"px, "+v+"px, 0)",p[u]=0,p[d]=0,p.willChange="transform";else{var g="bottom"===u?-1:1,b="right"===d?-1:1;p[u]=v*g,p[d]=h*b,p.willChange=u+", "+d}var w={"x-placement":e.placement};return e.attributes=N({},w,e.attributes),e.styles=N({},p,e.styles),e.arrowStyles=N({},e.offsets.arrow,e.arrowStyles),e}function fe(e,t,n){var r=U(e,function(e){return e.name===t}),o=!!r&&e.some(function(e){return e.name===n&&e.enabled&&e.order<r.order});if(!o){var i="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+i+" modifier in order to work, be sure to include it before "+i+"!")}return o}function pe(e,t){var n;if(!fe(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var o=e.placement.split("-")[0],i=e.offsets,a=i.popper,s=i.reference,p=-1!==["left","right"].indexOf(o),l=p?"height":"width",u=p?"Top":"Left",d=u.toLowerCase(),c=p?"left":"top",h=p?"bottom":"right",m=I(r)[l];s[h]-m<a[d]&&(e.offsets.popper[d]-=a[d]-(s[h]-m)),s[d]+m>a[h]&&(e.offsets.popper[d]+=s[d]+m-a[h]),e.offsets.popper=C(e.offsets.popper);var v=s[d]+s[l]/2-m/2,g=f(e.instance.popper),b=parseFloat(g["margin"+u]),w=parseFloat(g["border"+u+"Width"]),y=v-e.offsets.popper[d]-b-w;return y=Math.max(Math.min(a[l]-m,y),0),e.arrowElement=r,e.offsets.arrow=(M(n={},d,Math.round(y)),M(n,c,""),n),e}function le(e){return"end"===e?"start":"start"===e?"end":e}var ue=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],de=ue.slice(3);function ce(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=de.indexOf(e),r=de.slice(n+1).concat(de.slice(0,n));return t?r.reverse():r}var he={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function me(e,t){if(K(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=H(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],o=j(r),i=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case he.FLIP:a=[r,o];break;case he.CLOCKWISE:a=ce(r);break;case he.COUNTERCLOCKWISE:a=ce(r,!0);break;default:a=t.behavior}return a.forEach(function(s,f){if(r!==s||a.length===f+1)return e;r=e.placement.split("-")[0],o=j(r);var p=e.offsets.popper,l=e.offsets.reference,u=Math.floor,d="left"===r&&u(p.right)>u(l.left)||"right"===r&&u(p.left)<u(l.right)||"top"===r&&u(p.bottom)>u(l.top)||"bottom"===r&&u(p.top)<u(l.bottom),c=u(p.left)<u(n.left),h=u(p.right)>u(n.right),m=u(p.top)<u(n.top),v=u(p.bottom)>u(n.bottom),g="left"===r&&c||"right"===r&&h||"top"===r&&m||"bottom"===r&&v,b=-1!==["top","bottom"].indexOf(r),w=!!t.flipVariations&&(b&&"start"===i&&c||b&&"end"===i&&h||!b&&"start"===i&&m||!b&&"end"===i&&v),y=!!t.flipVariationsByContent&&(b&&"start"===i&&h||b&&"end"===i&&c||!b&&"start"===i&&v||!b&&"end"===i&&m),E=w||y;(d||g||E)&&(e.flipped=!0,(d||g)&&(r=a[f+1]),E&&(i=le(i)),e.placement=r+(i?"-"+i:""),e.offsets.popper=N({},e.offsets.popper,R(e.instance.popper,e.offsets.reference,e.placement)),e=V(e.instance.modifiers,e,"flip"))}),e}function ve(e){var t=e.offsets,n=t.popper,r=t.reference,o=e.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(o),s=a?"right":"bottom",f=a?"left":"top",p=a?"width":"height";return n[s]<i(r[f])&&(e.offsets.popper[f]=i(r[f])-n[p]),n[f]>i(r[s])&&(e.offsets.popper[f]=i(r[s])),e}function ge(e,t,n,r){var o=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+o[1],a=o[2];if(!i)return e;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return C(s)[t]/100*i}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i}return i}function be(e,t,n,r){var o=[0,0],i=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map(function(e){return e.trim()}),s=a.indexOf(U(a,function(e){return-1!==e.search(/,|\s/)}));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var f=/\s*,\s*|\s+/,p=-1!==s?[a.slice(0,s).concat([a[s].split(f)[0]]),[a[s].split(f)[1]].concat(a.slice(s+1))]:[a];return(p=p.map(function(e,r){var o=(1===r?!i:i)?"height":"width",a=!1;return e.reduce(function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)},[]).map(function(e){return ge(e,o,t,n)})})).forEach(function(e,t){e.forEach(function(n,r){ee(n)&&(o[t]+=n*("-"===e[r-1]?-1:1))})}),o}function we(e,t){var n=t.offset,r=e.placement,o=e.offsets,i=o.popper,a=o.reference,s=r.split("-")[0],f=void 0;return f=ee(+n)?[+n,0]:be(n,i,a,s),"left"===s?(i.top+=f[0],i.left-=f[1]):"right"===s?(i.top+=f[0],i.left+=f[1]):"top"===s?(i.left+=f[0],i.top-=f[1]):"bottom"===s&&(i.left+=f[0],i.top+=f[1]),e.popper=i,e}function ye(e,t){var n=t.boundariesElement||m(e.instance.popper);e.instance.reference===n&&(n=m(n));var r=_("transform"),o=e.instance.popper.style,i=o.top,a=o.left,s=o[r];o.top="",o.left="",o[r]="";var f=H(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);o.top=i,o.left=a,o[r]=s,t.boundaries=f;var p=t.priority,l=e.offsets.popper,u={primary:function(e){var n=l[e];return l[e]<f[e]&&!t.escapeWithReference&&(n=Math.max(l[e],f[e])),M({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=l[n];return l[e]>f[e]&&!t.escapeWithReference&&(r=Math.min(l[n],f[e]-("right"===e?l.width:l.height))),M({},n,r)}};return p.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";l=N({},l,u[t](e))}),e.offsets.popper=l,e}function Ee(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets,i=o.reference,a=o.popper,s=-1!==["bottom","top"].indexOf(n),f=s?"left":"top",p=s?"width":"height",l={start:M({},f,i[f]),end:M({},f,i[f]+i[p]-a[p])};e.offsets.popper=N({},a,l[r])}return e}function xe(e){if(!fe(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=U(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}function Oe(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,o=r.popper,i=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return o[a?"left":"top"]=i[n]-(s?o[a?"width":"height"]:0),e.placement=j(t),e.offsets.popper=C(o),e}var Le={shift:{order:100,enabled:!0,fn:Ee},offset:{order:200,enabled:!0,fn:we,offset:0},preventOverflow:{order:300,enabled:!0,fn:ye,priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:ve},arrow:{order:500,enabled:!0,fn:pe,element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:me,behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:Oe},hide:{order:800,enabled:!0,fn:xe},computeStyle:{order:850,enabled:!0,fn:se,gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:re,onLoad:oe,gpuAcceleration:void 0}},Te={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:Le},Me=function(){function e(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};L(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=a(this.update.bind(this)),this.options=N({},e.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(N({},e.Defaults.modifiers,o.modifiers)).forEach(function(t){r.options.modifiers[t]=N({},e.Defaults.modifiers[t]||{},o.modifiers?o.modifiers[t]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return N({name:e},r.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(e){e.enabled&&s(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)}),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return T(e,[{key:"update",value:function(){return q.call(this)}},{key:"destroy",value:function(){return z.call(this)}},{key:"enableEventListeners",value:function(){return Q.call(this)}},{key:"disableEventListeners",value:function(){return $.call(this)}}]),e}();Me.Utils=("undefined"!=typeof window?window:e).PopperUtils,Me.placements=ue,Me.Defaults=Te;var Ne=Me;exports.default=Ne; },{}],"pe4o":[function(require,module,exports) { var define; var global = arguments[3]; var t,e=arguments[3];!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("jquery"),require("popper.js")):"function"==typeof t&&t.amd?t(["exports","jquery","popper.js"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).bootstrap={},e.jQuery,e.Popper)}(this,function(t,e,n){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;var r="transitionend";function a(t){var n=this,i=!1;return e(this).one(l.TRANSITION_END,function(){i=!0}),setTimeout(function(){i||l.triggerTransitionEnd(n)},t),this}var l={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(i){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var n=e(t).css("transition-duration"),i=e(t).css("transition-delay"),o=parseFloat(n),s=parseFloat(i);return o||s?(n=n.split(",")[0],i=i.split(",")[0],1e3*(parseFloat(n)+parseFloat(i))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){e(t).trigger(r)},supportsTransitionEnd:function(){return Boolean(r)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],s=e[i],r=s&&l.isElement(s)?"element":null==(a=s)?""+a:{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(o).test(r))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+r+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?l.findShadowRoot(t.parentNode):null},jQueryDetection:function(){if(void 0===e)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||t[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};l.jQueryDetection(),e.fn.emulateTransitionEnd=a,e.event.special[l.TRANSITION_END]={bindType:r,delegateType:r,handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var c=e.fn.alert,h=function(){function t(t){this._element=t}var n=t.prototype;return n.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},n.dispose=function(){e.removeData(this._element,"bs.alert"),this._element=null},n._getRootElement=function(t){var n=l.getSelectorFromElement(t),i=!1;return n&&(i=document.querySelector(n)),i||(i=e(t).closest(".alert")[0]),i},n._triggerCloseEvent=function(t){var n=e.Event("close.bs.alert");return e(t).trigger(n),n},n._removeElement=function(t){var n=this;if(e(t).removeClass("show"),e(t).hasClass("fade")){var i=l.getTransitionDurationFromElement(t);e(t).one(l.TRANSITION_END,function(e){return n._destroyElement(t,e)}).emulateTransitionEnd(i)}else this._destroyElement(t)},n._destroyElement=function(t){e(t).detach().trigger("closed.bs.alert").remove()},t._jQueryInterface=function(n){return this.each(function(){var i=e(this),o=i.data("bs.alert");o||(o=new t(this),i.data("bs.alert",o)),"close"===n&&o[n](this)})},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},o(t,null,[{key:"VERSION",get:function(){return"4.5.2"}}]),t}();e(document).on("click.bs.alert.data-api",'[data-dismiss="alert"]',h._handleDismiss(new h)),e.fn.alert=h._jQueryInterface,e.fn.alert.Constructor=h,e.fn.alert.noConflict=function(){return e.fn.alert=c,h._jQueryInterface};var u=e.fn.button,d=function(){function t(t){this._element=t}var n=t.prototype;return n.toggle=function(){var t=!0,n=!0,i=e(this._element).closest('[data-toggle="buttons"]')[0];if(i){var o=this._element.querySelector('input:not([type="hidden"])');if(o){if("radio"===o.type)if(o.checked&&this._element.classList.contains("active"))t=!1;else{var s=i.querySelector(".active");s&&e(s).removeClass("active")}t&&("checkbox"!==o.type&&"radio"!==o.type||(o.checked=!this._element.classList.contains("active")),e(o).trigger("change")),o.focus(),n=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(n&&this._element.setAttribute("aria-pressed",!this._element.classList.contains("active")),t&&e(this._element).toggleClass("active"))},n.dispose=function(){e.removeData(this._element,"bs.button"),this._element=null},t._jQueryInterface=function(n){return this.each(function(){var i=e(this).data("bs.button");i||(i=new t(this),e(this).data("bs.button",i)),"toggle"===n&&i[n]()})},o(t,null,[{key:"VERSION",get:function(){return"4.5.2"}}]),t}();e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var n=t.target,i=n;if(e(n).hasClass("btn")||(n=e(n).closest(".btn")[0]),!n||n.hasAttribute("disabled")||n.classList.contains("disabled"))t.preventDefault();else{var o=n.querySelector('input:not([type="hidden"])');if(o&&(o.hasAttribute("disabled")||o.classList.contains("disabled")))return void t.preventDefault();("LABEL"!==i.tagName||o&&"checkbox"!==o.type)&&d._jQueryInterface.call(e(n),"toggle")}}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){var n=e(t.target).closest(".btn")[0];e(n).toggleClass("focus",/^focus(in)?$/.test(t.type))}),e(window).on("load.bs.button.data-api",function(){for(var t=[].slice.call(document.querySelectorAll('[data-toggle="buttons"] .btn')),e=0,n=t.length;e<n;e++){var i=t[e],o=i.querySelector('input:not([type="hidden"])');o.checked||o.hasAttribute("checked")?i.classList.add("active"):i.classList.remove("active")}for(var s=0,r=(t=[].slice.call(document.querySelectorAll('[data-toggle="button"]'))).length;s<r;s++){var a=t[s];"true"===a.getAttribute("aria-pressed")?a.classList.add("active"):a.classList.remove("active")}}),e.fn.button=d._jQueryInterface,e.fn.button.Constructor=d,e.fn.button.noConflict=function(){return e.fn.button=u,d._jQueryInterface};var f="carousel",g=".bs.carousel",m=e.fn[f],p={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},_={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},v=".carousel-indicators",b={TOUCH:"touch",PEN:"pen"},y=function(){function t(t,e){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._element=t,this._indicatorsElement=this._element.querySelector(v),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var n=t.prototype;return n.next=function(){this._isSliding||this._slide("next")},n.nextWhenVisible=function(){!document.hidden&&e(this._element).is(":visible")&&"hidden"!==e(this._element).css("visibility")&&this.next()},n.prev=function(){this._isSliding||this._slide("prev")},n.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(".carousel-item-next, .carousel-item-prev")&&(l.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},n.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},n.to=function(t){var n=this;this._activeElement=this._element.querySelector(".active.carousel-item");var i=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)e(this._element).one("slid.bs.carousel",function(){return n.to(t)});else{if(i===t)return this.pause(),void this.cycle();var o=t>i?"next":"prev";this._slide(o,this._items[t])}},n.dispose=function(){e(this._element).off(g),e.removeData(this._element,"bs.carousel"),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},n._getConfig=function(t){return t=s({},p,t),l.typeCheckConfig(f,t,_),t},n._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&this.prev(),e<0&&this.next()}},n._addEventListeners=function(){var t=this;this._config.keyboard&&e(this._element).on("keydown.bs.carousel",function(e){return t._keydown(e)}),"hover"===this._config.pause&&e(this._element).on("mouseenter.bs.carousel",function(e){return t.pause(e)}).on("mouseleave.bs.carousel",function(e){return t.cycle(e)}),this._config.touch&&this._addTouchEventListeners()},n._addTouchEventListeners=function(){var t=this;if(this._touchSupported){var n=function(e){t._pointerEvent&&b[e.originalEvent.pointerType.toUpperCase()]?t.touchStartX=e.originalEvent.clientX:t._pointerEvent||(t.touchStartX=e.originalEvent.touches[0].clientX)},i=function(e){t._pointerEvent&&b[e.originalEvent.pointerType.toUpperCase()]&&(t.touchDeltaX=e.originalEvent.clientX-t.touchStartX),t._handleSwipe(),"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout(function(e){return t.cycle(e)},500+t._config.interval))};e(this._element.querySelectorAll(".carousel-item img")).on("dragstart.bs.carousel",function(t){return t.preventDefault()}),this._pointerEvent?(e(this._element).on("pointerdown.bs.carousel",function(t){return n(t)}),e(this._element).on("pointerup.bs.carousel",function(t){return i(t)}),this._element.classList.add("pointer-event")):(e(this._element).on("touchstart.bs.carousel",function(t){return n(t)}),e(this._element).on("touchmove.bs.carousel",function(e){return function(e){e.originalEvent.touches&&e.originalEvent.touches.length>1?t.touchDeltaX=0:t.touchDeltaX=e.originalEvent.touches[0].clientX-t.touchStartX}(e)}),e(this._element).on("touchend.bs.carousel",function(t){return i(t)}))}},n._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},n._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(".carousel-item")):[],this._items.indexOf(t)},n._getItemByDirection=function(t,e){var n="next"===t,i="prev"===t,o=this._getItemIndex(e),s=this._items.length-1;if((i&&0===o||n&&o===s)&&!this._config.wrap)return e;var r=(o+("prev"===t?-1:1))%this._items.length;return-1===r?this._items[this._items.length-1]:this._items[r]},n._triggerSlideEvent=function(t,n){var i=this._getItemIndex(t),o=this._getItemIndex(this._element.querySelector(".active.carousel-item")),s=e.Event("slide.bs.carousel",{relatedTarget:t,direction:n,from:o,to:i});return e(this._element).trigger(s),s},n._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var n=[].slice.call(this._indicatorsElement.querySelectorAll(".active"));e(n).removeClass("active");var i=this._indicatorsElement.children[this._getItemIndex(t)];i&&e(i).addClass("active")}},n._slide=function(t,n){var i,o,s,r=this,a=this._element.querySelector(".active.carousel-item"),c=this._getItemIndex(a),h=n||a&&this._getItemByDirection(t,a),u=this._getItemIndex(h),d=Boolean(this._interval);if("next"===t?(i="carousel-item-left",o="carousel-item-next",s="left"):(i="carousel-item-right",o="carousel-item-prev",s="right"),h&&e(h).hasClass("active"))this._isSliding=!1;else if(!this._triggerSlideEvent(h,s).isDefaultPrevented()&&a&&h){this._isSliding=!0,d&&this.pause(),this._setActiveIndicatorElement(h);var f=e.Event("slid.bs.carousel",{relatedTarget:h,direction:s,from:c,to:u});if(e(this._element).hasClass("slide")){e(h).addClass(o),l.reflow(h),e(a).addClass(i),e(h).addClass(i);var g=parseInt(h.getAttribute("data-interval"),10);g?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=g):this._config.interval=this._config.defaultInterval||this._config.interval;var m=l.getTransitionDurationFromElement(a);e(a).one(l.TRANSITION_END,function(){e(h).removeClass(i+" "+o).addClass("active"),e(a).removeClass("active "+o+" "+i),r._isSliding=!1,setTimeout(function(){return e(r._element).trigger(f)},0)}).emulateTransitionEnd(m)}else e(a).removeClass("active"),e(h).addClass("active"),this._isSliding=!1,e(this._element).trigger(f);d&&this.cycle()}},t._jQueryInterface=function(n){return this.each(function(){var i=e(this).data("bs.carousel"),o=s({},p,e(this).data());"object"==typeof n&&(o=s({},o,n));var r="string"==typeof n?n:o.slide;if(i||(i=new t(this,o),e(this).data("bs.carousel",i)),"number"==typeof n)i.to(n);else if("string"==typeof r){if(void 0===i[r])throw new TypeError('No method named "'+r+'"');i[r]()}else o.interval&&o.ride&&(i.pause(),i.cycle())})},t._dataApiClickHandler=function(n){var i=l.getSelectorFromElement(this);if(i){var o=e(i)[0];if(o&&e(o).hasClass("carousel")){var r=s({},e(o).data(),e(this).data()),a=this.getAttribute("data-slide-to");a&&(r.interval=!1),t._jQueryInterface.call(e(o),r),a&&e(o).data("bs.carousel").to(a),n.preventDefault()}}},o(t,null,[{key:"VERSION",get:function(){return"4.5.2"}},{key:"Default",get:function(){return p}}]),t}();e(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",y._dataApiClickHandler),e(window).on("load.bs.carousel.data-api",function(){for(var t=[].slice.call(document.querySelectorAll('[data-ride="carousel"]')),n=0,i=t.length;n<i;n++){var o=e(t[n]);y._jQueryInterface.call(o,o.data())}}),e.fn[f]=y._jQueryInterface,e.fn[f].Constructor=y,e.fn[f].noConflict=function(){return e.fn[f]=m,y._jQueryInterface};var E="collapse",w=e.fn[E],T={toggle:!0,parent:""},C={toggle:"boolean",parent:"(string|element)"},S='[data-toggle="collapse"]',D=function(){function t(t,e){this._isTransitioning=!1,this._element=t,this._config=this._getConfig(e),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'));for(var n=[].slice.call(document.querySelectorAll(S)),i=0,o=n.length;i<o;i++){var s=n[i],r=l.getSelectorFromElement(s),a=[].slice.call(document.querySelectorAll(r)).filter(function(e){return e===t});null!==r&&a.length>0&&(this._selector=r,this._triggerArray.push(s))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var n=t.prototype;return n.toggle=function(){e(this._element).hasClass("show")?this.hide():this.show()},n.show=function(){var n,i,o=this;if(!this._isTransitioning&&!e(this._element).hasClass("show")&&(this._parent&&0===(n=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter(function(t){return"string"==typeof o._config.parent?t.getAttribute("data-parent")===o._config.parent:t.classList.contains("collapse")})).length&&(n=null),!(n&&(i=e(n).not(this._selector).data("bs.collapse"))&&i._isTransitioning))){var s=e.Event("show.bs.collapse");if(e(this._element).trigger(s),!s.isDefaultPrevented()){n&&(t._jQueryInterface.call(e(n).not(this._selector),"hide"),i||e(n).data("bs.collapse",null));var r=this._getDimension();e(this._element).removeClass("collapse").addClass("collapsing"),this._element.style[r]=0,this._triggerArray.length&&e(this._triggerArray).removeClass("collapsed").attr("aria-expanded",!0),this.setTransitioning(!0);var a="scroll"+(r[0].toUpperCase()+r.slice(1)),c=l.getTransitionDurationFromElement(this._element);e(this._element).one(l.TRANSITION_END,function(){e(o._element).removeClass("collapsing").addClass("collapse show"),o._element.style[r]="",o.setTransitioning(!1),e(o._element).trigger("shown.bs.collapse")}).emulateTransitionEnd(c),this._element.style[r]=this._element[a]+"px"}}},n.hide=function(){var t=this;if(!this._isTransitioning&&e(this._element).hasClass("show")){var n=e.Event("hide.bs.collapse");if(e(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",l.reflow(this._element),e(this._element).addClass("collapsing").removeClass("collapse show");var o=this._triggerArray.length;if(o>0)for(var s=0;s<o;s++){var r=this._triggerArray[s],a=l.getSelectorFromElement(r);if(null!==a)e([].slice.call(document.querySelectorAll(a))).hasClass("show")||e(r).addClass("collapsed").attr("aria-expanded",!1)}this.setTransitioning(!0);this._element.style[i]="";var c=l.getTransitionDurationFromElement(this._element);e(this._element).one(l.TRANSITION_END,function(){t.setTransitioning(!1),e(t._element).removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")}).emulateTransitionEnd(c)}}},n.setTransitioning=function(t){this._isTransitioning=t},n.dispose=function(){e.removeData(this._element,"bs.collapse"),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},n._getConfig=function(t){return(t=s({},T,t)).toggle=Boolean(t.toggle),l.typeCheckConfig(E,t,C),t},n._getDimension=function(){return e(this._element).hasClass("width")?"width":"height"},n._getParent=function(){var n,i=this;l.isElement(this._config.parent)?(n=this._config.parent,void 0!==this._config.parent.jquery&&(n=this._config.parent[0])):n=document.querySelector(this._config.parent);var o='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',s=[].slice.call(n.querySelectorAll(o));return e(s).each(function(e,n){i._addAriaAndCollapsedClass(t._getTargetFromElement(n),[n])}),n},n._addAriaAndCollapsedClass=function(t,n){var i=e(t).hasClass("show");n.length&&e(n).toggleClass("collapsed",!i).attr("aria-expanded",i)},t._getTargetFromElement=function(t){var e=l.getSelectorFromElement(t);return e?document.querySelector(e):null},t._jQueryInterface=function(n){return this.each(function(){var i=e(this),o=i.data("bs.collapse"),r=s({},T,i.data(),"object"==typeof n&&n?n:{});if(!o&&r.toggle&&"string"==typeof n&&/show|hide/.test(n)&&(r.toggle=!1),o||(o=new t(this,r),i.data("bs.collapse",o)),"string"==typeof n){if(void 0===o[n])throw new TypeError('No method named "'+n+'"');o[n]()}})},o(t,null,[{key:"VERSION",get:function(){return"4.5.2"}},{key:"Default",get:function(){return T}}]),t}();e(document).on("click.bs.collapse.data-api",S,function(t){"A"===t.currentTarget.tagName&&t.preventDefault();var n=e(this),i=l.getSelectorFromElement(this),o=[].slice.call(document.querySelectorAll(i));e(o).each(function(){var t=e(this),i=t.data("bs.collapse")?"toggle":n.data();D._jQueryInterface.call(t,i)})}),e.fn[E]=D._jQueryInterface,e.fn[E].Constructor=D,e.fn[E].noConflict=function(){return e.fn[E]=w,D._jQueryInterface};var k="dropdown",N=e.fn[k],A=new RegExp("38|40|27"),I={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic",popperConfig:null},O={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string",popperConfig:"(null|object)"},j=function(){function t(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var i=t.prototype;return i.toggle=function(){if(!this._element.disabled&&!e(this._element).hasClass("disabled")){var n=e(this._menu).hasClass("show");t._clearMenus(),n||this.show(!0)}},i.show=function(i){if(void 0===i&&(i=!1),!(this._element.disabled||e(this._element).hasClass("disabled")||e(this._menu).hasClass("show"))){var o={relatedTarget:this._element},s=e.Event("show.bs.dropdown",o),r=t._getParentFromElement(this._element);if(e(r).trigger(s),!s.isDefaultPrevented()){if(!this._inNavbar&&i){if(void 0===n)throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)");var a=this._element;"parent"===this._config.reference?a=r:l.isElement(this._config.reference)&&(a=this._config.reference,void 0!==this._config.reference.jquery&&(a=this._config.reference[0])),"scrollParent"!==this._config.boundary&&e(r).addClass("position-static"),this._popper=new n(a,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===e(r).closest(".navbar-nav").length&&e(document.body).children().on("mouseover",null,e.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),e(this._menu).toggleClass("show"),e(r).toggleClass("show").trigger(e.Event("shown.bs.dropdown",o))}}},i.hide=function(){if(!this._element.disabled&&!e(this._element).hasClass("disabled")&&e(this._menu).hasClass("show")){var n={relatedTarget:this._element},i=e.Event("hide.bs.dropdown",n),o=t._getParentFromElement(this._element);e(o).trigger(i),i.isDefaultPrevented()||(this._popper&&this._popper.destroy(),e(this._menu).toggleClass("show"),e(o).toggleClass("show").trigger(e.Event("hidden.bs.dropdown",n)))}},i.dispose=function(){e.removeData(this._element,"bs.dropdown"),e(this._element).off(".bs.dropdown"),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},i.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},i._addEventListeners=function(){var t=this;e(this._element).on("click.bs.dropdown",function(e){e.preventDefault(),e.stopPropagation(),t.toggle()})},i._getConfig=function(t){return t=s({},this.constructor.Default,e(this._element).data(),t),l.typeCheckConfig(k,t,this.constructor.DefaultType),t},i._getMenuElement=function(){if(!this._menu){var e=t._getParentFromElement(this._element);e&&(this._menu=e.querySelector(".dropdown-menu"))}return this._menu},i._getPlacement=function(){var t=e(this._element.parentNode),n="bottom-start";return t.hasClass("dropup")?n=e(this._menu).hasClass("dropdown-menu-right")?"top-end":"top-start":t.hasClass("dropright")?n="right-start":t.hasClass("dropleft")?n="left-start":e(this._menu).hasClass("dropdown-menu-right")&&(n="bottom-end"),n},i._detectNavbar=function(){return e(this._element).closest(".navbar").length>0},i._getOffset=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=s({},e.offsets,t._config.offset(e.offsets,t._element)||{}),e}:e.offset=this._config.offset,e},i._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),s({},t,this._config.popperConfig)},t._jQueryInterface=function(n){return this.each(function(){var i=e(this).data("bs.dropdown");if(i||(i=new t(this,"object"==typeof n?n:null),e(this).data("bs.dropdown",i)),"string"==typeof n){if(void 0===i[n])throw new TypeError('No method named "'+n+'"');i[n]()}})},t._clearMenus=function(n){if(!n||3!==n.which&&("keyup"!==n.type||9===n.which))for(var i=[].slice.call(document.querySelectorAll('[data-toggle="dropdown"]')),o=0,s=i.length;o<s;o++){var r=t._getParentFromElement(i[o]),a=e(i[o]).data("bs.dropdown"),l={relatedTarget:i[o]};if(n&&"click"===n.type&&(l.clickEvent=n),a){var c=a._menu;if(e(r).hasClass("show")&&!(n&&("click"===n.type&&/input|textarea/i.test(n.target.tagName)||"keyup"===n.type&&9===n.which)&&e.contains(r,n.target))){var h=e.Event("hide.bs.dropdown",l);e(r).trigger(h),h.isDefaultPrevented()||("ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),i[o].setAttribute("aria-expanded","false"),a._popper&&a._popper.destroy(),e(c).removeClass("show"),e(r).removeClass("show").trigger(e.Event("hidden.bs.dropdown",l)))}}}},t._getParentFromElement=function(t){var e,n=l.getSelectorFromElement(t);return n&&(e=document.querySelector(n)),e||t.parentNode},t._dataApiKeydownHandler=function(n){if((/input|textarea/i.test(n.target.tagName)?!(32===n.which||27!==n.which&&(40!==n.which&&38!==n.which||e(n.target).closest(".dropdown-menu").length)):A.test(n.which))&&!this.disabled&&!e(this).hasClass("disabled")){var i=t._getParentFromElement(this),o=e(i).hasClass("show");if(o||27!==n.which){if(n.preventDefault(),n.stopPropagation(),!o||o&&(27===n.which||32===n.which))return 27===n.which&&e(i.querySelector('[data-toggle="dropdown"]')).trigger("focus"),void e(this).trigger("click");var s=[].slice.call(i.querySelectorAll(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)")).filter(function(t){return e(t).is(":visible")});if(0!==s.length){var r=s.indexOf(n.target);38===n.which&&r>0&&r--,40===n.which&&r<s.length-1&&r++,r<0&&(r=0),s[r].focus()}}}},o(t,null,[{key:"VERSION",get:function(){return"4.5.2"}},{key:"Default",get:function(){return I}},{key:"DefaultType",get:function(){return O}}]),t}();e(document).on("keydown.bs.dropdown.data-api",'[data-toggle="dropdown"]',j._dataApiKeydownHandler).on("keydown.bs.dropdown.data-api",".dropdown-menu",j._dataApiKeydownHandler).on("click.bs.dropdown.data-api keyup.bs.dropdown.data-api",j._clearMenus).on("click.bs.dropdown.data-api",'[data-toggle="dropdown"]',function(t){t.preventDefault(),t.stopPropagation(),j._jQueryInterface.call(e(this),"toggle")}).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}),e.fn[k]=j._jQueryInterface,e.fn[k].Constructor=j,e.fn[k].noConflict=function(){return e.fn[k]=N,j._jQueryInterface};var x=e.fn.modal,P={backdrop:!0,keyboard:!0,focus:!0,show:!0},R={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},L=".modal-dialog",q=function(){function t(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(L),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var n=t.prototype;return n.toggle=function(t){return this._isShown?this.hide():this.show(t)},n.show=function(t){var n=this;if(!this._isShown&&!this._isTransitioning){e(this._element).hasClass("fade")&&(this._isTransitioning=!0);var i=e.Event("show.bs.modal",{relatedTarget:t});e(this._element).trigger(i),this._isShown||i.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),e(this._element).on("click.dismiss.bs.modal",'[data-dismiss="modal"]',function(t){return n.hide(t)}),e(this._dialog).on("mousedown.dismiss.bs.modal",function(){e(n._element).one("mouseup.dismiss.bs.modal",function(t){e(t.target).is(n._element)&&(n._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return n._showElement(t)}))}},n.hide=function(t){var n=this;if(t&&t.preventDefault(),this._isShown&&!this._isTransitioning){var i=e.Event("hide.bs.modal");if(e(this._element).trigger(i),this._isShown&&!i.isDefaultPrevented()){this._isShown=!1;var o=e(this._element).hasClass("fade");if(o&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),e(document).off("focusin.bs.modal"),e(this._element).removeClass("show"),e(this._element).off("click.dismiss.bs.modal"),e(this._dialog).off("mousedown.dismiss.bs.modal"),o){var s=l.getTransitionDurationFromElement(this._element);e(this._element).one(l.TRANSITION_END,function(t){return n._hideModal(t)}).emulateTransitionEnd(s)}else this._hideModal()}}},n.dispose=function(){[window,this._element,this._dialog].forEach(function(t){return e(t).off(".bs.modal")}),e(document).off("focusin.bs.modal"),e.removeData(this._element,"bs.modal"),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},n.handleUpdate=function(){this._adjustDialog()},n._getConfig=function(t){return t=s({},P,t),l.typeCheckConfig("modal",t,R),t},n._triggerBackdropTransition=function(){var t=this;if("static"===this._config.backdrop){var n=e.Event("hidePrevented.bs.modal");if(e(this._element).trigger(n),n.defaultPrevented)return;var i=this._element.scrollHeight>document.documentElement.clientHeight;i||(this._element.style.overflowY="hidden"),this._element.classList.add("modal-static");var o=l.getTransitionDurationFromElement(this._dialog);e(this._element).off(l.TRANSITION_END),e(this._element).one(l.TRANSITION_END,function(){t._element.classList.remove("modal-static"),i||e(t._element).one(l.TRANSITION_END,function(){t._element.style.overflowY=""}).emulateTransitionEnd(t._element,o)}).emulateTransitionEnd(o),this._element.focus()}else this.hide()},n._showElement=function(t){var n=this,i=e(this._element).hasClass("fade"),o=this._dialog?this._dialog.querySelector(".modal-body"):null;this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),e(this._dialog).hasClass("modal-dialog-scrollable")&&o?o.scrollTop=0:this._element.scrollTop=0,i&&l.reflow(this._element),e(this._element).addClass("show"),this._config.focus&&this._enforceFocus();var s=e.Event("shown.bs.modal",{relatedTarget:t}),r=function(){n._config.focus&&n._element.focus(),n._isTransitioning=!1,e(n._element).trigger(s)};if(i){var a=l.getTransitionDurationFromElement(this._dialog);e(this._dialog).one(l.TRANSITION_END,r).emulateTransitionEnd(a)}else r()},n._enforceFocus=function(){var t=this;e(document).off("focusin.bs.modal").on("focusin.bs.modal",function(n){document!==n.target&&t._element!==n.target&&0===e(t._element).has(n.target).length&&t._element.focus()})},n._setEscapeEvent=function(){var t=this;this._isShown?e(this._element).on("keydown.dismiss.bs.modal",function(e){t._config.keyboard&&27===e.which?(e.preventDefault(),t.hide()):t._config.keyboard||27!==e.which||t._triggerBackdropTransition()}):this._isShown||e(this._element).off("keydown.dismiss.bs.modal")},n._setResizeEvent=function(){var t=this;this._isShown?e(window).on("resize.bs.modal",function(e){return t.handleUpdate(e)}):e(window).off("resize.bs.modal")},n._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._showBackdrop(function(){e(document.body).removeClass("modal-open"),t._resetAdjustments(),t._resetScrollbar(),e(t._element).trigger("hidden.bs.modal")})},n._removeBackdrop=function(){this._backdrop&&(e(this._backdrop).remove(),this._backdrop=null)},n._showBackdrop=function(t){var n=this,i=e(this._element).hasClass("fade")?"fade":"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",i&&this._backdrop.classList.add(i),e(this._backdrop).appendTo(document.body),e(this._element).on("click.dismiss.bs.modal",function(t){n._ignoreBackdropClick?n._ignoreBackdropClick=!1:t.target===t.currentTarget&&n._triggerBackdropTransition()}),i&&l.reflow(this._backdrop),e(this._backdrop).addClass("show"),!t)return;if(!i)return void t();var o=l.getTransitionDurationFromElement(this._backdrop);e(this._backdrop).one(l.TRANSITION_END,t).emulateTransitionEnd(o)}else if(!this._isShown&&this._backdrop){e(this._backdrop).removeClass("show");var s=function(){n._removeBackdrop(),t&&t()};if(e(this._element).hasClass("fade")){var r=l.getTransitionDurationFromElement(this._backdrop);e(this._backdrop).one(l.TRANSITION_END,s).emulateTransitionEnd(r)}else s()}else t&&t()},n._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},n._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},n._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},n._setScrollbar=function(){var t=this;if(this._isBodyOverflowing){var n=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top")),i=[].slice.call(document.querySelectorAll(".sticky-top"));e(n).each(function(n,i){var o=i.style.paddingRight,s=e(i).css("padding-right");e(i).data("padding-right",o).css("padding-right",parseFloat(s)+t._scrollbarWidth+"px")}),e(i).each(function(n,i){var o=i.style.marginRight,s=e(i).css("margin-right");e(i).data("margin-right",o).css("margin-right",parseFloat(s)-t._scrollbarWidth+"px")});var o=document.body.style.paddingRight,s=e(document.body).css("padding-right");e(document.body).data("padding-right",o).css("padding-right",parseFloat(s)+this._scrollbarWidth+"px")}e(document.body).addClass("modal-open")},n._resetScrollbar=function(){var t=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top"));e(t).each(function(t,n){var i=e(n).data("padding-right");e(n).removeData("padding-right"),n.style.paddingRight=i||""});var n=[].slice.call(document.querySelectorAll(".sticky-top"));e(n).each(function(t,n){var i=e(n).data("margin-right");void 0!==i&&e(n).css("margin-right",i).removeData("margin-right")});var i=e(document.body).data("padding-right");e(document.body).removeData("padding-right"),document.body.style.paddingRight=i||""},n._getScrollbarWidth=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},t._jQueryInterface=function(n,i){return this.each(function(){var o=e(this).data("bs.modal"),r=s({},P,e(this).data(),"object"==typeof n&&n?n:{});if(o||(o=new t(this,r),e(this).data("bs.modal",o)),"string"==typeof n){if(void 0===o[n])throw new TypeError('No method named "'+n+'"');o[n](i)}else r.show&&o.show(i)})},o(t,null,[{key:"VERSION",get:function(){return"4.5.2"}},{key:"Default",get:function(){return P}}]),t}();e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var n,i=this,o=l.getSelectorFromElement(this);o&&(n=document.querySelector(o));var r=e(n).data("bs.modal")?"toggle":s({},e(n).data(),e(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault();var a=e(n).one("show.bs.modal",function(t){t.isDefaultPrevented()||a.one("hidden.bs.modal",function(){e(i).is(":visible")&&i.focus()})});q._jQueryInterface.call(e(n),r,this)}),e.fn.modal=q._jQueryInterface,e.fn.modal.Constructor=q,e.fn.modal.noConflict=function(){return e.fn.modal=x,q._jQueryInterface};var F=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],Q={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},B=/^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi,H=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;function U(t,e,n){if(0===t.length)return t;if(n&&"function"==typeof n)return n(t);for(var i=(new window.DOMParser).parseFromString(t,"text/html"),o=Object.keys(e),s=[].slice.call(i.body.querySelectorAll("*")),r=function(t,n){var i=s[t],r=i.nodeName.toLowerCase();if(-1===o.indexOf(i.nodeName.toLowerCase()))return i.parentNode.removeChild(i),"continue";var a=[].slice.call(i.attributes),l=[].concat(e["*"]||[],e[r]||[]);a.forEach(function(t){(function(t,e){var n=t.nodeName.toLowerCase();if(-1!==e.indexOf(n))return-1===F.indexOf(n)||Boolean(t.nodeValue.match(B)||t.nodeValue.match(H));for(var i=e.filter(function(t){return t instanceof RegExp}),o=0,s=i.length;o<s;o++)if(n.match(i[o]))return!0;return!1})(t,l)||i.removeAttribute(t.nodeName)})},a=0,l=s.length;a<l;a++)r(a);return i.body.innerHTML}var M="tooltip",W=e.fn.tooltip,V=new RegExp("(^|\\s)bs-tooltip\\S+","g"),z=["sanitize","whiteList","sanitizeFn"],K={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object",popperConfig:"(null|object)"},X={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},Y={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Q,popperConfig:null},$={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},J=function(){function t(t,e){if(void 0===n)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var i=t.prototype;return i.enable=function(){this._isEnabled=!0},i.disable=function(){this._isEnabled=!1},i.toggleEnabled=function(){this._isEnabled=!this._isEnabled},i.toggle=function(t){if(this._isEnabled)if(t){var n=this.constructor.DATA_KEY,i=e(t.currentTarget).data(n);i||(i=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(e(this.getTipElement()).hasClass("show"))return void this._leave(null,this);this._enter(null,this)}},i.dispose=function(){clearTimeout(this._timeout),e.removeData(this.element,this.constructor.DATA_KEY),e(this.element).off(this.constructor.EVENT_KEY),e(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&e(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},i.show=function(){var t=this;if("none"===e(this.element).css("display"))throw new Error("Please use show on visible elements");var i=e.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){e(this.element).trigger(i);var o=l.findShadowRoot(this.element),s=e.contains(null!==o?o:this.element.ownerDocument.documentElement,this.element);if(i.isDefaultPrevented()||!s)return;var r=this.getTipElement(),a=l.getUID(this.constructor.NAME);r.setAttribute("id",a),this.element.setAttribute("aria-describedby",a),this.setContent(),this.config.animation&&e(r).addClass("fade");var c="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,h=this._getAttachment(c);this.addAttachmentClass(h);var u=this._getContainer();e(r).data(this.constructor.DATA_KEY,this),e.contains(this.element.ownerDocument.documentElement,this.tip)||e(r).appendTo(u),e(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new n(this.element,r,this._getPopperConfig(h)),e(r).addClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().on("mouseover",null,e.noop);var d=function(){t.config.animation&&t._fixTransition();var n=t._hoverState;t._hoverState=null,e(t.element).trigger(t.constructor.Event.SHOWN),"out"===n&&t._leave(null,t)};if(e(this.tip).hasClass("fade")){var f=l.getTransitionDurationFromElement(this.tip);e(this.tip).one(l.TRANSITION_END,d).emulateTransitionEnd(f)}else d()}},i.hide=function(t){var n=this,i=this.getTipElement(),o=e.Event(this.constructor.Event.HIDE),s=function(){"show"!==n._hoverState&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),e(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),t&&t()};if(e(this.element).trigger(o),!o.isDefaultPrevented()){if(e(i).removeClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,e(this.tip).hasClass("fade")){var r=l.getTransitionDurationFromElement(i);e(i).one(l.TRANSITION_END,s).emulateTransitionEnd(r)}else s();this._hoverState=""}},i.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},i.isWithContent=function(){return Boolean(this.getTitle())},i.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-tooltip-"+t)},i.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},i.setContent=function(){var t=this.getTipElement();this.setElementContent(e(t.querySelectorAll(".tooltip-inner")),this.getTitle()),e(t).removeClass("fade show")},i.setElementContent=function(t,n){"object"!=typeof n||!n.nodeType&&!n.jquery?this.config.html?(this.config.sanitize&&(n=U(n,this.config.whiteList,this.config.sanitizeFn)),t.html(n)):t.text(n):this.config.html?e(n).parent().is(t)||t.empty().append(n):t.text(e(n).text())},i.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},i._getPopperConfig=function(t){var e=this;return s({},{placement:t,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}},this.config.popperConfig)},i._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=s({},e.offsets,t.config.offset(e.offsets,t.element)||{}),e}:e.offset=this.config.offset,e},i._getContainer=function(){return!1===this.config.container?document.body:l.isElement(this.config.container)?e(this.config.container):e(document).find(this.config.container)},i._getAttachment=function(t){return X[t.toUpperCase()]},i._setListeners=function(){var t=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)e(t.element).on(t.constructor.Event.CLICK,t.config.selector,function(e){return t.toggle(e)});else if("manual"!==n){var i="hover"===n?t.constructor.Event.MOUSEENTER:t.constructor.Event.FOCUSIN,o="hover"===n?t.constructor.Event.MOUSELEAVE:t.constructor.Event.FOCUSOUT;e(t.element).on(i,t.config.selector,function(e){return t._enter(e)}).on(o,t.config.selector,function(e){return t._leave(e)})}}),this._hideModalHandler=function(){t.element&&t.hide()},e(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=s({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},i._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},i._enter=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusin"===t.type?"focus":"hover"]=!0),e(n.getTipElement()).hasClass("show")||"show"===n._hoverState?n._hoverState="show":(clearTimeout(n._timeout),n._hoverState="show",n.config.delay&&n.config.delay.show?n._timeout=setTimeout(function(){"show"===n._hoverState&&n.show()},n.config.delay.show):n.show())},i._leave=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusout"===t.type?"focus":"hover"]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState="out",n.config.delay&&n.config.delay.hide?n._timeout=setTimeout(function(){"out"===n._hoverState&&n.hide()},n.config.delay.hide):n.hide())},i._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},i._getConfig=function(t){var n=e(this.element).data();return Object.keys(n).forEach(function(t){-1!==z.indexOf(t)&&delete n[t]}),"number"==typeof(t=s({},this.constructor.Default,n,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),l.typeCheckConfig(M,t,this.constructor.DefaultType),t.sanitize&&(t.template=U(t.template,t.whiteList,t.sanitizeFn)),t},i._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},i._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(V);null!==n&&n.length&&t.removeClass(n.join(""))},i._handlePopperPlacementChange=function(t){this.tip=t.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},i._fixTransition=function(){var t=this.getTipElement(),n=this.config.animation;null===t.getAttribute("x-placement")&&(e(t).removeClass("fade"),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},t._jQueryInterface=function(n){return this.each(function(){var i=e(this).data("bs.tooltip"),o="object"==typeof n&&n;if((i||!/dispose|hide/.test(n))&&(i||(i=new t(this,o),e(this).data("bs.tooltip",i)),"string"==typeof n)){if(void 0===i[n])throw new TypeError('No method named "'+n+'"');i[n]()}})},o(t,null,[{key:"VERSION",get:function(){return"4.5.2"}},{key:"Default",get:function(){return Y}},{key:"NAME",get:function(){return M}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return $}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return K}}]),t}();e.fn.tooltip=J._jQueryInterface,e.fn.tooltip.Constructor=J,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=W,J._jQueryInterface};var G="popover",Z=e.fn.popover,tt=new RegExp("(^|\\s)bs-popover\\S+","g"),et=s({},J.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),nt=s({},J.DefaultType,{content:"(string|element|function)"}),it={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},ot=function(t){var n,i;function s(){return t.apply(this,arguments)||this}i=t,(n=s).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i;var r=s.prototype;return r.isWithContent=function(){return this.getTitle()||this._getContent()},r.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-popover-"+t)},r.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},r.setContent=function(){var t=e(this.getTipElement());this.setElementContent(t.find(".popover-header"),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(t.find(".popover-body"),n),t.removeClass("fade show")},r._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},r._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(tt);null!==n&&n.length>0&&t.removeClass(n.join(""))},s._jQueryInterface=function(t){return this.each(function(){var n=e(this).data("bs.popover"),i="object"==typeof t?t:null;if((n||!/dispose|hide/.test(t))&&(n||(n=new s(this,i),e(this).data("bs.popover",n)),"string"==typeof t)){if(void 0===n[t])throw new TypeError('No method named "'+t+'"');n[t]()}})},o(s,null,[{key:"VERSION",get:function(){return"4.5.2"}},{key:"Default",get:function(){return et}},{key:"NAME",get:function(){return G}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return it}},{key:"EVENT_KEY",get:function(){return".bs.popover"}},{key:"DefaultType",get:function(){return nt}}]),s}(J);e.fn.popover=ot._jQueryInterface,e.fn.popover.Constructor=ot,e.fn.popover.noConflict=function(){return e.fn.popover=Z,ot._jQueryInterface};var st="scrollspy",rt=e.fn[st],at={offset:10,method:"auto",target:""},lt={offset:"number",method:"string",target:"(string|element)"},ct="scroll.bs.scrollspy",ht=".nav-link",ut=".list-group-item",dt=".dropdown-item",ft=function(){function t(t,n){var i=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(n),this._selector=this._config.target+" "+ht+","+this._config.target+" "+ut+","+this._config.target+" "+dt,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,e(this._scrollElement).on(ct,function(t){return i._process(t)}),this.refresh(),this._process()}var n=t.prototype;return n.refresh=function(){var t=this,n=this._scrollElement===this._scrollElement.window?"offset":"position",i="auto"===this._config.method?n:this._config.method,o="position"===i?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map(function(t){var n,s=l.getSelectorFromElement(t);if(s&&(n=document.querySelector(s)),n){var r=n.getBoundingClientRect();if(r.width||r.height)return[e(n)[i]().top+o,s]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}).forEach(function(e){t._offsets.push(e[0]),t._targets.push(e[1])})},n.dispose=function(){e.removeData(this._element,"bs.scrollspy"),e(this._scrollElement).off(".bs.scrollspy"),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},n._getConfig=function(t){if("string"!=typeof(t=s({},at,"object"==typeof t&&t?t:{})).target&&l.isElement(t.target)){var n=e(t.target).attr("id");n||(n=l.getUID(st),e(t.target).attr("id",n)),t.target="#"+n}return l.typeCheckConfig(st,t,lt),t},n._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},n._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},n._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},n._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(void 0===this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}}},n._activate=function(t){this._activeTarget=t,this._clear();var n=this._selector.split(",").map(function(e){return e+'[data-target="'+t+'"],'+e+'[href="'+t+'"]'}),i=e([].slice.call(document.querySelectorAll(n.join(","))));i.hasClass("dropdown-item")?(i.closest(".dropdown").find(".dropdown-toggle").addClass("active"),i.addClass("active")):(i.addClass("active"),i.parents(".nav, .list-group").prev(ht+", "+ut).addClass("active"),i.parents(".nav, .list-group").prev(".nav-item").children(ht).addClass("active")),e(this._scrollElement).trigger("activate.bs.scrollspy",{relatedTarget:t})},n._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter(function(t){return t.classList.contains("active")}).forEach(function(t){return t.classList.remove("active")})},t._jQueryInterface=function(n){return this.each(function(){var i=e(this).data("bs.scrollspy");if(i||(i=new t(this,"object"==typeof n&&n),e(this).data("bs.scrollspy",i)),"string"==typeof n){if(void 0===i[n])throw new TypeError('No method named "'+n+'"');i[n]()}})},o(t,null,[{key:"VERSION",get:function(){return"4.5.2"}},{key:"Default",get:function(){return at}}]),t}();e(window).on("load.bs.scrollspy.data-api",function(){for(var t=[].slice.call(document.querySelectorAll('[data-spy="scroll"]')),n=t.length;n--;){var i=e(t[n]);ft._jQueryInterface.call(i,i.data())}}),e.fn[st]=ft._jQueryInterface,e.fn[st].Constructor=ft,e.fn[st].noConflict=function(){return e.fn[st]=rt,ft._jQueryInterface};var gt=e.fn.tab,mt=function(){function t(t){this._element=t}var n=t.prototype;return n.show=function(){var t=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&e(this._element).hasClass("active")||e(this._element).hasClass("disabled"))){var n,i,o=e(this._element).closest(".nav, .list-group")[0],s=l.getSelectorFromElement(this._element);if(o){var r="UL"===o.nodeName||"OL"===o.nodeName?"> li > .active":".active";i=(i=e.makeArray(e(o).find(r)))[i.length-1]}var a=e.Event("hide.bs.tab",{relatedTarget:this._element}),c=e.Event("show.bs.tab",{relatedTarget:i});if(i&&e(i).trigger(a),e(this._element).trigger(c),!c.isDefaultPrevented()&&!a.isDefaultPrevented()){s&&(n=document.querySelector(s)),this._activate(this._element,o);var h=function(){var n=e.Event("hidden.bs.tab",{relatedTarget:t._element}),o=e.Event("shown.bs.tab",{relatedTarget:i});e(i).trigger(n),e(t._element).trigger(o)};n?this._activate(n,n.parentNode,h):h()}}},n.dispose=function(){e.removeData(this._element,"bs.tab"),this._element=null},n._activate=function(t,n,i){var o=this,s=(!n||"UL"!==n.nodeName&&"OL"!==n.nodeName?e(n).children(".active"):e(n).find("> li > .active"))[0],r=i&&s&&e(s).hasClass("fade"),a=function(){return o._transitionComplete(t,s,i)};if(s&&r){var c=l.getTransitionDurationFromElement(s);e(s).removeClass("show").one(l.TRANSITION_END,a).emulateTransitionEnd(c)}else a()},n._transitionComplete=function(t,n,i){if(n){e(n).removeClass("active");var o=e(n.parentNode).find("> .dropdown-menu .active")[0];o&&e(o).removeClass("active"),"tab"===n.getAttribute("role")&&n.setAttribute("aria-selected",!1)}if(e(t).addClass("active"),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),l.reflow(t),t.classList.contains("fade")&&t.classList.add("show"),t.parentNode&&e(t.parentNode).hasClass("dropdown-menu")){var s=e(t).closest(".dropdown")[0];if(s){var r=[].slice.call(s.querySelectorAll(".dropdown-toggle"));e(r).addClass("active")}t.setAttribute("aria-expanded",!0)}i&&i()},t._jQueryInterface=function(n){return this.each(function(){var i=e(this),o=i.data("bs.tab");if(o||(o=new t(this),i.data("bs.tab",o)),"string"==typeof n){if(void 0===o[n])throw new TypeError('No method named "'+n+'"');o[n]()}})},o(t,null,[{key:"VERSION",get:function(){return"4.5.2"}}]),t}();e(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',function(t){t.preventDefault(),mt._jQueryInterface.call(e(this),"show")}),e.fn.tab=mt._jQueryInterface,e.fn.tab.Constructor=mt,e.fn.tab.noConflict=function(){return e.fn.tab=gt,mt._jQueryInterface};var pt=e.fn.toast,_t={animation:"boolean",autohide:"boolean",delay:"number"},vt={animation:!0,autohide:!0,delay:500},bt=function(){function t(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var n=t.prototype;return n.show=function(){var t=this,n=e.Event("show.bs.toast");if(e(this._element).trigger(n),!n.isDefaultPrevented()){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");var i=function(){t._element.classList.remove("showing"),t._element.classList.add("show"),e(t._element).trigger("shown.bs.toast"),t._config.autohide&&(t._timeout=setTimeout(function(){t.hide()},t._config.delay))};if(this._element.classList.remove("hide"),l.reflow(this._element),this._element.classList.add("showing"),this._config.animation){var o=l.getTransitionDurationFromElement(this._element);e(this._element).one(l.TRANSITION_END,i).emulateTransitionEnd(o)}else i()}},n.hide=function(){if(this._element.classList.contains("show")){var t=e.Event("hide.bs.toast");e(this._element).trigger(t),t.isDefaultPrevented()||this._close()}},n.dispose=function(){this._clearTimeout(),this._element.classList.contains("show")&&this._element.classList.remove("show"),e(this._element).off("click.dismiss.bs.toast"),e.removeData(this._element,"bs.toast"),this._element=null,this._config=null},n._getConfig=function(t){return t=s({},vt,e(this._element).data(),"object"==typeof t&&t?t:{}),l.typeCheckConfig("toast",t,this.constructor.DefaultType),t},n._setListeners=function(){var t=this;e(this._element).on("click.dismiss.bs.toast",'[data-dismiss="toast"]',function(){return t.hide()})},n._close=function(){var t=this,n=function(){t._element.classList.add("hide"),e(t._element).trigger("hidden.bs.toast")};if(this._element.classList.remove("show"),this._config.animation){var i=l.getTransitionDurationFromElement(this._element);e(this._element).one(l.TRANSITION_END,n).emulateTransitionEnd(i)}else n()},n._clearTimeout=function(){clearTimeout(this._timeout),this._timeout=null},t._jQueryInterface=function(n){return this.each(function(){var i=e(this),o=i.data("bs.toast");if(o||(o=new t(this,"object"==typeof n&&n),i.data("bs.toast",o)),"string"==typeof n){if(void 0===o[n])throw new TypeError('No method named "'+n+'"');o[n](this)}})},o(t,null,[{key:"VERSION",get:function(){return"4.5.2"}},{key:"DefaultType",get:function(){return _t}},{key:"Default",get:function(){return vt}}]),t}();e.fn.toast=bt._jQueryInterface,e.fn.toast.Constructor=bt,e.fn.toast.noConflict=function(){return e.fn.toast=pt,bt._jQueryInterface},t.Alert=h,t.Button=d,t.Carousel=y,t.Collapse=D,t.Dropdown=j,t.Modal=q,t.Popover=ot,t.Scrollspy=ft,t.Tab=mt,t.Toast=bt,t.Tooltip=J,t.Util=l,Object.defineProperty(t,"__esModule",{value:!0})}); },{"jquery":"HlZQ","popper.js":"v5IM"}],"Eofe":[function(require,module,exports) { },{"./..\\webfonts\\fa-brands-400.eot":[["fa-brands-400.53b2d4ef.eot","YH3g"],"YH3g"],"./..\\webfonts\\fa-brands-400.woff2":[["fa-brands-400.135cf931.woff2","qUWF"],"qUWF"],"./..\\webfonts\\fa-brands-400.woff":[["fa-brands-400.24e99467.woff","d16i"],"d16i"],"./..\\webfonts\\fa-brands-400.ttf":[["fa-brands-400.9cad63cf.ttf","Lu1x"],"Lu1x"],"./..\\webfonts\\fa-brands-400.svg":[["fa-brands-400.f60f8635.svg","GRGc"],"GRGc"],"./..\\webfonts\\fa-regular-400.eot":[["fa-regular-400.64b5e1df.eot","nv22"],"nv22"],"./..\\webfonts\\fa-regular-400.woff2":[["fa-regular-400.175c85c4.woff2","M504"],"M504"],"./..\\webfonts\\fa-regular-400.woff":[["fa-regular-400.6640af22.woff","H1q6"],"H1q6"],"./..\\webfonts\\fa-regular-400.ttf":[["fa-regular-400.1a832918.ttf","Evul"],"Evul"],"./..\\webfonts\\fa-regular-400.svg":[["fa-regular-400.4664e228.svg","D7rB"],"D7rB"],"./..\\webfonts\\fa-solid-900.eot":[["fa-solid-900.e1a1f014.eot","ISQp"],"ISQp"],"./..\\webfonts\\fa-solid-900.woff2":[["fa-solid-900.5e604779.woff2","PerI"],"PerI"],"./..\\webfonts\\fa-solid-900.woff":[["fa-solid-900.5351c613.woff","nA9q"],"nA9q"],"./..\\webfonts\\fa-solid-900.ttf":[["fa-solid-900.749555ef.ttf","FJZt"],"FJZt"],"./..\\webfonts\\fa-solid-900.svg":[["fa-solid-900.dc549cd3.svg","lFqB"],"lFqB"]}],"FWXb":[function(require,module,exports) { },{"./..\\fonts\\materialdesignicons-webfont.eot":[["materialdesignicons-webfont.2d2445a4.eot","bBM4"],"bBM4"],"./..\\fonts\\materialdesignicons-webfont.woff2":[["materialdesignicons-webfont.5a0f213e.woff2","B1w0"],"B1w0"],"./..\\fonts\\materialdesignicons-webfont.woff":[["materialdesignicons-webfont.b1d63d1d.woff","oZPE"],"oZPE"],"./..\\fonts\\materialdesignicons-webfont.ttf":[["materialdesignicons-webfont.b0120e21.ttf","YQqa"],"YQqa"]}],"H97Y":[function(require,module,exports) { },{}],"lMlK":[function(require,module,exports) { var define; var e;!function(n){var t;if("function"==typeof e&&e.amd&&(e(n),t=!0),"object"==typeof exports&&(module.exports=n(),t=!0),!t){var o=window.Cookies,r=window.Cookies=n();r.noConflict=function(){return window.Cookies=o,r}}}(function(){function e(){for(var e=0,n={};e<arguments.length;e++){var t=arguments[e];for(var o in t)n[o]=t[o]}return n}function n(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function t(o){function r(){}function i(n,t,i){if("undefined"!=typeof document){"number"==typeof(i=e({path:"/"},r.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var c=JSON.stringify(t);/^[\{\[]/.test(c)&&(t=c)}catch(a){}t=o.write?o.write(t,n):encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=encodeURIComponent(String(n)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var f="";for(var u in i)i[u]&&(f+="; "+u,!0!==i[u]&&(f+="="+i[u].split(";")[0]));return document.cookie=n+"="+t+f}}function c(e,t){if("undefined"!=typeof document){for(var r={},i=document.cookie?document.cookie.split("; "):[],c=0;c<i.length;c++){var f=i[c].split("="),u=f.slice(1).join("=");t||'"'!==u.charAt(0)||(u=u.slice(1,-1));try{var a=n(f[0]);if(u=(o.read||o)(u,a)||n(u),t)try{u=JSON.parse(u)}catch(p){}if(r[a]=u,e===a)break}catch(p){}}return e?r[e]:r}}return r.set=i,r.get=function(e){return c(e,!1)},r.getJSON=function(e){return c(e,!0)},r.remove=function(n,t){i(n,"",e(t,{expires:-1}))},r.defaults={},r.withConverter=t,r}(function(){})}); },{}],"XEp8":[function(require,module,exports) { var define; var n;!function(e){function r(n,e,r){var t,a,b,h,A,l,p,E,d,H=0,v=[],S=0,g=!1,U=[],R=[],y=!1,k=!1,m=-1;if(t=(r=r||{}).encoding||"UTF8",(d=r.numRounds||1)!==parseInt(d,10)||1>d)throw Error("numRounds must a integer >= 1");if("SHA-1"===n)A=512,l=O,p=X,h=160,E=function(n){return n.slice()};else if(0===n.lastIndexOf("SHA-",0))if(l=function(e,r){return P(e,r,n)},p=function(e,r,t,a){var o,i;if("SHA-224"===n||"SHA-256"===n)o=15+(r+65>>>9<<4),i=16;else{if("SHA-384"!==n&&"SHA-512"!==n)throw Error("Unexpected error in SHA-2 implementation");o=31+(r+129>>>10<<5),i=32}for(;e.length<=o;)e.push(0);for(e[r>>>5]|=128<<24-r%32,r+=t,e[o]=4294967295&r,e[o-1]=r/4294967296|0,t=e.length,r=0;r<t;r+=i)a=P(e.slice(r,r+i),a,n);if("SHA-224"===n)e=[a[0],a[1],a[2],a[3],a[4],a[5],a[6]];else if("SHA-256"===n)e=a;else if("SHA-384"===n)e=[a[0].a,a[0].b,a[1].a,a[1].b,a[2].a,a[2].b,a[3].a,a[3].b,a[4].a,a[4].b,a[5].a,a[5].b];else{if("SHA-512"!==n)throw Error("Unexpected error in SHA-2 implementation");e=[a[0].a,a[0].b,a[1].a,a[1].b,a[2].a,a[2].b,a[3].a,a[3].b,a[4].a,a[4].b,a[5].a,a[5].b,a[6].a,a[6].b,a[7].a,a[7].b]}return e},E=function(n){return n.slice()},"SHA-224"===n)A=512,h=224;else if("SHA-256"===n)A=512,h=256;else if("SHA-384"===n)A=1024,h=384;else{if("SHA-512"!==n)throw Error("Chosen SHA variant is not supported");A=1024,h=512}else{if(0!==n.lastIndexOf("SHA3-",0)&&0!==n.lastIndexOf("SHAKE",0))throw Error("Chosen SHA variant is not supported");var F=6;if(l=M,E=function(n){var e,r=[];for(e=0;5>e;e+=1)r[e]=n[e].slice();return r},m=1,"SHA3-224"===n)A=1152,h=224;else if("SHA3-256"===n)A=1088,h=256;else if("SHA3-384"===n)A=832,h=384;else if("SHA3-512"===n)A=576,h=512;else if("SHAKE128"===n)A=1344,h=-1,F=31,k=!0;else{if("SHAKE256"!==n)throw Error("Chosen SHA variant is not supported");A=1088,h=-1,F=31,k=!0}p=function(n,e,r,t,a){var o,i=F,u=[],f=(r=A)>>>5,w=0,s=e>>>5;for(o=0;o<s&&e>=r;o+=f)t=M(n.slice(o,o+f),t),e-=r;for(n=n.slice(o),e%=r;n.length<f;)n.push(0);for(n[(o=e>>>3)>>2]^=i<<o%4*8,n[f-1]^=2147483648,t=M(n,t);32*u.length<a&&(n=t[w%5][w/5|0],u.push(n.b),!(32*u.length>=a));)u.push(n.a),0==64*(w+=1)%r&&(M(null,t),w=0);return u}}b=c(e,t,m),a=N(n),this.setHMACKey=function(e,r,o){var i;if(!0===g)throw Error("HMAC key already set");if(!0===y)throw Error("Cannot set HMAC key after calling update");if(!0===k)throw Error("SHAKE is not supported for HMAC");for(e=(r=c(r,t=(o||{}).encoding||"UTF8",m)(e)).binLen,r=r.value,o=(i=A>>>3)/4-1,i<e/8&&(r=p(r,e,0,N(n),h));r.length<=o;)r.push(0);for(e=0;e<=o;e+=1)U[e]=909522486^r[e],R[e]=1549556828^r[e];a=l(U,a),H=A,g=!0},this.update=function(n){var e,r,t,o=0,i=A>>>5;for(n=(e=b(n,v,S)).binLen,r=e.value,e=n>>>5,t=0;t<e;t+=i)o+A<=n&&(a=l(r.slice(t,t+i),a),o+=A);H+=o,v=r.slice(o>>>5),S=n%A,y=!0},this.getHash=function(e,r){var t,c,b,A;if(!0===g)throw Error("Cannot call getHash after setting HMAC key");if(b=s(r),!0===k){if(-1===b.shakeLen)throw Error("shakeLen must be specified in options");h=b.shakeLen}switch(e){case"HEX":t=function(n){return o(n,h,m,b)};break;case"B64":t=function(n){return i(n,h,m,b)};break;case"BYTES":t=function(n){return u(n,h,m)};break;case"ARRAYBUFFER":try{c=new ArrayBuffer(0)}catch(l){throw Error("ARRAYBUFFER not supported by this environment")}t=function(n){return f(n,h,m)};break;case"UINT8ARRAY":try{c=new Uint8Array(0)}catch(l){throw Error("UINT8ARRAY not supported by this environment")}t=function(n){return w(n,h,m)};break;default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}for(A=p(v.slice(),S,H,E(a),h),c=1;c<d;c+=1)!0===k&&0!=h%32&&(A[A.length-1]&=16777215>>>24-h%32),A=p(A,h,0,N(n),h);return t(A)},this.getHMAC=function(e,r){var t,c,b,d;if(!1===g)throw Error("Cannot call getHMAC without first setting HMAC key");switch(b=s(r),e){case"HEX":t=function(n){return o(n,h,m,b)};break;case"B64":t=function(n){return i(n,h,m,b)};break;case"BYTES":t=function(n){return u(n,h,m)};break;case"ARRAYBUFFER":try{t=new ArrayBuffer(0)}catch(U){throw Error("ARRAYBUFFER not supported by this environment")}t=function(n){return f(n,h,m)};break;case"UINT8ARRAY":try{t=new Uint8Array(0)}catch(U){throw Error("UINT8ARRAY not supported by this environment")}t=function(n){return w(n,h,m)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return c=p(v.slice(),S,H,E(a),h),d=l(R,N(n)),t(d=p(c,h,A,d,h))}}function t(n,e){this.a=n,this.b=e}function a(n,e,r,t){var a,o,i,u,f;for(e=e||[0],o=(r=r||0)>>>3,f=-1===t?3:0,a=0;a<n.length;a+=1)i=(u=a+o)>>>2,e.length<=i&&e.push(0),e[i]|=n[a]<<8*(f+u%4*t);return{value:e,binLen:8*n.length+r}}function o(n,e,r,t){var a,o,i,u="";for(e/=8,i=-1===r?3:0,a=0;a<e;a+=1)o=n[a>>>2]>>>8*(i+a%4*r),u+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return t.outputUpper?u.toUpperCase():u}function i(n,e,r,t){var a,o,i,u,f="",w=e/8;for(u=-1===r?3:0,a=0;a<w;a+=3)for(o=a+1<w?n[a+1>>>2]:0,i=a+2<w?n[a+2>>>2]:0,i=(n[a>>>2]>>>8*(u+a%4*r)&255)<<16|(o>>>8*(u+(a+1)%4*r)&255)<<8|i>>>8*(u+(a+2)%4*r)&255,o=0;4>o;o+=1)f+=8*a+6*o<=e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>>6*(3-o)&63):t.b64Pad;return f}function u(n,e,r){var t,a,o,i="";for(e/=8,o=-1===r?3:0,t=0;t<e;t+=1)a=n[t>>>2]>>>8*(o+t%4*r)&255,i+=String.fromCharCode(a);return i}function f(n,e,r){e/=8;var t,a,o,i=new ArrayBuffer(e);for(o=new Uint8Array(i),a=-1===r?3:0,t=0;t<e;t+=1)o[t]=n[t>>>2]>>>8*(a+t%4*r)&255;return i}function w(n,e,r){e/=8;var t,a,o=new Uint8Array(e);for(a=-1===r?3:0,t=0;t<e;t+=1)o[t]=n[t>>>2]>>>8*(a+t%4*r)&255;return o}function s(n){var e={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(n=n||{},e.outputUpper=n.outputUpper||!1,!0===n.hasOwnProperty("b64Pad")&&(e.b64Pad=n.b64Pad),!0===n.hasOwnProperty("shakeLen")){if(0!=n.shakeLen%8)throw Error("shakeLen must be a multiple of 8");e.shakeLen=n.shakeLen}if("boolean"!=typeof e.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof e.b64Pad)throw Error("Invalid b64Pad formatting option");return e}function c(n,e,r){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(n){case"HEX":n=function(n,e,t){var a,o,i,u,f,w,s=n.length;if(0!=s%2)throw Error("String of HEX type must be in byte increments");for(e=e||[0],f=(t=t||0)>>>3,w=-1===r?3:0,a=0;a<s;a+=2){if(o=parseInt(n.substr(a,2),16),isNaN(o))throw Error("String of HEX type contains invalid characters");for(i=(u=(a>>>1)+f)>>>2;e.length<=i;)e.push(0);e[i]|=o<<8*(w+u%4*r)}return{value:e,binLen:4*s+t}};break;case"TEXT":n=function(n,t,a){var o,i,u,f,w,s,c,b,h=0;if(t=t||[0],w=(a=a||0)>>>3,"UTF8"===e)for(b=-1===r?3:0,u=0;u<n.length;u+=1)for(i=[],128>(o=n.charCodeAt(u))?i.push(o):2048>o?(i.push(192|o>>>6),i.push(128|63&o)):55296>o||57344<=o?i.push(224|o>>>12,128|o>>>6&63,128|63&o):(u+=1,o=65536+((1023&o)<<10|1023&n.charCodeAt(u)),i.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),f=0;f<i.length;f+=1){for(s=(c=h+w)>>>2;t.length<=s;)t.push(0);t[s]|=i[f]<<8*(b+c%4*r),h+=1}else if("UTF16BE"===e||"UTF16LE"===e)for(b=-1===r?2:0,i="UTF16LE"===e&&1!==r||"UTF16LE"!==e&&1===r,u=0;u<n.length;u+=1){for(o=n.charCodeAt(u),!0===i&&(o=(f=255&o)<<8|o>>>8),s=(c=h+w)>>>2;t.length<=s;)t.push(0);t[s]|=o<<8*(b+c%4*r),h+=2}return{value:t,binLen:8*h+a}};break;case"B64":n=function(n,e,t){var a,o,i,u,f,w,s,c,b=0;if(-1===n.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(o=n.indexOf("="),n=n.replace(/\=/g,""),-1!==o&&o<n.length)throw Error("Invalid '=' found in base-64 string");for(e=e||[0],w=(t=t||0)>>>3,c=-1===r?3:0,o=0;o<n.length;o+=4){for(f=n.substr(o,4),i=u=0;i<f.length;i+=1)u|=(a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(f.charAt(i)))<<18-6*i;for(i=0;i<f.length-1;i+=1){for(a=(s=b+w)>>>2;e.length<=a;)e.push(0);e[a]|=(u>>>16-8*i&255)<<8*(c+s%4*r),b+=1}}return{value:e,binLen:8*b+t}};break;case"BYTES":n=function(n,e,t){var a,o,i,u,f,w;for(e=e||[0],i=(t=t||0)>>>3,w=-1===r?3:0,o=0;o<n.length;o+=1)a=n.charCodeAt(o),u=(f=o+i)>>>2,e.length<=u&&e.push(0),e[u]|=a<<8*(w+f%4*r);return{value:e,binLen:8*n.length+t}};break;case"ARRAYBUFFER":try{n=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}n=function(n,e,t){return a(new Uint8Array(n),e,t,r)};break;case"UINT8ARRAY":try{n=new Uint8Array(0)}catch(t){throw Error("UINT8ARRAY not supported by this environment")}n=function(n,e,t){return a(n,e,t,r)};break;default:throw Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return n}function b(n,e){return n<<e|n>>>32-e}function h(n,e){return 32<e?(e-=32,new t(n.b<<e|n.a>>>32-e,n.a<<e|n.b>>>32-e)):0!==e?new t(n.a<<e|n.b>>>32-e,n.b<<e|n.a>>>32-e):n}function A(n,e){return n>>>e|n<<32-e}function l(n,e){var r=null;r=new t(n.a,n.b);return 32>=e?new t(r.a>>>e|r.b<<32-e&4294967295,r.b>>>e|r.a<<32-e&4294967295):new t(r.b>>>e-32|r.a<<64-e&4294967295,r.a>>>e-32|r.b<<64-e&4294967295)}function p(n,e){return 32>=e?new t(n.a>>>e,n.b>>>e|n.a<<32-e&4294967295):new t(0,n.a>>>e-32)}function E(n,e,r){return n&e^~n&r}function d(n,e,r){return new t(n.a&e.a^~n.a&r.a,n.b&e.b^~n.b&r.b)}function H(n,e,r){return n&e^n&r^e&r}function v(n,e,r){return new t(n.a&e.a^n.a&r.a^e.a&r.a,n.b&e.b^n.b&r.b^e.b&r.b)}function S(n){return A(n,2)^A(n,13)^A(n,22)}function g(n){var e=l(n,28),r=l(n,34);return n=l(n,39),new t(e.a^r.a^n.a,e.b^r.b^n.b)}function U(n){return A(n,6)^A(n,11)^A(n,25)}function R(n){var e=l(n,14),r=l(n,18);return n=l(n,41),new t(e.a^r.a^n.a,e.b^r.b^n.b)}function y(n){return A(n,7)^A(n,18)^n>>>3}function k(n){var e=l(n,1),r=l(n,8);return n=p(n,7),new t(e.a^r.a^n.a,e.b^r.b^n.b)}function m(n){return A(n,17)^A(n,19)^n>>>10}function F(n){var e=l(n,19),r=l(n,61);return n=p(n,6),new t(e.a^r.a^n.a,e.b^r.b^n.b)}function T(n,e){var r=(65535&n)+(65535&e);return((n>>>16)+(e>>>16)+(r>>>16)&65535)<<16|65535&r}function B(n,e,r,t){var a=(65535&n)+(65535&e)+(65535&r)+(65535&t);return((n>>>16)+(e>>>16)+(r>>>16)+(t>>>16)+(a>>>16)&65535)<<16|65535&a}function Y(n,e,r,t,a){var o=(65535&n)+(65535&e)+(65535&r)+(65535&t)+(65535&a);return((n>>>16)+(e>>>16)+(r>>>16)+(t>>>16)+(a>>>16)+(o>>>16)&65535)<<16|65535&o}function C(n,e){var r,a,o;return r=(65535&n.b)+(65535&e.b),o=(65535&(a=(n.b>>>16)+(e.b>>>16)+(r>>>16)))<<16|65535&r,r=(65535&n.a)+(65535&e.a)+(a>>>16),new t((65535&(a=(n.a>>>16)+(e.a>>>16)+(r>>>16)))<<16|65535&r,o)}function I(n,e,r,a){var o,i,u;return o=(65535&n.b)+(65535&e.b)+(65535&r.b)+(65535&a.b),u=(65535&(i=(n.b>>>16)+(e.b>>>16)+(r.b>>>16)+(a.b>>>16)+(o>>>16)))<<16|65535&o,o=(65535&n.a)+(65535&e.a)+(65535&r.a)+(65535&a.a)+(i>>>16),new t((65535&(i=(n.a>>>16)+(e.a>>>16)+(r.a>>>16)+(a.a>>>16)+(o>>>16)))<<16|65535&o,u)}function L(n,e,r,a,o){var i,u,f;return i=(65535&n.b)+(65535&e.b)+(65535&r.b)+(65535&a.b)+(65535&o.b),f=(65535&(u=(n.b>>>16)+(e.b>>>16)+(r.b>>>16)+(a.b>>>16)+(o.b>>>16)+(i>>>16)))<<16|65535&i,i=(65535&n.a)+(65535&e.a)+(65535&r.a)+(65535&a.a)+(65535&o.a)+(u>>>16),new t((65535&(u=(n.a>>>16)+(e.a>>>16)+(r.a>>>16)+(a.a>>>16)+(o.a>>>16)+(i>>>16)))<<16|65535&i,f)}function x(n,e){return new t(n.a^e.a,n.b^e.b)}function N(n){var e,r=[];if("SHA-1"===n)r=[1732584193,4023233417,2562383102,271733878,3285377520];else if(0===n.lastIndexOf("SHA-",0))switch(r=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],e=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],n){case"SHA-224":break;case"SHA-256":r=e;break;case"SHA-384":r=[new t(3418070365,r[0]),new t(1654270250,r[1]),new t(2438529370,r[2]),new t(355462360,r[3]),new t(1731405415,r[4]),new t(41048885895,r[5]),new t(3675008525,r[6]),new t(1203062813,r[7])];break;case"SHA-512":r=[new t(e[0],4089235720),new t(e[1],2227873595),new t(e[2],4271175723),new t(e[3],1595750129),new t(e[4],2917565137),new t(e[5],725511199),new t(e[6],4215389547),new t(e[7],327033209)];break;default:throw Error("Unknown SHA variant")}else{if(0!==n.lastIndexOf("SHA3-",0)&&0!==n.lastIndexOf("SHAKE",0))throw Error("No SHA variants supported");for(n=0;5>n;n+=1)r[n]=[new t(0,0),new t(0,0),new t(0,0),new t(0,0),new t(0,0)]}return r}function O(n,e){var r,t,a,o,i,u,f,w=[];for(r=e[0],t=e[1],a=e[2],o=e[3],i=e[4],f=0;80>f;f+=1)w[f]=16>f?n[f]:b(w[f-3]^w[f-8]^w[f-14]^w[f-16],1),u=20>f?Y(b(r,5),t&a^~t&o,i,1518500249,w[f]):40>f?Y(b(r,5),t^a^o,i,1859775393,w[f]):60>f?Y(b(r,5),H(t,a,o),i,2400959708,w[f]):Y(b(r,5),t^a^o,i,3395469782,w[f]),i=o,o=a,a=b(t,30),t=r,r=u;return e[0]=T(r,e[0]),e[1]=T(t,e[1]),e[2]=T(a,e[2]),e[3]=T(o,e[3]),e[4]=T(i,e[4]),e}function X(n,e,r,t){var a;for(a=15+(e+65>>>9<<4);n.length<=a;)n.push(0);for(n[e>>>5]|=128<<24-e%32,e+=r,n[a]=4294967295&e,n[a-1]=e/4294967296|0,e=n.length,a=0;a<e;a+=16)t=O(n.slice(a,a+16),t);return t}function P(n,e,r){var a,o,i,u,f,w,s,c,b,h,A,l,p,x,N,O,X,P,M,z,Z,q,D,G=[];if("SHA-224"===r||"SHA-256"===r)h=64,l=1,q=Number,p=T,x=B,N=Y,O=y,X=m,P=S,M=U,Z=H,z=E,D=K;else{if("SHA-384"!==r&&"SHA-512"!==r)throw Error("Unexpected error in SHA-2 implementation");h=80,l=2,q=t,p=C,x=I,N=L,O=k,X=F,P=g,M=R,Z=v,z=d,D=j}for(r=e[0],a=e[1],o=e[2],i=e[3],u=e[4],f=e[5],w=e[6],s=e[7],A=0;A<h;A+=1)16>A?(b=A*l,c=n.length<=b?0:n[b],b=n.length<=b+1?0:n[b+1],G[A]=new q(c,b)):G[A]=x(X(G[A-2]),G[A-7],O(G[A-15]),G[A-16]),c=N(s,M(u),z(u,f,w),D[A],G[A]),b=p(P(r),Z(r,a,o)),s=w,w=f,f=u,u=p(i,c),i=o,o=a,a=r,r=p(c,b);return e[0]=p(r,e[0]),e[1]=p(a,e[1]),e[2]=p(o,e[2]),e[3]=p(i,e[3]),e[4]=p(u,e[4]),e[5]=p(f,e[5]),e[6]=p(w,e[6]),e[7]=p(s,e[7]),e}function M(n,e){var r,a,o,i,u=[],f=[];if(null!==n)for(a=0;a<n.length;a+=2)e[(a>>>1)%5][(a>>>1)/5|0]=x(e[(a>>>1)%5][(a>>>1)/5|0],new t(n[a+1],n[a]));for(r=0;24>r;r+=1){for(i=N("SHA3-"),a=0;5>a;a+=1){o=e[a][0];var w=e[a][1],s=e[a][2],c=e[a][3],b=e[a][4];u[a]=new t(o.a^w.a^s.a^c.a^b.a,o.b^w.b^s.b^c.b^b.b)}for(a=0;5>a;a+=1)f[a]=x(u[(a+4)%5],h(u[(a+1)%5],1));for(a=0;5>a;a+=1)for(o=0;5>o;o+=1)e[a][o]=x(e[a][o],f[a]);for(a=0;5>a;a+=1)for(o=0;5>o;o+=1)i[o][(2*a+3*o)%5]=h(e[a][o],z[a][o]);for(a=0;5>a;a+=1)for(o=0;5>o;o+=1)e[a][o]=x(i[a][o],new t(~i[(a+1)%5][o].a&i[(a+2)%5][o].a,~i[(a+1)%5][o].b&i[(a+2)%5][o].b));e[0][0]=x(e[0][0],Z[r])}return e}var K,j,z,Z;j=[new t((K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])[0],3609767458),new t(K[1],602891725),new t(K[2],3964484399),new t(K[3],2173295548),new t(K[4],4081628472),new t(K[5],3053834265),new t(K[6],2937671579),new t(K[7],3664609560),new t(K[8],2734883394),new t(K[9],1164996542),new t(K[10],1323610764),new t(K[11],3590304994),new t(K[12],4068182383),new t(K[13],991336113),new t(K[14],633803317),new t(K[15],3479774868),new t(K[16],2666613458),new t(K[17],944711139),new t(K[18],2341262773),new t(K[19],2007800933),new t(K[20],1495990901),new t(K[21],1856431235),new t(K[22],3175218132),new t(K[23],2198950837),new t(K[24],3999719339),new t(K[25],766784016),new t(K[26],2566594879),new t(K[27],3203337956),new t(K[28],1034457026),new t(K[29],2466948901),new t(K[30],3758326383),new t(K[31],168717936),new t(K[32],1188179964),new t(K[33],1546045734),new t(K[34],1522805485),new t(K[35],2643833823),new t(K[36],2343527390),new t(K[37],1014477480),new t(K[38],1206759142),new t(K[39],344077627),new t(K[40],1290863460),new t(K[41],3158454273),new t(K[42],3505952657),new t(K[43],106217008),new t(K[44],3606008344),new t(K[45],1432725776),new t(K[46],1467031594),new t(K[47],851169720),new t(K[48],3100823752),new t(K[49],1363258195),new t(K[50],3750685593),new t(K[51],3785050280),new t(K[52],3318307427),new t(K[53],3812723403),new t(K[54],2003034995),new t(K[55],3602036899),new t(K[56],1575990012),new t(K[57],1125592928),new t(K[58],2716904306),new t(K[59],442776044),new t(K[60],593698344),new t(K[61],3733110249),new t(K[62],2999351573),new t(K[63],3815920427),new t(3391569614,3928383900),new t(3515267271,566280711),new t(3940187606,3454069534),new t(4118630271,4000239992),new t(116418474,1914138554),new t(174292421,2731055270),new t(289380356,3203993006),new t(460393269,320620315),new t(685471733,587496836),new t(852142971,1086792851),new t(1017036298,365543100),new t(1126000580,2618297676),new t(1288033470,3409855158),new t(1501505948,4234509866),new t(1607167915,987167468),new t(1816402316,1246189591)],Z=[new t(0,1),new t(0,32898),new t(2147483648,32906),new t(2147483648,2147516416),new t(0,32907),new t(0,2147483649),new t(2147483648,2147516545),new t(2147483648,32777),new t(0,138),new t(0,136),new t(0,2147516425),new t(0,2147483658),new t(0,2147516555),new t(2147483648,139),new t(2147483648,32905),new t(2147483648,32771),new t(2147483648,32770),new t(2147483648,128),new t(0,32778),new t(2147483648,2147483658),new t(2147483648,2147516545),new t(2147483648,32896),new t(0,2147483649),new t(2147483648,2147516424)],z=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]],"function"==typeof n&&n.amd?n(function(){return r}):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(module.exports=r),exports=r):e.jsSHA=r}(this); },{}],"iROh":[function(require,module,exports) { var define; var global = arguments[3]; var e,t=arguments[3];!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof e&&e.amd?e(n):t.moment=n()}(this,function(){"use strict";var e,t;function n(){return e.apply(null,arguments)}function s(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function a(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(r(e,t))return!1;return!0}function o(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function l(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function h(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function d(e,t){for(var n in t)r(t,n)&&(e[n]=t[n]);return r(t,"toString")&&(e.toString=t.toString),r(t,"valueOf")&&(e.valueOf=t.valueOf),e}function c(e,t,n,s){return Tt(e,t,n,s,!0).utc()}function f(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function m(e){if(null==e._isValid){var n=f(e),s=t.call(n.parsedDateParts,function(e){return null!=e}),i=!isNaN(e._d.getTime())&&n.overflow<0&&!n.empty&&!n.invalidEra&&!n.invalidMonth&&!n.invalidWeekday&&!n.weekdayMismatch&&!n.nullInput&&!n.invalidFormat&&!n.userInvalidated&&(!n.meridiem||n.meridiem&&s);if(e._strict&&(i=i&&0===n.charsLeftOver&&0===n.unusedTokens.length&&void 0===n.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return i;e._isValid=i}return e._isValid}function _(e){var t=c(NaN);return null!=e?d(f(t),e):f(t).userInvalidated=!0,t}t=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),s=n.length>>>0;for(t=0;t<s;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var y=n.momentProperties=[],g=!1;function w(e,t){var n,s,i;if(o(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),o(t._i)||(e._i=t._i),o(t._f)||(e._f=t._f),o(t._l)||(e._l=t._l),o(t._strict)||(e._strict=t._strict),o(t._tzm)||(e._tzm=t._tzm),o(t._isUTC)||(e._isUTC=t._isUTC),o(t._offset)||(e._offset=t._offset),o(t._pf)||(e._pf=f(t)),o(t._locale)||(e._locale=t._locale),y.length>0)for(n=0;n<y.length;n++)o(i=t[s=y[n]])||(e[s]=i);return e}function p(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===g&&(g=!0,n.updateOffset(this),g=!1)}function v(e){return e instanceof p||null!=e&&null!=e._isAMomentObject}function k(e){!1===n.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function M(e,t){var s=!0;return d(function(){if(null!=n.deprecationHandler&&n.deprecationHandler(null,e),s){var i,a,o,u=[];for(a=0;a<arguments.length;a++){if(i="","object"==typeof arguments[a]){for(o in i+="\n["+a+"] ",arguments[0])r(arguments[0],o)&&(i+=o+": "+arguments[0][o]+", ");i=i.slice(0,-2)}else i=arguments[a];u.push(i)}k(e+"\nArguments: "+Array.prototype.slice.call(u).join("")+"\n"+(new Error).stack),s=!1}return t.apply(this,arguments)},t)}var D,S={};function Y(e,t){null!=n.deprecationHandler&&n.deprecationHandler(e,t),S[e]||(k(t),S[e]=!0)}function O(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function b(e,t){var n,s=d({},e);for(n in t)r(t,n)&&(i(e[n])&&i(t[n])?(s[n]={},d(s[n],e[n]),d(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)r(e,n)&&!r(t,n)&&i(e[n])&&(s[n]=d({},s[n]));return s}function x(e){null!=e&&this.set(e)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null,D=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)r(e,t)&&n.push(t);return n};function T(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,P=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,R={},W={};function C(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(W[e]=i),t&&(W[t[0]]=function(){return T(i.apply(this,arguments),t[1],t[2])}),n&&(W[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function U(e,t){return e.isValid()?(t=H(t,e.localeData()),R[t]=R[t]||function(e){var t,n,s,i=e.match(N);for(t=0,n=i.length;t<n;t++)W[i[t]]?i[t]=W[i[t]]:i[t]=(s=i[t]).match(/\[[\s\S]/)?s.replace(/^\[|\]$/g,""):s.replace(/\\/g,"");return function(t){var s,r="";for(s=0;s<n;s++)r+=O(i[s])?i[s].call(t,e):i[s];return r}}(t),R[t](e)):e.localeData().invalidDate()}function H(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(P.lastIndex=0;n>=0&&P.test(e);)e=e.replace(P,s),P.lastIndex=0,n-=1;return e}var F={};function L(e,t){var n=e.toLowerCase();F[n]=F[n+"s"]=F[t]=e}function V(e){return"string"==typeof e?F[e]||F[e.toLowerCase()]:void 0}function G(e){var t,n,s={};for(n in e)r(e,n)&&(t=V(n))&&(s[t]=e[n]);return s}var E={};function A(e,t){E[e]=t}function j(e){return e%4==0&&e%100!=0||e%400==0}function I(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function Z(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=I(t)),n}function z(e,t){return function(s){return null!=s?(q(this,e,s),n.updateOffset(this,t),this):$(this,e)}}function $(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function q(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&j(e.year())&&1===e.month()&&29===e.date()?(n=Z(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Te(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var B,J=/\d/,Q=/\d\d/,X=/\d{3}/,K=/\d{4}/,ee=/[+-]?\d{6}/,te=/\d\d?/,ne=/\d\d\d\d?/,se=/\d\d\d\d\d\d?/,ie=/\d{1,3}/,re=/\d{1,4}/,ae=/[+-]?\d{1,6}/,oe=/\d+/,ue=/[+-]?\d+/,le=/Z|[+-]\d\d:?\d\d/gi,he=/Z|[+-]\d\d(?::?\d\d)?/gi,de=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function ce(e,t,n){B[e]=O(t)?t:function(e,s){return e&&n?n:t}}function fe(e,t){return r(B,e)?B[e](t._strict,t._locale):new RegExp(me(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function me(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}B={};var _e={};function ye(e,t){var n,s=t;for("string"==typeof e&&(e=[e]),u(t)&&(s=function(e,n){n[t]=Z(e)}),n=0;n<e.length;n++)_e[e[n]]=s}function ge(e,t){ye(e,function(e,n,s,i){s._w=s._w||{},t(e,s._w,s,i)})}function we(e,t,n){null!=t&&r(_e,e)&&_e[e](t,n._a,n,e)}var pe,ve=0,ke=1,Me=2,De=3,Se=4,Ye=5,Oe=6,be=7,xe=8;function Te(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?j(e)?29:28:31-s%7%2}pe=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},C("M",["MM",2],"Mo",function(){return this.month()+1}),C("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),C("MMMM",0,0,function(e){return this.localeData().months(this,e)}),L("month","M"),A("month",8),ce("M",te),ce("MM",te,Q),ce("MMM",function(e,t){return t.monthsShortRegex(e)}),ce("MMMM",function(e,t){return t.monthsRegex(e)}),ye(["M","MM"],function(e,t){t[ke]=Z(e)-1}),ye(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[ke]=i:f(n).invalidMonth=e});var Ne="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Pe="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Re=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,We=de,Ce=de;function Ue(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=Z(t);else if(!u(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Te(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function He(e){return null!=e?(Ue(this,e),n.updateOffset(this,!0),this):$(this,"Month")}function Fe(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=c([2e3,t]),s.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=me(s[t]),i[t]=me(i[t]);for(t=0;t<24;t++)r[t]=me(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Le(e){return j(e)?366:365}C("Y",0,0,function(){var e=this.year();return e<=9999?T(e,4):"+"+e}),C(0,["YY",2],0,function(){return this.year()%100}),C(0,["YYYY",4],0,"year"),C(0,["YYYYY",5],0,"year"),C(0,["YYYYYY",6,!0],0,"year"),L("year","y"),A("year",1),ce("Y",ue),ce("YY",te,Q),ce("YYYY",re,K),ce("YYYYY",ae,ee),ce("YYYYYY",ae,ee),ye(["YYYYY","YYYYYY"],ve),ye("YYYY",function(e,t){t[ve]=2===e.length?n.parseTwoDigitYear(e):Z(e)}),ye("YY",function(e,t){t[ve]=n.parseTwoDigitYear(e)}),ye("Y",function(e,t){t[ve]=parseInt(e,10)}),n.parseTwoDigitYear=function(e){return Z(e)+(Z(e)>68?1900:2e3)};var Ve=z("FullYear",!0);function Ge(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ee(e,t,n){var s=7+t-n;return-((7+Ge(e,0,s).getUTCDay()-t)%7)+s-1}function Ae(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Ee(e,s,i);return o<=0?a=Le(r=e-1)+o:o>Le(e)?(r=e+1,a=o-Le(e)):(r=e,a=o),{year:r,dayOfYear:a}}function je(e,t,n){var s,i,r=Ee(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ie(i=e.year()-1,t,n):a>Ie(e.year(),t,n)?(s=a-Ie(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ie(e,t,n){var s=Ee(e,t,n),i=Ee(e+1,t,n);return(Le(e)-s+i)/7}C("w",["ww",2],"wo","week"),C("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),A("week",5),A("isoWeek",5),ce("w",te),ce("ww",te,Q),ce("W",te),ce("WW",te,Q),ge(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=Z(e)});function Ze(e,t){return e.slice(t,7).concat(e.slice(0,t))}C("d",0,"do","day"),C("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),C("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),C("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),C("e",0,0,"weekday"),C("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),A("day",11),A("weekday",11),A("isoWeekday",11),ce("d",te),ce("e",te),ce("E",te),ce("dd",function(e,t){return t.weekdaysMinRegex(e)}),ce("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ce("dddd",function(e,t){return t.weekdaysRegex(e)}),ge(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:f(n).invalidWeekday=e}),ge(["d","e","E"],function(e,t,n,s){t[s]=Z(e)});var ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),$e="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),qe="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Be=de,Je=de,Qe=de;function Xe(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=c([2e3,1]).day(t),s=me(this.weekdaysMin(n,"")),i=me(this.weekdaysShort(n,"")),r=me(this.weekdays(n,"")),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);a.sort(e),o.sort(e),u.sort(e),l.sort(e),this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Ke(){return this.hours()%12||12}function et(e,t){C(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function tt(e,t){return t._meridiemParse}C("H",["HH",2],0,"hour"),C("h",["hh",2],0,Ke),C("k",["kk",2],0,function(){return this.hours()||24}),C("hmm",0,0,function(){return""+Ke.apply(this)+T(this.minutes(),2)}),C("hmmss",0,0,function(){return""+Ke.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),C("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),C("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),et("a",!0),et("A",!1),L("hour","h"),A("hour",13),ce("a",tt),ce("A",tt),ce("H",te),ce("h",te),ce("k",te),ce("HH",te,Q),ce("hh",te,Q),ce("kk",te,Q),ce("hmm",ne),ce("hmmss",se),ce("Hmm",ne),ce("Hmmss",se),ye(["H","HH"],De),ye(["k","kk"],function(e,t,n){var s=Z(e);t[De]=24===s?0:s}),ye(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ye(["h","hh"],function(e,t,n){t[De]=Z(e),f(n).bigHour=!0}),ye("hmm",function(e,t,n){var s=e.length-2;t[De]=Z(e.substr(0,s)),t[Se]=Z(e.substr(s)),f(n).bigHour=!0}),ye("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[De]=Z(e.substr(0,s)),t[Se]=Z(e.substr(s,2)),t[Ye]=Z(e.substr(i)),f(n).bigHour=!0}),ye("Hmm",function(e,t,n){var s=e.length-2;t[De]=Z(e.substr(0,s)),t[Se]=Z(e.substr(s))}),ye("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[De]=Z(e.substr(0,s)),t[Se]=Z(e.substr(s,2)),t[Ye]=Z(e.substr(i))});var nt=z("Hours",!0);var st,it={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ne,monthsShort:Pe,week:{dow:0,doy:6},weekdays:ze,weekdaysMin:qe,weekdaysShort:$e,meridiemParse:/[ap]\.?m?\.?/i},rt={},at={};function ot(e,t){var n,s=Math.min(e.length,t.length);for(n=0;n<s;n+=1)if(e[n]!==t[n])return n;return s}function ut(e){return e?e.toLowerCase().replace("_","-"):e}function lt(e){var t=null;if(void 0===rt[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=st._abbr,require("./locale/"+e),ht(t)}catch(n){rt[e]=null}return rt[e]}function ht(e,t){var n;return e&&((n=o(t)?ct(e):dt(e,t))?st=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),st._abbr}function dt(e,t){if(null!==t){var n,s=it;if(t.abbr=e,null!=rt[e])Y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=rt[e]._config;else if(null!=t.parentLocale)if(null!=rt[t.parentLocale])s=rt[t.parentLocale]._config;else{if(null==(n=lt(t.parentLocale)))return at[t.parentLocale]||(at[t.parentLocale]=[]),at[t.parentLocale].push({name:e,config:t}),null;s=n._config}return rt[e]=new x(b(s,t)),at[e]&&at[e].forEach(function(e){dt(e.name,e.config)}),ht(e),rt[e]}return delete rt[e],null}function ct(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return st;if(!s(e)){if(t=lt(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=ut(e[r]).split("-")).length,n=(n=ut(e[r+1]))?n.split("-"):null;t>0;){if(s=lt(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&ot(i,n)>=t-1)break;t--}r++}return st}(e)}function ft(e){var t,n=e._a;return n&&-2===f(e).overflow&&(t=n[ke]<0||n[ke]>11?ke:n[Me]<1||n[Me]>Te(n[ve],n[ke])?Me:n[De]<0||n[De]>24||24===n[De]&&(0!==n[Se]||0!==n[Ye]||0!==n[Oe])?De:n[Se]<0||n[Se]>59?Se:n[Ye]<0||n[Ye]>59?Ye:n[Oe]<0||n[Oe]>999?Oe:-1,f(e)._overflowDayOfYear&&(t<ve||t>Me)&&(t=Me),f(e)._overflowWeeks&&-1===t&&(t=be),f(e)._overflowWeekday&&-1===t&&(t=xe),f(e).overflow=t),e}var mt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yt=/Z|[+-]\d\d(?::?\d\d)?/,gt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],wt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pt=/^\/?Date\((-?\d+)/i,vt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,kt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Mt(e){var t,n,s,i,r,a,o=e._i,u=mt.exec(o)||_t.exec(o);if(u){for(f(e).iso=!0,t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[1])){i=gt[t][0],s=!1!==gt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=wt.length;t<n;t++)if(wt[t][1].exec(u[3])){r=(u[2]||" ")+wt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!yt.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),bt(e)}else e._isValid=!1}function Dt(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function St(e){var t,n,s,i,r,a,o,u,l=vt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(l){if(n=l[4],s=l[3],i=l[2],r=l[5],a=l[6],o=l[7],u=[Dt(n),Pe.indexOf(s),parseInt(i,10),parseInt(r,10),parseInt(a,10)],o&&u.push(parseInt(o,10)),t=u,!function(e,t,n){return!e||$e.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(f(n).weekdayMismatch=!0,n._isValid=!1,!1)}(l[1],t,e))return;e._a=t,e._tzm=function(e,t,n){if(e)return kt[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(l[8],l[9],l[10]),e._d=Ge.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),f(e).rfc2822=!0}else e._isValid=!1}function Yt(e,t,n){return null!=e?e:null!=t?t:n}function Ot(e){var t,s,i,r,a,o=[];if(!e._d){for(i=function(e){var t=new Date(n.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[Me]&&null==e._a[ke]&&function(e){var t,n,s,i,r,a,o,u,l;null!=(t=e._w).GG||null!=t.W||null!=t.E?(r=1,a=4,n=Yt(t.GG,e._a[ve],je(Nt(),1,4).year),s=Yt(t.W,1),((i=Yt(t.E,1))<1||i>7)&&(u=!0)):(r=e._locale._week.dow,a=e._locale._week.doy,l=je(Nt(),r,a),n=Yt(t.gg,e._a[ve],l.year),s=Yt(t.w,l.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||t.e>6)&&(u=!0)):i=r);s<1||s>Ie(n,r,a)?f(e)._overflowWeeks=!0:null!=u?f(e)._overflowWeekday=!0:(o=Ae(n,s,i,r,a),e._a[ve]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(a=Yt(e._a[ve],i[ve]),(e._dayOfYear>Le(a)||0===e._dayOfYear)&&(f(e)._overflowDayOfYear=!0),s=Ge(a,0,e._dayOfYear),e._a[ke]=s.getUTCMonth(),e._a[Me]=s.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=i[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[De]&&0===e._a[Se]&&0===e._a[Ye]&&0===e._a[Oe]&&(e._nextDay=!0,e._a[De]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o;return e<100&&e>=0?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}).apply(null,o),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[De]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(f(e).weekdayMismatch=!0)}}function bt(e){if(e._f!==n.ISO_8601)if(e._f!==n.RFC_2822){e._a=[],f(e).empty=!0;var t,s,i,r,a,o,u=""+e._i,l=u.length,h=0;for(i=H(e._f,e._locale).match(N)||[],t=0;t<i.length;t++)r=i[t],(s=(u.match(fe(r,e))||[])[0])&&((a=u.substr(0,u.indexOf(s))).length>0&&f(e).unusedInput.push(a),u=u.slice(u.indexOf(s)+s.length),h+=s.length),W[r]?(s?f(e).empty=!1:f(e).unusedTokens.push(r),we(r,s,e)):e._strict&&!s&&f(e).unusedTokens.push(r);f(e).charsLeftOver=l-h,u.length>0&&f(e).unusedInput.push(u),e._a[De]<=12&&!0===f(e).bigHour&&e._a[De]>0&&(f(e).bigHour=void 0),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[De]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0),t):t}(e._locale,e._a[De],e._meridiem),null!==(o=f(e).era)&&(e._a[ve]=e._locale.erasConvertYear(o,e._a[ve])),Ot(e),ft(e)}else St(e);else Mt(e)}function xt(e){var t=e._i,r=e._f;return e._locale=e._locale||ct(e._l),null===t||void 0===r&&""===t?_({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),v(t)?new p(ft(t)):(l(t)?e._d=t:s(r)?function(e){var t,n,s,i,r,a,o=!1;if(0===e._f.length)return f(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<e._f.length;i++)r=0,a=!1,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],bt(t),m(t)&&(a=!0),r+=f(t).charsLeftOver,r+=10*f(t).unusedTokens.length,f(t).score=r,o?r<s&&(s=r,n=t):(null==s||r<s||a)&&(s=r,n=t,a&&(o=!0));d(e,n||t)}(e):r?bt(e):function(e){var t=e._i;o(t)?e._d=new Date(n.now()):l(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=pt.exec(e._i);null===t?(Mt(e),!1===e._isValid&&(delete e._isValid,St(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:n.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):s(t)?(e._a=h(t.slice(0),function(e){return parseInt(e,10)}),Ot(e)):i(t)?function(e){if(!e._d){var t=G(e._i),n=void 0===t.day?t.date:t.day;e._a=h([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Ot(e)}}(e):u(t)?e._d=new Date(t):n.createFromInputFallback(e)}(e),m(e)||(e._d=null),e))}function Tt(e,t,n,r,o){var u,l={};return!0!==t&&!1!==t||(r=t,t=void 0),!0!==n&&!1!==n||(r=n,n=void 0),(i(e)&&a(e)||s(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=o,l._l=n,l._i=e,l._f=t,l._strict=r,(u=new p(ft(xt(l))))._nextDay&&(u.add(1,"d"),u._nextDay=void 0),u}function Nt(e,t,n,s){return Tt(e,t,n,s,!1)}n.createFromInputFallback=M("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),n.ISO_8601=function(){},n.RFC_2822=function(){};var Pt=M("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Nt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:_()}),Rt=M("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Nt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:_()});function Wt(e,t){var n,i;if(1===t.length&&s(t[0])&&(t=t[0]),!t.length)return Nt();for(n=t[0],i=1;i<t.length;++i)t[i].isValid()&&!t[i][e](n)||(n=t[i]);return n}var Ct=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ut(e){var t=G(e),n=t.year||0,s=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,o=t.day||0,u=t.hour||0,l=t.minute||0,h=t.second||0,d=t.millisecond||0;this._isValid=function(e){var t,n,s=!1;for(t in e)if(r(e,t)&&(-1===pe.call(Ct,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<Ct.length;++n)if(e[Ct[n]]){if(s)return!1;parseFloat(e[Ct[n]])!==Z(e[Ct[n]])&&(s=!0)}return!0}(t),this._milliseconds=+d+1e3*h+6e4*l+1e3*u*60*60,this._days=+o+7*a,this._months=+i+3*s+12*n,this._data={},this._locale=ct(),this._bubble()}function Ht(e){return e instanceof Ut}function Ft(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Lt(e,t){C(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+T(~~(e/60),2)+t+T(~~e%60,2)})}Lt("Z",":"),Lt("ZZ",""),ce("Z",he),ce("ZZ",he),ye(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Gt(he,e)});var Vt=/([\+\-]|\d\d)/gi;function Gt(e,t){var n,s,i=(t||"").match(e);return null===i?null:0===(s=60*(n=((i[i.length-1]||[])+"").match(Vt)||["-",0,0])[1]+Z(n[2]))?0:"+"===n[0]?s:-s}function Et(e,t){var s,i;return t._isUTC?(s=t.clone(),i=(v(e)||l(e)?e.valueOf():Nt(e).valueOf())-s.valueOf(),s._d.setTime(s._d.valueOf()+i),n.updateOffset(s,!1),s):Nt(e).local()}function At(e){return-Math.round(e._d.getTimezoneOffset())}function jt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}n.updateOffset=function(){};var It=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Zt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function zt(e,t){var n,s,i,a=e,o=null;return Ht(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(a={},t?a[t]=+e:a.milliseconds=+e):(o=It.exec(e))?(n="-"===o[1]?-1:1,a={y:0,d:Z(o[Me])*n,h:Z(o[De])*n,m:Z(o[Se])*n,s:Z(o[Ye])*n,ms:Z(Ft(1e3*o[Oe]))*n}):(o=Zt.exec(e))?(n="-"===o[1]?-1:1,a={y:$t(o[2],n),M:$t(o[3],n),w:$t(o[4],n),d:$t(o[5],n),h:$t(o[6],n),m:$t(o[7],n),s:$t(o[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Et(t,e),e.isBefore(t)?n=qt(e,t):((n=qt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Nt(a.from),Nt(a.to)),(a={}).ms=i.milliseconds,a.M=i.months),s=new Ut(a),Ht(e)&&r(e,"_locale")&&(s._locale=e._locale),Ht(e)&&r(e,"_isValid")&&(s._isValid=e._isValid),s}function $t(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function qt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Bt(e,t){return function(n,s){var i;return null===s||isNaN(+s)||(Y(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=s,s=i),Jt(this,zt(n,s),e),this}}function Jt(e,t,s,i){var r=t._milliseconds,a=Ft(t._days),o=Ft(t._months);e.isValid()&&(i=null==i||i,o&&Ue(e,$(e,"Month")+o*s),a&&q(e,"Date",$(e,"Date")+a*s),r&&e._d.setTime(e._d.valueOf()+r*s),i&&n.updateOffset(e,a||o))}zt.fn=Ut.prototype,zt.invalid=function(){return zt(NaN)};var Qt=Bt(1,"add"),Xt=Bt(-1,"subtract");function Kt(e){return"string"==typeof e||e instanceof String}function en(e){return v(e)||l(e)||Kt(e)||u(e)||function(e){var t=s(e),n=!1;t&&(n=0===e.filter(function(t){return!u(t)&&Kt(e)}).length);return t&&n}(e)||function(e){var t,n,s=i(e)&&!a(e),o=!1,u=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(t=0;t<u.length;t+=1)n=u[t],o=o||r(e,n);return s&&o}(e)||null==e}function tn(e,t){if(e.date()<t.date())return-tn(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(n+1,"months")-s)))||0}function nn(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ct(e))&&(this._locale=t),this)}n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var sn=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function rn(){return this._locale}var an=1e3,on=60*an,un=60*on,ln=3506328*un;function hn(e,t){return(e%t+t)%t}function dn(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-ln:new Date(e,t,n).valueOf()}function cn(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-ln:Date.UTC(e,t,n)}function fn(e,t){return t.erasAbbrRegex(e)}function mn(){var e,t,n=[],s=[],i=[],r=[],a=this.eras();for(e=0,t=a.length;e<t;++e)s.push(me(a[e].name)),n.push(me(a[e].abbr)),i.push(me(a[e].narrow)),r.push(me(a[e].name)),r.push(me(a[e].abbr)),r.push(me(a[e].narrow));this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+s.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+i.join("|")+")","i")}function _n(e,t){C(0,[e,e.length],0,t)}function yn(e,t,n,s,i){var r;return null==e?je(this,s,i).year:(t>(r=Ie(e,s,i))&&(t=r),function(e,t,n,s,i){var r=Ae(e,t,n,s,i),a=Ge(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}C("N",0,0,"eraAbbr"),C("NN",0,0,"eraAbbr"),C("NNN",0,0,"eraAbbr"),C("NNNN",0,0,"eraName"),C("NNNNN",0,0,"eraNarrow"),C("y",["y",1],"yo","eraYear"),C("y",["yy",2],0,"eraYear"),C("y",["yyy",3],0,"eraYear"),C("y",["yyyy",4],0,"eraYear"),ce("N",fn),ce("NN",fn),ce("NNN",fn),ce("NNNN",function(e,t){return t.erasNameRegex(e)}),ce("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),ye(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){var i=n._locale.erasParse(e,s,n._strict);i?f(n).era=i:f(n).invalidEra=e}),ce("y",oe),ce("yy",oe),ce("yyy",oe),ce("yyyy",oe),ce("yo",function(e,t){return t._eraYearOrdinalRegex||oe}),ye(["y","yy","yyy","yyyy"],ve),ye(["yo"],function(e,t,n,s){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[ve]=n._locale.eraYearOrdinalParse(e,i):t[ve]=parseInt(e,10)}),C(0,["gg",2],0,function(){return this.weekYear()%100}),C(0,["GG",2],0,function(){return this.isoWeekYear()%100}),_n("gggg","weekYear"),_n("ggggg","weekYear"),_n("GGGG","isoWeekYear"),_n("GGGGG","isoWeekYear"),L("weekYear","gg"),L("isoWeekYear","GG"),A("weekYear",1),A("isoWeekYear",1),ce("G",ue),ce("g",ue),ce("GG",te,Q),ce("gg",te,Q),ce("GGGG",re,K),ce("gggg",re,K),ce("GGGGG",ae,ee),ce("ggggg",ae,ee),ge(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=Z(e)}),ge(["gg","GG"],function(e,t,s,i){t[i]=n.parseTwoDigitYear(e)}),C("Q",0,"Qo","quarter"),L("quarter","Q"),A("quarter",7),ce("Q",J),ye("Q",function(e,t){t[ke]=3*(Z(e)-1)}),C("D",["DD",2],"Do","date"),L("date","D"),A("date",9),ce("D",te),ce("DD",te,Q),ce("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ye(["D","DD"],Me),ye("Do",function(e,t){t[Me]=Z(e.match(te)[0])});var gn=z("Date",!0);C("DDD",["DDDD",3],"DDDo","dayOfYear"),L("dayOfYear","DDD"),A("dayOfYear",4),ce("DDD",ie),ce("DDDD",X),ye(["DDD","DDDD"],function(e,t,n){n._dayOfYear=Z(e)}),C("m",["mm",2],0,"minute"),L("minute","m"),A("minute",14),ce("m",te),ce("mm",te,Q),ye(["m","mm"],Se);var wn=z("Minutes",!1);C("s",["ss",2],0,"second"),L("second","s"),A("second",15),ce("s",te),ce("ss",te,Q),ye(["s","ss"],Ye);var pn,vn,kn=z("Seconds",!1);for(C("S",0,0,function(){return~~(this.millisecond()/100)}),C(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),C(0,["SSS",3],0,"millisecond"),C(0,["SSSS",4],0,function(){return 10*this.millisecond()}),C(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),C(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),C(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),C(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),C(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),L("millisecond","ms"),A("millisecond",16),ce("S",ie,J),ce("SS",ie,Q),ce("SSS",ie,X),pn="SSSS";pn.length<=9;pn+="S")ce(pn,oe);function Mn(e,t){t[Oe]=Z(1e3*("0."+e))}for(pn="S";pn.length<=9;pn+="S")ye(pn,Mn);vn=z("Milliseconds",!1),C("z",0,0,"zoneAbbr"),C("zz",0,0,"zoneName");var Dn=p.prototype;function Sn(e){return e}Dn.add=Qt,Dn.calendar=function(e,t){1===arguments.length&&(en(arguments[0])?(e=arguments[0],t=void 0):function(e){var t,n=i(e)&&!a(e),s=!1,o=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<o.length;t+=1)s=s||r(e,o[t]);return n&&s}(arguments[0])&&(t=arguments[0],e=void 0));var s=e||Nt(),o=Et(s,this).startOf("day"),u=n.calendarFormat(this,o)||"sameElse",l=t&&(O(t[u])?t[u].call(this,s):t[u]);return this.format(l||this.localeData().calendar(u,this,Nt(s)))},Dn.clone=function(){return new p(this)},Dn.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Et(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=V(t)){case"year":r=tn(this,s)/12;break;case"month":r=tn(this,s);break;case"quarter":r=tn(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:I(r)},Dn.endOf=function(e){var t,s;if(void 0===(e=V(e))||"millisecond"===e||!this.isValid())return this;switch(s=this._isUTC?cn:dn,e){case"year":t=s(this.year()+1,0,1)-1;break;case"quarter":t=s(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=s(this.year(),this.month()+1,1)-1;break;case"week":t=s(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=s(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=s(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=un-hn(t+(this._isUTC?0:this.utcOffset()*on),un)-1;break;case"minute":t=this._d.valueOf(),t+=on-hn(t,on)-1;break;case"second":t=this._d.valueOf(),t+=an-hn(t,an)-1}return this._d.setTime(t),n.updateOffset(this,!0),this},Dn.format=function(e){e||(e=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var t=U(this,e);return this.localeData().postformat(t)},Dn.from=function(e,t){return this.isValid()&&(v(e)&&e.isValid()||Nt(e).isValid())?zt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Dn.fromNow=function(e){return this.from(Nt(),e)},Dn.to=function(e,t){return this.isValid()&&(v(e)&&e.isValid()||Nt(e).isValid())?zt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Dn.toNow=function(e){return this.to(Nt(),e)},Dn.get=function(e){return O(this[e=V(e)])?this[e]():this},Dn.invalidAt=function(){return f(this).overflow},Dn.isAfter=function(e,t){var n=v(e)?e:Nt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},Dn.isBefore=function(e,t){var n=v(e)?e:Nt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},Dn.isBetween=function(e,t,n,s){var i=v(e)?e:Nt(e),r=v(t)?t:Nt(t);return!!(this.isValid()&&i.isValid()&&r.isValid())&&("("===(s=s||"()")[0]?this.isAfter(i,n):!this.isBefore(i,n))&&(")"===s[1]?this.isBefore(r,n):!this.isAfter(r,n))},Dn.isSame=function(e,t){var n,s=v(e)?e:Nt(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},Dn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},Dn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},Dn.isValid=function(){return m(this)},Dn.lang=sn,Dn.locale=nn,Dn.localeData=rn,Dn.max=Rt,Dn.min=Pt,Dn.parsingFlags=function(){return d({},f(this))},Dn.set=function(e,t){if("object"==typeof e){var n,s=function(e){var t,n=[];for(t in e)r(e,t)&&n.push({unit:t,priority:E[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=G(e));for(n=0;n<s.length;n++)this[s[n].unit](e[s[n].unit])}else if(O(this[e=V(e)]))return this[e](t);return this},Dn.startOf=function(e){var t,s;if(void 0===(e=V(e))||"millisecond"===e||!this.isValid())return this;switch(s=this._isUTC?cn:dn,e){case"year":t=s(this.year(),0,1);break;case"quarter":t=s(this.year(),this.month()-this.month()%3,1);break;case"month":t=s(this.year(),this.month(),1);break;case"week":t=s(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=s(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=s(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=hn(t+(this._isUTC?0:this.utcOffset()*on),un);break;case"minute":t=this._d.valueOf(),t-=hn(t,on);break;case"second":t=this._d.valueOf(),t-=hn(t,an)}return this._d.setTime(t),n.updateOffset(this,!0),this},Dn.subtract=Xt,Dn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},Dn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},Dn.toDate=function(){return new Date(this.valueOf())},Dn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?U(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",U(n,"Z")):U(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Dn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,s="moment",i="";return this.isLocal()||(s=0===this.utcOffset()?"moment.utc":"moment.parseZone",i="Z"),e="["+s+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n=i+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(Dn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Dn.toJSON=function(){return this.isValid()?this.toISOString():null},Dn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Dn.unix=function(){return Math.floor(this.valueOf()/1e3)},Dn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Dn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Dn.eraName=function(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until)return s[e].name;if(s[e].until<=n&&n<=s[e].since)return s[e].name}return""},Dn.eraNarrow=function(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until)return s[e].narrow;if(s[e].until<=n&&n<=s[e].since)return s[e].narrow}return""},Dn.eraAbbr=function(){var e,t,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until)return s[e].abbr;if(s[e].until<=n&&n<=s[e].since)return s[e].abbr}return""},Dn.eraYear=function(){var e,t,s,i,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(s=r[e].since<=r[e].until?1:-1,i=this.clone().startOf("day").valueOf(),r[e].since<=i&&i<=r[e].until||r[e].until<=i&&i<=r[e].since)return(this.year()-n(r[e].since).year())*s+r[e].offset;return this.year()},Dn.year=Ve,Dn.isLeapYear=function(){return j(this.year())},Dn.weekYear=function(e){return yn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Dn.isoWeekYear=function(e){return yn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},Dn.quarter=Dn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},Dn.month=He,Dn.daysInMonth=function(){return Te(this.year(),this.month())},Dn.week=Dn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},Dn.isoWeek=Dn.isoWeeks=function(e){var t=je(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},Dn.weeksInYear=function(){var e=this.localeData()._week;return Ie(this.year(),e.dow,e.doy)},Dn.weeksInWeekYear=function(){var e=this.localeData()._week;return Ie(this.weekYear(),e.dow,e.doy)},Dn.isoWeeksInYear=function(){return Ie(this.year(),1,4)},Dn.isoWeeksInISOWeekYear=function(){return Ie(this.isoWeekYear(),1,4)},Dn.date=gn,Dn.day=Dn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},Dn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},Dn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},Dn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},Dn.hour=Dn.hours=nt,Dn.minute=Dn.minutes=wn,Dn.second=Dn.seconds=kn,Dn.millisecond=Dn.milliseconds=vn,Dn.utcOffset=function(e,t,s){var i,r=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Gt(he,e)))return this}else Math.abs(e)<16&&!s&&(e*=60);return!this._isUTC&&t&&(i=At(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?Jt(this,zt(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:At(this)},Dn.utc=function(e){return this.utcOffset(0,e)},Dn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(At(this),"m")),this},Dn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Gt(le,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},Dn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Nt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},Dn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Dn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Dn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Dn.isUtc=jt,Dn.isUTC=jt,Dn.zoneAbbr=function(){return this._isUTC?"UTC":""},Dn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Dn.dates=M("dates accessor is deprecated. Use date instead.",gn),Dn.months=M("months accessor is deprecated. Use month instead",He),Dn.years=M("years accessor is deprecated. Use year instead",Ve),Dn.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),Dn.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var e,t={};return w(t,this),(t=xt(t))._a?(e=t._isUTC?c(t._a):Nt(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&Z(e[s])!==Z(t[s]))&&a++;return a+r}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted});var Yn=x.prototype;function On(e,t,n,s){var i=ct(),r=c().set(s,t);return i[n](r,e)}function bn(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return On(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=On(e,s,n,"month");return i}function xn(e,t,n,s){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var i,r=ct(),a=e?r._week.dow:0,o=[];if(null!=n)return On(t,(n+a)%7,s,"day");for(i=0;i<7;i++)o[i]=On(t,(i+a)%7,s,"day");return o}Yn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return O(s)?s.call(t,n):s},Yn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(N).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},Yn.invalidDate=function(){return this._invalidDate},Yn.ordinal=function(e){return this._ordinal.replace("%d",e)},Yn.preparse=Sn,Yn.postformat=Sn,Yn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return O(i)?i(e,t,n,s):i.replace(/%d/i,e)},Yn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return O(n)?n(t):n.replace(/%s/i,t)},Yn.set=function(e){var t,n;for(n in e)r(e,n)&&(O(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Yn.eras=function(e,t){var s,i,r,a=this._eras||ct("en")._eras;for(s=0,i=a.length;s<i;++s){switch(typeof a[s].since){case"string":r=n(a[s].since).startOf("day"),a[s].since=r.valueOf()}switch(typeof a[s].until){case"undefined":a[s].until=1/0;break;case"string":r=n(a[s].until).startOf("day").valueOf(),a[s].until=r.valueOf()}}return a},Yn.erasParse=function(e,t,n){var s,i,r,a,o,u=this.eras();for(e=e.toUpperCase(),s=0,i=u.length;s<i;++s)if(r=u[s].name.toUpperCase(),a=u[s].abbr.toUpperCase(),o=u[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return u[s];break;case"NNNN":if(r===e)return u[s];break;case"NNNNN":if(o===e)return u[s]}else if([r,a,o].indexOf(e)>=0)return u[s]},Yn.erasConvertYear=function(e,t){var s=e.since<=e.until?1:-1;return void 0===t?n(e.since).year():n(e.since).year()+(t-e.offset)*s},Yn.erasAbbrRegex=function(e){return r(this,"_erasAbbrRegex")||mn.call(this),e?this._erasAbbrRegex:this._erasRegex},Yn.erasNameRegex=function(e){return r(this,"_erasNameRegex")||mn.call(this),e?this._erasNameRegex:this._erasRegex},Yn.erasNarrowRegex=function(e){return r(this,"_erasNarrowRegex")||mn.call(this),e?this._erasNarrowRegex:this._erasRegex},Yn.months=function(e,t){return e?s(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Re).test(t)?"format":"standalone"][e.month()]:s(this._months)?this._months:this._months.standalone},Yn.monthsShort=function(e,t){return e?s(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Re.test(t)?"format":"standalone"][e.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Yn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=c([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=pe.call(this._shortMonthsParse,a))?i:null:-1!==(i=pe.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=pe.call(this._shortMonthsParse,a))?i:-1!==(i=pe.call(this._longMonthsParse,a))?i:null:-1!==(i=pe.call(this._longMonthsParse,a))?i:-1!==(i=pe.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=c([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},Yn.monthsRegex=function(e){return this._monthsParseExact?(r(this,"_monthsRegex")||Fe.call(this),e?this._monthsStrictRegex:this._monthsRegex):(r(this,"_monthsRegex")||(this._monthsRegex=Ce),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Yn.monthsShortRegex=function(e){return this._monthsParseExact?(r(this,"_monthsRegex")||Fe.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(r(this,"_monthsShortRegex")||(this._monthsShortRegex=We),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Yn.week=function(e){return je(e,this._week.dow,this._week.doy).week},Yn.firstDayOfYear=function(){return this._week.doy},Yn.firstDayOfWeek=function(){return this._week.dow},Yn.weekdays=function(e,t){var n=s(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ze(n,this._week.dow):e?n[e.day()]:n},Yn.weekdaysMin=function(e){return!0===e?Ze(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Yn.weekdaysShort=function(e){return!0===e?Ze(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Yn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=c([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=pe.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=pe.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=pe.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=pe.call(this._weekdaysParse,a))?i:-1!==(i=pe.call(this._shortWeekdaysParse,a))?i:-1!==(i=pe.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=pe.call(this._shortWeekdaysParse,a))?i:-1!==(i=pe.call(this._weekdaysParse,a))?i:-1!==(i=pe.call(this._minWeekdaysParse,a))?i:null:-1!==(i=pe.call(this._minWeekdaysParse,a))?i:-1!==(i=pe.call(this._weekdaysParse,a))?i:-1!==(i=pe.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=c([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},Yn.weekdaysRegex=function(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Xe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(r(this,"_weekdaysRegex")||(this._weekdaysRegex=Be),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Yn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Xe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(r(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Je),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Yn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Xe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(r(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Qe),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Yn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Yn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},ht("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===Z(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),n.lang=M("moment.lang is deprecated. Use moment.locale instead.",ht),n.langData=M("moment.langData is deprecated. Use moment.localeData instead.",ct);var Tn=Math.abs;function Nn(e,t,n,s){var i=zt(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function Pn(e){return e<0?Math.floor(e):Math.ceil(e)}function Rn(e){return 4800*e/146097}function Wn(e){return 146097*e/4800}function Cn(e){return function(){return this.as(e)}}var Un=Cn("ms"),Hn=Cn("s"),Fn=Cn("m"),Ln=Cn("h"),Vn=Cn("d"),Gn=Cn("w"),En=Cn("M"),An=Cn("Q"),jn=Cn("y");function In(e){return function(){return this.isValid()?this._data[e]:NaN}}var Zn=In("milliseconds"),zn=In("seconds"),$n=In("minutes"),qn=In("hours"),Bn=In("days"),Jn=In("months"),Qn=In("years");var Xn=Math.round,Kn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};var es=Math.abs;function ts(e){return(e>0)-(e<0)||+e}function ns(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,s,i,r,a,o,u=es(this._milliseconds)/1e3,l=es(this._days),h=es(this._months),d=this.asSeconds();return d?(e=I(u/60),t=I(e/60),u%=60,e%=60,n=I(h/12),h%=12,s=u?u.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",r=ts(this._months)!==ts(d)?"-":"",a=ts(this._days)!==ts(d)?"-":"",o=ts(this._milliseconds)!==ts(d)?"-":"",i+"P"+(n?r+n+"Y":"")+(h?r+h+"M":"")+(l?a+l+"D":"")+(t||e||u?"T":"")+(t?o+t+"H":"")+(e?o+e+"M":"")+(u?o+s+"S":"")):"P0D"}var ss=Ut.prototype;return ss.isValid=function(){return this._isValid},ss.abs=function(){var e=this._data;return this._milliseconds=Tn(this._milliseconds),this._days=Tn(this._days),this._months=Tn(this._months),e.milliseconds=Tn(e.milliseconds),e.seconds=Tn(e.seconds),e.minutes=Tn(e.minutes),e.hours=Tn(e.hours),e.months=Tn(e.months),e.years=Tn(e.years),this},ss.add=function(e,t){return Nn(this,e,t,1)},ss.subtract=function(e,t){return Nn(this,e,t,-1)},ss.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=V(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+Rn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Wn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},ss.asMilliseconds=Un,ss.asSeconds=Hn,ss.asMinutes=Fn,ss.asHours=Ln,ss.asDays=Vn,ss.asWeeks=Gn,ss.asMonths=En,ss.asQuarters=An,ss.asYears=jn,ss.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*Z(this._months/12):NaN},ss._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return r>=0&&a>=0&&o>=0||r<=0&&a<=0&&o<=0||(r+=864e5*Pn(Wn(o)+a),a=0,o=0),u.milliseconds=r%1e3,e=I(r/1e3),u.seconds=e%60,t=I(e/60),u.minutes=t%60,n=I(t/60),u.hours=n%24,a+=I(n/24),o+=i=I(Rn(a)),a-=Pn(Wn(i)),s=I(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},ss.clone=function(){return zt(this)},ss.get=function(e){return e=V(e),this.isValid()?this[e+"s"]():NaN},ss.milliseconds=Zn,ss.seconds=zn,ss.minutes=$n,ss.hours=qn,ss.days=Bn,ss.weeks=function(){return I(this.days()/7)},ss.months=Jn,ss.years=Qn,ss.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,s,i=!1,r=Kn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(r=Object.assign({},Kn,t),null!=t.s&&null==t.ss&&(r.ss=t.s-1)),s=function(e,t,n,s){var i=zt(e).abs(),r=Xn(i.as("s")),a=Xn(i.as("m")),o=Xn(i.as("h")),u=Xn(i.as("d")),l=Xn(i.as("M")),h=Xn(i.as("w")),d=Xn(i.as("y")),c=r<=n.ss&&["s",r]||r<n.s&&["ss",r]||a<=1&&["m"]||a<n.m&&["mm",a]||o<=1&&["h"]||o<n.h&&["hh",o]||u<=1&&["d"]||u<n.d&&["dd",u];return null!=n.w&&(c=c||h<=1&&["w"]||h<n.w&&["ww",h]),(c=c||l<=1&&["M"]||l<n.M&&["MM",l]||d<=1&&["y"]||["yy",d])[2]=t,c[3]=+e>0,c[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,c)}(this,!i,r,n=this.localeData()),i&&(s=n.pastFuture(+this,s)),n.postformat(s)},ss.toISOString=ns,ss.toString=ns,ss.toJSON=ns,ss.locale=nn,ss.localeData=rn,ss.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ns),ss.lang=sn,C("X",0,0,"unix"),C("x",0,0,"valueOf"),ce("x",ue),ce("X",/[+-]?\d+(\.\d{1,3})?/),ye("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),ye("x",function(e,t,n){n._d=new Date(Z(e))}),n.version="2.28.0",e=Nt,n.fn=Dn,n.min=function(){return Wt("isBefore",[].slice.call(arguments,0))},n.max=function(){return Wt("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=c,n.unix=function(e){return Nt(1e3*e)},n.months=function(e,t){return bn(e,t,"months")},n.isDate=l,n.locale=ht,n.invalid=_,n.duration=zt,n.isMoment=v,n.weekdays=function(e,t,n){return xn(e,t,n,"weekdays")},n.parseZone=function(){return Nt.apply(null,arguments).parseZone()},n.localeData=ct,n.isDuration=Ht,n.monthsShort=function(e,t){return bn(e,t,"monthsShort")},n.weekdaysMin=function(e,t,n){return xn(e,t,n,"weekdaysMin")},n.defineLocale=dt,n.updateLocale=function(e,t){if(null!=t){var n,s,i=it;null!=rt[e]&&null!=rt[e].parentLocale?rt[e].set(b(rt[e]._config,t)):(null!=(s=lt(e))&&(i=s._config),t=b(i,t),null==s&&(t.abbr=e),(n=new x(t)).parentLocale=rt[e],rt[e]=n),ht(e)}else null!=rt[e]&&(null!=rt[e].parentLocale?(rt[e]=rt[e].parentLocale,e===ht()&&ht(e)):null!=rt[e]&&delete rt[e]);return rt[e]},n.locales=function(){return D(rt)},n.weekdaysShort=function(e,t,n){return xn(e,t,n,"weekdaysShort")},n.normalizeUnits=V,n.relativeTimeRounding=function(e){return void 0===e?Xn:"function"==typeof e&&(Xn=e,!0)},n.relativeTimeThreshold=function(e,t){return void 0!==Kn[e]&&(void 0===t?Kn[e]:(Kn[e]=t,"s"===e&&(Kn.ss=t-1),!0))},n.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},n.prototype=Dn,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n}); },{}],"IvHv":[function(require,module,exports) { var define; var global = arguments[3]; var t,e=arguments[3];!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(function(){try{return require("moment")}catch(t){}}()):"function"==typeof t&&t.amd?t(["require"],function(t){return n(function(){try{return t("moment")}catch(e){}}())}):(e=e||self).Chart=n(e.moment)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e,n={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},i=(function(t){var e={};for(var i in n)n.hasOwnProperty(i)&&(e[n[i]]=i);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var r in a)if(a.hasOwnProperty(r)){if(!("channels"in a[r]))throw new Error("missing channels property: "+r);if(!("labels"in a[r]))throw new Error("missing channel labels property: "+r);if(a[r].labels.length!==a[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=a[r].channels,s=a[r].labels;delete a[r].channels,delete a[r].labels,Object.defineProperty(a[r],"channels",{value:o}),Object.defineProperty(a[r],"labels",{value:s})}a.rgb.hsl=function(t){var e,n,i=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.min(i,a,r),s=Math.max(i,a,r),l=s-o;return s===o?e=0:i===s?e=(a-r)/l:a===s?e=2+(r-i)/l:r===s&&(e=4+(i-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(o+s)/2,[e,100*(s===o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]},a.rgb.hsv=function(t){var e,n,i,a,r,o=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(o,s,l),d=u-Math.min(o,s,l),h=function(t){return(u-t)/6/d+.5};return 0===d?a=r=0:(r=d/u,e=h(o),n=h(s),i=h(l),o===u?a=i-n:s===u?a=1/3+e-i:l===u&&(a=2/3+n-e),a<0?a+=1:a>1&&(a-=1)),[360*a,100*r,100*u]},a.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,i))),100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-a)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var i=e[t];if(i)return i;var a,r,o,s=1/0;for(var l in n)if(n.hasOwnProperty(l)){var u=n[l],d=(r=t,o=u,Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)+Math.pow(r[2]-o[2],2));d<s&&(s=d,a=l)}return a},a.keyword.rgb=function(t){return n[t]},a.rgb.xyz=function(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.hsl.rgb=function(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[r=255*l,r,r];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(i=o+1/3*-(u-1))<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,a=n,r=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,a*=r<=1?r:2-r,[e,100*(0===i?2*a/(r+a):2*n/(i+n)),100*((i+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r));switch(i*=255,a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},a.hsv.hsl=function(t){var e,n,i,a=t[0],r=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return i=(2-r)*o,n=r*s,[a,100*(n=(n/=(e=(2-r)*s)<=1?e:2-e)||0),100*(i/=2)]},a.hwb.rgb=function(t){var e,n,i,a,r,o,s,l=t[0]/360,u=t[1]/100,d=t[2]/100,h=u+d;switch(h>1&&(u/=h,d/=h),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),a=u+i*((n=1-d)-u),e){default:case 6:case 0:r=n,o=a,s=u;break;case 1:r=a,o=n,s=u;break;case 2:r=u,o=n,s=a;break;case 3:r=u,o=a,s=n;break;case 4:r=a,o=u,s=n;break;case 5:r=n,o=u,s=a}return[255*r,255*o,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,i=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a))]},a.xyz.rgb=function(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return n=-.9689*a+1.8758*r+.0415*o,i=.0557*a+-.204*r+1.057*o,e=(e=3.2406*a+-1.5372*r+-.4986*o)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.lab.xyz=function(t){var e,n,i,a=t[0];e=t[1]/500+(n=(a+16)/116),i=n-t[2]/200;var r=Math.pow(n,3),o=Math.pow(e,3),s=Math.pow(i,3);return n=r>.008856?r:(n-16/116)/7.787,e=o>.008856?o:(e-16/116)/7.787,i=s>.008856?s:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},a.lab.lch=function(t){var e,n=t[0],i=t[1],a=t[2];return(e=360*Math.atan2(a,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+a*a),e]},a.lch.lab=function(t){var e,n=t[0],i=t[1];return e=t[2]/360*2*Math.PI,[n,i*Math.cos(e),i*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map(function(t){return t+t}).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},a.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255,r=Math.max(Math.max(n,i),a),o=Math.min(Math.min(n,i),a),s=r-o;return e=s<=0?0:r===n?(i-a)/s%6:r===i?2+(a-n)/s:4+(n-i)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1,a=0;return(i=n<.5?2*e*n:2*e*(1-n))<1&&(a=(n-.5*i)/(1-i)),[t[0],100*i,100*a]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=e*n,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100;if(0===n)return[255*i,255*i,255*i];var a,r=[0,0,0],o=e%1*6,s=o%1,l=1-s;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=l,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=l,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=l}return a=(1-n)*i,[255*(n*r[0]+a),255*(n*r[1]+a),255*(n*r[2]+a)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,i=n-e,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}(e={exports:{}},e.exports),e.exports);i.rgb,i.hsl,i.hsv,i.hwb,i.cmyk,i.xyz,i.lab,i.lch,i.hex,i.keyword,i.ansi16,i.ansi256,i.hcg,i.apple,i.gray;function a(t){var e=function(){for(var t={},e=Object.keys(i),n=e.length,a=0;a<n;a++)t[e[a]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;)for(var a=n.pop(),r=Object.keys(i[a]),o=r.length,s=0;s<o;s++){var l=r[s],u=e[l];-1===u.distance&&(u.distance=e[a].distance+1,u.parent=a,n.unshift(l))}return e}function r(t,e){return function(n){return e(t(n))}}function o(t,e){for(var n=[e[t].parent,t],a=i[e[t].parent][t],o=e[t].parent;e[o].parent;)n.unshift(e[o].parent),a=r(i[e[o].parent][o],a),o=e[o].parent;return a.conversion=n,a}var s={};Object.keys(i).forEach(function(t){s[t]={},Object.defineProperty(s[t],"channels",{value:i[t].channels}),Object.defineProperty(s[t],"labels",{value:i[t].labels});var e=function(t){for(var e=a(t),n={},i=Object.keys(e),r=i.length,s=0;s<r;s++){var l=i[s];null!==e[l].parent&&(n[l]=o(l,e))}return n}(t);Object.keys(e).forEach(function(n){var i=e[n];s[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,a=0;a<i;a++)n[a]=Math.round(n[a]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}(i),s[t][n].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)})});var l=s,u={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},d={getRgba:h,getHsla:c,getRgb:function(t){var e=h(t);return e&&e.slice(0,3)},getHsl:function(t){var e=c(t);return e&&e.slice(0,3)},getHwb:f,getAlpha:function(t){var e=h(t);if(e)return e[3];if(e=c(t))return e[3];if(e=f(t))return e[3]},hexString:function(t,e){var e=void 0!==e&&3===t.length?e:t[3];return"#"+b(t[0])+b(t[1])+b(t[2])+(e>=0&&e<1?b(Math.round(255*e)):"")},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return g(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:g,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return p(t,e);var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"},percentaString:p,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return m(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:m,hwbString:function(t,e){void 0===e&&(e=void 0!==t[3]?t[3]:1);return"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return x[t.slice(0,3)]}};function h(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(i){a=(i=i[1])[3];for(var r=0;r<e.length;r++)e[r]=parseInt(i[r]+i[r],16);a&&(n=Math.round(parseInt(a+a,16)/255*100)/100)}else if(i=t.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){a=i[2],i=i[1];for(r=0;r<e.length;r++)e[r]=parseInt(i.slice(2*r,2*r+2),16);a&&(n=Math.round(parseInt(a,16)/255*100)/100)}else if(i=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(r=0;r<e.length;r++)e[r]=parseInt(i[r+1]);n=parseFloat(i[4])}else if(i=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(r=0;r<e.length;r++)e[r]=Math.round(2.55*parseFloat(i[r+1]));n=parseFloat(i[4])}else if(i=t.match(/(\w+)/)){if("transparent"==i[1])return[0,0,0,0];if(!(e=u[i[1]]))return}for(r=0;r<e.length;r++)e[r]=v(e[r],0,255);return n=n||0==n?v(n,0,1):1,e[3]=n,e}}function c(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[v(parseInt(e[1]),0,360),v(parseFloat(e[2]),0,100),v(parseFloat(e[3]),0,100),v(isNaN(n)?1:n,0,1)]}}}function f(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[v(parseInt(e[1]),0,360),v(parseFloat(e[2]),0,100),v(parseFloat(e[3]),0,100),v(isNaN(n)?1:n,0,1)]}}}function g(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function p(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function m(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function v(t,e,n){return Math.min(Math.max(e,t),n)}function b(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var x={};for(var y in u)x[u[y]]=y;var _=function(t){return t instanceof _?t:this instanceof _?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof t?(e=d.getRgba(t))?this.setValues("rgb",e):(e=d.getHsla(t))?this.setValues("hsl",e):(e=d.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e)))):new _(t);var e};_.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return d.hexString(this.values.rgb)},rgbString:function(){return d.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return d.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return d.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return d.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return d.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return d.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return d.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=t,i=void 0===e?.5:e,a=2*i-1,r=this.alpha()-n.alpha(),o=((a*r==-1?a:(a+r)/(1+a*r))+1)/2,s=1-o;return this.rgb(o*this.red()+s*n.red(),o*this.green()+s*n.green(),o*this.blue()+s*n.blue()).alpha(this.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new _,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],"[object Array]"===(e={}.toString.call(t))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},_.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},_.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},_.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i<t.length;i++)n[t.charAt(i)]=e[t][i];return 1!==e.alpha&&(n.a=e.alpha),n},_.prototype.setValues=function(t,e){var n,i,a=this.values,r=this.spaces,o=this.maxes,s=1;if(this.valid=!0,"alpha"===t)s=e;else if(e.length)a[t]=e.slice(0,t.length),s=e[t.length];else if(void 0!==e[t.charAt(0)]){for(n=0;n<t.length;n++)a[t][n]=e[t.charAt(n)];s=e.a}else if(void 0!==e[r[t][0]]){var u=r[t];for(n=0;n<t.length;n++)a[t][n]=e[u[n]];s=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===s?a.alpha:s)),"alpha"===t)return!1;for(n=0;n<t.length;n++)i=Math.max(0,Math.min(o[t][n],a[t][n])),a[t][n]=Math.round(i);for(var d in r)d!==t&&(a[d]=l[t][d](a[t]));return!0},_.prototype.setSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n),this)},_.prototype.setChannel=function(t,e,n){var i=this.values[t];return void 0===n?i[e]:n===i[e]?this:(i[e]=n,this.setValues(t,i),this)},"undefined"!=typeof window&&(window.Color=_);var k,w=_,M={noop:function(){},uid:(k=0,function(){return k++}),isNullOrUndef:function(t){return null==t},isArray:function(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},isFinite:function(t){return("number"==typeof t||t instanceof Number)&&isFinite(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,n){return M.valueOrDefault(M.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)},each:function(t,e,n,i){var a,r,o;if(M.isArray(t))if(r=t.length,i)for(a=r-1;a>=0;a--)e.call(n,t[a],a);else for(a=0;a<r;a++)e.call(n,t[a],a);else if(M.isObject(t))for(r=(o=Object.keys(t)).length,a=0;a<r;a++)e.call(n,t[o[a]],o[a])},arrayEquals:function(t,e){var n,i,a,r;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(a=t[n],r=e[n],a instanceof Array&&r instanceof Array){if(!M.arrayEquals(a,r))return!1}else if(a!==r)return!1;return!0},clone:function(t){if(M.isArray(t))return t.map(M.clone);if(M.isObject(t)){for(var e={},n=Object.keys(t),i=n.length,a=0;a<i;++a)e[n[a]]=M.clone(t[n[a]]);return e}return t},_merger:function(t,e,n,i){var a=e[t],r=n[t];M.isObject(a)&&M.isObject(r)?M.merge(a,r,i):e[t]=M.clone(r)},_mergerIf:function(t,e,n){var i=e[t],a=n[t];M.isObject(i)&&M.isObject(a)?M.mergeIf(i,a):e.hasOwnProperty(t)||(e[t]=M.clone(a))},merge:function(t,e,n){var i,a,r,o,s,l=M.isArray(e)?e:[e],u=l.length;if(!M.isObject(t))return t;for(i=(n=n||{}).merger||M._merger,a=0;a<u;++a)if(e=l[a],M.isObject(e))for(s=0,o=(r=Object.keys(e)).length;s<o;++s)i(r[s],t,e,n);return t},mergeIf:function(t,e){return M.merge(t,e,{merger:M._mergerIf})},extend:Object.assign||function(t){return M.merge(t,[].slice.call(arguments,1),{merger:function(t,e,n){e[t]=n[t]}})},inherits:function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=M.inherits,t&&M.extend(n.prototype,t),n.__super__=e.prototype,n},_deprecated:function(t,e,n,i){void 0!==e&&console.warn(t+': "'+n+'" is deprecated. Please use "'+i+'" instead')}},S=M;M.callCallback=M.callback,M.indexOf=function(t,e,n){return Array.prototype.indexOf.call(t,e,n)},M.getValueOrDefault=M.valueOrDefault,M.getValueAtIndexOrDefault=M.valueAtIndexOrDefault;var C={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*(Math.PI/2))},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-C.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*C.easeInBounce(2*t):.5*C.easeOutBounce(2*t-1)+.5}},P={effects:C};S.easingEffects=C;var A=Math.PI,D=A/180,T=2*A,I=A/2,F=A/4,O=2*A/3,L={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,r){if(r){var o=Math.min(r,a/2,i/2),s=e+o,l=n+o,u=e+i-o,d=n+a-o;t.moveTo(e,l),s<u&&l<d?(t.arc(s,l,o,-A,-I),t.arc(u,l,o,-I,0),t.arc(u,d,o,0,I),t.arc(s,d,o,I,A)):s<u?(t.moveTo(s,n),t.arc(u,l,o,-I,I),t.arc(s,l,o,I,A+I)):l<d?(t.arc(s,l,o,-A,0),t.arc(s,d,o,0,A)):t.arc(s,l,o,-A,A),t.closePath(),t.moveTo(e,n)}else t.rect(e,n,i,a)},drawPoint:function(t,e,n,i,a,r){var o,s,l,u,d,h=(r||0)*D;if(e&&"object"==typeof e&&("[object HTMLImageElement]"===(o=e.toString())||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,a),t.rotate(h),t.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),void t.restore();if(!(isNaN(n)||n<=0)){switch(t.beginPath(),e){default:t.arc(i,a,n,0,T),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(h)*n,a-Math.cos(h)*n),h+=O,t.lineTo(i+Math.sin(h)*n,a-Math.cos(h)*n),h+=O,t.lineTo(i+Math.sin(h)*n,a-Math.cos(h)*n),t.closePath();break;case"rectRounded":u=n-(d=.516*n),s=Math.cos(h+F)*u,l=Math.sin(h+F)*u,t.arc(i-s,a-l,d,h-A,h-I),t.arc(i+l,a-s,d,h-I,h),t.arc(i+s,a+l,d,h,h+I),t.arc(i-l,a+s,d,h+I,h+A),t.closePath();break;case"rect":if(!r){u=Math.SQRT1_2*n,t.rect(i-u,a-u,2*u,2*u);break}h+=F;case"rectRot":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+l,a-s),t.lineTo(i+s,a+l),t.lineTo(i-l,a+s),t.closePath();break;case"crossRot":h+=F;case"cross":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s);break;case"star":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s),h+=F,s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s);break;case"line":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l);break;case"dash":t.moveTo(i,a),t.lineTo(i+Math.cos(h)*n,a+Math.sin(h)*n)}t.fill(),t.stroke()}},_isPointInArea:function(t,e){return t.x>e.left-1e-6&&t.x<e.right+1e-6&&t.y>e.top-1e-6&&t.y<e.bottom+1e-6},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,n,i){var a=n.steppedLine;if(a){if("middle"===a){var r=(e.x+n.x)/2;t.lineTo(r,i?n.y:e.y),t.lineTo(r,i?e.y:n.y)}else"after"===a&&!i||"after"!==a&&i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}else n.tension?t.bezierCurveTo(i?e.controlPointPreviousX:e.controlPointNextX,i?e.controlPointPreviousY:e.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):t.lineTo(n.x,n.y)}},R=L;S.clear=L.clear,S.drawRoundedRectangle=function(t){t.beginPath(),L.roundedRect.apply(L,arguments)};var z={_set:function(t,e){return S.merge(this[t]||(this[t]={}),e)}};z._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var N=z,B=S.valueOrDefault;var E={toLineHeight:function(t,e){var n=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,n,i,a;return S.isObject(t)?(e=+t.top||0,n=+t.right||0,i=+t.bottom||0,a=+t.left||0):e=n=i=a=+t||0,{top:e,right:n,bottom:i,left:a,height:e+i,width:a+n}},_parseFont:function(t){var e=N.global,n=B(t.fontSize,e.defaultFontSize),i={family:B(t.fontFamily,e.defaultFontFamily),lineHeight:S.options.toLineHeight(B(t.lineHeight,e.defaultLineHeight),n),size:n,style:B(t.fontStyle,e.defaultFontStyle),weight:null,string:""};return i.string=function(t){return!t||S.isNullOrUndef(t.size)||S.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(i),i},resolve:function(t,e,n,i){var a,r,o,s=!0;for(a=0,r=t.length;a<r;++a)if(void 0!==(o=t[a])&&(void 0!==e&&"function"==typeof o&&(o=o(e),s=!1),void 0!==n&&S.isArray(o)&&(o=o[n],s=!1),void 0!==o))return i&&!s&&(i.cacheable=!1),o}},W={_factorize:function(t){var e,n=[],i=Math.sqrt(t);for(e=1;e<i;e++)t%e==0&&(n.push(e),n.push(t/e));return i===(0|i)&&n.push(i),n.sort(function(t,e){return t-e}).pop(),n},log10:Math.log10||function(t){var e=Math.log(t)*Math.LOG10E,n=Math.round(e);return t===Math.pow(10,n)?n:e}},V=W;S.log10=W.log10;var H=S,j=P,q=R,U=E,Y=V,G={getRtlAdapter:function(t,e,n){return t?function(t,e){return{x:function(n){return t+t+e-n},setWidth:function(t){e=t},textAlign:function(t){return"center"===t?t:"right"===t?"left":"right"},xPlus:function(t,e){return t-e},leftForLtr:function(t,e){return t-e}}}(e,n):{x:function(t){return t},setWidth:function(t){},textAlign:function(t){return t},xPlus:function(t,e){return t+e},leftForLtr:function(t,e){return t}}},overrideTextDirection:function(t,e){var n,i;"ltr"!==e&&"rtl"!==e||(i=[(n=t.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)},restoreTextDirection:function(t){var e=t.prevTextDirection;void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}};H.easing=j,H.canvas=q,H.options=U,H.math=Y,H.rtl=G;var X=function(t){H.extend(this,t),this.initialize.apply(this,arguments)};H.extend(X.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=H.extend({},t._model)),t._start={},t},transition:function(t){var e=this,n=e._model,i=e._start,a=e._view;return n&&1!==t?(a||(a=e._view={}),i||(i=e._start={}),function(t,e,n,i){var a,r,o,s,l,u,d,h,c,f=Object.keys(n);for(a=0,r=f.length;a<r;++a)if(u=n[o=f[a]],e.hasOwnProperty(o)||(e[o]=u),(s=e[o])!==u&&"_"!==o[0]){if(t.hasOwnProperty(o)||(t[o]=s),(d=typeof u)==typeof(l=t[o]))if("string"===d){if((h=w(l)).valid&&(c=w(u)).valid){e[o]=c.mix(h,i).rgbString();continue}}else if(H.isFinite(l)&&H.isFinite(u)){e[o]=l+(u-l)*i;continue}e[o]=u}}(i,a,n,t),e):(e._view=H.extend({},n),e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return H.isNumber(this._model.x)&&H.isNumber(this._model.y)}}),X.extend=H.inherits;var K=X,Z=K.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),$=Z;Object.defineProperty(Z.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(Z.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}}),N._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:H.noop,onComplete:H.noop}});var J={animations:[],request:null,addAnimation:function(t,e,n,i){var a,r,o=this.animations;for(e.chart=t,e.startTime=Date.now(),e.duration=n,i||(t.animating=!0),a=0,r=o.length;a<r;++a)if(o[a].chart===t)return void(o[a]=e);o.push(e),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=H.findIndex(this.animations,function(e){return e.chart===t});-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=H.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){this.advance(),this.animations.length>0&&this.requestAnimationFrame()},advance:function(){for(var t,e,n,i,a=this.animations,r=0;r<a.length;)e=(t=a[r]).chart,n=t.numSteps,i=Math.floor((Date.now()-t.startTime)/t.duration*n)+1,t.currentStep=Math.min(i,n),H.callback(t.render,[e,t],e),H.callback(t.onAnimationProgress,[t],e),t.currentStep>=n?(H.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},Q=H.options.resolve,tt=["push","pop","shift","splice","unshift"];function et(t,e){var n=t._chartjs;if(n){var i=n.listeners,a=i.indexOf(e);-1!==a&&i.splice(a,1),i.length>0||(tt.forEach(function(e){delete t[e]}),delete t._chartjs)}}var nt=function(t,e){this.initialize(t,e)};H.extend(nt.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this.getMeta(),e=this.chart,n=e.scales,i=this.getDataset(),a=e.options.scales;null!==t.xAxisID&&t.xAxisID in n&&!i.xAxisID||(t.xAxisID=i.xAxisID||a.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in n&&!i.yAxisID||(t.yAxisID=i.yAxisID||a.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&et(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,n=this.getMeta(),i=this.getDataset().data||[],a=n.data;for(t=0,e=i.length;t<e;++t)a[t]=a[t]||this.createMetaData(t);n.dataset=n.dataset||this.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t,e,n=this,i=n.getDataset(),a=i.data||(i.data=[]);n._data!==a&&(n._data&&et(n._data,n),a&&Object.isExtensible(a)&&(e=n,(t=a)._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),tt.forEach(function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),i=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),a=i.apply(this,e);return H.each(t._chartjs.listeners,function(t){"function"==typeof t[n]&&t[n].apply(t,e)}),a}})}))),n._data=a),n.resyncElements()},_configure:function(){this._config=H.merge({},[this.chart.options.datasets[this._type],this.getDataset()],{merger:function(t,e,n){"_meta"!==t&&"data"!==t&&H._merger(t,e,n)}})},_update:function(t){this._configure(),this._cachedDataOpts=null,this.update(t)},update:H.noop,transition:function(t){for(var e=this.getMeta(),n=e.data||[],i=n.length,a=0;a<i;++a)n[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],n=e.length,i=0;for(t.dataset&&t.dataset.draw();i<n;++i)e[i].draw()},getStyle:function(t){var e,n=this.getMeta(),i=n.dataset;return this._configure(),i&&void 0===t?e=this._resolveDatasetElementOptions(i||{}):(t=t||0,e=this._resolveDataElementOptions(n.data[t]||{},t)),!1!==e.fill&&null!==e.fill||(e.backgroundColor=e.borderColor),e},_resolveDatasetElementOptions:function(t,e){var n,i,a,r,o=this,s=o.chart,l=o._config,u=t.custom||{},d=s.options.elements[o.datasetElementType.prototype._type]||{},h=o._datasetElementOptions,c={},f={chart:s,dataset:o.getDataset(),datasetIndex:o.index,hover:e};for(n=0,i=h.length;n<i;++n)a=h[n],r=e?"hover"+a.charAt(0).toUpperCase()+a.slice(1):a,c[a]=Q([u[r],l[r],d[r]],f);return c},_resolveDataElementOptions:function(t,e){var n=this,i=t&&t.custom,a=n._cachedDataOpts;if(a&&!i)return a;var r,o,s,l,u=n.chart,d=n._config,h=u.options.elements[n.dataElementType.prototype._type]||{},c=n._dataElementOptions,f={},g={chart:u,dataIndex:e,dataset:n.getDataset(),datasetIndex:n.index},p={cacheable:!i};if(i=i||{},H.isArray(c))for(o=0,s=c.length;o<s;++o)f[l=c[o]]=Q([i[l],d[l],h[l]],g,e,p);else for(o=0,s=(r=Object.keys(c)).length;o<s;++o)f[l=r[o]]=Q([i[l],d[c[l]],d[l],h[l]],g,e,p);return p.cacheable&&(n._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(t){H.merge(t._model,t.$previousStyle||{}),delete t.$previousStyle},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model,r=H.getHoverColor;t.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth},a.backgroundColor=Q([i.hoverBackgroundColor,e.hoverBackgroundColor,r(a.backgroundColor)],void 0,n),a.borderColor=Q([i.hoverBorderColor,e.hoverBorderColor,r(a.borderColor)],void 0,n),a.borderWidth=Q([i.hoverBorderWidth,e.hoverBorderWidth,a.borderWidth],void 0,n)},_removeDatasetHoverStyle:function(){var t=this.getMeta().dataset;t&&this.removeHoverStyle(t)},_setDatasetHoverStyle:function(){var t,e,n,i,a,r,o=this.getMeta().dataset,s={};if(o){for(r=o._model,a=this._resolveDatasetElementOptions(o,!0),t=0,e=(i=Object.keys(a)).length;t<e;++t)s[n=i[t]]=r[n],r[n]=a[n];o.$previousStyle=s}},resyncElements:function(){var t=this.getMeta(),e=this.getDataset().data,n=t.data.length,i=e.length;i<n?t.data.splice(i,n-i):i>n&&this.insertElements(n,i-n)},insertElements:function(t,e){for(var n=0;n<e;++n)this.addElementAndReset(t+n)},onDataPush:function(){var t=arguments.length;this.insertElements(this.getDataset().data.length-t,t)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),nt.extend=H.inherits;var it=nt,at=2*Math.PI;function rt(t,e){var n=e.startAngle,i=e.endAngle,a=e.pixelMargin,r=a/e.outerRadius,o=e.x,s=e.y;t.beginPath(),t.arc(o,s,e.outerRadius,n-r,i+r),e.innerRadius>a?(r=a/e.innerRadius,t.arc(o,s,e.innerRadius-a,i+r,n-r,!0)):t.arc(o,s,a,i+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}function ot(t,e,n){var i="inner"===e.borderAlign;i?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),n.fullCircles&&function(t,e,n,i){var a,r=n.endAngle;for(i&&(n.endAngle=n.startAngle+at,rt(t,n),n.endAngle=r,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=at,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+at,n.startAngle,!0),a=0;a<n.fullCircles;++a)t.stroke();for(t.beginPath(),t.arc(n.x,n.y,e.outerRadius,n.startAngle,n.startAngle+at),a=0;a<n.fullCircles;++a)t.stroke()}(t,e,n,i),i&&rt(t,n),t.beginPath(),t.arc(n.x,n.y,e.outerRadius,n.startAngle,n.endAngle),t.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),t.closePath(),t.stroke()}N._set("global",{elements:{arc:{backgroundColor:N.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var st=K.extend({_type:"arc",inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var n=this._view;if(n){for(var i=H.getAngleFromPoint(n,{x:t,y:e}),a=i.angle,r=i.distance,o=n.startAngle,s=n.endAngle;s<o;)s+=at;for(;a>s;)a-=at;for(;a<o;)a+=at;var l=a>=o&&a<=s,u=r>=n.innerRadius&&r<=n.outerRadius;return l&&u}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/at)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+at,e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),t=0;t<a.fullCircles;++t)e.fill();a.endAngle=a.startAngle+n.circumference%at}e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),e.fill(),n.borderWidth&&ot(e,n,a),e.restore()}}),lt=H.valueOrDefault,ut=N.global.defaultColor;N._set("global",{elements:{line:{tension:.4,backgroundColor:ut,borderWidth:3,borderColor:ut,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var dt=K.extend({_type:"line",draw:function(){var t,e,n,i=this,a=i._view,r=i._chart.ctx,o=a.spanGaps,s=i._children.slice(),l=N.global,u=l.elements.line,d=-1,h=i._loop;if(s.length){if(i._loop){for(t=0;t<s.length;++t)if(e=H.previousItem(s,t),!s[t]._view.skip&&e._view.skip){s=s.slice(t).concat(s.slice(0,t)),h=o;break}h&&s.push(s[0])}for(r.save(),r.lineCap=a.borderCapStyle||u.borderCapStyle,r.setLineDash&&r.setLineDash(a.borderDash||u.borderDash),r.lineDashOffset=lt(a.borderDashOffset,u.borderDashOffset),r.lineJoin=a.borderJoinStyle||u.borderJoinStyle,r.lineWidth=lt(a.borderWidth,u.borderWidth),r.strokeStyle=a.borderColor||l.defaultColor,r.beginPath(),(n=s[0]._view).skip||(r.moveTo(n.x,n.y),d=0),t=1;t<s.length;++t)n=s[t]._view,e=-1===d?H.previousItem(s,t):s[d],n.skip||(d!==t-1&&!o||-1===d?r.moveTo(n.x,n.y):H.canvas.lineTo(r,e._view,n),d=t);h&&r.closePath(),r.stroke(),r.restore()}}}),ht=H.valueOrDefault,ct=N.global.defaultColor;function ft(t){var e=this._view;return!!e&&Math.abs(t-e.x)<e.radius+e.hitRadius}N._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:ct,borderColor:ct,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var gt=K.extend({_type:"point",inRange:function(t,e){var n=this._view;return!!n&&Math.pow(t-n.x,2)+Math.pow(e-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:ft,inXRange:ft,inYRange:function(t){var e=this._view;return!!e&&Math.abs(t-e.y)<e.radius+e.hitRadius},getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(t){var e=this._view,n=this._chart.ctx,i=e.pointStyle,a=e.rotation,r=e.radius,o=e.x,s=e.y,l=N.global,u=l.defaultColor;e.skip||(void 0===t||H.canvas._isPointInArea(e,t))&&(n.strokeStyle=e.borderColor||u,n.lineWidth=ht(e.borderWidth,l.elements.point.borderWidth),n.fillStyle=e.backgroundColor||u,H.canvas.drawPoint(n,i,r,o,s,a))}}),pt=N.global.defaultColor;function mt(t){return t&&void 0!==t.width}function vt(t){var e,n,i,a,r;return mt(t)?(r=t.width/2,e=t.x-r,n=t.x+r,i=Math.min(t.y,t.base),a=Math.max(t.y,t.base)):(r=t.height/2,e=Math.min(t.x,t.base),n=Math.max(t.x,t.base),i=t.y-r,a=t.y+r),{left:e,top:i,right:n,bottom:a}}function bt(t,e,n){return t===e?n:t===n?e:t}function xt(t,e,n){var i,a,r,o,s=t.borderWidth,l=function(t){var e=t.borderSkipped,n={};return e?(t.horizontal?t.base>t.x&&(e=bt(e,"left","right")):t.base<t.y&&(e=bt(e,"bottom","top")),n[e]=!0,n):n}(t);return H.isObject(s)?(i=+s.top||0,a=+s.right||0,r=+s.bottom||0,o=+s.left||0):i=a=r=o=+s||0,{t:l.top||i<0?0:i>n?n:i,r:l.right||a<0?0:a>e?e:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}function yt(t,e,n){var i=null===e,a=null===n,r=!(!t||i&&a)&&vt(t);return r&&(i||e>=r.left&&e<=r.right)&&(a||n>=r.top&&n<=r.bottom)}N._set("global",{elements:{rectangle:{backgroundColor:pt,borderColor:pt,borderSkipped:"bottom",borderWidth:0}}});var _t=K.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=vt(t),n=e.right-e.left,i=e.bottom-e.top,a=xt(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b}}}(e),i=n.outer,a=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===a.w&&i.h===a.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return yt(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return mt(n)?yt(n,t,null):yt(n,null,e)},inXRange:function(t){return yt(this._view,t,null)},inYRange:function(t){return yt(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return mt(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return mt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),kt={},wt=st,Mt=dt,St=gt,Ct=_t;kt.Arc=wt,kt.Line=Mt,kt.Point=St,kt.Rectangle=Ct;var Pt=H._deprecated,At=H.valueOrDefault;function Dt(t,e,n){var i,a,r=n.barThickness,o=e.stackCount,s=e.pixels[t],l=H.isNullOrUndef(r)?function(t,e){var n,i,a,r,o=t._length;for(a=1,r=e.length;a<r;++a)o=Math.min(o,Math.abs(e[a]-e[a-1]));for(a=0,r=t.getTicks().length;a<r;++a)i=t.getPixelForTick(a),o=a>0?Math.min(o,Math.abs(i-n)):o,n=i;return o}(e.scale,e.pixels):-1;return H.isNullOrUndef(r)?(i=l*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}N._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),N._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var Tt=it.extend({dataElementType:kt.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,n=this;it.prototype.initialize.apply(n,arguments),(t=n.getMeta()).stack=n.getDataset().stack,t.bar=!0,e=n._getIndexScale().options,Pt("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),Pt("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),Pt("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),Pt("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),Pt("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,n,i=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,n=i.length;e<n;++e)this.updateElement(i[e],e,t)},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=i.getDataset(),o=i._resolveDataElementOptions(t,e);t._xScale=i.getScaleForId(a.xAxisID),t._yScale=i.getScaleForId(a.yAxisID),t._datasetIndex=i.index,t._index=e,t._model={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderSkipped:o.borderSkipped,borderWidth:o.borderWidth,datasetLabel:r.label,label:i.chart.data.labels[e]},H.isArray(r.data[e])&&(t._model.borderSkipped=null),i._updateElementGeometry(t,e,n,o),t.pivot()},_updateElementGeometry:function(t,e,n,i){var a=this,r=t._model,o=a._getValueScale(),s=o.getBasePixel(),l=o.isHorizontal(),u=a._ruler||a.getRuler(),d=a.calculateBarValuePixels(a.index,e,i),h=a.calculateBarIndexPixels(a.index,e,u,i);r.horizontal=l,r.base=n?s:d.base,r.x=l?n?s:d.head:h.center,r.y=l?h.center:n?s:d.head,r.height=l?h.size:void 0,r.width=l?void 0:h.size},_getStacks:function(t){var e,n,i=this._getIndexScale(),a=i._getMatchingVisibleMetas(this._type),r=i.options.stacked,o=a.length,s=[];for(e=0;e<o&&(n=a[e],(!1===r||-1===s.indexOf(n.stack)||void 0===r&&void 0===n.stack)&&s.push(n.stack),n.index!==t);++e);return s},getStackCount:function(){return this._getStacks().length},getStackIndex:function(t,e){var n=this._getStacks(t),i=void 0!==e?n.indexOf(e):-1;return-1===i?n.length-1:i},getRuler:function(){var t,e,n=this._getIndexScale(),i=[];for(t=0,e=this.getMeta().data.length;t<e;++t)i.push(n.getPixelForValue(null,t,this.index));return{pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this.getStackCount(),scale:n}},calculateBarValuePixels:function(t,e,n){var i,a,r,o,s,l,u,d=this.chart,h=this._getValueScale(),c=h.isHorizontal(),f=d.data.datasets,g=h._getMatchingVisibleMetas(this._type),p=h._parseValue(f[t].data[e]),m=n.minBarLength,v=h.options.stacked,b=this.getMeta().stack,x=void 0===p.start?0:p.max>=0&&p.min>=0?p.min:p.max,y=void 0===p.start?p.end:p.max>=0&&p.min>=0?p.max-p.min:p.min-p.max,_=g.length;if(v||void 0===v&&void 0!==b)for(i=0;i<_&&(a=g[i]).index!==t;++i)a.stack===b&&(r=void 0===(u=h._parseValue(f[a.index].data[e])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(p.min<0&&r<0||p.max>=0&&r>0)&&(x+=r));return o=h.getPixelForValue(x),l=(s=h.getPixelForValue(x+y))-o,void 0!==m&&Math.abs(l)<m&&(l=m,s=y>=0&&!c||y<0&&c?o-m:o+m),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,i){var a="flex"===i.barThickness?function(t,e,n){var i,a=e.pixels,r=a[t],o=t>0?a[t-1]:null,s=t<a.length-1?a[t+1]:null,l=n.categoryPercentage;return null===o&&(o=r-(null===s?e.end-e.start:s-r)),null===s&&(s=r+r-o),i=r-(r-Math.min(o,s))/2*l,{chunk:Math.abs(s-o)/2*l/e.stackCount,ratio:n.barPercentage,start:i}}(e,n,i):Dt(e,n,i),r=this.getStackIndex(t,this.getMeta().stack),o=a.start+a.chunk*r+a.chunk/2,s=Math.min(At(i.maxBarThickness,1/0),a.chunk*a.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}},draw:function(){var t=this.chart,e=this._getValueScale(),n=this.getMeta().data,i=this.getDataset(),a=n.length,r=0;for(H.canvas.clipArea(t.ctx,t.chartArea);r<a;++r){var o=e._parseValue(i.data[r]);isNaN(o.min)||isNaN(o.max)||n[r].draw()}H.canvas.unclipArea(t.ctx)},_resolveDataElementOptions:function(){var t=H.extend({},it.prototype._resolveDataElementOptions.apply(this,arguments)),e=this._getIndexScale().options,n=this._getValueScale().options;return t.barPercentage=At(e.barPercentage,t.barPercentage),t.barThickness=At(e.barThickness,t.barThickness),t.categoryPercentage=At(e.categoryPercentage,t.categoryPercentage),t.maxBarThickness=At(e.maxBarThickness,t.maxBarThickness),t.minBarLength=At(n.minBarLength,t.minBarLength),t}}),It=H.valueOrDefault,Ft=H.options.resolve;N._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.datasets[t.datasetIndex].label||"",i=e.datasets[t.datasetIndex].data[t.index];return n+": ("+t.xLabel+", "+t.yLabel+", "+i.r+")"}}}});var Ot=it.extend({dataElementType:kt.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(t){var e=this,n=e.getMeta().data;H.each(n,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=t.custom||{},o=i.getScaleForId(a.xAxisID),s=i.getScaleForId(a.yAxisID),l=i._resolveDataElementOptions(t,e),u=i.getDataset().data[e],d=i.index,h=n?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,e,d),c=n?s.getBasePixel():s.getPixelForValue(u,e,d);t._xScale=o,t._yScale=s,t._options=l,t._datasetIndex=d,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:n?0:l.radius,skip:r.skip||isNaN(h)||isNaN(c),x:h,y:c},t.pivot()},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=It(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=It(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=It(n.hoverBorderWidth,n.borderWidth),e.radius=n.radius+n.hoverRadius},_resolveDataElementOptions:function(t,e){var n=this,i=n.chart,a=n.getDataset(),r=t.custom||{},o=a.data[e]||{},s=it.prototype._resolveDataElementOptions.apply(n,arguments),l={chart:i,dataIndex:e,dataset:a,datasetIndex:n.index};return n._cachedDataOpts===s&&(s=H.extend({},s)),s.radius=Ft([r.radius,o.r,n._config.radius,i.options.elements.point.radius],l,e),s}}),Lt=H.valueOrDefault,Rt=Math.PI,zt=2*Rt,Nt=Rt/2;N._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data,o=r.datasets,s=r.labels;if(a.setAttribute("class",t.id+"-legend"),o.length)for(e=0,n=o[0].data.length;e<n;++e)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[e],s[e]&&i.appendChild(document.createTextNode(s[e]));return a.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),r=a.controller.getStyle(i);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,hidden:isNaN(e.datasets[0].data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r]&&(a.data[r].hidden=!a.data[r].hidden);o.update()}},cutoutPercentage:50,rotation:-Nt,circumference:zt,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.labels[t.index],i=": "+e.datasets[t.datasetIndex].data[t.index];return H.isArray(n)?(n=n.slice())[0]+=i:n+=i,n}}}});var Bt=it.extend({dataElementType:kt.Arc,linkScales:H.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&++e;return e},update:function(t){var e,n,i,a,r=this,o=r.chart,s=o.chartArea,l=o.options,u=1,d=1,h=0,c=0,f=r.getMeta(),g=f.data,p=l.cutoutPercentage/100||0,m=l.circumference,v=r._getRingWeight(r.index);if(m<zt){var b=l.rotation%zt,x=(b+=b>=Rt?-zt:b<-Rt?zt:0)+m,y=Math.cos(b),_=Math.sin(b),k=Math.cos(x),w=Math.sin(x),M=b<=0&&x>=0||x>=zt,S=b<=Nt&&x>=Nt||x>=zt+Nt,C=b<=-Nt&&x>=-Nt||x>=Rt+Nt,P=b===-Rt||x>=Rt?-1:Math.min(y,y*p,k,k*p),A=C?-1:Math.min(_,_*p,w,w*p),D=M?1:Math.max(y,y*p,k,k*p),T=S?1:Math.max(_,_*p,w,w*p);u=(D-P)/2,d=(T-A)/2,h=-(D+P)/2,c=-(T+A)/2}for(i=0,a=g.length;i<a;++i)g[i]._options=r._resolveDataElementOptions(g[i],i);for(o.borderWidth=r.getMaxBorderWidth(),e=(s.right-s.left-o.borderWidth)/u,n=(s.bottom-s.top-o.borderWidth)/d,o.outerRadius=Math.max(Math.min(e,n)/2,0),o.innerRadius=Math.max(o.outerRadius*p,0),o.radiusLength=(o.outerRadius-o.innerRadius)/(r._getVisibleDatasetWeightTotal()||1),o.offsetX=h*o.outerRadius,o.offsetY=c*o.outerRadius,f.total=r.calculateTotal(),r.outerRadius=o.outerRadius-o.radiusLength*r._getRingWeightOffset(r.index),r.innerRadius=Math.max(r.outerRadius-o.radiusLength*v,0),i=0,a=g.length;i<a;++i)r.updateElement(g[i],i,t)},updateElement:function(t,e,n){var i=this,a=i.chart,r=a.chartArea,o=a.options,s=o.animation,l=(r.left+r.right)/2,u=(r.top+r.bottom)/2,d=o.rotation,h=o.rotation,c=i.getDataset(),f=n&&s.animateRotate?0:t.hidden?0:i.calculateCircumference(c.data[e])*(o.circumference/zt),g=n&&s.animateScale?0:i.innerRadius,p=n&&s.animateScale?0:i.outerRadius,m=t._options||{};H.extend(t,{_datasetIndex:i.index,_index:e,_model:{backgroundColor:m.backgroundColor,borderColor:m.borderColor,borderWidth:m.borderWidth,borderAlign:m.borderAlign,x:l+a.offsetX,y:u+a.offsetY,startAngle:d,endAngle:h,circumference:f,outerRadius:p,innerRadius:g,label:H.valueAtIndexOrDefault(c.label,e,a.data.labels[e])}});var v=t._model;n&&s.animateRotate||(v.startAngle=0===e?o.rotation:i.getMeta().data[e-1]._model.endAngle,v.endAngle=v.startAngle+v.circumference),t.pivot()},calculateTotal:function(){var t,e=this.getDataset(),n=this.getMeta(),i=0;return H.each(n.data,function(n,a){t=e.data[a],isNaN(t)||n.hidden||(i+=Math.abs(t))}),i},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?zt*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,a,r,o,s,l,u=0,d=this.chart;if(!t)for(e=0,n=d.data.datasets.length;e<n;++e)if(d.isDatasetVisible(e)){t=(i=d.getDatasetMeta(e)).data,e!==this.index&&(r=i.controller);break}if(!t)return 0;for(e=0,n=t.length;e<n;++e)a=t[e],r?(r._configure(),o=r._resolveDataElementOptions(a,e)):o=a._options,"inner"!==o.borderAlign&&(s=o.borderWidth,u=(l=o.hoverBorderWidth)>(u=s>u?s:u)?l:u);return u},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Lt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Lt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Lt(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e},_getRingWeight:function(t){return Math.max(Lt(this.chart.data.datasets[t].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});N._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}}),N._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var Et=Tt.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),Wt=H.valueOrDefault,Vt=H.options.resolve,Ht=H.canvas._isPointInArea;function jt(t,e){var n=t&&t.options.ticks||{},i=n.reverse,a=void 0===n.min?e:0,r=void 0===n.max?e:0;return{start:i?r:a,end:i?a:r}}N._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var qt=it.extend({datasetElementType:kt.Line,dataElementType:kt.Point,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(t){var e,n,i=this,a=i.getMeta(),r=a.dataset,o=a.data||[],s=i.chart.options,l=i._config,u=i._showLine=Wt(l.showLine,s.showLines);for(i._xScale=i.getScaleForId(a.xAxisID),i._yScale=i.getScaleForId(a.yAxisID),u&&(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),r._scale=i._yScale,r._datasetIndex=i.index,r._children=o,r._model=i._resolveDatasetElementOptions(r),r.pivot()),e=0,n=o.length;e<n;++e)i.updateElement(o[e],e,t);for(u&&0!==r._model.tension&&i.updateBezierControlPoints(),e=0,n=o.length;e<n;++e)o[e].pivot()},updateElement:function(t,e,n){var i,a,r=this,o=r.getMeta(),s=t.custom||{},l=r.getDataset(),u=r.index,d=l.data[e],h=r._xScale,c=r._yScale,f=o.dataset._model,g=r._resolveDataElementOptions(t,e);i=h.getPixelForValue("object"==typeof d?d:NaN,e,u),a=n?c.getBasePixel():r.calculatePointY(d,e,u),t._xScale=h,t._yScale=c,t._options=g,t._datasetIndex=u,t._index=e,t._model={x:i,y:a,skip:s.skip||isNaN(i)||isNaN(a),radius:g.radius,pointStyle:g.pointStyle,rotation:g.rotation,backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,tension:Wt(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:g.hitRadius}},_resolveDatasetElementOptions:function(t){var e,n,i,a,r,o,s,l,u,d,h,c=this,f=c._config,g=t.custom||{},p=c.chart.options,m=p.elements.line,v=it.prototype._resolveDatasetElementOptions.apply(c,arguments);return v.spanGaps=Wt(f.spanGaps,p.spanGaps),v.tension=Wt(f.lineTension,m.tension),v.steppedLine=Vt([g.steppedLine,f.steppedLine,m.stepped]),v.clip=(e=Wt(f.clip,(o=c._xScale,s=c._yScale,l=v.borderWidth,d=jt(o,u=l/2),{top:(h=jt(s,u)).end,right:d.end,bottom:h.start,left:d.start})),H.isObject(e)?(n=e.top,i=e.right,a=e.bottom,r=e.left):n=i=a=r=e,{top:n,right:i,bottom:a,left:r}),v},calculatePointY:function(t,e,n){var i,a,r,o,s,l,u,d=this.chart,h=this._yScale,c=0,f=0;if(h.options.stacked){for(s=+h.getRightValue(t),u=(l=d._getSortedVisibleDatasetMetas()).length,i=0;i<u&&(r=l[i]).index!==n;++i)a=d.data.datasets[r.index],"line"===r.type&&r.yAxisID===h.id&&((o=+h.getRightValue(a.data[e]))<0?f+=o||0:c+=o||0);return s<0?h.getPixelForValue(f+s):h.getPixelForValue(c+s)}return h.getPixelForValue(t)},updateBezierControlPoints:function(){var t,e,n,i,a=this.chart,r=this.getMeta(),o=r.dataset._model,s=a.chartArea,l=r.data||[];function u(t,e,n){return Math.max(Math.min(t,n),e)}if(o.spanGaps&&(l=l.filter(function(t){return!t._model.skip})),"monotone"===o.cubicInterpolationMode)H.splineCurveMonotone(l);else for(t=0,e=l.length;t<e;++t)n=l[t]._model,i=H.splineCurve(H.previousItem(l,t)._model,n,H.nextItem(l,t)._model,o.tension),n.controlPointPreviousX=i.previous.x,n.controlPointPreviousY=i.previous.y,n.controlPointNextX=i.next.x,n.controlPointNextY=i.next.y;if(a.options.elements.line.capBezierPoints)for(t=0,e=l.length;t<e;++t)n=l[t]._model,Ht(n,s)&&(t>0&&Ht(l[t-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),t<l.length-1&&Ht(l[t+1]._model,s)&&(n.controlPointNextX=u(n.controlPointNextX,s.left,s.right),n.controlPointNextY=u(n.controlPointNextY,s.top,s.bottom)))},draw:function(){var t,e=this.chart,n=this.getMeta(),i=n.data||[],a=e.chartArea,r=e.canvas,o=0,s=i.length;for(this._showLine&&(t=n.dataset._model.clip,H.canvas.clipArea(e.ctx,{left:!1===t.left?0:a.left-t.left,right:!1===t.right?r.width:a.right+t.right,top:!1===t.top?0:a.top-t.top,bottom:!1===t.bottom?r.height:a.bottom+t.bottom}),n.dataset.draw(),H.canvas.unclipArea(e.ctx));o<s;++o)i[o].draw(a)},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Wt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Wt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Wt(n.hoverBorderWidth,n.borderWidth),e.radius=Wt(n.hoverRadius,n.radius)}}),Ut=H.options.resolve;N._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data,o=r.datasets,s=r.labels;if(a.setAttribute("class",t.id+"-legend"),o.length)for(e=0,n=o[0].data.length;e<n;++e)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[e],s[e]&&i.appendChild(document.createTextNode(s[e]));return a.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),r=a.controller.getStyle(i);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,hidden:isNaN(e.datasets[0].data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r].hidden=!a.data[r].hidden;o.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}});var Yt=it.extend({dataElementType:kt.Arc,linkScales:H.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,n,i,a=this,r=a.getDataset(),o=a.getMeta(),s=a.chart.options.startAngle||0,l=a._starts=[],u=a._angles=[],d=o.data;for(a._updateRadius(),o.count=a.countVisibleElements(),e=0,n=r.data.length;e<n;e++)l[e]=s,i=a._computeAngle(e),u[e]=i,s+=i;for(e=0,n=d.length;e<n;++e)d[e]._options=a._resolveDataElementOptions(d[e],e),a.updateElement(d[e],e,t)},_updateRadius:function(){var t=this,e=t.chart,n=e.chartArea,i=e.options,a=Math.min(n.right-n.left,n.bottom-n.top);e.outerRadius=Math.max(a/2,0),e.innerRadius=Math.max(i.cutoutPercentage?e.outerRadius/100*i.cutoutPercentage:1,0),e.radiusLength=(e.outerRadius-e.innerRadius)/e.getVisibleDatasetCount(),t.outerRadius=e.outerRadius-e.radiusLength*t.index,t.innerRadius=t.outerRadius-e.radiusLength},updateElement:function(t,e,n){var i=this,a=i.chart,r=i.getDataset(),o=a.options,s=o.animation,l=a.scale,u=a.data.labels,d=l.xCenter,h=l.yCenter,c=o.startAngle,f=t.hidden?0:l.getDistanceFromCenterForValue(r.data[e]),g=i._starts[e],p=g+(t.hidden?0:i._angles[e]),m=s.animateScale?0:l.getDistanceFromCenterForValue(r.data[e]),v=t._options||{};H.extend(t,{_datasetIndex:i.index,_index:e,_scale:l,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:d,y:h,innerRadius:0,outerRadius:n?m:f,startAngle:n&&s.animateRotate?c:g,endAngle:n&&s.animateRotate?c:p,label:H.valueAtIndexOrDefault(u,e,u[e])}}),t.pivot()},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),n=0;return H.each(e.data,function(e,i){isNaN(t.data[i])||e.hidden||n++}),n},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor,a=H.valueOrDefault;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=a(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=a(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=a(n.hoverBorderWidth,n.borderWidth)},_computeAngle:function(t){var e=this,n=this.getMeta().count,i=e.getDataset(),a=e.getMeta();if(isNaN(i.data[t])||a.data[t].hidden)return 0;var r={chart:e.chart,dataIndex:t,dataset:i,datasetIndex:e.index};return Ut([e.chart.options.elements.arc.angle,2*Math.PI/n],r,t)}});N._set("pie",H.clone(N.doughnut)),N._set("pie",{cutoutPercentage:0});var Gt=Bt,Xt=H.valueOrDefault;N._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var Kt=it.extend({datasetElementType:kt.Line,dataElementType:kt.Point,linkScales:H.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,n,i=this,a=i.getMeta(),r=a.dataset,o=a.data||[],s=i.chart.scale,l=i._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),r._scale=s,r._datasetIndex=i.index,r._children=o,r._loop=!0,r._model=i._resolveDatasetElementOptions(r),r.pivot(),e=0,n=o.length;e<n;++e)i.updateElement(o[e],e,t);for(i.updateBezierControlPoints(),e=0,n=o.length;e<n;++e)o[e].pivot()},updateElement:function(t,e,n){var i=this,a=t.custom||{},r=i.getDataset(),o=i.chart.scale,s=o.getPointPositionForValue(e,r.data[e]),l=i._resolveDataElementOptions(t,e),u=i.getMeta().dataset._model,d=n?o.xCenter:s.x,h=n?o.yCenter:s.y;t._scale=o,t._options=l,t._datasetIndex=i.index,t._index=e,t._model={x:d,y:h,skip:a.skip||isNaN(d)||isNaN(h),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:Xt(a.tension,u?u.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var t=this._config,e=this.chart.options,n=it.prototype._resolveDatasetElementOptions.apply(this,arguments);return n.spanGaps=Xt(t.spanGaps,e.spanGaps),n.tension=Xt(t.lineTension,e.elements.line.tension),n},updateBezierControlPoints:function(){var t,e,n,i,a=this.getMeta(),r=this.chart.chartArea,o=a.data||[];function s(t,e,n){return Math.max(Math.min(t,n),e)}for(a.dataset._model.spanGaps&&(o=o.filter(function(t){return!t._model.skip})),t=0,e=o.length;t<e;++t)n=o[t]._model,i=H.splineCurve(H.previousItem(o,t,!0)._model,n,H.nextItem(o,t,!0)._model,n.tension),n.controlPointPreviousX=s(i.previous.x,r.left,r.right),n.controlPointPreviousY=s(i.previous.y,r.top,r.bottom),n.controlPointNextX=s(i.next.x,r.left,r.right),n.controlPointNextY=s(i.next.y,r.top,r.bottom)},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Xt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Xt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Xt(n.hoverBorderWidth,n.borderWidth),e.radius=Xt(n.hoverRadius,n.radius)}});N._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),N._set("global",{datasets:{scatter:{showLine:!1}}});var Zt={bar:Tt,bubble:Ot,doughnut:Bt,horizontalBar:Et,line:qt,polarArea:Yt,pie:Gt,radar:Kt,scatter:qt};function $t(t,e){return t.native?{x:t.x,y:t.y}:H.getRelativePosition(t,e)}function Jt(t,e){var n,i,a,r,o,s,l=t._getSortedVisibleDatasetMetas();for(i=0,r=l.length;i<r;++i)for(a=0,o=(n=l[i].data).length;a<o;++a)(s=n[a])._view.skip||e(s)}function Qt(t,e){var n=[];return Jt(t,function(t){t.inRange(e.x,e.y)&&n.push(t)}),n}function te(t,e,n,i){var a=Number.POSITIVE_INFINITY,r=[];return Jt(t,function(t){if(!n||t.inRange(e.x,e.y)){var o=t.getCenterPoint(),s=i(e,o);s<a?(r=[t],a=s):s===a&&r.push(t)}}),r}function ee(t){var e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){var a=e?Math.abs(t.x-i.x):0,r=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(r,2))}}function ne(t,e,n){var i=$t(e,t);n.axis=n.axis||"x";var a=ee(n.axis),r=n.intersect?Qt(t,i):te(t,i,!1,a),o=[];return r.length?(t._getSortedVisibleDatasetMetas().forEach(function(t){var e=t.data[r[0]._index];e&&!e._view.skip&&o.push(e)}),o):[]}var ie={modes:{single:function(t,e){var n=$t(e,t),i=[];return Jt(t,function(t){if(t.inRange(n.x,n.y))return i.push(t),i}),i.slice(0,1)},label:ne,index:ne,dataset:function(t,e,n){var i=$t(e,t);n.axis=n.axis||"xy";var a=ee(n.axis),r=n.intersect?Qt(t,i):te(t,i,!1,a);return r.length>0&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return ne(t,e,{intersect:!1})},point:function(t,e){return Qt(t,$t(e,t))},nearest:function(t,e,n){var i=$t(e,t);n.axis=n.axis||"xy";var a=ee(n.axis);return te(t,i,n.intersect,a)},x:function(t,e,n){var i=$t(e,t),a=[],r=!1;return Jt(t,function(t){t.inXRange(i.x)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)}),n.intersect&&!r&&(a=[]),a},y:function(t,e,n){var i=$t(e,t),a=[],r=!1;return Jt(t,function(t){t.inYRange(i.y)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)}),n.intersect&&!r&&(a=[]),a}}},ae=H.extend;function re(t,e){return H.where(t,function(t){return t.pos===e})}function oe(t,e){return t.sort(function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight})}function se(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function le(t,e,n){var i,a,r=n.box,o=t.maxPadding;if(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,t[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(i=e.outerWidth-se(o,t,"left","right"),a=e.outerHeight-se(o,t,"top","bottom"),i!==t.w||a!==t.h)return t.w=i,t.h=a,n.horizontal?i!==t.w:a!==t.h}function ue(t,e){var n=e.maxPadding;function i(t){var i={left:0,top:0,right:0,bottom:0};return t.forEach(function(t){i[t]=Math.max(e[t],n[t])}),i}return i(t?["left","right"]:["top","bottom"])}function de(t,e,n){var i,a,r,o,s,l,u=[];for(i=0,a=t.length;i<a;++i)(o=(r=t[i]).box).update(r.width||e.w,r.height||e.h,ue(r.horizontal,e)),le(e,n,r)&&(l=!0,u.length&&(s=!0)),o.fullWidth||u.push(r);return s&&de(u,e,n)||l}function he(t,e,n){var i,a,r,o,s=n.padding,l=e.x,u=e.y;for(i=0,a=t.length;i<a;++i)o=(r=t[i]).box,r.horizontal?(o.left=o.fullWidth?s.left:e.left,o.right=o.fullWidth?n.outerWidth-s.right:e.left+e.w,o.top=u,o.bottom=u+o.height,o.width=o.right-o.left,u=o.bottom):(o.left=l,o.right=l+o.width,o.top=e.top,o.bottom=e.top+e.h,o.height=o.bottom-o.top,l=o.right);e.x=l,e.y=u}N._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var ce,fe={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw:function(){e.draw.apply(e,arguments)}}]},t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var i,a=["fullWidth","position","weight"],r=a.length,o=0;o<r;++o)i=a[o],n.hasOwnProperty(i)&&(e[i]=n[i])},update:function(t,e,n){if(t){var i=t.options.layout||{},a=H.options.toPadding(i.padding),r=e-a.width,o=n-a.height,s=function(t){var e=function(t){var e,n,i,a=[];for(e=0,n=(t||[]).length;e<n;++e)i=t[e],a.push({index:e,box:i,pos:i.position,horizontal:i.isHorizontal(),weight:i.weight});return a}(t),n=oe(re(e,"left"),!0),i=oe(re(e,"right")),a=oe(re(e,"top"),!0),r=oe(re(e,"bottom"));return{leftAndTop:n.concat(a),rightAndBottom:i.concat(r),chartArea:re(e,"chartArea"),vertical:n.concat(i),horizontal:a.concat(r)}}(t.boxes),l=s.vertical,u=s.horizontal,d=Object.freeze({outerWidth:e,outerHeight:n,padding:a,availableWidth:r,vBoxMaxWidth:r/2/l.length,hBoxMaxHeight:o/2}),h=ae({maxPadding:ae({},a),w:r,h:o,x:a.left,y:a.top},a);!function(t,e){var n,i,a;for(n=0,i=t.length;n<i;++n)(a=t[n]).width=a.horizontal?a.box.fullWidth&&e.availableWidth:e.vBoxMaxWidth,a.height=a.horizontal&&e.hBoxMaxHeight}(l.concat(u),d),de(l,h,d),de(u,h,d)&&de(l,h,d),function(t){var e=t.maxPadding;function n(n){var i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(h),he(s.leftAndTop,h,d),h.x+=h.w,h.y+=h.h,he(s.rightAndBottom,h,d),t.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h},H.each(s.chartArea,function(e){var n=e.box;ae(n,t.chartArea),n.update(h.w,h.h)})}}},ge=(ce=Object.freeze({__proto__:null,default:"/*\n * DOM element rendering detection\n * https://davidwalsh.name/detect-node-insertion\n */\n@keyframes chartjs-render-animation {\n\tfrom { opacity: 0.99; }\n\tto { opacity: 1; }\n}\n\n.chartjs-render-monitor {\n\tanimation: chartjs-render-animation 0.001s;\n}\n\n/*\n * DOM element resizing detection\n * https://github.com/marcj/css-element-queries\n */\n.chartjs-size-monitor,\n.chartjs-size-monitor-expand,\n.chartjs-size-monitor-shrink {\n\tposition: absolute;\n\tdirection: ltr;\n\tleft: 0;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\toverflow: hidden;\n\tpointer-events: none;\n\tvisibility: hidden;\n\tz-index: -1;\n}\n\n.chartjs-size-monitor-expand > div {\n\tposition: absolute;\n\twidth: 1000000px;\n\theight: 1000000px;\n\tleft: 0;\n\ttop: 0;\n}\n\n.chartjs-size-monitor-shrink > div {\n\tposition: absolute;\n\twidth: 200%;\n\theight: 200%;\n\tleft: 0;\n\ttop: 0;\n}\n"}))&&ce.default||ce,pe="$chartjs",me="chartjs-size-monitor",ve="chartjs-render-monitor",be="chartjs-render-animation",xe=["animationstart","webkitAnimationStart"],ye={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function _e(t,e){var n=H.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var ke=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(n){}return t}()&&{passive:!0};function we(t,e,n){t.addEventListener(e,n,ke)}function Me(t,e,n){t.removeEventListener(e,n,ke)}function Se(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function Ce(t){var e=document.createElement("div");return e.className=t||"",e}function Pe(t,e,n){var i,a,r,o,s=t[pe]||(t[pe]={}),l=s.resizer=function(t){var e=Ce(me),n=Ce(me+"-expand"),i=Ce(me+"-shrink");n.appendChild(Ce()),i.appendChild(Ce()),e.appendChild(n),e.appendChild(i),e._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,i.scrollLeft=1e6,i.scrollTop=1e6};var a=function(){e._reset(),t()};return we(n,"scroll",a.bind(n,"expand")),we(i,"scroll",a.bind(i,"shrink")),e}((i=function(){if(s.resizer){var i=n.options.maintainAspectRatio&&t.parentNode,a=i?i.clientWidth:0;e(Se("resize",n)),i&&i.clientWidth<a&&n.canvas&&e(Se("resize",n))}},r=!1,o=[],function(){o=Array.prototype.slice.call(arguments),a=a||this,r||(r=!0,H.requestAnimFrame.call(window,function(){r=!1,i.apply(a,o)}))}));!function(t,e){var n=t[pe]||(t[pe]={}),i=n.renderProxy=function(t){t.animationName===be&&e()};H.each(xe,function(e){we(t,e,i)}),n.reflow=!!t.offsetParent,t.classList.add(ve)}(t,function(){if(s.resizer){var e=t.parentNode;e&&e!==l.parentNode&&e.insertBefore(l,e.firstChild),l._reset()}})}function Ae(t){var e=t[pe]||{},n=e.resizer;delete e.resizer,function(t){var e=t[pe]||{},n=e.renderProxy;n&&(H.each(xe,function(e){Me(t,e,n)}),delete e.renderProxy),t.classList.remove(ve)}(t),n&&n.parentNode&&n.parentNode.removeChild(n)}var De={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(t){if(!this.disableCSSInjection){var e=t.getRootNode?t.getRootNode():document;!function(t,e){var n=t[pe]||(t[pe]={});if(!n.containsStyles){n.containsStyles=!0,e="/* Chart.js */\n"+e;var i=document.createElement("style");i.setAttribute("type","text/css"),i.appendChild(document.createTextNode(e)),t.appendChild(i)}}(e.host?e:document.head,ge)}},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(this._ensureLoaded(t),function(t,e){var n=t.style,i=t.getAttribute("height"),a=t.getAttribute("width");if(t[pe]={initial:{height:i,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===a||""===a){var r=_e(t,"width");void 0!==r&&(t.width=r)}if(null===i||""===i)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var o=_e(t,"height");void 0!==r&&(t.height=o)}}(t,e),n):null},releaseContext:function(t){var e=t.canvas;if(e[pe]){var n=e[pe].initial;["height","width"].forEach(function(t){var i=n[t];H.isNullOrUndef(i)?e.removeAttribute(t):e.setAttribute(t,i)}),H.each(n.style||{},function(t,n){e.style[n]=t}),e.width=e.width,delete e[pe]}},addEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=n[pe]||(n[pe]={});we(i,e,(a.proxies||(a.proxies={}))[t.id+"_"+e]=function(e){n(function(t,e){var n=ye[t.type]||t.type,i=H.getRelativePosition(t,e);return Se(n,e,i.x,i.y,t)}(e,t))})}else Pe(i,n,t)},removeEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=((n[pe]||{}).proxies||{})[t.id+"_"+e];a&&Me(i,e,a)}else Ae(i)}};H.addEvent=we,H.removeEvent=Me;var Te=De._enabled?De:{acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}},Ie=H.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},Te);N._set("global",{plugins:{}});var Fe={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach(function(t){-1===e.indexOf(t)&&e.push(t)}),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach(function(t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,n){var i,a,r,o,s,l=this.descriptors(t),u=l.length;for(i=0;i<u;++i)if("function"==typeof(s=(r=(a=l[i]).plugin)[e])&&((o=[t].concat(n||[])).push(a.options),!1===s.apply(r,o)))return!1;return!0},descriptors:function(t){var e=t.$plugins||(t.$plugins={});if(e.id===this._cacheId)return e.descriptors;var n=[],i=[],a=t&&t.config||{},r=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach(function(t){if(-1===n.indexOf(t)){var e=t.id,a=r[e];!1!==a&&(!0===a&&(a=H.clone(N.global.plugins[e])),n.push(t),i.push({plugin:t,options:a||{}}))}}),e.descriptors=i,e.id=this._cacheId,i},_invalidate:function(t){delete t.$plugins}},Oe={constructors:{},defaults:{},registerScaleType:function(t,e,n){this.constructors[t]=e,this.defaults[t]=H.clone(n)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?H.merge({},[N.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){this.defaults.hasOwnProperty(t)&&(this.defaults[t]=H.extend(this.defaults[t],e))},addScalesToLayout:function(t){H.each(t.scales,function(e){e.fullWidth=e.options.fullWidth,e.position=e.options.position,e.weight=e.options.weight,fe.addBox(t,e)})}},Le=H.valueOrDefault,Re=H.rtl.getRtlAdapter;N._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:H.noop,title:function(t,e){var n="",i=e.labels,a=i?i.length:0;if(t.length>0){var r=t[0];r.label?n=r.label:r.xLabel?n=r.xLabel:a>0&&r.index<a&&(n=i[r.index])}return n},afterTitle:H.noop,beforeBody:H.noop,beforeLabel:H.noop,label:function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n&&(n+=": "),H.isNullOrUndef(t.value)?n+=t.yLabel:n+=t.value,n},labelColor:function(t,e){var n=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:H.noop,afterBody:H.noop,beforeFooter:H.noop,footer:H.noop,afterFooter:H.noop}}});var ze={average:function(t){if(!t.length)return!1;var e,n,i=0,a=0,r=0;for(e=0,n=t.length;e<n;++e){var o=t[e];if(o&&o.hasValue()){var s=o.tooltipPosition();i+=s.x,a+=s.y,++r}}return{x:i/r,y:a/r}},nearest:function(t,e){var n,i,a,r=e.x,o=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){var l=t[n];if(l&&l.hasValue()){var u=l.getCenterPoint(),d=H.distanceBetweenPoints(e,u);d<s&&(s=d,a=l)}}if(a){var h=a.tooltipPosition();r=h.x,o=h.y}return{x:r,y:o}}};function Ne(t,e){return e&&(H.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Be(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Ee(t){var e=N.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:Le(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:Le(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:Le(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:Le(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:Le(t.titleFontStyle,e.defaultFontStyle),titleFontSize:Le(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:Le(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:Le(t.footerFontStyle,e.defaultFontStyle),footerFontSize:Le(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function We(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Ve(t){return Ne([],Be(t))}var He=K.extend({initialize:function(){this._model=Ee(this._options),this._lastActive=[]},getTitle:function(){var t=this._options.callbacks,e=t.beforeTitle.apply(this,arguments),n=t.title.apply(this,arguments),i=t.afterTitle.apply(this,arguments),a=[];return a=Ne(a,Be(e)),a=Ne(a,Be(n)),a=Ne(a,Be(i))},getBeforeBody:function(){return Ve(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,a=[];return H.each(t,function(t){var r={before:[],lines:[],after:[]};Ne(r.before,Be(i.beforeLabel.call(n,t,e))),Ne(r.lines,i.label.call(n,t,e)),Ne(r.after,Be(i.afterLabel.call(n,t,e))),a.push(r)}),a},getAfterBody:function(){return Ve(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this._options.callbacks,e=t.beforeFooter.apply(this,arguments),n=t.footer.apply(this,arguments),i=t.afterFooter.apply(this,arguments),a=[];return a=Ne(a,Be(e)),a=Ne(a,Be(n)),a=Ne(a,Be(i))},update:function(t){var e,n,i,a,r,o,s,l,u,d,h=this,c=h._options,f=h._model,g=h._model=Ee(c),p=h._active,m=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},x={width:f.width,height:f.height},y={x:f.caretX,y:f.caretY};if(p.length){g.opacity=1;var _=[],k=[];y=ze[c.position].call(h,p,h._eventPosition);var w=[];for(e=0,n=p.length;e<n;++e)w.push((i=p[e],a=void 0,r=void 0,o=void 0,s=void 0,l=void 0,u=void 0,d=void 0,a=i._xScale,r=i._yScale||i._scale,o=i._index,s=i._datasetIndex,l=i._chart.getDatasetMeta(s).controller,u=l._getIndexScale(),d=l._getValueScale(),{xLabel:a?a.getLabelForIndex(o,s):"",yLabel:r?r.getLabelForIndex(o,s):"",label:u?""+u.getLabelForIndex(o,s):"",value:d?""+d.getLabelForIndex(o,s):"",index:o,datasetIndex:s,x:i._model.x,y:i._model.y}));c.filter&&(w=w.filter(function(t){return c.filter(t,m)})),c.itemSort&&(w=w.sort(function(t,e){return c.itemSort(t,e,m)})),H.each(w,function(t){_.push(c.callbacks.labelColor.call(h,t,h._chart)),k.push(c.callbacks.labelTextColor.call(h,t,h._chart))}),g.title=h.getTitle(w,m),g.beforeBody=h.getBeforeBody(w,m),g.body=h.getBody(w,m),g.afterBody=h.getAfterBody(w,m),g.footer=h.getFooter(w,m),g.x=y.x,g.y=y.y,g.caretPadding=c.caretPadding,g.labelColors=_,g.labelTextColors=k,g.dataPoints=w,x=function(t,e){var n=t._chart.ctx,i=2*e.yPadding,a=0,r=e.body,o=r.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);o+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,u=e.titleFontSize,d=e.bodyFontSize,h=e.footerFontSize;i+=s*u,i+=s?(s-1)*e.titleSpacing:0,i+=s?e.titleMarginBottom:0,i+=o*d,i+=o?(o-1)*e.bodySpacing:0,i+=l?e.footerMarginTop:0,i+=l*h,i+=l?(l-1)*e.footerSpacing:0;var c=0,f=function(t){a=Math.max(a,n.measureText(t).width+c)};return n.font=H.fontString(u,e._titleFontStyle,e._titleFontFamily),H.each(e.title,f),n.font=H.fontString(d,e._bodyFontStyle,e._bodyFontFamily),H.each(e.beforeBody.concat(e.afterBody),f),c=e.displayColors?d+2:0,H.each(r,function(t){H.each(t.before,f),H.each(t.lines,f),H.each(t.after,f)}),c=0,n.font=H.fontString(h,e._footerFontStyle,e._footerFontFamily),H.each(e.footer,f),{width:a+=2*e.xPadding,height:i}}(this,g),b=function(t,e,n,i){var a=t.x,r=t.y,o=t.caretSize,s=t.caretPadding,l=t.cornerRadius,u=n.xAlign,d=n.yAlign,h=o+s,c=l+s;return"right"===u?a-=e.width:"center"===u&&((a-=e.width/2)+e.width>i.width&&(a=i.width-e.width),a<0&&(a=0)),"top"===d?r+=h:r-="bottom"===d?e.height+h:e.height/2,"center"===d?"left"===u?a+=h:"right"===u&&(a-=h):"left"===u?a-=c:"right"===u&&(a+=c),{x:a,y:r}}(g,x,v=function(t,e){var n,i,a,r,o,s=t._model,l=t._chart,u=t._chart.chartArea,d="center",h="center";s.y<e.height?h="top":s.y>l.height-e.height&&(h="bottom");var c=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===h?(n=function(t){return t<=c},i=function(t){return t>c}):(n=function(t){return t<=e.width/2},i=function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},r=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},n(s.x)?(d="left",a(s.x)&&(d="center",h=o(s.y))):i(s.x)&&(d="right",r(s.x)&&(d="center",h=o(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:d,yAlign:g.yAlign?g.yAlign:h}}(this,x),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=x.width,g.height=x.height,g.caretX=y.x,g.caretY=y.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,h=n.xAlign,c=n.yAlign,f=t.x,g=t.y,p=e.width,m=e.height;if("center"===c)s=g+m/2,"left"===h?(a=(i=f)-u,r=i,o=s+u,l=s-u):(a=(i=f+p)+u,r=i,o=s-u,l=s+u);else if("left"===h?(i=(a=f+d+u)-u,r=a+u):"right"===h?(i=(a=f+p-d-u)-u,r=a+u):(i=(a=n.caretX)-u,r=a+u),"top"===c)s=(o=g)-u,l=o;else{s=(o=g+m)+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,n){var i,a,r,o=e.title,s=o.length;if(s){var l=Re(e.rtl,e.x,e.width);for(t.x=We(e,e._titleAlign),n.textAlign=l.textAlign(e._titleAlign),n.textBaseline="middle",i=e.titleFontSize,a=e.titleSpacing,n.fillStyle=e.titleFontColor,n.font=H.fontString(i,e._titleFontStyle,e._titleFontFamily),r=0;r<s;++r)n.fillText(o[r],l.x(t.x),t.y+i/2),t.y+=i+a,r+1===s&&(t.y+=e.titleMarginBottom-a)}},drawBody:function(t,e,n){var i,a,r,o,s,l,u,d,h=e.bodyFontSize,c=e.bodySpacing,f=e._bodyAlign,g=e.body,p=e.displayColors,m=0,v=p?We(e,"left"):0,b=Re(e.rtl,e.x,e.width),x=function(e){n.fillText(e,b.x(t.x+m),t.y+h/2),t.y+=h+c},y=b.textAlign(f);for(n.textAlign=f,n.textBaseline="middle",n.font=H.fontString(h,e._bodyFontStyle,e._bodyFontFamily),t.x=We(e,y),n.fillStyle=e.bodyFontColor,H.each(e.beforeBody,x),m=p&&"right"!==y?"center"===f?h/2+1:h+2:0,s=0,u=g.length;s<u;++s){for(i=g[s],a=e.labelTextColors[s],r=e.labelColors[s],n.fillStyle=a,H.each(i.before,x),l=0,d=(o=i.lines).length;l<d;++l){if(p){var _=b.x(v);n.fillStyle=e.legendColorBackground,n.fillRect(b.leftForLtr(_,h),t.y,h,h),n.lineWidth=1,n.strokeStyle=r.borderColor,n.strokeRect(b.leftForLtr(_,h),t.y,h,h),n.fillStyle=r.backgroundColor,n.fillRect(b.leftForLtr(b.xPlus(_,1),h-2),t.y+1,h-2,h-2),n.fillStyle=a}x(o[l])}H.each(i.after,x)}m=0,H.each(e.afterBody,x),t.y-=c},drawFooter:function(t,e,n){var i,a,r=e.footer,o=r.length;if(o){var s=Re(e.rtl,e.x,e.width);for(t.x=We(e,e._footerAlign),t.y+=e.footerMarginTop,n.textAlign=s.textAlign(e._footerAlign),n.textBaseline="middle",i=e.footerFontSize,n.fillStyle=e.footerFontColor,n.font=H.fontString(i,e._footerFontStyle,e._footerFontFamily),a=0;a<o;++a)n.fillText(r[a],s.x(t.x),t.y+i/2),t.y+=i+e.footerSpacing}},drawBackground:function(t,e,n,i){n.fillStyle=e.backgroundColor,n.strokeStyle=e.borderColor,n.lineWidth=e.borderWidth;var a=e.xAlign,r=e.yAlign,o=t.x,s=t.y,l=i.width,u=i.height,d=e.cornerRadius;n.beginPath(),n.moveTo(o+d,s),"top"===r&&this.drawCaret(t,i),n.lineTo(o+l-d,s),n.quadraticCurveTo(o+l,s,o+l,s+d),"center"===r&&"right"===a&&this.drawCaret(t,i),n.lineTo(o+l,s+u-d),n.quadraticCurveTo(o+l,s+u,o+l-d,s+u),"bottom"===r&&this.drawCaret(t,i),n.lineTo(o+d,s+u),n.quadraticCurveTo(o,s+u,o,s+u-d),"center"===r&&"left"===a&&this.drawCaret(t,i),n.lineTo(o,s+d),n.quadraticCurveTo(o,s,o+d,s),n.closePath(),n.fill(),e.borderWidth>0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity,r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&r&&(t.save(),t.globalAlpha=a,this.drawBackground(i,e,t,n),i.y+=e.yPadding,H.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),H.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e,n=this,i=n._options;return n._lastActive=n._lastActive||[],"mouseout"===t.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(t,i.mode,i),i.reverse&&n._active.reverse()),(e=!H.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}}),je=ze,qe=He;qe.positioners=je;var Ue=H.valueOrDefault;function Ye(){return H.merge({},[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var a,r,o,s=n[t].length;for(e[t]||(e[t]=[]),a=0;a<s;++a)o=n[t][a],r=Ue(o.type,"xAxes"===t?"category":"linear"),a>=e[t].length&&e[t].push({}),!e[t][a].type||o.type&&o.type!==e[t][a].type?H.merge(e[t][a],[Oe.getScaleDefaults(r),o]):H.merge(e[t][a],o)}else H._merger(t,e,n,i)}})}function Ge(){return H.merge({},[].slice.call(arguments),{merger:function(t,e,n,i){var a=e[t]||{},r=n[t];"scales"===t?e[t]=Ye(a,r):"scale"===t?e[t]=H.merge(a,[Oe.getScaleDefaults(r.type),r]):H._merger(t,e,n,i)}})}function Xe(t,e,n){var i,a=function(t){return t.id===i};do{i=e+n++}while(H.findIndex(t,a)>=0);return i}function Ke(t){return"top"===t||"bottom"===t}function Ze(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}N._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var $e=function(t,e){return this.construct(t,e),this};H.extend($e.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Ge(N.global,N[t.type],t.options||{}),t}(e);var i=Ie.acquireContext(t,e),a=i&&i.canvas,r=a&&a.height,o=a&&a.width;n.id=H.uid(),n.ctx=i,n.canvas=a,n.config=e,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,$e.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Fe.notify(t,"beforeInit"),H.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),Fe.notify(t,"afterInit"),t},clear:function(){return H.canvas.clear(this),this},stop:function(){return J.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,a=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(H.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:H.getMaximumHeight(i)));if((e.width!==r||e.height!==o)&&(i.width=e.width=r,i.height=e.height=o,i.style.width=r+"px",i.style.height=o+"px",H.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};Fe.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;H.each(e.xAxes,function(t,n){t.id||(t.id=Xe(e.xAxes,"x-axis-",n))}),H.each(e.yAxes,function(t,n){t.id||(t.id=Xe(e.yAxes,"y-axis-",n))}),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],a=Object.keys(n).reduce(function(t,e){return t[e]=!1,t},{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(e.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),H.each(i,function(e){var i=e.options,r=i.id,o=Ue(i.type,e.dtype);Ke(i.position)!==Ke(e.dposition)&&(i.position=e.dposition),a[r]=!0;var s=null;if(r in n&&n[r].type===o)(s=n[r]).options=i,s.ctx=t.ctx,s.chart=t;else{var l=Oe.getScaleConstructor(o);if(!l)return;s=new l({id:r,type:o,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)}),H.each(a,function(t,e){t||delete n[e]}),t.scales=n,Oe.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,i=[],a=n.data.datasets;for(t=0,e=a.length;t<e;t++){var r=a[t],o=n.getDatasetMeta(t),s=r.type||n.config.type;if(o.type&&o.type!==s&&(n.destroyDatasetMeta(t),o=n.getDatasetMeta(t)),o.type=s,o.order=r.order||0,o.index=t,o.controller)o.controller.updateIndex(t),o.controller.linkScales();else{var l=Zt[o.type];if(void 0===l)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new l(n,t),i.push(o.controller)}}return i},resetElements:function(){var t=this;H.each(t.data.datasets,function(e,n){t.getDatasetMeta(n).controller.reset()},t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e,n,i,a,r=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),a=(i=r).options,H.each(i.scales,function(t){fe.removeBox(i,t)}),a=Ge(N.global,N[i.config.type],a),i.options=i.config.options=a,i.ensureScalesHaveIDs(),i.buildOrUpdateScales(),i.tooltip._options=a.tooltips,i.tooltip.initialize(),Fe._invalidate(r),!1!==Fe.notify(r,"beforeUpdate")){r.tooltip._data=r.data;var o=r.buildOrUpdateControllers();for(e=0,n=r.data.datasets.length;e<n;e++)r.getDatasetMeta(e).controller.buildOrUpdateElements();r.updateLayout(),r.options.animation&&r.options.animation.duration&&H.each(o,function(t){t.reset()}),r.updateDatasets(),r.tooltip.initialize(),r.lastActive=[],Fe.notify(r,"afterUpdate"),r._layers.sort(Ze("z","_idx")),r._bufferedRender?r._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:r.render(t)}},updateLayout:function(){var t=this;!1!==Fe.notify(t,"beforeLayout")&&(fe.update(this,this.width,this.height),t._layers=[],H.each(t.boxes,function(e){e._configure&&e._configure(),t._layers.push.apply(t._layers,e._layers())},t),t._layers.forEach(function(t,e){t._idx=e}),Fe.notify(t,"afterScaleUpdate"),Fe.notify(t,"afterLayout"))},updateDatasets:function(){if(!1!==Fe.notify(this,"beforeDatasetsUpdate")){for(var t=0,e=this.data.datasets.length;t<e;++t)this.updateDataset(t);Fe.notify(this,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this.getDatasetMeta(t),n={meta:e,index:t};!1!==Fe.notify(this,"beforeDatasetUpdate",[n])&&(e.controller._update(),Fe.notify(this,"afterDatasetUpdate",[n]))},render:function(t){var e=this;t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]});var n=e.options.animation,i=Ue(t.duration,n&&n.duration),a=t.lazy;if(!1!==Fe.notify(e,"beforeRender")){var r=function(t){Fe.notify(e,"afterRender"),H.callback(n&&n.onComplete,[t],e)};if(n&&i){var o=new $({numSteps:i/16.66,easing:t.easing||n.easing,render:function(t,e){var n=H.easing.effects[e.easing],i=e.currentStep,a=i/e.numSteps;t.draw(n(a),a,i)},onAnimationProgress:n.onProgress,onAnimationComplete:r});J.addAnimation(e,o,i,a)}else e.draw(),r(new $({numSteps:0,chart:e}));return e}},draw:function(t){var e,n,i=this;if(i.clear(),H.isNullOrUndef(t)&&(t=1),i.transition(t),!(i.width<=0||i.height<=0)&&!1!==Fe.notify(i,"beforeDraw",[t])){for(n=i._layers,e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(i.chartArea);for(i.drawDatasets(t);e<n.length;++e)n[e].draw(i.chartArea);i._drawTooltip(t),Fe.notify(i,"afterDraw",[t])}},transition:function(t){for(var e=0,n=(this.data.datasets||[]).length;e<n;++e)this.isDatasetVisible(e)&&this.getDatasetMeta(e).controller.transition(t);this.tooltip.transition(t)},_getSortedDatasetMetas:function(t){var e,n,i=[];for(e=0,n=(this.data.datasets||[]).length;e<n;++e)t&&!this.isDatasetVisible(e)||i.push(this.getDatasetMeta(e));return i.sort(Ze("order","index")),i},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(t){var e,n;if(!1!==Fe.notify(this,"beforeDatasetsDraw",[t])){for(n=(e=this._getSortedVisibleDatasetMetas()).length-1;n>=0;--n)this.drawDataset(e[n],t);Fe.notify(this,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n={meta:t,index:t.index,easingValue:e};!1!==Fe.notify(this,"beforeDatasetDraw",[n])&&(t.controller.draw(e),Fe.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,n={tooltip:e,easingValue:t};!1!==Fe.notify(this,"beforeTooltipDraw",[n])&&(e.draw(),Fe.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return ie.modes.single(this,t)},getElementsAtEvent:function(t){return ie.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return ie.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=ie.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return ie.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var n=e._meta[this.id];return n||(n=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e.order||0,index:t}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e<n;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,n=this.data.datasets[t],i=n._meta&&n._meta[e];i&&(i.controller.destroy(),delete n._meta[e])},destroy:function(){var t,e,n=this,i=n.canvas;for(n.stop(),t=0,e=n.data.datasets.length;t<e;++t)n.destroyDatasetMeta(t);i&&(n.unbindEvents(),H.canvas.clear(n),Ie.releaseContext(n.ctx),n.canvas=null,n.ctx=null),Fe.notify(n,"destroy"),delete $e.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var t=this;t.tooltip=new qe({_chart:t,_chartInstance:t,_data:t.data,_options:t.options.tooltips},t)},bindEvents:function(){var t=this,e=t._listeners={},n=function(){t.eventHandler.apply(t,arguments)};H.each(t.options.events,function(i){Ie.addEventListener(t,i,n),e[i]=n}),t.options.responsive&&(n=function(){t.resize()},Ie.addEventListener(t,"resize",n),e.resize=n)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,H.each(e,function(e,n){Ie.removeEventListener(t,n,e)}))},updateHoverStyle:function(t,e,n){var i,a,r,o=n?"set":"remove";for(a=0,r=t.length;a<r;++a)(i=t[a])&&this.getDatasetMeta(i._datasetIndex).controller[o+"HoverStyle"](i);"dataset"===e&&this.getDatasetMeta(t[0]._datasetIndex).controller["_"+o+"DatasetHoverStyle"]()},eventHandler:function(t){var e=this,n=e.tooltip;if(!1!==Fe.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var i=e.handleEvent(t);n&&(i=n._start?n.handleEvent(t):i|n.handleEvent(t)),Fe.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):i&&!e.animating&&(e.stop(),e.render({duration:e.options.hover.animationDuration,lazy:!0})),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e,n=this,i=n.options||{},a=i.hover;return n.lastActive=n.lastActive||[],"mouseout"===t.type?n.active=[]:n.active=n.getElementsAtEventForMode(t,a.mode,a),H.callback(i.onHover||i.hover.onHover,[t.native,n.active],n),"mouseup"!==t.type&&"click"!==t.type||i.onClick&&i.onClick.call(n,t.native,n.active),n.lastActive.length&&n.updateHoverStyle(n.lastActive,a.mode,!1),n.active.length&&a.mode&&n.updateHoverStyle(n.active,a.mode,!0),e=!H.arrayEquals(n.active,n.lastActive),n.lastActive=n.active,e}}),$e.instances={};var Je=$e;$e.Controller=$e,$e.types={},H.configMerge=Ge,H.scaleMerge=Ye;function Qe(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function tn(t){this.options=t||{}}H.extend(tn.prototype,{formats:Qe,parse:Qe,format:Qe,add:Qe,diff:Qe,startOf:Qe,endOf:Qe,_create:function(t){return t}}),tn.override=function(t){H.extend(tn.prototype,t)};var en={_date:tn},nn={formatters:{values:function(t){return H.isArray(t)?t:""+t},linear:function(t,e,n){var i=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var a=H.log10(Math.abs(i)),r="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=H.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),r=t.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}else r="0";return r},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(H.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},an=H.isArray,rn=H.isNullOrUndef,on=H.valueOrDefault,sn=H.valueAtIndexOrDefault;function ln(t,e,n){var i,a=t.getTicks().length,r=Math.min(e,a-1),o=t.getPixelForTick(r),s=t._startPixel,l=t._endPixel;if(!(n&&(i=1===a?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(r-1))/2,(o+=r<e?i:-i)<s-1e-6||o>l+1e-6)))return o}function un(t,e,n,i){var a,r,o,s,l,u,d,h,c,f,g,p,m,v=n.length,b=[],x=[],y=[];for(a=0;a<v;++a){if(s=n[a].label,l=n[a].major?e.major:e.minor,t.font=u=l.string,d=i[u]=i[u]||{data:{},gc:[]},h=l.lineHeight,c=f=0,rn(s)||an(s)){if(an(s))for(r=0,o=s.length;r<o;++r)g=s[r],rn(g)||an(g)||(c=H.measureText(t,d.data,d.gc,c,g),f+=h)}else c=H.measureText(t,d.data,d.gc,c,s),f=h;b.push(c),x.push(f),y.push(h/2)}function _(t){return{width:b[t]||0,height:x[t]||0,offset:y[t]||0}}return function(t,e){H.each(t,function(t){var n,i=t.gc,a=i.length/2;if(a>e){for(n=0;n<a;++n)delete t.data[i[n]];i.splice(0,a)}})}(i,v),p=b.indexOf(Math.max.apply(null,b)),m=x.indexOf(Math.max.apply(null,x)),{first:_(0),last:_(v-1),widest:_(p),highest:_(m)}}function dn(t){return t.drawTicks?t.tickMarkLength:0}function hn(t){var e,n;return t.display?(e=H.options._parseFont(t),n=H.options.toPadding(t.padding),e.lineHeight+n.height):0}function cn(t,e){return H.extend(H.options._parseFont({fontFamily:on(e.fontFamily,t.fontFamily),fontSize:on(e.fontSize,t.fontSize),fontStyle:on(e.fontStyle,t.fontStyle),lineHeight:on(e.lineHeight,t.lineHeight)}),{color:H.options.resolve([e.fontColor,t.fontColor,N.global.defaultFontColor])})}function fn(t){var e=cn(t,t.minor);return{minor:e,major:t.major.enabled?cn(t,t.major):e}}function gn(t){var e,n,i,a=[];for(n=0,i=t.length;n<i;++n)void 0!==(e=t[n])._index&&a.push(e);return a}function pn(t,e,n,i){var a,r,o,s,l=on(n,0),u=Math.min(on(i,t.length),t.length),d=0;for(e=Math.ceil(e),i&&(e=(a=i-n)/Math.floor(a/e)),s=l;s<0;)d++,s=Math.round(l+d*e);for(r=Math.max(l,0);r<u;r++)o=t[r],r===s?(o._index=r,d++,s=Math.round(l+d*e)):delete o.label}N._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:nn.formatters.values,minor:{},major:{}}});var mn=K.extend({zeroLineIndex:0,getPadding:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){H.callback(this.options.beforeUpdate,[this])},update:function(t,e,n){var i,a,r,o,s,l=this,u=l.options.ticks,d=u.sampleSize;if(l.beforeUpdate(),l.maxWidth=t,l.maxHeight=e,l.margins=H.extend({left:0,right:0,top:0,bottom:0},n),l._ticks=null,l.ticks=null,l._labelSizes=null,l._maxLabelLines=0,l.longestLabelWidth=0,l.longestTextCache=l.longestTextCache||{},l._gridLineItems=null,l._labelItems=null,l.beforeSetDimensions(),l.setDimensions(),l.afterSetDimensions(),l.beforeDataLimits(),l.determineDataLimits(),l.afterDataLimits(),l.beforeBuildTicks(),o=l.buildTicks()||[],(!(o=l.afterBuildTicks(o)||o)||!o.length)&&l.ticks)for(o=[],i=0,a=l.ticks.length;i<a;++i)o.push({value:l.ticks[i],major:!1});return l._ticks=o,s=d<o.length,r=l._convertTicksToLabels(s?function(t,e){for(var n=[],i=t.length/e,a=0,r=t.length;a<r;a+=i)n.push(t[Math.floor(a)]);return n}(o,d):o),l._configure(),l.beforeCalculateTickRotation(),l.calculateTickRotation(),l.afterCalculateTickRotation(),l.beforeFit(),l.fit(),l.afterFit(),l._ticksToDraw=u.display&&(u.autoSkip||"auto"===u.source)?l._autoSkip(o):o,s&&(r=l._convertTicksToLabels(l._ticksToDraw)),l.ticks=r,l.afterUpdate(),l.minSize},_configure:function(){var t,e,n=this,i=n.options.ticks.reverse;n.isHorizontal()?(t=n.left,e=n.right):(t=n.top,e=n.bottom,i=!i),n._startPixel=t,n._endPixel=e,n._reversePixels=i,n._length=e-t},afterUpdate:function(){H.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){H.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0},afterSetDimensions:function(){H.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){H.callback(this.options.beforeDataLimits,[this])},determineDataLimits:H.noop,afterDataLimits:function(){H.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){H.callback(this.options.beforeBuildTicks,[this])},buildTicks:H.noop,afterBuildTicks:function(t){var e=this;return an(t)&&t.length?H.callback(e.options.afterBuildTicks,[e,t]):(e.ticks=H.callback(e.options.afterBuildTicks,[e,e.ticks])||e.ticks,t)},beforeTickToLabelConversion:function(){H.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this.options.ticks;this.ticks=this.ticks.map(t.userCallback||t.callback,this)},afterTickToLabelConversion:function(){H.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){H.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t,e,n,i,a,r,o,s=this,l=s.options,u=l.ticks,d=s.getTicks().length,h=u.minRotation||0,c=u.maxRotation,f=h;!s._isVisible()||!u.display||h>=c||d<=1||!s.isHorizontal()?s.labelRotation=h:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,i=Math.min(s.maxWidth,s.chart.width-e),e+6>(a=l.offset?s.maxWidth/d:i/(d-1))&&(a=i/(d-(l.offset?.5:1)),r=s.maxHeight-dn(l.gridLines)-u.padding-hn(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=H.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),f=Math.max(h,Math.min(c,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){H.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){H.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,i=t.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=t._isVisible(),l="bottom"===i.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=dn(o)+hn(r)),u?s&&(e.height=dn(o)+hn(r)):e.height=t.maxHeight,a.display&&s){var d=fn(a),h=t._getLabelSizes(),c=h.first,f=h.last,g=h.widest,p=h.highest,m=.4*d.minor.lineHeight,v=a.padding;if(u){var b=0!==t.labelRotation,x=H.toRadians(t.labelRotation),y=Math.cos(x),_=Math.sin(x),k=_*g.width+y*(p.height-(b?p.offset:0))+(b?0:m);e.height=Math.min(t.maxHeight,e.height+k+v);var w,M,S=t.getPixelForTick(0)-t.left,C=t.right-t.getPixelForTick(t.getTicks().length-1);b?(w=l?y*c.width+_*c.offset:_*(c.height-c.offset),M=l?_*(f.height-f.offset):y*f.width+_*f.offset):(w=c.width/2,M=f.width/2),t.paddingLeft=Math.max((w-S)*t.width/(t.width-S),0)+3,t.paddingRight=Math.max((M-C)*t.width/(t.width-C),0)+3}else{var P=a.mirror?0:g.width+v+m;e.width=Math.min(t.maxWidth,e.width+P),t.paddingTop=c.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),u?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){H.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(rn(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,n,i,a=this;for(a.ticks=t.map(function(t){return t.value}),a.beforeTickToLabelConversion(),e=a.convertTicksToLabels(t)||a.ticks,a.afterTickToLabelConversion(),n=0,i=t.length;n<i;++n)t[n].label=e[n];return e},_getLabelSizes:function(){var t=this,e=t._labelSizes;return e||(t._labelSizes=e=un(t.ctx,fn(t.options.ticks),t.getTicks(),t.longestTextCache),t.longestLabelWidth=e.widest.width),e},_parseValue:function(t){var e,n,i,a;return an(t)?(e=+this.getRightValue(t[0]),n=+this.getRightValue(t[1]),i=Math.min(e,n),a=Math.max(e,n)):(e=void 0,n=t=+this.getRightValue(t),i=t,a=t),{min:i,max:a,start:e,end:n}},_getScaleLabel:function(t){var e=this._parseValue(t);return void 0!==e.start?"["+e.start+", "+e.end+"]":+this.getRightValue(t)},getLabelForIndex:H.noop,getPixelForValue:H.noop,getValueForPixel:H.noop,getPixelForTick:function(t){var e=this.options.offset,n=this._ticks.length,i=1/Math.max(n-(e?0:1),1);return t<0||t>n-1?null:this.getPixelForDecimal(t*i+(e?i/2:0))},getPixelForDecimal:function(t){return this._reversePixels&&(t=1-t),this._startPixel+t*this._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0},_autoSkip:function(t){var e,n,i,a,r=this.options.ticks,o=this._length,s=r.maxTicksLimit||o/this._tickSize()+1,l=r.major.enabled?function(t){var e,n,i=[];for(e=0,n=t.length;e<n;e++)t[e].major&&i.push(e);return i}(t):[],u=l.length,d=l[0],h=l[u-1];if(u>s)return function(t,e,n){var i,a,r=0,o=e[0];for(n=Math.ceil(n),i=0;i<t.length;i++)a=t[i],i===o?(a._index=i,o=e[++r*n]):delete a.label}(t,l,u/s),gn(t);if(i=function(t,e,n,i){var a,r,o,s,l=function(t){var e,n,i=t.length;if(i<2)return!1;for(n=t[0],e=1;e<i;++e)if(t[e]-t[e-1]!==n)return!1;return n}(t),u=(e.length-1)/i;if(!l)return Math.max(u,1);for(o=0,s=(a=H.math._factorize(l)).length-1;o<s;o++)if((r=a[o])>u)return r;return Math.max(u,1)}(l,t,0,s),u>0){for(e=0,n=u-1;e<n;e++)pn(t,i,l[e],l[e+1]);return a=u>1?(h-d)/(u-1):null,pn(t,i,H.isNullOrUndef(a)?0:d-a,d),pn(t,i,h,H.isNullOrUndef(a)?t.length:h+a),gn(t)}return pn(t,i),gn(t)},_tickSize:function(){var t=this.options.ticks,e=H.toRadians(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),a=this._getLabelSizes(),r=t.autoSkipPadding||0,o=a?a.widest.width+r:0,s=a?a.highest.height+r:0;return this.isHorizontal()?s*n>o*i?o/n:s/i:s*i<o*n?s/n:o/i},_isVisible:function(){var t,e,n,i=this.chart,a=this.options.display;if("auto"!==a)return!!a;for(t=0,e=i.data.datasets.length;t<e;++t)if(i.isDatasetVisible(t)&&((n=i.getDatasetMeta(t)).xAxisID===this.id||n.yAxisID===this.id))return!0;return!1},_computeGridLineItems:function(t){var e,n,i,a,r,o,s,l,u,d,h,c,f,g,p,m,v,b=this,x=b.chart,y=b.options,_=y.gridLines,k=y.position,w=_.offsetGridLines,M=b.isHorizontal(),S=b._ticksToDraw,C=S.length+(w?1:0),P=dn(_),A=[],D=_.drawBorder?sn(_.lineWidth,0,0):0,T=D/2,I=H._alignPixel,F=function(t){return I(x,t,D)};for("top"===k?(e=F(b.bottom),s=b.bottom-P,u=e-T,h=F(t.top)+T,f=t.bottom):"bottom"===k?(e=F(b.top),h=t.top,f=F(t.bottom)-T,s=e+T,u=b.top+P):"left"===k?(e=F(b.right),o=b.right-P,l=e-T,d=F(t.left)+T,c=t.right):(e=F(b.left),d=t.left,c=F(t.right)-T,o=e+T,l=b.left+P),n=0;n<C;++n)i=S[n]||{},rn(i.label)&&n<S.length||(n===b.zeroLineIndex&&y.offset===w?(g=_.zeroLineWidth,p=_.zeroLineColor,m=_.zeroLineBorderDash||[],v=_.zeroLineBorderDashOffset||0):(g=sn(_.lineWidth,n,1),p=sn(_.color,n,"rgba(0,0,0,0.1)"),m=_.borderDash||[],v=_.borderDashOffset||0),void 0!==(a=ln(b,i._index||n,w))&&(r=I(x,a,g),M?o=l=d=c=r:s=u=h=f=r,A.push({tx1:o,ty1:s,tx2:l,ty2:u,x1:d,y1:h,x2:c,y2:f,width:g,color:p,borderDash:m,borderDashOffset:v})));return A.ticksLength=C,A.borderValue=e,A},_computeLabelItems:function(){var t,e,n,i,a,r,o,s,l,u,d,h,c=this,f=c.options,g=f.ticks,p=f.position,m=g.mirror,v=c.isHorizontal(),b=c._ticksToDraw,x=fn(g),y=g.padding,_=dn(f.gridLines),k=-H.toRadians(c.labelRotation),w=[];for("top"===p?(r=c.bottom-_-y,o=k?"left":"center"):"bottom"===p?(r=c.top+_+y,o=k?"right":"center"):"left"===p?(a=c.right-(m?0:_)-y,o=m?"left":"right"):(a=c.left+(m?0:_)+y,o=m?"right":"left"),t=0,e=b.length;t<e;++t)i=(n=b[t]).label,rn(i)||(s=c.getPixelForTick(n._index||t)+g.labelOffset,u=(l=n.major?x.major:x.minor).lineHeight,d=an(i)?i.length:1,v?(a=s,h="top"===p?((k?1:.5)-d)*u:(k?0:.5)*u):(r=s,h=(1-d)*u/2),w.push({x:a,y:r,rotation:k,label:i,font:l,textOffset:h,textAlign:o}));return w},_drawGrid:function(t){var e=this,n=e.options.gridLines;if(n.display){var i,a,r,o,s,l=e.ctx,u=e.chart,d=H._alignPixel,h=n.drawBorder?sn(n.lineWidth,0,0):0,c=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));for(r=0,o=c.length;r<o;++r)i=(s=c[r]).width,a=s.color,i&&a&&(l.save(),l.lineWidth=i,l.strokeStyle=a,l.setLineDash&&(l.setLineDash(s.borderDash),l.lineDashOffset=s.borderDashOffset),l.beginPath(),n.drawTicks&&(l.moveTo(s.tx1,s.ty1),l.lineTo(s.tx2,s.ty2)),n.drawOnChartArea&&(l.moveTo(s.x1,s.y1),l.lineTo(s.x2,s.y2)),l.stroke(),l.restore());if(h){var f,g,p,m,v=h,b=sn(n.lineWidth,c.ticksLength-1,1),x=c.borderValue;e.isHorizontal()?(f=d(u,e.left,v)-v/2,g=d(u,e.right,b)+b/2,p=m=x):(p=d(u,e.top,v)-v/2,m=d(u,e.bottom,b)+b/2,f=g=x),l.lineWidth=h,l.strokeStyle=sn(n.color,0),l.beginPath(),l.moveTo(f,p),l.lineTo(g,m),l.stroke()}}},_drawLabels:function(){var t=this;if(t.options.ticks.display){var e,n,i,a,r,o,s,l,u=t.ctx,d=t._labelItems||(t._labelItems=t._computeLabelItems());for(e=0,i=d.length;e<i;++e){if(o=(r=d[e]).font,u.save(),u.translate(r.x,r.y),u.rotate(r.rotation),u.font=o.string,u.fillStyle=o.color,u.textBaseline="middle",u.textAlign=r.textAlign,s=r.label,l=r.textOffset,an(s))for(n=0,a=s.length;n<a;++n)u.fillText(""+s[n],0,l),l+=o.lineHeight;else u.fillText(s,0,l);u.restore()}}},_drawTitle:function(){var t=this,e=t.ctx,n=t.options,i=n.scaleLabel;if(i.display){var a,r,o=on(i.fontColor,N.global.defaultFontColor),s=H.options._parseFont(i),l=H.options.toPadding(i.padding),u=s.lineHeight/2,d=n.position,h=0;if(t.isHorizontal())a=t.left+t.width/2,r="bottom"===d?t.bottom-u-l.bottom:t.top+u+l.top;else{var c="left"===d;a=c?t.left+u+l.top:t.right-u-l.top,r=t.top+t.height/2,h=c?-.5*Math.PI:.5*Math.PI}e.save(),e.translate(a,r),e.rotate(h),e.textAlign="center",e.textBaseline="middle",e.fillStyle=o,e.font=s.string,e.fillText(i.labelString,0,0),e.restore()}},draw:function(t){this._isVisible()&&(this._drawGrid(t),this._drawTitle(),this._drawLabels())},_layers:function(){var t=this,e=t.options,n=e.ticks&&e.ticks.z||0,i=e.gridLines&&e.gridLines.z||0;return t._isVisible()&&n!==i&&t.draw===t._draw?[{z:i,draw:function(){t._drawGrid.apply(t,arguments),t._drawTitle.apply(t,arguments)}},{z:n,draw:function(){t._drawLabels.apply(t,arguments)}}]:[{z:n,draw:function(){t.draw.apply(t,arguments)}}]},_getMatchingVisibleMetas:function(t){var e=this,n=e.isHorizontal();return e.chart._getSortedVisibleDatasetMetas().filter(function(i){return(!t||i.type===t)&&(n?i.xAxisID===e.id:i.yAxisID===e.id)})}});mn.prototype._draw=mn.prototype.draw;var vn=mn,bn=H.isNullOrUndef,xn=vn.extend({determineDataLimits:function(){var t,e=this,n=e._getLabels(),i=e.options.ticks,a=i.min,r=i.max,o=0,s=n.length-1;void 0!==a&&(t=n.indexOf(a))>=0&&(o=t),void 0!==r&&(t=n.indexOf(r))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this._getLabels(),e=this.minIndex,n=this.maxIndex;this.ticks=0===e&&n===t.length-1?t:t.slice(e,n+1)},getLabelForIndex:function(t,e){var n=this.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===this.id?this.getRightValue(n.data.datasets[e].data[t]):this._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;vn.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var i,a,r,o=this;return bn(e)||bn(n)||(t=o.chart.data.datasets[n].data[e]),bn(t)||(i=o.isHorizontal()?t.x:t.y),(void 0!==i||void 0!==t&&isNaN(e))&&(a=o._getLabels(),t=H.valueOrDefault(i,t),e=-1!==(r=a.indexOf(t))?r:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange);return Math.min(Math.max(e,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}}),yn={position:"bottom"};xn._defaults=yn;var _n=H.noop,kn=H.isNullOrUndef;var wn=vn.extend({getRightValue:function(t){return"string"==typeof t?+t:vn.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=H.sign(t.min),i=H.sign(t.max);n<0&&i<0?t.max=0:n>0&&i>0&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),a!==r&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,n=e.stepSize,i=e.maxTicksLimit;return n?t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(t=this._computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:_n,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:H.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var n,i,a,r,o=[],s=t.stepSize,l=s||1,u=t.maxTicks-1,d=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,p=H.niceNum((g-f)/u/l)*l;if(p<1e-14&&kn(d)&&kn(h))return[f,g];(r=Math.ceil(g/p)-Math.floor(f/p))>u&&(p=H.niceNum(r*p/u/l)*l),s||kn(c)?n=Math.pow(10,H._decimalPlaces(p)):(n=Math.pow(10,c),p=Math.ceil(p*n)/n),i=Math.floor(f/p)*p,a=Math.ceil(g/p)*p,s&&(!kn(d)&&H.almostWhole(d/p,p/1e3)&&(i=d),!kn(h)&&H.almostWhole(h/p,p/1e3)&&(a=h)),r=(a-i)/p,r=H.almostEquals(r,Math.round(r),p/1e3)?Math.round(r):Math.ceil(r),i=Math.round(i*n)/n,a=Math.round(a*n)/n,o.push(kn(d)?i:d);for(var m=1;m<r;++m)o.push(Math.round((i+m*p)*n)/n);return o.push(kn(h)?a:h),o}(i,t);t.handleDirectionalChanges(),t.max=H.max(a),t.min=H.min(a),e.reverse?(a.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),vn.prototype.convertTicksToLabels.call(t)},_configure:function(){var t,e=this,n=e.getTicks(),i=e.min,a=e.max;vn.prototype._configure.call(e),e.options.offset&&n.length&&(i-=t=(a-i)/Math.max(n.length-1,1)/2,a+=t),e._startValue=i,e._endValue=a,e._valueRange=a-i}}),Mn={position:"left",ticks:{callback:nn.formatters.linear}};function Sn(t,e,n,i){var a,r,o=t.options,s=function(t,e,n){var i=[n.type,void 0===e&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===t[i]&&(t[i]={pos:[],neg:[]}),t[i]}(e,o.stacked,n),l=s.pos,u=s.neg,d=i.length;for(a=0;a<d;++a)r=t._parseValue(i[a]),isNaN(r.min)||isNaN(r.max)||n.data[a].hidden||(l[a]=l[a]||0,u[a]=u[a]||0,o.relativePoints?l[a]=100:r.min<0||r.max<0?u[a]+=r.min:l[a]+=r.max)}function Cn(t,e,n){var i,a,r=n.length;for(i=0;i<r;++i)a=t._parseValue(n[i]),isNaN(a.min)||isNaN(a.max)||e.data[i].hidden||(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}var Pn=wn.extend({determineDataLimits:function(){var t,e,n,i,a=this,r=a.options,o=a.chart.data.datasets,s=a._getMatchingVisibleMetas(),l=r.stacked,u={},d=s.length;if(a.min=Number.POSITIVE_INFINITY,a.max=Number.NEGATIVE_INFINITY,void 0===l)for(t=0;!l&&t<d;++t)l=void 0!==(e=s[t]).stack;for(t=0;t<d;++t)n=o[(e=s[t]).index].data,l?Sn(a,u,e,n):Cn(a,e,n);H.each(u,function(t){i=t.pos.concat(t.neg),a.min=Math.min(a.min,H.min(i)),a.max=Math.max(a.max,H.max(i))}),a.min=H.isFinite(a.min)&&!isNaN(a.min)?a.min:0,a.max=H.isFinite(a.max)&&!isNaN(a.max)?a.max:1,a.handleTickRangeOptions()},_computeTickLimit:function(){var t;return this.isHorizontal()?Math.ceil(this.width/40):(t=H.options._parseFont(this.options.ticks),Math.ceil(this.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){return this.getPixelForDecimal((+this.getRightValue(t)-this._startValue)/this._valueRange)},getValueForPixel:function(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange},getPixelForTick:function(t){var e=this.ticksAsNumbers;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])}}),An=Mn;Pn._defaults=An;var Dn=H.valueOrDefault,Tn=H.math.log10;var In={position:"left",ticks:{callback:nn.formatters.logarithmic}};function Fn(t,e){return H.isFinite(t)&&t>=0?t:e}var On=vn.extend({determineDataLimits:function(){var t,e,n,i,a,r,o=this,s=o.options,l=o.chart,u=l.data.datasets,d=o.isHorizontal();function h(t){return d?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var c=s.stacked;if(void 0===c)for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&h(e)&&void 0!==e.stack){c=!0;break}if(s.stacked||c){var f={};for(t=0;t<u.length;t++){var g=[(e=l.getDatasetMeta(t)).type,void 0===s.stacked&&void 0===e.stack?t:"",e.stack].join(".");if(l.isDatasetVisible(t)&&h(e))for(void 0===f[g]&&(f[g]=[]),a=0,r=(i=u[t].data).length;a<r;a++){var p=f[g];n=o._parseValue(i[a]),isNaN(n.min)||isNaN(n.max)||e.data[a].hidden||n.min<0||n.max<0||(p[a]=p[a]||0,p[a]+=n.max)}}H.each(f,function(t){if(t.length>0){var e=H.min(t),n=H.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}})}else for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&h(e))for(a=0,r=(i=u[t].data).length;a<r;a++)n=o._parseValue(i[a]),isNaN(n.min)||isNaN(n.max)||e.data[a].hidden||n.min<0||n.max<0||(o.min=Math.min(n.min,o.min),o.max=Math.max(n.max,o.max),0!==n.min&&(o.minNotZero=Math.min(n.min,o.minNotZero)));o.min=H.isFinite(o.min)?o.min:null,o.max=H.isFinite(o.max)?o.max:null,o.minNotZero=H.isFinite(o.minNotZero)?o.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;t.min=Fn(e.min,t.min),t.max=Fn(e.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(Tn(t.min))-1),t.max=Math.pow(10,Math.floor(Tn(t.max))+1)):(t.min=1,t.max=10)),null===t.min&&(t.min=Math.pow(10,Math.floor(Tn(t.max))-1)),null===t.max&&(t.max=0!==t.min?Math.pow(10,Math.floor(Tn(t.min))+1):10),null===t.minNotZero&&(t.min>0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(Tn(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:Fn(e.min),max:Fn(e.max)},a=t.ticks=function(t,e){var n,i,a=[],r=Dn(t.min,Math.pow(10,Math.floor(Tn(e.min)))),o=Math.floor(Tn(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(Tn(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(r),r=i*Math.pow(10,n)):(n=Math.floor(Tn(r)),i=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(r),10==++i&&(i=1,l=++n>=0?1:l),r=Math.round(i*Math.pow(10,n)*l)/l}while(n<o||n===o&&i<s);var u=Dn(t.max,r);return a.push(u),a}(i,t);t.max=H.max(a),t.min=H.min(a),e.reverse?(n=!n,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),vn.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){var e=this.tickValues;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(Tn(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;vn.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=Dn(t.options.ticks.fontSize,N.global.defaultFontSize)/t._length),t._startValue=Tn(e),t._valueOffset=n,t._valueRange=(Tn(t.max)-Tn(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(Tn(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}}),Ln=In;On._defaults=Ln;var Rn=H.valueOrDefault,zn=H.valueAtIndexOrDefault,Nn=H.options.resolve,Bn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:nn.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function En(t){var e=t.ticks;return e.display&&t.display?Rn(e.fontSize,N.global.defaultFontSize)+2*e.backdropPaddingY:0}function Wn(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||t>a?{start:e-n,end:e}:{start:e,end:e+n}}function Vn(t){return 0===t||180===t?"center":t<180?"left":"right"}function Hn(t,e,n,i){var a,r,o=n.y+i/2;if(H.isArray(e))for(a=0,r=e.length;a<r;++a)t.fillText(e[a],n.x,o),o+=i;else t.fillText(e,n.x,o)}function jn(t,e,n){90===t||270===t?n.y-=e.h/2:(t>270||t<90)&&(n.y-=e.h)}function qn(t){return H.isNumber(t)?t:0}var Un=wn.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=En(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;H.each(e.data.datasets,function(a,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);H.each(a.data,function(e,a){var r=+t.getRightValue(e);isNaN(r)||o.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))})}}),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/En(this.options))},convertTicksToLabels:function(){var t=this;wn.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map(function(){var e=H.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""})},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,n,i,a=H.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,u,d=t.chart.data.labels.length;for(e=0;e<d;e++){i=t.getPointPosition(e,t.drawingArea+5),s=t.ctx,l=a.lineHeight,u=t.pointLabels[e],n=H.isArray(u)?{w:H.longestText(s,s.font,u),h:u.length*l}:{w:s.measureText(u).width,h:l},t._pointLabelSizes[e]=n;var h=t.getIndexAngle(e),c=H.toDegrees(h)%360,f=Wn(c,i.x,n.w,0,180),g=Wn(c,i.y,n.h,90,270);f.start<r.l&&(r.l=f.start,o.l=h),f.end>r.r&&(r.r=f.end,o.r=h),g.start<r.t&&(r.t=g.start,o.t=h),g.end>r.b&&(r.b=g.end,o.b=h)}t.setReductions(t.drawingArea,r,o)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);a=qn(a),r=qn(r),o=qn(o),s=qn(s),i.drawingArea=Math.min(Math.floor(t-(a+r)/2),Math.floor(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,n,i){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=n+a.drawingArea,l=a.height-a.paddingTop-i-a.drawingArea;a.xCenter=Math.floor((o+r)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){var e=this.chart,n=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(H.isNullOrUndef(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this.min,n=this.max;return this.getPointPositionForValue(t||0,this.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},_drawGrid:function(){var t,e,n,i=this,a=i.ctx,r=i.options,o=r.gridLines,s=r.angleLines,l=Rn(s.lineWidth,o.lineWidth),u=Rn(s.color,o.color);if(r.pointLabels.display&&function(t){var e=t.ctx,n=t.options,i=n.pointLabels,a=En(n),r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=H.options._parseFont(i);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?a/2:0,u=t.getPointPosition(s,r+l+5),d=zn(i.fontColor,s,N.global.defaultFontColor);e.fillStyle=d;var h=t.getIndexAngle(s),c=H.toDegrees(h);e.textAlign=Vn(c),jn(c,t._pointLabelSizes[s],u),Hn(e,t.pointLabels[s],u,o.lineHeight)}e.restore()}(i),o.display&&H.each(i.ticks,function(t,n){0!==n&&(e=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),function(t,e,n,i){var a,r=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=zn(e.color,i-1),u=zn(e.lineWidth,i-1);if((o||s)&&l&&u){if(r.save(),r.strokeStyle=l,r.lineWidth=u,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{a=t.getPointPosition(0,n),r.moveTo(a.x,a.y);for(var d=1;d<s;d++)a=t.getPointPosition(d,n),r.lineTo(a.x,a.y)}r.closePath(),r.stroke(),r.restore()}}(i,o,e,n))}),s.display&&l&&u){for(a.save(),a.lineWidth=l,a.strokeStyle=u,a.setLineDash&&(a.setLineDash(Nn([s.borderDash,o.borderDash,[]])),a.lineDashOffset=Nn([s.borderDashOffset,o.borderDashOffset,0])),t=i.chart.data.labels.length-1;t>=0;t--)e=i.getDistanceFromCenterForValue(r.ticks.reverse?i.min:i.max),n=i.getPointPosition(t,e),a.beginPath(),a.moveTo(i.xCenter,i.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var i,a,r=t.getIndexAngle(0),o=H.options._parseFont(n),s=Rn(n.fontColor,N.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",H.each(t.ticks,function(r,l){(0!==l||n.reverse)&&(i=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(a=e.measureText(r).width,e.fillStyle=n.backdropColor,e.fillRect(-a/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(r,0,-i))}),e.restore()}},_drawTitle:H.noop}),Yn=Bn;Un._defaults=Yn;var Gn=H._deprecated,Xn=H.options.resolve,Kn=H.valueOrDefault,Zn=Number.MIN_SAFE_INTEGER||-9007199254740991,$n=Number.MAX_SAFE_INTEGER||9007199254740991,Jn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Qn=Object.keys(Jn);function ti(t,e){return t-e}function ei(t){return H.valueOrDefault(t.time.min,t.ticks.min)}function ni(t){return H.valueOrDefault(t.time.max,t.ticks.max)}function ii(t,e,n,i){var a=function(t,e,n){for(var i,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(a=t[(i=o+s>>1)-1]||null,r=t[i],!a)return{lo:null,hi:r};if(r[e]<n)o=i+1;else{if(!(a[e]>n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}(t,e,n),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],o=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=o[e]-r[e],l=s?(n-r[e])/s:0,u=(o[i]-r[i])*l;return r[i]+u}function ai(t,e){var n=t._adapter,i=t.options.time,a=i.parser,r=a||i.format,o=e;return"function"==typeof a&&(o=a(o)),H.isFinite(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(a||"function"!=typeof r||(o=r(e),H.isFinite(o)||(o=n.parse(o))),o)}function ri(t,e){if(H.isNullOrUndef(e))return null;var n=t.options.time,i=ai(t,t.getRightValue(e));return null===i?i:(n.round&&(i=+t._adapter.startOf(i,n.round)),i)}function oi(t,e,n,i){var a,r,o,s=Qn.length;for(a=Qn.indexOf(t);a<s-1;++a)if(o=(r=Jn[Qn[a]]).steps?r.steps:$n,r.common&&Math.ceil((n-e)/(o*r.size))<=i)return Qn[a];return Qn[s-1]}function si(t,e,n){var i,a,r=[],o={},s=e.length;for(i=0;i<s;++i)o[a=e[i]]=i,r.push({value:a,major:!1});return 0!==s&&n?function(t,e,n,i){var a,r,o=t._adapter,s=+o.startOf(e[0].value,i),l=e[e.length-1].value;for(a=s;a<=l;a=+o.add(a,1,i))(r=n[a])>=0&&(e[r].major=!0);return e}(t,r,o,n):r}var li=vn.extend({initialize:function(){this.mergeTicksOptions(),vn.prototype.initialize.call(this)},update:function(){var t=this.options,e=t.time||(t.time={}),n=this._adapter=new en._date(t.adapters.date);return Gn("time scale",e.format,"time.format","time.parser"),Gn("time scale",e.min,"time.min","ticks.min"),Gn("time scale",e.max,"time.max","ticks.max"),H.mergeIf(e.displayFormats,n.formats()),vn.prototype.update.apply(this,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),vn.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,i,a,r,o,s=this,l=s.chart,u=s._adapter,d=s.options,h=d.time.unit||"day",c=$n,f=Zn,g=[],p=[],m=[],v=s._getLabels();for(t=0,n=v.length;t<n;++t)m.push(ri(s,v[t]));for(t=0,n=(l.data.datasets||[]).length;t<n;++t)if(l.isDatasetVisible(t))if(a=l.data.datasets[t].data,H.isObject(a[0]))for(p[t]=[],e=0,i=a.length;e<i;++e)r=ri(s,a[e]),g.push(r),p[t][e]=r;else p[t]=m.slice(0),o||(g=g.concat(m),o=!0);else p[t]=[];m.length&&(c=Math.min(c,m[0]),f=Math.max(f,m[m.length-1])),g.length&&(g=n>1?function(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e<n;++e)a[i=t[e]]||(a[i]=!0,r.push(i));return r}(g).sort(ti):g.sort(ti),c=Math.min(c,g[0]),f=Math.max(f,g[g.length-1])),c=ri(s,ei(d))||c,f=ri(s,ni(d))||f,c=c===$n?+u.startOf(Date.now(),h):c,f=f===Zn?+u.endOf(Date.now(),h)+1:f,s.min=Math.min(c,f),s.max=Math.max(c+1,f),s._table=[],s._timestamps={data:g,datasets:p,labels:m}},buildTicks:function(){var t,e,n,i=this,a=i.min,r=i.max,o=i.options,s=o.ticks,l=o.time,u=i._timestamps,d=[],h=i.getLabelCapacity(a),c=s.source,f=o.distribution;for(u="data"===c||"auto"===c&&"series"===f?u.data:"labels"===c?u.labels:function(t,e,n,i){var a,r=t._adapter,o=t.options,s=o.time,l=s.unit||oi(s.minUnit,e,n,i),u=Xn([s.stepSize,s.unitStepSize,1]),d="week"===l&&s.isoWeekday,h=e,c=[];if(d&&(h=+r.startOf(h,"isoWeek",d)),h=+r.startOf(h,d?"day":l),r.diff(n,e,l)>1e5*u)throw e+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=h;a<n;a=+r.add(a,u,l))c.push(a);return a!==n&&"ticks"!==o.bounds||c.push(a),c}(i,a,r,h),"ticks"===o.bounds&&u.length&&(a=u[0],r=u[u.length-1]),a=ri(i,ei(o))||a,r=ri(i,ni(o))||r,t=0,e=u.length;t<e;++t)(n=u[t])>=a&&n<=r&&d.push(n);return i.min=a,i.max=r,i._unit=l.unit||(s.autoSkip?oi(l.minUnit,i.min,i.max,h):function(t,e,n,i,a){var r,o;for(r=Qn.length-1;r>=Qn.indexOf(n);r--)if(o=Qn[r],Jn[o].common&&t._adapter.diff(a,i,o)>=e-1)return o;return Qn[n?Qn.indexOf(n):0]}(i,d.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?function(t){for(var e=Qn.indexOf(t)+1,n=Qn.length;e<n;++e)if(Jn[Qn[e]].common)return Qn[e]}(i._unit):void 0,i._table=function(t,e,n,i){if("linear"===i||!t.length)return[{time:e,pos:0},{time:n,pos:1}];var a,r,o,s,l,u=[],d=[e];for(a=0,r=t.length;a<r;++a)(s=t[a])>e&&s<n&&d.push(s);for(d.push(n),a=0,r=d.length;a<r;++a)l=d[a+1],o=d[a-1],s=d[a],void 0!==o&&void 0!==l&&Math.round((l+o)/2)===s||u.push({time:s,pos:a/(r-1)});return u}(i._timestamps.data,a,r,f),i._offsets=function(t,e,n,i,a){var r,o,s=0,l=0;return a.offset&&e.length&&(r=ii(t,"time",e[0],"pos"),s=1===e.length?1-r:(ii(t,"time",e[1],"pos")-r)/2,o=ii(t,"time",e[e.length-1],"pos"),l=1===e.length?o:(o-ii(t,"time",e[e.length-2],"pos"))/2),{start:s,end:l,factor:1/(s+1+l)}}(i._table,d,0,0,o),s.reverse&&d.reverse(),si(i,d,i._majorUnit)},getLabelForIndex:function(t,e){var n=this,i=n._adapter,a=n.chart.data,r=n.options.time,o=a.labels&&t<a.labels.length?a.labels[t]:"",s=a.datasets[e].data[t];return H.isObject(s)&&(o=n.getRightValue(s)),r.tooltipFormat?i.format(ai(n,o),r.tooltipFormat):"string"==typeof o?o:i.format(ai(n,o),r.displayFormats.datetime)},tickFormatFunction:function(t,e,n,i){var a=this._adapter,r=this.options,o=r.time.displayFormats,s=o[this._unit],l=this._majorUnit,u=o[l],d=n[e],h=r.ticks,c=l&&u&&d&&d.major,f=a.format(t,i||(c?u:s)),g=c?h.major:h.minor,p=Xn([g.callback,g.userCallback,h.callback,h.userCallback]);return p?p(f,e,n):f},convertTicksToLabels:function(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(this.tickFormatFunction(t[e].value,e,t));return i},getPixelForOffset:function(t){var e=this._offsets,n=ii(this._table,"time",t,"pos");return this.getPixelForDecimal((e.start+n)*e.factor)},getPixelForValue:function(t,e,n){var i=null;if(void 0!==e&&void 0!==n&&(i=this._timestamps.datasets[n][e]),null===i&&(i=ri(this,t)),null!==i)return this.getPixelForOffset(i)},getPixelForTick:function(t){var e=this.getTicks();return t>=0&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end,i=ii(this._table,"pos",n,"time");return this._adapter._create(i)},_getLabelSize:function(t){var e=this.options.ticks,n=this.ctx.measureText(t).width,i=H.toRadians(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(i),r=Math.sin(i),o=Kn(e.fontSize,N.global.defaultFontSize);return{w:n*a+o*r,h:n*r+o*a}},getLabelWidth:function(t){return this._getLabelSize(t).w},getLabelCapacity:function(t){var e=this,n=e.options.time,i=n.displayFormats,a=i[n.unit]||i.millisecond,r=e.tickFormatFunction(t,0,si(e,[t],e._majorUnit),a),o=e._getLabelSize(r),s=Math.floor(e.isHorizontal()?e.width/o.w:e.height/o.h);return e.options.offset&&s--,s>0?s:1}}),ui={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};li._defaults=ui;var di={category:xn,linear:Pn,logarithmic:On,radialLinear:Un,time:li},hi={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};en._date.override("function"==typeof t?{_id:"moment",formats:function(){return hi},parse:function(e,n){return"string"==typeof e&&"string"==typeof n?e=t(e,n):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,n){return t(e).format(n)},add:function(e,n,i){return t(e).add(n,i).valueOf()},diff:function(e,n,i){return t(e).diff(t(n),i)},startOf:function(e,n,i){return e=t(e),"isoWeek"===n?e.isoWeekday(i).valueOf():e.startOf(n).valueOf()},endOf:function(e,n){return t(e).endOf(n).valueOf()},_create:function(e){return t(e)}}:{}),N._set("global",{plugins:{filler:{propagate:!0}}});var ci={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.dataset._children||[],r=a.length||0;return r?function(t,e){return e<r&&a[e]._view||null}:null},boundary:function(t){var e=t.boundary,n=e?e.x:null,i=e?e.y:null;return H.isArray(e)?function(t,n){return e[n]}:function(t){return{x:null===n?t.x:n,y:null===i?t.y:i}}}};function fi(t,e,n){var i,a=t._model||{},r=a.fill;if(void 0===r&&(r=!!a.backgroundColor),!1===r||null===r)return!1;if(!0===r)return"origin";if(i=parseFloat(r,10),isFinite(i)&&Math.floor(i)===i)return"-"!==r[0]&&"+"!==r[0]||(i=e+i),!(i===e||i<0||i>=n)&&i;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function gi(t){return(t.el._scale||{}).getPointPositionForValue?function(t){var e,n,i,a,r,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,u=t.fill,d=[];if(!l)return null;for(e=s.ticks.reverse?o.max:o.min,n=s.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,e),a=0;a<l;++a)r="start"===u||"end"===u?o.getPointPositionForValue(a,"start"===u?e:n):o.getBasePosition(a),s.gridLines.circular&&(r.cx=i.x,r.cy=i.y,r.angle=o.getIndexAngle(a)-Math.PI/2),d.push(r);return d}(t):function(t){var e,n=t.el._model||{},i=t.el._scale||{},a=t.fill,r=null;if(isFinite(a))return null;if("start"===a?r=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===a?r=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?r=n.scaleZero:i.getBasePixel&&(r=i.getBasePixel()),null!=r){if(void 0!==r.x&&void 0!==r.y)return r;if(H.isFinite(r))return{x:(e=i.isHorizontal())?r:null,y:e?null:r}}return null}(t)}function pi(t,e,n){var i,a=t[e].fill,r=[e];if(!n)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!isFinite(a))return a;if(!(i=t[a]))return!1;if(i.visible)return a;r.push(a),a=i.fill}return!1}function mi(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),ci[n](t))}function vi(t){return t&&!t.skip}function bi(t,e,n,i,a){var r,o,s,l;if(i&&a){for(t.moveTo(e[0].x,e[0].y),r=1;r<i;++r)H.canvas.lineTo(t,e[r-1],e[r]);if(void 0===n[0].angle)for(t.lineTo(n[a-1].x,n[a-1].y),r=a-1;r>0;--r)H.canvas.lineTo(t,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=a-1;r>0;--r)t.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function xi(t,e,n,i,a,r){var o,s,l,u,d,h,c,f,g=e.length,p=i.spanGaps,m=[],v=[],b=0,x=0;for(t.beginPath(),o=0,s=g;o<s;++o)d=n(u=e[l=o%g]._view,l,i),h=vi(u),c=vi(d),r&&void 0===f&&h&&(s=g+(f=o+1)),h&&c?(b=m.push(u),x=v.push(d)):b&&x&&(p?(h&&m.push(u),c&&v.push(d)):(bi(t,m,v,b,x),b=x=0,m=[],v=[]));bi(t,m,v,b,x),t.closePath(),t.fillStyle=a,t.fill()}var yi={id:"filler",afterDatasetsUpdate:function(t,e){var n,i,a,r,o=(t.data.datasets||[]).length,s=e.propagate,l=[];for(i=0;i<o;++i)r=null,(a=(n=t.getDatasetMeta(i)).dataset)&&a._model&&a instanceof kt.Line&&(r={visible:t.isDatasetVisible(i),fill:fi(a,i,o),chart:t,el:a}),n.$filler=r,l.push(r);for(i=0;i<o;++i)(r=l[i])&&(r.fill=pi(l,i,s),r.boundary=gi(r),r.mapper=mi(r))},beforeDatasetsDraw:function(t){var e,n,i,a,r,o,s,l=t._getSortedVisibleDatasetMetas(),u=t.ctx;for(n=l.length-1;n>=0;--n)(e=l[n].$filler)&&e.visible&&(a=(i=e.el)._view,r=i._children||[],o=e.mapper,s=a.backgroundColor||N.global.defaultColor,o&&s&&r.length&&(H.canvas.clipArea(u,t.chartArea),xi(u,r,o,a,s,i._loop),H.canvas.unclipArea(u)))}},_i=H.rtl.getRtlAdapter,ki=H.noop,wi=H.valueOrDefault;function Mi(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}N._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},i=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map(function(n){var a=n.controller.getStyle(i?0:void 0);return{text:e[n.index].label,fillStyle:a.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}},this)}}},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data.datasets;for(a.setAttribute("class",t.id+"-legend"),e=0,n=r.length;e<n;e++)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=r[e].backgroundColor,r[e].label&&i.appendChild(document.createTextNode(r[e].label));return a.outerHTML}});var Si=K.extend({initialize:function(t){H.extend(this,t),this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1},beforeUpdate:ki,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:ki,beforeSetDimensions:ki,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:ki,beforeBuildLabels:ki,buildLabels:function(){var t=this,e=t.options.labels||{},n=H.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter(function(n){return e.filter(n,t.chart.data)})),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:ki,beforeFit:ki,fit:function(){var t=this,e=t.options,n=e.labels,i=e.display,a=t.ctx,r=H.options._parseFont(n),o=r.size,s=t.legendHitBoxes=[],l=t.minSize,u=t.isHorizontal();if(u?(l.width=t.maxWidth,l.height=i?10:0):(l.width=i?10:0,l.height=t.maxHeight),i){if(a.font=r.string,u){var d=t.lineWidths=[0],h=0;a.textAlign="left",a.textBaseline="middle",H.each(t.legendItems,function(t,e){var i=Mi(n,o)+o/2+a.measureText(t.text).width;(0===e||d[d.length-1]+i+2*n.padding>l.width)&&(h+=o+n.padding,d[d.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:i,height:o},d[d.length-1]+=i+n.padding}),l.height+=h}else{var c=n.padding,f=t.columnWidths=[],g=t.columnHeights=[],p=n.padding,m=0,v=0;H.each(t.legendItems,function(t,e){var i=Mi(n,o)+o/2+a.measureText(t.text).width;e>0&&v+o+2*c>l.height&&(p+=m+n.padding,f.push(m),g.push(v),m=0,v=0),m=Math.max(m,i),v+=o+c,s[e]={left:0,top:0,width:i,height:o}}),p+=m,f.push(m),g.push(v),l.width+=p}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:ki,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=N.global,a=i.defaultColor,r=i.elements.line,o=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var d,h=_i(e.rtl,t.left,t.minSize.width),c=t.ctx,f=wi(n.fontColor,i.defaultFontColor),g=H.options._parseFont(n),p=g.size;c.textAlign=h.textAlign("left"),c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=g.string;var m=Mi(n,p),v=t.legendHitBoxes,b=function(t,i){switch(e.align){case"start":return n.padding;case"end":return t-i;default:return(t-i+n.padding)/2}},x=t.isHorizontal();d=x?{x:t.left+b(l,u[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+b(o,s[0]),line:0},H.rtl.overrideTextDirection(t.ctx,e.textDirection);var y=p+n.padding;H.each(t.legendItems,function(e,i){var f=c.measureText(e.text).width,g=m+p/2+f,_=d.x,k=d.y;h.setWidth(t.minSize.width),x?i>0&&_+g+n.padding>t.left+t.minSize.width&&(k=d.y+=y,d.line++,_=d.x=t.left+b(l,u[d.line])):i>0&&k+y>t.top+t.minSize.height&&(_=d.x=_+t.columnWidths[d.line]+n.padding,d.line++,k=d.y=t.top+b(o,s[d.line]));var w=h.x(_);!function(t,e,i){if(!(isNaN(m)||m<=0)){c.save();var o=wi(i.lineWidth,r.borderWidth);if(c.fillStyle=wi(i.fillStyle,a),c.lineCap=wi(i.lineCap,r.borderCapStyle),c.lineDashOffset=wi(i.lineDashOffset,r.borderDashOffset),c.lineJoin=wi(i.lineJoin,r.borderJoinStyle),c.lineWidth=o,c.strokeStyle=wi(i.strokeStyle,a),c.setLineDash&&c.setLineDash(wi(i.lineDash,r.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=h.xPlus(t,m/2),u=e+p/2;H.canvas.drawPoint(c,i.pointStyle,s,l,u,i.rotation)}else c.fillRect(h.leftForLtr(t,m),e,m,p),0!==o&&c.strokeRect(h.leftForLtr(t,m),e,m,p);c.restore()}}(w,k,e),v[i].left=h.leftForLtr(w,v[i].width),v[i].top=k,function(t,e,n,i){var a=p/2,r=h.xPlus(t,m+a),o=e+a;c.fillText(n.text,r,o),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(r,o),c.lineTo(h.xPlus(r,i),o),c.stroke())}(w,k,e,f),x?d.x+=g+n.padding:d.y+=y}),H.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,i,a,r=this;if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)for(a=r.legendHitBoxes,n=0;n<a.length;++n)if(t>=(i=a[n]).left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return r.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!i.onHover&&!i.onLeave)return}else{if("click"!==a)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===a?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function Ci(t,e){var n=new Si({ctx:t.ctx,options:e,chart:t});fe.configure(t,n,e),fe.addBox(t,n),t.legend=n}var Pi={id:"legend",_element:Si,beforeInit:function(t){var e=t.options.legend;e&&Ci(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(H.mergeIf(e,N.global.legend),n?(fe.configure(t,n,e),n.options=e):Ci(t,e)):n&&(fe.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Ai=H.noop;N._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Di=K.extend({initialize:function(t){H.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:Ai,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:Ai,beforeSetDimensions:Ai,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Ai,beforeBuildLabels:Ai,buildLabels:Ai,afterBuildLabels:Ai,beforeFit:Ai,fit:function(){var t,e=this,n=e.options,i=e.minSize={},a=e.isHorizontal();n.display?(t=(H.isArray(n.text)?n.text.length:1)*H.options._parseFont(n).lineHeight+2*n.padding,e.width=i.width=a?e.maxWidth:t,e.height=i.height=a?t:e.maxHeight):e.width=i.width=e.height=i.height=0},afterFit:Ai,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,a,r,o=H.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,d=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=H.valueOrDefault(n.fontColor,N.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(a=h+(f-h)/2,r=d+l,i=f-h):(a="left"===n.position?h+l:f-l,r=d+(c-d)/2,i=c-d,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(a,r),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(H.isArray(g))for(var p=0,m=0;m<g.length;++m)e.fillText(g[m],0,p,i),p+=s;else e.fillText(g,0,0,i);e.restore()}}});function Ti(t,e){var n=new Di({ctx:t.ctx,options:e,chart:t});fe.configure(t,n,e),fe.addBox(t,n),t.titleBlock=n}var Ii={},Fi=yi,Oi=Pi,Li={id:"title",_element:Di,beforeInit:function(t){var e=t.options.title;e&&Ti(t,e)},beforeUpdate:function(t){var e=t.options.title,n=t.titleBlock;e?(H.mergeIf(e,N.global.title),n?(fe.configure(t,n,e),n.options=e):Ti(t,e)):n&&(fe.removeBox(t,n),delete t.titleBlock)}};for(var Ri in Ii.filler=Fi,Ii.legend=Oi,Ii.title=Li,Je.helpers=H,function(){function t(t,e,n){var i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}function e(t){return null!=t&&"none"!==t}function n(n,i,a){var r=document.defaultView,o=H._getParentNode(n),s=r.getComputedStyle(n)[i],l=r.getComputedStyle(o)[i],u=e(s),d=e(l),h=Number.POSITIVE_INFINITY;return u||d?Math.min(u?t(s,n,a):h,d?t(l,o,a):h):"none"}H.where=function(t,e){if(H.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return H.each(t,function(t){e(t)&&n.push(t)}),n},H.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var i=0,a=t.length;i<a;++i)if(e.call(n,t[i],i,t))return i;return-1},H.findNextWhere=function(t,e,n){H.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<t.length;i++){var a=t[i];if(e(a))return a}},H.findPreviousWhere=function(t,e,n){H.isNullOrUndef(n)&&(n=t.length);for(var i=n-1;i>=0;i--){var a=t[i];if(e(a))return a}},H.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},H.almostEquals=function(t,e,n){return Math.abs(t-e)<n},H.almostWhole=function(t,e){var n=Math.round(t);return n-e<=t&&n+e>=t},H.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},H.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},H.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},H.toRadians=function(t){return t*(Math.PI/180)},H.toDegrees=function(t){return t*(180/Math.PI)},H._decimalPlaces=function(t){if(H.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},H.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},H.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},H.aliasPixel=function(t){return t%2==0?0:.5},H._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,a=n/2;return Math.round((e-a)*i)/i+a},H.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l),h=i*(u=isNaN(u)?0:u),c=i*(d=isNaN(d)?0:d);return{previous:{x:r.x-h*(o.x-a.x),y:r.y-h*(o.y-a.y)},next:{x:r.x+c*(o.x-a.x),y:r.y+c*(o.y-a.y)}}},H.EPSILON=Number.EPSILON||1e-14,H.splineCurveMonotone=function(t){var e,n,i,a,r,o,s,l,u,d=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),h=d.length;for(e=0;e<h;++e)if(!(i=d[e]).model.skip){if(n=e>0?d[e-1]:null,(a=e<h-1?d[e+1]:null)&&!a.model.skip){var c=a.model.x-i.model.x;i.deltaK=0!==c?(a.model.y-i.model.y)/c:0}!n||n.model.skip?i.mK=i.deltaK:!a||a.model.skip?i.mK=n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?i.mK=0:i.mK=(n.deltaK+i.deltaK)/2}for(e=0;e<h-1;++e)i=d[e],a=d[e+1],i.model.skip||a.model.skip||(H.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=a.mK=0:(r=i.mK/i.deltaK,o=a.mK/i.deltaK,(l=Math.pow(r,2)+Math.pow(o,2))<=9||(s=3/Math.sqrt(l),i.mK=r*s*i.deltaK,a.mK=o*s*i.deltaK)));for(e=0;e<h;++e)(i=d[e]).model.skip||(n=e>0?d[e-1]:null,a=e<h-1?d[e+1]:null,n&&!n.model.skip&&(u=(i.model.x-n.model.x)/3,i.model.controlPointPreviousX=i.model.x-u,i.model.controlPointPreviousY=i.model.y-u*i.mK),a&&!a.model.skip&&(u=(a.model.x-i.model.x)/3,i.model.controlPointNextX=i.model.x+u,i.model.controlPointNextY=i.model.y+u*i.mK))},H.nextItem=function(t,e,n){return n?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},H.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},H.niceNum=function(t,e){var n=Math.floor(H.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},H.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},H.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var l=parseFloat(H.getStyle(r,"padding-left")),u=parseFloat(H.getStyle(r,"padding-top")),d=parseFloat(H.getStyle(r,"padding-right")),h=parseFloat(H.getStyle(r,"padding-bottom")),c=o.right-o.left-l-d,f=o.bottom-o.top-u-h;return{x:n=Math.round((n-o.left-l)/c*r.width/e.currentDevicePixelRatio),y:i=Math.round((i-o.top-u)/f*r.height/e.currentDevicePixelRatio)}},H.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},H.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},H._calculatePadding=function(t,e,n){return(e=H.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},H._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},H.getMaximumWidth=function(t){var e=H._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-H._calculatePadding(e,"padding-left",n)-H._calculatePadding(e,"padding-right",n),a=H.getConstraintWidth(t);return isNaN(a)?i:Math.min(i,a)},H.getMaximumHeight=function(t){var e=H._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-H._calculatePadding(e,"padding-top",n)-H._calculatePadding(e,"padding-bottom",n),a=H.getConstraintHeight(t);return isNaN(a)?i:Math.min(i,a)},H.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},H.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=a+"px",i.style.width=r+"px")}},H.fontString=function(t,e,n){return e+" "+t+"px "+n},H.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var o,s,l,u,d,h=0,c=n.length;for(o=0;o<c;o++)if(null!=(u=n[o])&&!0!==H.isArray(u))h=H.measureText(t,a,r,h,u);else if(H.isArray(u))for(s=0,l=u.length;s<l;s++)null==(d=u[s])||H.isArray(d)||(h=H.measureText(t,a,r,h,d));var f=r.length/2;if(f>n.length){for(o=0;o<f;o++)delete a[r[o]];r.splice(0,f)}return h},H.measureText=function(t,e,n,i,a){var r=e[a];return r||(r=e[a]=t.measureText(a).width,n.push(a)),r>i&&(i=r),i},H.numberOfLabelLines=function(t){var e=1;return H.each(t,function(t){H.isArray(t)&&t.length>e&&(e=t.length)}),e},H.color=w?function(t){return t instanceof CanvasGradient&&(t=N.global.defaultColor),w(t)}:function(t){return console.error("Color.js not found!"),t},H.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:H.color(t).saturate(.5).darken(.1).rgbString()}}(),Je._adapters=en,Je.Animation=$,Je.animationService=J,Je.controllers=Zt,Je.DatasetController=it,Je.defaults=N,Je.Element=K,Je.elements=kt,Je.Interaction=ie,Je.layouts=fe,Je.platform=Ie,Je.plugins=Fe,Je.Scale=vn,Je.scaleService=Oe,Je.Ticks=nn,Je.Tooltip=qe,Je.helpers.each(di,function(t,e){Je.scaleService.registerScaleType(e,t,t._defaults)}),Ii)Ii.hasOwnProperty(Ri)&&Je.plugins.register(Ii[Ri]);Je.platform.initialize();var zi=Je;return"undefined"!=typeof window&&(window.Chart=Je),Je.Chart=Je,Je.Legend=Ii.legend._element,Je.Title=Ii.title._element,Je.pluginService=Je.plugins,Je.PluginBase=Je.Element.extend({}),Je.canvasHelpers=Je.helpers.canvas,Je.layoutService=Je.layouts,Je.LinearScaleBase=wn,Je.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(t){Je[t]=function(e,n){return new Je(e,Je.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}}),zi}); },{"moment":"iROh"}],"RkNv":[function(require,module,exports) { var define; var e;!function(o){"function"==typeof e&&e.amd?e(["jquery"],o):"object"==typeof exports?o(require("jquery")):o(jQuery)}(function(e){var o=/\+/g;function n(e){return t.raw?e:encodeURIComponent(e)}function i(e){return n(t.json?JSON.stringify(e):String(e))}function r(n,i){var r=t.raw?n:function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(o," ")),t.json?JSON.parse(e):e}catch(n){}}(n);return e.isFunction(i)?i(r):r}var t=e.cookie=function(o,c,u){if(void 0!==c&&!e.isFunction(c)){if("number"==typeof(u=e.extend({},t.defaults,u)).expires){var a=u.expires,p=u.expires=new Date;p.setTime(+p+864e5*a)}return document.cookie=[n(o),"=",i(c),u.expires?"; expires="+u.expires.toUTCString():"",u.path?"; path="+u.path:"",u.domain?"; domain="+u.domain:"",u.secure?"; secure":""].join("")}for(var s,d=o?void 0:{},f=document.cookie?document.cookie.split("; "):[],m=0,v=f.length;m<v;m++){var x=f[m].split("="),k=(s=x.shift(),t.raw?s:decodeURIComponent(s)),l=x.join("=");if(o&&o===k){d=r(l,c);break}o||void 0===(l=r(l))||(d[k]=l)}return d};t.defaults={},e.removeCookie=function(o,n){return void 0!==e.cookie(o)&&(e.cookie(o,"",e.extend({},n,{expires:-1})),!e.cookie(o))}}); },{"jquery":"HlZQ"}],"f12I":[function(require,module,exports) { var define; var t;!function(e){"use strict";"function"==typeof t&&t.amd?t(["jquery"],e):e(jQuery)}(function(t){"use strict";var e=[],s=[],o={precision:100,elapse:!1,defer:!1};s.push(/^[0-9]*$/.source),s.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),s.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),s=new RegExp(s.join("|"));var i={Y:"years",m:"months",n:"daysToMonth",d:"daysToWeek",w:"weeks",W:"weeksToMonth",H:"hours",M:"minutes",S:"seconds",D:"totalDays",I:"totalHours",N:"totalMinutes",T:"totalSeconds"};function n(t,e){var s="s",o="";return t&&(1===(t=t.replace(/(:|;|\s)/gi,"").split(/\,/)).length?s=t[0]:(o=t[0],s=t[1])),Math.abs(e)>1?s:o}var a=function(s,i,n){this.el=s,this.$el=t(s),this.interval=null,this.offset={},this.options=t.extend({},o),this.instanceNumber=e.length,e.push(this),this.$el.data("countdown-instance",this.instanceNumber),n&&("function"==typeof n?(this.$el.on("update.countdown",n),this.$el.on("stoped.countdown",n),this.$el.on("finish.countdown",n)):this.options=t.extend({},o,n)),this.setFinalDate(i),!1===this.options.defer&&this.start()};t.extend(a.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var t=this;this.update(),this.interval=setInterval(function(){t.update.call(t)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),e[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(t){this.finalDate=function(t){if(t instanceof Date)return t;if(String(t).match(s))return String(t).match(/^[0-9]*$/)&&(t=Number(t)),String(t).match(/\-/)&&(t=String(t).replace(/\-/g,"/")),new Date(t);throw new Error("Couldn't cast `"+t+"` to a date object.")}(t)},update:function(){if(0!==this.$el.closest("html").length){var e,s=void 0!==t._data(this.el,"events"),o=new Date;e=this.finalDate.getTime()-o.getTime(),e=Math.ceil(e/1e3),e=!this.options.elapse&&e<0?0:Math.abs(e),this.totalSecsLeft!==e&&s&&(this.totalSecsLeft=e,this.elapsed=o>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),weeksToMonth:Math.floor(this.totalSecsLeft/60/60/24/7)%4,months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-o.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/60/60/24),totalHours:Math.floor(this.totalSecsLeft/60/60),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft},this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish")))}else this.remove()},dispatchEvent:function(e){var s,o=t.Event(e+".countdown");o.finalDate=this.finalDate,o.elapsed=this.elapsed,o.offset=t.extend({},this.offset),o.strftime=(s=this.offset,function(t){var e,o,a=t.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(a)for(var h=0,l=a.length;h<l;++h){var r=a[h].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),c=(e=r[0],o=void 0,o=e.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),new RegExp(o)),f=r[1]||"",u=r[3]||"",p=null;r=r[2],i.hasOwnProperty(r)&&(p=i[r],p=Number(s[p])),null!==p&&("!"===f&&(p=n(u,p)),""===f&&p<10&&(p="0"+p.toString()),t=t.replace(c,p.toString()))}return t=t.replace(/%%/,"%")}),this.$el.trigger(o)}}),t.fn.countdown=function(){var s=Array.prototype.slice.call(arguments,0);return this.each(function(){var o=t(this).data("countdown-instance");if(void 0!==o){var i=e[o],n=s[0];a.prototype.hasOwnProperty(n)?i[n].apply(i,s.slice(1)):null===String(n).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(i.setFinalDate.call(i,n),i.start()):t.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,n))}else new a(this,s[0],s[1])})}}); },{}],"uc98":[function(require,module,exports) { var define; var t;!function(i){"function"==typeof t&&t.amd?t(["jquery"],i):i(jQuery)}(function(t){"use strict";var i={},s=Math.max,h=Math.min;i.c={},i.c.d=t(document),i.c.t=function(t){return t.originalEvent.touches.length-1},i.o=function(){var s=this;this.o=null,this.$=null,this.i=null,this.g=null,this.v=null,this.cv=null,this.x=0,this.y=0,this.w=0,this.h=0,this.$c=null,this.c=null,this.t=0,this.isInit=!1,this.fgColor=null,this.pColor=null,this.dH=null,this.cH=null,this.eH=null,this.rH=null,this.scale=1,this.relative=!1,this.relativeWidth=!1,this.relativeHeight=!1,this.$div=null,this.run=function(){var i=function(t,i){var h;for(h in i)s.o[h]=i[h];s._carve().init(),s._configure()._draw()};if(!this.$.data("kontroled")){if(this.$.data("kontroled",!0),this.extend(),this.o=t.extend({min:void 0!==this.$.data("min")?this.$.data("min"):0,max:void 0!==this.$.data("max")?this.$.data("max"):100,stopper:!0,readOnly:this.$.data("readonly")||"readonly"===this.$.attr("readonly"),cursor:(!0===this.$.data("cursor")?30:this.$.data("cursor"))||0,thickness:this.$.data("thickness")&&Math.max(Math.min(this.$.data("thickness"),1),.01)||.35,lineCap:this.$.data("linecap")||"butt",width:this.$.data("width")||200,height:this.$.data("height")||200,displayInput:null==this.$.data("displayinput")||this.$.data("displayinput"),displayPrevious:this.$.data("displayprevious"),fgColor:this.$.data("fgcolor")||"#87CEEB",inputColor:this.$.data("inputcolor"),font:this.$.data("font")||"Arial",fontWeight:this.$.data("font-weight")||"bold",inline:!1,step:this.$.data("step")||1,rotation:this.$.data("rotation"),draw:null,change:null,cancel:null,release:null,format:function(t){return t},parse:function(t){return parseFloat(t)}},this.o),this.o.flip="anticlockwise"===this.o.rotation||"acw"===this.o.rotation,this.o.inputColor||(this.o.inputColor=this.o.fgColor),this.$.is("fieldset")?(this.v={},this.i=this.$.find("input"),this.i.each(function(i){var h=t(this);s.i[i]=h,s.v[i]=s.o.parse(h.val()),h.bind("change blur",function(){var t={};t[i]=h.val(),s.val(s._validate(t))})}),this.$.find("legend").remove()):(this.i=this.$,this.v=this.o.parse(this.$.val()),""===this.v&&(this.v=this.o.min),this.$.bind("change blur",function(){s.val(s._validate(s.o.parse(s.$.val())))})),!this.o.displayInput&&this.$.hide(),this.$c=t(document.createElement("canvas")).attr({width:this.o.width,height:this.o.height}),this.$div=t('<div style="'+(this.o.inline?"display:inline;":"")+"width:"+this.o.width+"px;height:"+this.o.height+'px;"></div>'),this.$.wrap(this.$div).before(this.$c),this.$div=this.$.parent(),"undefined"!=typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(this.$c[0]),this.c=this.$c[0].getContext?this.$c[0].getContext("2d"):null,!this.c)throw{name:"CanvasNotSupportedException",message:"Canvas not supported. Please use excanvas on IE8.0.",toString:function(){return this.name+": "+this.message}};return this.scale=(window.devicePixelRatio||1)/(this.c.webkitBackingStorePixelRatio||this.c.mozBackingStorePixelRatio||this.c.msBackingStorePixelRatio||this.c.oBackingStorePixelRatio||this.c.backingStorePixelRatio||1),this.relativeWidth=this.o.width%1!=0&&this.o.width.indexOf("%"),this.relativeHeight=this.o.height%1!=0&&this.o.height.indexOf("%"),this.relative=this.relativeWidth||this.relativeHeight,this._carve(),this.v instanceof Object?(this.cv={},this.copy(this.v,this.cv)):this.cv=this.v,this.$.bind("configure",i).parent().bind("configure",i),this._listen()._configure()._xy().init(),this.isInit=!0,this.$.val(this.o.format(this.v)),this._draw(),this}},this._carve=function(){if(this.relative){var t=this.relativeWidth?this.$div.parent().width()*parseInt(this.o.width)/100:this.$div.parent().width(),i=this.relativeHeight?this.$div.parent().height()*parseInt(this.o.height)/100:this.$div.parent().height();this.w=this.h=Math.min(t,i)}else this.w=this.o.width,this.h=this.o.height;return this.$div.css({width:this.w+"px",height:this.h+"px"}),this.$c.attr({width:this.w,height:this.h}),1!==this.scale&&(this.$c[0].width=this.$c[0].width*this.scale,this.$c[0].height=this.$c[0].height*this.scale,this.$c.width(this.w),this.$c.height(this.h)),this},this._draw=function(){var t=!0;s.g=s.c,s.clear(),s.dH&&(t=s.dH()),!1!==t&&s.draw()},this._touch=function(t){var h=function(t){var i=s.xy2val(t.originalEvent.touches[s.t].pageX,t.originalEvent.touches[s.t].pageY);i!=s.cv&&(s.cH&&!1===s.cH(i)||(s.change(s._validate(i)),s._draw()))};return this.t=i.c.t(t),h(t),i.c.d.bind("touchmove.k",h).bind("touchend.k",function(){i.c.d.unbind("touchmove.k touchend.k"),s.val(s.cv)}),this},this._mouse=function(t){var h=function(t){var i=s.xy2val(t.pageX,t.pageY);i!=s.cv&&(s.cH&&!1===s.cH(i)||(s.change(s._validate(i)),s._draw()))};return h(t),i.c.d.bind("mousemove.k",h).bind("keyup.k",function(t){if(27===t.keyCode){if(i.c.d.unbind("mouseup.k mousemove.k keyup.k"),s.eH&&!1===s.eH())return;s.cancel()}}).bind("mouseup.k",function(t){i.c.d.unbind("mousemove.k mouseup.k keyup.k"),s.val(s.cv)}),this},this._xy=function(){var t=this.$c.offset();return this.x=t.left,this.y=t.top,this},this._listen=function(){return this.o.readOnly?this.$.attr("readonly","readonly"):(this.$c.bind("mousedown",function(t){t.preventDefault(),s._xy()._mouse(t)}).bind("touchstart",function(t){t.preventDefault(),s._xy()._touch(t)}),this.listen()),this.relative&&t(window).resize(function(){s._carve().init(),s._draw()}),this},this._configure=function(){return this.o.draw&&(this.dH=this.o.draw),this.o.change&&(this.cH=this.o.change),this.o.cancel&&(this.eH=this.o.cancel),this.o.release&&(this.rH=this.o.release),this.o.displayPrevious?(this.pColor=this.h2rgba(this.o.fgColor,"0.4"),this.fgColor=this.h2rgba(this.o.fgColor,"0.6")):this.fgColor=this.o.fgColor,this},this._clear=function(){this.$c[0].width=this.$c[0].width},this._validate=function(t){var i=~~((t<0?-.5:.5)+t/this.o.step)*this.o.step;return Math.round(100*i)/100},this.listen=function(){},this.extend=function(){},this.init=function(){},this.change=function(t){},this.val=function(t){},this.xy2val=function(t,i){},this.draw=function(){},this.clear=function(){this._clear()},this.h2rgba=function(t,i){var s;return t=t.substring(1,7),"rgba("+(s=[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)])[0]+","+s[1]+","+s[2]+","+i+")"},this.copy=function(t,i){for(var s in t)i[s]=t[s]}},i.Dial=function(){i.o.call(this),this.startAngle=null,this.xy=null,this.radius=null,this.lineWidth=null,this.cursorExt=null,this.w2=null,this.PI2=2*Math.PI,this.extend=function(){this.o=t.extend({bgColor:this.$.data("bgcolor")||"#EEEEEE",angleOffset:this.$.data("angleoffset")||0,angleArc:this.$.data("anglearc")||360,inline:!0},this.o)},this.val=function(t,i){if(null==t)return this.v;t=this.o.parse(t),!1!==i&&t!=this.v&&this.rH&&!1===this.rH(t)||(this.cv=this.o.stopper?s(h(t,this.o.max),this.o.min):t,this.v=this.cv,this.$.val(this.o.format(this.v)),this._draw())},this.xy2val=function(t,i){var n,e;return n=Math.atan2(t-(this.x+this.w2),-(i-this.y-this.w2))-this.angleOffset,this.o.flip&&(n=this.angleArc-n-this.PI2),this.angleArc!=this.PI2&&n<0&&n>-.5?n=0:n<0&&(n+=this.PI2),e=n*(this.o.max-this.o.min)/this.angleArc+this.o.min,this.o.stopper&&(e=s(h(e,this.o.max),this.o.min)),e},this.listen=function(){var i,n,e,a,o=this,r=function(t){t.preventDefault();var e=t.originalEvent,a=e.detail||e.wheelDeltaX,r=e.detail||e.wheelDeltaY,l=o._validate(o.o.parse(o.$.val()))+(a>0||r>0?o.o.step:a<0||r<0?-o.o.step:0);l=s(h(l,o.o.max),o.o.min),o.val(l,!1),o.rH&&(clearTimeout(i),i=setTimeout(function(){o.rH(l),i=null},100),n||(n=setTimeout(function(){i&&o.rH(l),n=null},200)))},l=1,c={37:-o.o.step,38:o.o.step,39:o.o.step,40:-o.o.step};this.$.bind("keydown",function(i){var n=i.keyCode;if(n>=96&&n<=105&&(n=i.keyCode=n-48),e=parseInt(String.fromCharCode(n)),isNaN(e)&&(13!==n&&8!==n&&9!==n&&189!==n&&(190!==n||o.$.val().match(/\./))&&i.preventDefault(),t.inArray(n,[37,38,39,40])>-1)){i.preventDefault();var r=o.o.parse(o.$.val())+c[n]*l;o.o.stopper&&(r=s(h(r,o.o.max),o.o.min)),o.change(o._validate(r)),o._draw(),a=window.setTimeout(function(){l*=2},30)}}).bind("keyup",function(t){isNaN(e)?a&&(window.clearTimeout(a),a=null,l=1,o.val(o.$.val())):o.$.val()>o.o.max&&o.$.val(o.o.max)||o.$.val()<o.o.min&&o.$.val(o.o.min)}),this.$c.bind("mousewheel DOMMouseScroll",r),this.$.bind("mousewheel DOMMouseScroll",r)},this.init=function(){(this.v<this.o.min||this.v>this.o.max)&&(this.v=this.o.min),this.$.val(this.v),this.w2=this.w/2,this.cursorExt=this.o.cursor/100,this.xy=this.w2*this.scale,this.lineWidth=this.xy*this.o.thickness,this.lineCap=this.o.lineCap,this.radius=this.xy-this.lineWidth/2,this.o.angleOffset&&(this.o.angleOffset=isNaN(this.o.angleOffset)?0:this.o.angleOffset),this.o.angleArc&&(this.o.angleArc=isNaN(this.o.angleArc)?this.PI2:this.o.angleArc),this.angleOffset=this.o.angleOffset*Math.PI/180,this.angleArc=this.o.angleArc*Math.PI/180,this.startAngle=1.5*Math.PI+this.angleOffset,this.endAngle=1.5*Math.PI+this.angleOffset+this.angleArc;var t=s(String(Math.abs(this.o.max)).length,String(Math.abs(this.o.min)).length,2)+2;this.o.displayInput&&this.i.css({width:(this.w/2+4>>0)+"px",height:(this.w/3>>0)+"px",position:"absolute","vertical-align":"middle","margin-top":(this.w/3>>0)+"px","margin-left":"-"+(3*this.w/4+2>>0)+"px",border:0,background:"none",font:this.o.fontWeight+" "+(this.w/t>>0)+"px "+this.o.font,"text-align":"center",color:this.o.inputColor||this.o.fgColor,padding:"0px","-webkit-appearance":"none"})||this.i.css({width:"0px",visibility:"hidden"})},this.change=function(t){this.cv=t,this.$.val(this.o.format(t))},this.angle=function(t){return(t-this.o.min)*this.angleArc/(this.o.max-this.o.min)},this.arc=function(t){var i,s;return t=this.angle(t),s=this.o.flip?(i=this.endAngle+1e-5)-t-1e-5:(i=this.startAngle-1e-5)+t+1e-5,this.o.cursor&&(i=s-this.cursorExt)&&(s+=this.cursorExt),{s:i,e:s,d:this.o.flip&&!this.o.cursor}},this.draw=function(){var t,i=this.g,s=this.arc(this.cv),h=1;i.lineWidth=this.lineWidth,i.lineCap=this.lineCap,"none"!==this.o.bgColor&&(i.beginPath(),i.strokeStyle=this.o.bgColor,i.arc(this.xy,this.xy,this.radius,this.endAngle-1e-5,this.startAngle+1e-5,!0),i.stroke()),this.o.displayPrevious&&(t=this.arc(this.v),i.beginPath(),i.strokeStyle=this.pColor,i.arc(this.xy,this.xy,this.radius,t.s,t.e,t.d),i.stroke(),h=this.cv==this.v),i.beginPath(),i.strokeStyle=h?this.o.fgColor:this.fgColor,i.arc(this.xy,this.xy,this.radius,s.s,s.e,s.d),i.stroke()},this.cancel=function(){this.val(this.v)}},t.fn.dial=t.fn.knob=function(s){return this.each(function(){var h=new i.Dial;h.o=s,h.$=t(this),h.run()}).parent()}}); },{}],"VWng":[function(require,module,exports) { var define; var t;!function(e){"use strict";"function"==typeof t&&t.amd?t(["jquery"],e):"object"==typeof exports&&"object"==typeof module?module.exports=e(require("jquery")):e(jQuery)}(function(t,e){"use strict";var r={beforeShow:f,move:f,change:f,show:f,hide:f,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!0,showInitial:!1,showPalette:!1,showPaletteOnly:!1,hideAfterPaletteSelect:!1,togglePaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:!1,className:"",containerClassName:"",replacerClassName:"",showAlpha:!1,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:!1,offset:null},a=[],n=!!/msie/i.exec(window.navigator.userAgent),i=function(){function t(t,e){return!!~(""+t).indexOf(e)}var e=document.createElement("div").style;return e.cssText="background-color:rgba(0,0,0,.5)",t(e.backgroundColor,"rgba")||t(e.backgroundColor,"hsla")}(),o=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>▼</div>","</div>"].join(""),s=function(){var t="";if(n)for(var e=1;e<=6;e++)t+="<div class='sp-"+e+"'></div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>","</div>","</div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>","</div>","</div>","</div>","<div class='sp-clear sp-clear-display'>","</div>","<div class='sp-hue'>","<div class='sp-slider'></div>",t,"</div>","</div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>","</div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false' />","</div>","<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>","</div>","</div>","</div>"].join("")}();function l(e,r,a,n){for(var o=[],s=0;s<e.length;s++){var l=e[s];if(l){var c=tinycolor(l),f=c.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";f+=tinycolor.equals(r,l)?" sp-thumb-active":"";var h=c.toString(n.preferredFormat||"rgb"),u=i?"background-color:"+c.toRgbString():"filter:"+c.toFilter();o.push('<span title="'+h+'" data-color="'+c.toRgbString()+'" class="'+f+'"><span class="sp-thumb-inner" style="'+u+';"></span></span>')}else{o.push(t("<div />").append(t('<span data-color="" style="background-color:transparent;" class="sp-clear-display"></span>').attr("title",n.noColorSelectedText)).html())}}return"<div class='sp-cf "+a+"'>"+o.join("")+"</div>"}function c(c,f){var g,b,v,m,y=function(e,a){var n=t.extend({},r,e);return n.callbacks={move:u(n.move,a),change:u(n.change,a),show:u(n.show,a),hide:u(n.hide,a),beforeShow:u(n.beforeShow,a)},n}(f,c),w=y.flat,_=y.showSelectionPalette,x=y.localStorageKey,k=y.theme,S=y.callbacks,C=(g=Kt,b=10,function(){var t=this,e=arguments;v&&clearTimeout(m),!v&&m||(m=setTimeout(function(){m=null,g.apply(t,e)},b))}),P=!1,A=!1,M=0,R=0,H=0,F=0,T=0,O=0,q=0,N=0,j=0,E=0,D=1,I=[],z=[],B={},L=y.selectionPalette.slice(0),K=y.maxSelectionSize,V="sp-dragging",$=null,W=c.ownerDocument,X=(W.body,t(c)),Y=!1,G=t(s,W).addClass(k),Q=G.find(".sp-picker-container"),J=G.find(".sp-color"),U=G.find(".sp-dragger"),Z=G.find(".sp-hue"),tt=G.find(".sp-slider"),et=G.find(".sp-alpha-inner"),rt=G.find(".sp-alpha"),at=G.find(".sp-alpha-handle"),nt=G.find(".sp-input"),it=G.find(".sp-palette"),ot=G.find(".sp-initial"),st=G.find(".sp-cancel"),lt=G.find(".sp-clear"),ct=G.find(".sp-choose"),ft=G.find(".sp-palette-toggle"),ht=X.is("input"),ut=ht&&"color"===X.attr("type")&&p(),dt=ht&&!w,pt=dt?t(o).addClass(k).addClass(y.className).addClass(y.replacerClassName):t([]),gt=dt?pt:X,bt=pt.find(".sp-preview-inner"),vt=y.color||ht&&X.val(),mt=!1,yt=y.preferredFormat,wt=!y.showButtons||y.clickoutFiresChange,_t=!vt,xt=y.allowEmpty&&!ut;function kt(){if(y.showPaletteOnly&&(y.showPalette=!0),ft.text(y.showPaletteOnly?y.togglePaletteMoreText:y.togglePaletteLessText),y.palette){I=y.palette.slice(0),z=t.isArray(I[0])?I:[I],B={};for(var e=0;e<z.length;e++)for(var r=0;r<z[e].length;r++){var a=tinycolor(z[e][r]).toRgbString();B[a]=!0}}G.toggleClass("sp-flat",w),G.toggleClass("sp-input-disabled",!y.showInput),G.toggleClass("sp-alpha-enabled",y.showAlpha),G.toggleClass("sp-clear-enabled",xt),G.toggleClass("sp-buttons-disabled",!y.showButtons),G.toggleClass("sp-palette-buttons-disabled",!y.togglePaletteOnly),G.toggleClass("sp-palette-disabled",!y.showPalette),G.toggleClass("sp-palette-only",y.showPaletteOnly),G.toggleClass("sp-initial-disabled",!y.showInitial),G.addClass(y.className).addClass(y.containerClassName),Kt()}function St(){if(x&&window.localStorage){try{var e=window.localStorage[x].split(",#");e.length>1&&(delete window.localStorage[x],t.each(e,function(t,e){Ct(e)}))}catch(r){}try{L=window.localStorage[x].split(";")}catch(r){}}}function Ct(e){if(_){var r=tinycolor(e).toRgbString();if(!B[r]&&-1===t.inArray(r,L))for(L.push(r);L.length>K;)L.shift();if(x&&window.localStorage)try{window.localStorage[x]=L.join(";")}catch(a){}}}function Pt(){var e=Dt(),r=t.map(z,function(t,r){return l(t,e,"sp-palette-row sp-palette-row-"+r,y)});St(),L&&r.push(l(function(){var t=[];if(y.showPalette)for(var e=0;e<L.length;e++){var r=tinycolor(L[e]).toRgbString();B[r]||t.push(L[e])}return t.reverse().slice(0,y.maxSelectionSize)}(),e,"sp-palette-row sp-palette-row-selection",y)),it.html(r.join(""))}function At(){if(y.showInitial){var t=mt,e=Dt();ot.html(l([t,e],e,"sp-palette-row-initial",y))}}function Mt(){(R<=0||M<=0||F<=0)&&Kt(),A=!0,G.addClass(V),$=null,X.trigger("dragstart.spectrum",[Dt()])}function Rt(){A=!1,G.removeClass(V),X.trigger("dragstop.spectrum",[Dt()])}function Ht(){var t=nt.val();if(null!==t&&""!==t||!xt){var e=tinycolor(t);e.isValid()?(Et(e),It(),Lt()):nt.addClass("sp-validation-error")}else Et(null),It(),Lt()}function Ft(){P?Nt():Tt()}function Tt(){var e=t.Event("beforeShow.spectrum");P?Kt():(X.trigger(e,[Dt()]),!1===S.beforeShow(Dt())||e.isDefaultPrevented()||(!function(){for(var t=0;t<a.length;t++)a[t]&&a[t].hide()}(),P=!0,t(W).on("keydown.spectrum",Ot),t(W).on("click.spectrum",qt),t(window).on("resize.spectrum",C),pt.addClass("sp-active"),G.removeClass("sp-hidden"),Kt(),zt(),mt=Dt(),At(),S.show(mt),X.trigger("show.spectrum",[mt])))}function Ot(t){27===t.keyCode&&Nt()}function qt(t){2!=t.button&&(A||(wt?Lt(!0):jt(),Nt()))}function Nt(){P&&!w&&(P=!1,t(W).off("keydown.spectrum",Ot),t(W).off("click.spectrum",qt),t(window).off("resize.spectrum",C),pt.removeClass("sp-active"),G.addClass("sp-hidden"),S.hide(Dt()),X.trigger("hide.spectrum",[Dt()]))}function jt(){Et(mt,!0),Lt(!0)}function Et(t,e){var r,a;tinycolor.equals(t,Dt())?zt():(!t&&xt?_t=!0:(_t=!1,a=(r=tinycolor(t)).toHsv(),N=a.h%360/360,j=a.s,E=a.v,D=a.a),zt(),r&&r.isValid()&&!e&&(yt=y.preferredFormat||r.getFormat()))}function Dt(t){return t=t||{},xt&&_t?null:tinycolor.fromRatio({h:N,s:j,v:E,a:Math.round(1e3*D)/1e3},{format:t.format||yt})}function It(){zt(),S.move(Dt()),X.trigger("move.spectrum",[Dt()])}function zt(){nt.removeClass("sp-validation-error"),Bt();var t=tinycolor.fromRatio({h:N,s:1,v:1});J.css("background-color",t.toHexString());var e=yt;D<1&&(0!==D||"name"!==e)&&("hex"!==e&&"hex3"!==e&&"hex6"!==e&&"name"!==e||(e="rgb"));var r=Dt({format:e}),a="";if(bt.removeClass("sp-clear-display"),bt.css("background-color","transparent"),!r&&xt)bt.addClass("sp-clear-display");else{var o=r.toHexString(),s=r.toRgbString();if(i||1===r.alpha?bt.css("background-color",s):(bt.css("background-color","transparent"),bt.css("filter",r.toFilter())),y.showAlpha){var l=r.toRgb();l.a=0;var c=tinycolor(l).toRgbString(),f="linear-gradient(left, "+c+", "+o+")";n?et.css("filter",tinycolor(c).toFilter({gradientType:1},o)):(et.css("background","-webkit-"+f),et.css("background","-moz-"+f),et.css("background","-ms-"+f),et.css("background","linear-gradient(to right, "+c+", "+o+")"))}a=r.toString(e)}y.showInput&&nt.val(a),y.showPalette&&Pt(),At()}function Bt(){var t=j,e=E;if(xt&&_t)at.hide(),tt.hide(),U.hide();else{at.show(),tt.show(),U.show();var r=t*M,a=R-e*R;r=Math.max(-H,Math.min(M-H,r-H)),a=Math.max(-H,Math.min(R-H,a-H)),U.css({top:a+"px",left:r+"px"});var n=D*T;at.css({left:n-O/2+"px"});var i=N*F;tt.css({top:i-q+"px"})}}function Lt(t){var e=Dt(),r="",a=!tinycolor.equals(e,mt);e&&(r=e.toString(yt),Ct(e)),ht&&X.val(r),t&&a&&(S.change(e),X.trigger("change",[e]))}function Kt(){var e,r,a,n,i,o,s,l,c,f,h,u;P&&(M=J.width(),R=J.height(),H=U.height(),Z.width(),F=Z.height(),q=tt.height(),T=rt.width(),O=at.width(),w||(G.css("position","absolute"),y.offset?G.offset(y.offset):G.offset((r=gt,a=(e=G).outerWidth(),n=e.outerHeight(),i=r.outerHeight(),o=e[0].ownerDocument,s=o.documentElement,l=s.clientWidth+t(o).scrollLeft(),c=s.clientHeight+t(o).scrollTop(),f=r.offset(),h=f.left,u=f.top,u+=i,h-=Math.min(h,h+a>l&&l>a?Math.abs(h+a-l):0),{top:u-=Math.min(u,u+n>c&&c>n?Math.abs(n+i-0):0),bottom:f.bottom,left:h,right:f.right,width:f.width,height:f.height}))),Bt(),y.showPalette&&Pt(),X.trigger("reflow.spectrum"))}function Vt(){Nt(),Y=!0,X.attr("disabled",!0),gt.addClass("sp-disabled")}!function(){if(n&&G.find("*:not(input)").attr("unselectable","on"),kt(),dt&&X.after(pt).hide(),xt||lt.hide(),w)X.after(G).hide();else{var e="parent"===y.appendTo?X.parent():t(y.appendTo);1!==e.length&&(e=t("body")),e.append(G)}function r(e){return e.data&&e.data.ignore?(Et(t(e.target).closest(".sp-thumb-el").data("color")),It()):(Et(t(e.target).closest(".sp-thumb-el").data("color")),It(),y.hideAfterPaletteSelect?(Lt(!0),Nt()):Lt()),!1}St(),gt.on("click.spectrum touchstart.spectrum",function(e){Y||Ft(),e.stopPropagation(),t(e.target).is("input")||e.preventDefault()}),(X.is(":disabled")||!0===y.disabled)&&Vt(),G.click(h),nt.change(Ht),nt.on("paste",function(){setTimeout(Ht,1)}),nt.keydown(function(t){13==t.keyCode&&Ht()}),st.text(y.cancelText),st.on("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),jt(),Nt()}),lt.attr("title",y.clearText),lt.on("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),_t=!0,It(),w&&Lt(!0)}),ct.text(y.chooseText),ct.on("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),n&&nt.is(":focus")&&nt.trigger("change"),nt.hasClass("sp-validation-error")||(Lt(!0),Nt())}),ft.text(y.showPaletteOnly?y.togglePaletteMoreText:y.togglePaletteLessText),ft.on("click.spectrum",function(t){t.stopPropagation(),t.preventDefault(),y.showPaletteOnly=!y.showPaletteOnly,y.showPaletteOnly||w||G.css("left","-="+(Q.outerWidth(!0)+5)),kt()}),d(rt,function(t,e,r){D=t/T,_t=!1,r.shiftKey&&(D=Math.round(10*D)/10),It()},Mt,Rt),d(Z,function(t,e){N=parseFloat(e/F),_t=!1,y.showAlpha||(D=1),It()},Mt,Rt),d(J,function(t,e,r){if(r.shiftKey){if(!$){var a=j*M,n=R-E*R,i=Math.abs(t-a)>Math.abs(e-n);$=i?"x":"y"}}else $=null;var o=!$||"y"===$;(!$||"x"===$)&&(j=parseFloat(t/M)),o&&(E=parseFloat((R-e)/R)),_t=!1,y.showAlpha||(D=1),It()},Mt,Rt),vt?(Et(vt),zt(),yt=y.preferredFormat||tinycolor(vt).format,Ct(vt)):zt(),w&&Tt();var a=n?"mousedown.spectrum":"click.spectrum touchstart.spectrum";it.on(a,".sp-thumb-el",r),ot.on(a,".sp-thumb-el:nth-child(1)",{ignore:!0},r)}();var $t={show:Tt,hide:Nt,toggle:Ft,reflow:Kt,option:function(r,a){return r===e?t.extend({},y):a===e?y[r]:(y[r]=a,"preferredFormat"===r&&(yt=y.preferredFormat),void kt())},enable:function(){Y=!1,X.attr("disabled",!1),gt.removeClass("sp-disabled")},disable:Vt,offset:function(t){y.offset=t,Kt()},set:function(t){Et(t),Lt()},get:Dt,destroy:function(){X.show(),gt.off("click.spectrum touchstart.spectrum"),G.remove(),pt.remove(),a[$t.id]=null},container:G};return $t.id=a.push($t)-1,$t}function f(){}function h(t){t.stopPropagation()}function u(t,e){var r=Array.prototype.slice,a=r.call(arguments,2);return function(){return t.apply(e,a.concat(r.call(arguments)))}}function d(e,r,a,i){r=r||function(){},a=a||function(){},i=i||function(){};var o=document,s=!1,l={},c=0,f=0,h="ontouchstart"in window,u={};function d(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function p(t){if(s){if(n&&o.documentMode<9&&!t.button)return g();var a=t.originalEvent&&t.originalEvent.touches&&t.originalEvent.touches[0],i=a&&a.pageX||t.pageX,u=a&&a.pageY||t.pageY,p=Math.max(0,Math.min(i-l.left,f)),b=Math.max(0,Math.min(u-l.top,c));h&&d(t),r.apply(e,[p,b,t])}}function g(){s&&(t(o).off(u),t(o.body).removeClass("sp-dragging"),setTimeout(function(){i.apply(e,arguments)},0)),s=!1}u.selectstart=d,u.dragstart=d,u["touchmove mousemove"]=p,u["touchend mouseup"]=g,t(e).on("touchstart mousedown",function(r){(r.which?3==r.which:2==r.button)||s||!1!==a.apply(e,arguments)&&(s=!0,c=t(e).height(),f=t(e).width(),l=t(e).offset(),t(o).on(u),t(o.body).addClass("sp-dragging"),p(r),d(r))})}function p(){return t.fn.spectrum.inputTypeColorSupport()}t.fn.spectrum=function(e,r){if("string"==typeof e){var n=this,i=Array.prototype.slice.call(arguments,1);return this.each(function(){var r=a[t(this).data("spectrum.id")];if(r){var o=r[e];if(!o)throw new Error("Spectrum: no such method: '"+e+"'");"get"==e?n=r.get():"container"==e?n=r.container:"option"==e?n=r.option.apply(r,i):"destroy"==e?(r.destroy(),t(this).removeData("spectrum.id")):o.apply(r,i)}}),n}return this.spectrum("destroy").each(function(){var r=c(this,t.extend({},t(this).data(),e));t(this).data("spectrum.id",r.id)})},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=d,t.fn.spectrum.defaults=r,t.fn.spectrum.inputTypeColorSupport=function e(){if(void 0===e._cachedResult){var r=t("<input type='color'/>")[0];e._cachedResult="color"===r.type&&""!==r.value}return e._cachedResult},t.spectrum={},t.spectrum.localization={},t.spectrum.palettes={},t.fn.spectrum.processNativeColorInputs=function(){var e=t("input[type=color]");e.length&&!p()&&e.spectrum({preferredFormat:"hex6"})},function(){var t=/^[\s,#]+/,e=/\s+$/,r=0,a=Math,n=a.round,i=a.min,o=a.max,s=a.random,l=function(s,c){if(c=c||{},(s=s||"")instanceof l)return s;if(!(this instanceof l))return new l(s,c);var f=function(r){var n={r:0,g:0,b:0},s=1,l=!1,c=!1;"string"==typeof r&&(r=function(r){r=r.replace(t,"").replace(e,"").toLowerCase();var a,n=!1;if(P[r])r=P[r],n=!0;else if("transparent"==r)return{r:0,g:0,b:0,a:0,format:"name"};if(a=E.rgb.exec(r))return{r:a[1],g:a[2],b:a[3]};if(a=E.rgba.exec(r))return{r:a[1],g:a[2],b:a[3],a:a[4]};if(a=E.hsl.exec(r))return{h:a[1],s:a[2],l:a[3]};if(a=E.hsla.exec(r))return{h:a[1],s:a[2],l:a[3],a:a[4]};if(a=E.hsv.exec(r))return{h:a[1],s:a[2],v:a[3]};if(a=E.hsva.exec(r))return{h:a[1],s:a[2],v:a[3],a:a[4]};if(a=E.hex8.exec(r))return{a:(i=a[1],F(i)/255),r:F(a[2]),g:F(a[3]),b:F(a[4]),format:n?"name":"hex8"};var i;if(a=E.hex6.exec(r))return{r:F(a[1]),g:F(a[2]),b:F(a[3]),format:n?"name":"hex"};if(a=E.hex3.exec(r))return{r:F(a[1]+""+a[1]),g:F(a[2]+""+a[2]),b:F(a[3]+""+a[3]),format:n?"name":"hex"};return!1}(r));"object"==typeof r&&(r.hasOwnProperty("r")&&r.hasOwnProperty("g")&&r.hasOwnProperty("b")?(f=r.r,h=r.g,u=r.b,n={r:255*R(f,255),g:255*R(h,255),b:255*R(u,255)},l=!0,c="%"===String(r.r).substr(-1)?"prgb":"rgb"):r.hasOwnProperty("h")&&r.hasOwnProperty("s")&&r.hasOwnProperty("v")?(r.s=O(r.s),r.v=O(r.v),n=function(t,e,r){t=6*R(t,360),e=R(e,100),r=R(r,100);var n=a.floor(t),i=t-n,o=r*(1-e),s=r*(1-i*e),l=r*(1-(1-i)*e),c=n%6;return{r:255*[r,s,o,o,l,r][c],g:255*[l,r,r,s,o,o][c],b:255*[o,o,l,r,r,s][c]}}(r.h,r.s,r.v),l=!0,c="hsv"):r.hasOwnProperty("h")&&r.hasOwnProperty("s")&&r.hasOwnProperty("l")&&(r.s=O(r.s),r.l=O(r.l),n=function(t,e,r){var a,n,i;function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=R(t,360),e=R(e,100),r=R(r,100),0===e)a=n=i=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;a=o(l,s,t+1/3),n=o(l,s,t),i=o(l,s,t-1/3)}return{r:255*a,g:255*n,b:255*i}}(r.h,r.s,r.l),l=!0,c="hsl"),r.hasOwnProperty("a")&&(s=r.a));var f,h,u;return s=M(s),{ok:l,format:r.format||c,r:i(255,o(n.r,0)),g:i(255,o(n.g,0)),b:i(255,o(n.b,0)),a:s}}(s);this._originalInput=s,this._r=f.r,this._g=f.g,this._b=f.b,this._a=f.a,this._roundA=n(1e3*this._a)/1e3,this._format=c.format||f.format,this._gradientType=c.gradientType,this._r<1&&(this._r=n(this._r)),this._g<1&&(this._g=n(this._g)),this._b<1&&(this._b=n(this._b)),this._ok=f.ok,this._tc_id=r++};function c(t,e,r){t=R(t,255),e=R(e,255),r=R(r,255);var a,n,s=o(t,e,r),l=i(t,e,r),c=(s+l)/2;if(s==l)a=n=0;else{var f=s-l;switch(n=c>.5?f/(2-s-l):f/(s+l),s){case t:a=(e-r)/f+(e<r?6:0);break;case e:a=(r-t)/f+2;break;case r:a=(t-e)/f+4}a/=6}return{h:a,s:n,l:c}}function f(t,e,r){t=R(t,255),e=R(e,255),r=R(r,255);var a,n,s=o(t,e,r),l=i(t,e,r),c=s,f=s-l;if(n=0===s?0:f/s,s==l)a=0;else{switch(s){case t:a=(e-r)/f+(e<r?6:0);break;case e:a=(r-t)/f+2;break;case r:a=(t-e)/f+4}a/=6}return{h:a,s:n,v:c}}function h(t,e,r,a){var i=[T(n(t).toString(16)),T(n(e).toString(16)),T(n(r).toString(16))];return a&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function u(t,e,r,a){var i;return[T((i=a,Math.round(255*parseFloat(i)).toString(16))),T(n(t).toString(16)),T(n(e).toString(16)),T(n(r).toString(16))].join("")}function d(t,e){e=0===e?0:e||10;var r=l(t).toHsl();return r.s-=e/100,r.s=H(r.s),l(r)}function p(t,e){e=0===e?0:e||10;var r=l(t).toHsl();return r.s+=e/100,r.s=H(r.s),l(r)}function g(t){return l(t).desaturate(100)}function b(t,e){e=0===e?0:e||10;var r=l(t).toHsl();return r.l+=e/100,r.l=H(r.l),l(r)}function v(t,e){e=0===e?0:e||10;var r=l(t).toRgb();return r.r=o(0,i(255,r.r-n(-e/100*255))),r.g=o(0,i(255,r.g-n(-e/100*255))),r.b=o(0,i(255,r.b-n(-e/100*255))),l(r)}function m(t,e){e=0===e?0:e||10;var r=l(t).toHsl();return r.l-=e/100,r.l=H(r.l),l(r)}function y(t,e){var r=l(t).toHsl(),a=(n(r.h)+e)%360;return r.h=a<0?360+a:a,l(r)}function w(t){var e=l(t).toHsl();return e.h=(e.h+180)%360,l(e)}function _(t){var e=l(t).toHsl(),r=e.h;return[l(t),l({h:(r+120)%360,s:e.s,l:e.l}),l({h:(r+240)%360,s:e.s,l:e.l})]}function x(t){var e=l(t).toHsl(),r=e.h;return[l(t),l({h:(r+90)%360,s:e.s,l:e.l}),l({h:(r+180)%360,s:e.s,l:e.l}),l({h:(r+270)%360,s:e.s,l:e.l})]}function k(t){var e=l(t).toHsl(),r=e.h;return[l(t),l({h:(r+72)%360,s:e.s,l:e.l}),l({h:(r+216)%360,s:e.s,l:e.l})]}function S(t,e,r){e=e||6,r=r||30;var a=l(t).toHsl(),n=360/r,i=[l(t)];for(a.h=(a.h-(n*e>>1)+720)%360;--e;)a.h=(a.h+n)%360,i.push(l(a));return i}function C(t,e){e=e||6;for(var r=l(t).toHsv(),a=r.h,n=r.s,i=r.v,o=[],s=1/e;e--;)o.push(l({h:a,s:n,v:i})),i=(i+s)%1;return o}l.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},setAlpha:function(t){return this._a=M(t),this._roundA=n(1e3*this._a)/1e3,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=n(360*t.h),r=n(100*t.s),a=n(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+a+"%)":"hsva("+e+", "+r+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var t=c(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=c(this._r,this._g,this._b),e=n(360*t.h),r=n(100*t.s),a=n(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+a+"%)":"hsla("+e+", "+r+"%, "+a+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return u(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:n(this._r),g:n(this._g),b:n(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+n(this._r)+", "+n(this._g)+", "+n(this._b)+")":"rgba("+n(this._r)+", "+n(this._g)+", "+n(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:n(100*R(this._r,255))+"%",g:n(100*R(this._g,255))+"%",b:n(100*R(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+n(100*R(this._r,255))+"%, "+n(100*R(this._g,255))+"%, "+n(100*R(this._b,255))+"%)":"rgba("+n(100*R(this._r,255))+"%, "+n(100*R(this._g,255))+"%, "+n(100*R(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(A[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+u(this._r,this._g,this._b,this._a),r=e,a=this._gradientType?"GradientType = 1, ":"";t&&(r=l(t).toHex8String());return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,a=this._a<1&&this._a>=0;return e||!a||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(C,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},l.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var a in t)t.hasOwnProperty(a)&&(r[a]="a"===a?t[a]:O(t[a]));t=r}return l(t,e)},l.equals=function(t,e){return!(!t||!e)&&l(t).toRgbString()==l(e).toRgbString()},l.random=function(){return l.fromRatio({r:s(),g:s(),b:s()})},l.mix=function(t,e,r){r=0===r?0:r||50;var a,n=l(t).toRgb(),i=l(e).toRgb(),o=r/100,s=2*o-1,c=i.a-n.a,f=1-(a=((a=s*c==-1?s:(s+c)/(1+s*c))+1)/2),h={r:i.r*a+n.r*f,g:i.g*a+n.g*f,b:i.b*a+n.b*f,a:i.a*o+n.a*(1-o)};return l(h)},l.readability=function(t,e){var r=l(t),a=l(e),n=r.toRgb(),i=a.toRgb(),o=r.getBrightness(),s=a.getBrightness(),c=Math.max(n.r,i.r)-Math.min(n.r,i.r)+Math.max(n.g,i.g)-Math.min(n.g,i.g)+Math.max(n.b,i.b)-Math.min(n.b,i.b);return{brightness:Math.abs(o-s),color:c}},l.isReadable=function(t,e){var r=l.readability(t,e);return r.brightness>125&&r.color>500},l.mostReadable=function(t,e){for(var r=null,a=0,n=!1,i=0;i<e.length;i++){var o=l.readability(t,e[i]),s=o.brightness>125&&o.color>500,c=o.brightness/125*3+o.color/500;(s&&!n||s&&n&&c>a||!s&&!n&&c>a)&&(n=s,a=c,r=l(e[i]))}return r};var P=l.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},A=l.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(P);function M(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function R(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=i(e,o(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),a.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function H(t){return i(1,o(0,t))}function F(t){return parseInt(t,16)}function T(t){return 1==t.length?"0"+t:""+t}function O(t){return t<=1&&(t=100*t+"%"),t}var q,N,j,E=(N="[\\s|\\(]+("+(q="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+q+")[,|\\s]+("+q+")\\s*\\)?",j="[\\s|\\(]+("+q+")[,|\\s]+("+q+")[,|\\s]+("+q+")[,|\\s]+("+q+")\\s*\\)?",{rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+j),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});window.tinycolor=l}(),t(function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()})}); },{"jquery":"HlZQ"}],"n0k7":[function(require,module,exports) { !function(e){var t=e.spectrum.localization.pl={cancelText:"Anuluj",chooseText:"Wybierz",clearText:"Usuń wybór koloru",noColorSelectedText:"Nie wybrano koloru",togglePaletteMoreText:"Więcej",togglePaletteLessText:"Mniej"};e.extend(e.fn.spectrum.defaults,t)}(jQuery); },{}],"OEzi":[function(require,module,exports) { "use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e){var t=o();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return r(this,n)}}function r(t,n){return!n||"object"!==e(n)&&"function"!=typeof n?a(t):n}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=u(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function u(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function h(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),e}var f=function(){function e(){d(this,e)}return h(e,[{key:"on",value:function(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}},{key:"emit",value:function(e){this._callbacks=this._callbacks||{};var t=this._callbacks[e];if(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var a,o=l(t);try{for(o.s();!(a=o.n()).done;){a.value.apply(this,i)}}catch(s){o.e(s)}finally{o.f()}}return this}},{key:"off",value:function(e,t){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(var i=0;i<n.length;i++){if(n[i]===t){n.splice(i,1);break}}return this}}]),e}(),m=function(e){t(o,f);var n=i(o);function o(e,t){var i,s,l;if(d(this,o),(i=n.call(this)).element=e,i.version=o.version,i.defaultOptions.previewTemplate=i.defaultOptions.previewTemplate.replace(/\n*/g,""),i.clickableElements=[],i.listeners=[],i.files=[],"string"==typeof i.element&&(i.element=document.querySelector(i.element)),!i.element||null==i.element.nodeType)throw new Error("Invalid dropzone element.");if(i.element.dropzone)throw new Error("Dropzone already attached.");o.instances.push(a(i)),i.element.dropzone=a(i);var u=null!=(l=o.optionsForElement(i.element))?l:{};if(i.options=o.extend({},i.defaultOptions,u,null!=t?t:{}),i.options.forceFallback||!o.isBrowserSupported())return r(i,i.options.fallback.call(a(i)));if(null==i.options.url&&(i.options.url=i.element.getAttribute("action")),!i.options.url)throw new Error("No URL provided.");if(i.options.acceptedFiles&&i.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(i.options.uploadMultiple&&i.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");return i.options.acceptedMimeTypes&&(i.options.acceptedFiles=i.options.acceptedMimeTypes,delete i.options.acceptedMimeTypes),null!=i.options.renameFilename&&(i.options.renameFile=function(e){return i.options.renameFilename.call(a(i),e.name,e)}),"string"==typeof i.options.method&&(i.options.method=i.options.method.toUpperCase()),(s=i.getExistingFallback())&&s.parentNode&&s.parentNode.removeChild(s),!1!==i.options.previewsContainer&&(i.options.previewsContainer?i.previewsContainer=o.getElement(i.options.previewsContainer,"previewsContainer"):i.previewsContainer=i.element),i.options.clickable&&(!0===i.options.clickable?i.clickableElements=[i.element]:i.clickableElements=o.getElements(i.options.clickable,"clickable")),i.init(),i}return h(o,null,[{key:"initClass",value:function(){this.prototype.Emitter=f,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,timeout:3e4,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2e6,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function(){},params:function(e,t,n){if(n)return{dzuuid:n.file.upload.uuid,dzchunkindex:n.index,dztotalfilesize:n.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:n.file.upload.totalChunkCount,dzchunkbyteoffset:n.index*this.options.chunkSize}},accept:function(e,t){return t()},chunksUploaded:function(e,t){t()},fallback:function(){var e;this.element.className="".concat(this.element.className," dz-browser-not-supported");var t,n=l(this.element.getElementsByTagName("div"));try{for(n.s();!(t=n.n()).done;){var i=t.value;if(/(^| )dz-message($| )/.test(i.className)){e=i,i.className="dz-message";break}}}catch(a){n.e(a)}finally{n.f()}e||(e=o.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(e));var r=e.getElementsByTagName("span")[0];return r&&(null!=r.textContent?r.textContent=this.options.dictFallbackMessage:null!=r.innerText&&(r.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e,t,n,i){var r={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},a=e.width/e.height;null==t&&null==n?(t=r.srcWidth,n=r.srcHeight):null==t?t=n*a:null==n&&(n=t/a);var o=(t=Math.min(t,r.srcWidth))/(n=Math.min(n,r.srcHeight));if(r.srcWidth>t||r.srcHeight>n)if("crop"===i)a>o?(r.srcHeight=e.height,r.srcWidth=r.srcHeight*o):(r.srcWidth=e.width,r.srcHeight=r.srcWidth/o);else{if("contain"!==i)throw new Error("Unknown resizeMethod '".concat(i,"'"));a>o?n=t/a:t=n*a}return r.srcX=(e.width-r.srcWidth)/2,r.srcY=(e.height-r.srcHeight)/2,r.trgWidth=t,r.trgHeight=n,r},transformFile:function(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:'<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail /></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size></span></div>\n <div class="dz-filename"><span data-dz-name></span></div>\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n <div class="dz-success-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Check</title>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF"></path>\n </g>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Error</title>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>',drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:function(e){},dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:function(e){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var t=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){e.previewElement=o.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement);var n,i=l(e.previewElement.querySelectorAll("[data-dz-name]"));try{for(i.s();!(n=i.n()).done;){var r=n.value;r.textContent=e.name}}catch(p){i.e(p)}finally{i.f()}var a,s=l(e.previewElement.querySelectorAll("[data-dz-size]"));try{for(s.s();!(a=s.n()).done;)(r=a.value).innerHTML=this.filesize(e.size)}catch(p){s.e(p)}finally{s.f()}this.options.addRemoveLinks&&(e._removeLink=o.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'.concat(this.options.dictRemoveFile,"</a>")),e.previewElement.appendChild(e._removeLink));var u,c=function(n){return n.preventDefault(),n.stopPropagation(),e.status===o.UPLOADING?o.confirm(t.options.dictCancelUploadConfirmation,function(){return t.removeFile(e)}):t.options.dictRemoveFileConfirmation?o.confirm(t.options.dictRemoveFileConfirmation,function(){return t.removeFile(e)}):t.removeFile(e)},d=l(e.previewElement.querySelectorAll("[data-dz-remove]"));try{for(d.s();!(u=d.n()).done;){u.value.addEventListener("click",c)}}catch(p){d.e(p)}finally{d.f()}}},removedfile:function(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");var n,i=l(e.previewElement.querySelectorAll("[data-dz-thumbnail]"));try{for(i.s();!(n=i.n()).done;){var r=n.value;r.alt=e.name,r.src=t}}catch(a){i.e(a)}finally{i.f()}return setTimeout(function(){return e.previewElement.classList.add("dz-image-preview")},1)}},error:function(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"string"!=typeof t&&t.error&&(t=t.error);var n,i=l(e.previewElement.querySelectorAll("[data-dz-errormessage]"));try{for(i.s();!(n=i.n()).done;){n.value.textContent=t}}catch(r){i.e(r)}finally{i.f()}}},errormultiple:function(){},processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(e,t,n){if(e.previewElement){var i,r=l(e.previewElement.querySelectorAll("[data-dz-uploadprogress]"));try{for(r.s();!(i=r.n()).done;){var a=i.value;"PROGRESS"===a.nodeName?a.value=t:a.style.width="".concat(t,"%")}}catch(o){r.e(o)}finally{r.f()}}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}},this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];for(var r=0,a=n;r<a.length;r++){var o=a[r];for(var s in o){var l=o[s];e[s]=l}}return e}}]),h(o,[{key:"getAcceptedFiles",value:function(){return this.files.filter(function(e){return e.accepted}).map(function(e){return e})}},{key:"getRejectedFiles",value:function(){return this.files.filter(function(e){return!e.accepted}).map(function(e){return e})}},{key:"getFilesWithStatus",value:function(e){return this.files.filter(function(t){return t.status===e}).map(function(e){return e})}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(o.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(o.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(o.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter(function(e){return e.status===o.UPLOADING||e.status===o.QUEUED}).map(function(e){return e})}},{key:"init",value:function(){var e=this;if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(o.createElement('<div class="dz-default dz-message"><button class="dz-button" type="button">'.concat(this.options.dictDefaultMessage,"</button></div>"))),this.clickableElements.length){!function t(){return e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null===e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!==e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!==e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",o.getElement(e.options.hiddenInputContainer,"hiddenInputContainer").appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var n=e.hiddenFileInput.files;if(n.length){var i,r=l(n);try{for(r.s();!(i=r.n()).done;){var a=i.value;e.addFile(a)}}catch(o){r.e(o)}finally{r.f()}}return e.emit("addedfiles",n),t()})}()}this.URL=null!==window.URL?window.URL:window.webkitURL;var t,n=l(this.events);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.on(i,this.options[i])}}catch(a){n.e(a)}finally{n.f()}this.on("uploadprogress",function(){return e.updateTotalUploadProgress()}),this.on("removedfile",function(){return e.updateTotalUploadProgress()}),this.on("canceled",function(t){return e.emit("complete",t)}),this.on("complete",function(t){if(0===e.getAddedFiles().length&&0===e.getUploadingFiles().length&&0===e.getQueuedFiles().length)return setTimeout(function(){return e.emit("queuecomplete")},0)});var r=function(e){if(function(e){if(e.dataTransfer.types)for(var t=0;t<e.dataTransfer.types.length;t++)if("Files"===e.dataTransfer.types[t])return!0;return!1}(e))return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:function(t){return e.emit("dragstart",t)},dragenter:function(t){return r(t),e.emit("dragenter",t)},dragover:function(t){var n;try{n=t.dataTransfer.effectAllowed}catch(i){}return t.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",r(t),e.emit("dragover",t)},dragleave:function(t){return e.emit("dragleave",t)},drop:function(t){return r(t),e.drop(t)},dragend:function(t){return e.emit("dragend",t)}}}],this.clickableElements.forEach(function(t){return e.listeners.push({element:t,events:{click:function(n){return(t!==e.element||n.target===e.element||o.elementInside(n.target,e.element.querySelector(".dz-message")))&&e.hiddenFileInput.click(),!0}}})}),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,o.instances.splice(o.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var e,t=0,n=0;if(this.getActiveFiles().length){var i,r=l(this.getActiveFiles());try{for(r.s();!(i=r.n()).done;){var a=i.value;t+=a.upload.bytesSent,n+=a.upload.total}}catch(o){r.e(o)}finally{r.f()}e=100*t/n}else e=100;return this.emit("totaluploadprogress",e,n,t)}},{key:"_getParamName",value:function(e){return"function"==typeof this.options.paramName?this.options.paramName(e):"".concat(this.options.paramName).concat(this.options.uploadMultiple?"[".concat(e,"]"):"")}},{key:"_renameFile",value:function(e){return"function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)}},{key:"getFallbackForm",value:function(){var e,t;if(e=this.getExistingFallback())return e;var n='<div class="dz-fallback">';this.options.dictFallbackText&&(n+="<p>".concat(this.options.dictFallbackText,"</p>")),n+='<input type="file" name="'.concat(this._getParamName(0),'" ').concat(this.options.uploadMultiple?'multiple="multiple"':void 0,' /><input type="submit" value="Upload!"></div>');var i=o.createElement(n);return"FORM"!==this.element.tagName?(t=o.createElement('<form action="'.concat(this.options.url,'" enctype="multipart/form-data" method="').concat(this.options.method,'"></form>'))).appendChild(i):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:i}},{key:"getExistingFallback",value:function(){for(var e=function(e){var t,n=l(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(/(^| )fallback($| )/.test(i.className))return i}}catch(r){n.e(r)}finally{n.f()}},t=0,n=["div","form"];t<n.length;t++){var i,r=n[t];if(i=e(this.element.getElementsByTagName(r)))return i}}},{key:"setupEventListeners",value:function(){return this.listeners.map(function(e){return function(){var t=[];for(var n in e.events){var i=e.events[n];t.push(e.element.addEventListener(n,i,!1))}return t}()})}},{key:"removeEventListeners",value:function(){return this.listeners.map(function(e){return function(){var t=[];for(var n in e.events){var i=e.events[n];t.push(e.element.removeEventListener(n,i,!1))}return t}()})}},{key:"disable",value:function(){var e=this;return this.clickableElements.forEach(function(e){return e.classList.remove("dz-clickable")}),this.removeEventListeners(),this.disabled=!0,this.files.map(function(t){return e.cancelUpload(t)})}},{key:"enable",value:function(){return delete this.disabled,this.clickableElements.forEach(function(e){return e.classList.add("dz-clickable")}),this.setupEventListeners()}},{key:"filesize",value:function(e){var t=0,n="b";if(e>0){for(var i=["tb","gb","mb","kb","b"],r=0;r<i.length;r++){var a=i[r];if(e>=Math.pow(this.options.filesizeBase,4-r)/10){t=e/Math.pow(this.options.filesizeBase,4-r),n=a;break}}t=Math.round(10*t)/10}return"<strong>".concat(t,"</strong> ").concat(this.options.dictFileSizeUnits[n])}},{key:"_updateMaxFilesReachedClass",value:function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function(e){if(e.dataTransfer){this.emit("drop",e);for(var t=[],n=0;n<e.dataTransfer.files.length;n++)t[n]=e.dataTransfer.files[n];if(t.length){var i=e.dataTransfer.items;i&&i.length&&null!=i[0].webkitGetAsEntry?this._addFilesFromItems(i):this.handleFiles(t)}this.emit("addedfiles",t)}}},{key:"paste",value:function(e){if(null!=w(null!=e?e.clipboardData:void 0,function(e){return e.items})){this.emit("paste",e);var t=e.clipboardData.items;return t.length?this._addFilesFromItems(t):void 0}}},{key:"handleFiles",value:function(e){var t,n=l(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.addFile(i)}}catch(r){n.e(r)}finally{n.f()}}},{key:"_addFilesFromItems",value:function(e){var t=this;return function(){var n,i=[],r=l(e);try{for(r.s();!(n=r.n()).done;){var a,o=n.value;null!=o.webkitGetAsEntry&&(a=o.webkitGetAsEntry())?a.isFile?i.push(t.addFile(o.getAsFile())):a.isDirectory?i.push(t._addFilesFromDirectory(a,a.name)):i.push(void 0):null!=o.getAsFile&&(null==o.kind||"file"===o.kind)?i.push(t.addFile(o.getAsFile())):i.push(void 0)}}catch(s){r.e(s)}finally{r.f()}return i}()}},{key:"_addFilesFromDirectory",value:function(e,t){var n=this,i=e.createReader(),r=function(e){return E(console,"log",function(t){return t.log(e)})};return function e(){return i.readEntries(function(i){if(i.length>0){var r,a=l(i);try{for(a.s();!(r=a.n()).done;){var o=r.value;o.isFile?o.file(function(e){if(!n.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath="".concat(t,"/").concat(e.name),n.addFile(e)}):o.isDirectory&&n._addFilesFromDirectory(o,"".concat(t,"/").concat(o.name))}}catch(s){a.e(s)}finally{a.f()}e()}return null},r)}()}},{key:"accept",value:function(e,t){this.options.maxFilesize&&e.size>1024*this.options.maxFilesize*1024?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):o.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}},{key:"addFile",value:function(e){var t=this;e.upload={uuid:o.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=o.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(n){n?(e.accepted=!1,t._errorProcessing([e],n)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(e){var t,n=l(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.enqueueFile(i)}}catch(r){n.e(r)}finally{n.f()}return null}},{key:"enqueueFile",value:function(e){var t=this;if(e.status!==o.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=o.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return t.processQueue()},0)}},{key:"_enqueueThumbnail",value:function(e){var t=this;if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(e),setTimeout(function(){return t._processThumbnailQueue()},0)}},{key:"_processThumbnailQueue",value:function(){var e=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var t=this._thumbnailQueue.shift();return this.createThumbnail(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(n){return e.emit("thumbnail",t,n),e._processingThumbnail=!1,e._processThumbnailQueue()})}}},{key:"removeFile",value:function(e){if(e.status===o.UPLOADING&&this.cancelUpload(e),this.files=v(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(e){null==e&&(e=!1);var t,n=l(this.files.slice());try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.status!==o.UPLOADING||e)&&this.removeFile(i)}}catch(r){n.e(r)}finally{n.f()}return null}},{key:"resizeImage",value:function(e,t,n,i,r){var a=this;return this.createThumbnail(e,t,n,i,!0,function(t,n){if(null==n)return r(e);var i=a.options.resizeMimeType;null==i&&(i=e.type);var s=n.toDataURL(i,a.options.resizeQuality);return"image/jpeg"!==i&&"image/jpg"!==i||(s=b.restore(e.dataURL,s)),r(o.dataURItoBlob(s))})}},{key:"createThumbnail",value:function(e,t,n,i,r,a){var o=this,s=new FileReader;s.onload=function(){e.dataURL=s.result,"image/svg+xml"!==e.type?o.createThumbnailFromUrl(e,t,n,i,r,a):null!=a&&a(s.result)},s.readAsDataURL(e)}},{key:"displayExistingFile",value:function(e,t,n,i){var r=this,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(this.emit("addedfile",e),this.emit("complete",e),a){e.dataURL=t,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.resizeMethod,this.options.fixOrientation,function(t){r.emit("thumbnail",e,t),n&&n()},i)}else this.emit("thumbnail",e,t),n&&n()}},{key:"createThumbnailFromUrl",value:function(e,t,n,i,r,a,o){var s=this,l=document.createElement("img");return o&&(l.crossOrigin=o),r="from-image"!=getComputedStyle(document.body).imageOrientation&&r,l.onload=function(){var o=function(e){return e(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&r&&(o=function(e){return EXIF.getData(l,function(){return e(EXIF.getTag(this,"Orientation"))})}),o(function(r){e.width=l.width,e.height=l.height;var o=s.options.resize.call(s,e,t,n,i),u=document.createElement("canvas"),c=u.getContext("2d");switch(u.width=o.trgWidth,u.height=o.trgHeight,r>4&&(u.width=o.trgHeight,u.height=o.trgWidth),r){case 2:c.translate(u.width,0),c.scale(-1,1);break;case 3:c.translate(u.width,u.height),c.rotate(Math.PI);break;case 4:c.translate(0,u.height),c.scale(1,-1);break;case 5:c.rotate(.5*Math.PI),c.scale(1,-1);break;case 6:c.rotate(.5*Math.PI),c.translate(0,-u.width);break;case 7:c.rotate(.5*Math.PI),c.translate(u.height,-u.width),c.scale(-1,1);break;case 8:c.rotate(-.5*Math.PI),c.translate(-u.height,0)}k(c,l,null!=o.srcX?o.srcX:0,null!=o.srcY?o.srcY:0,o.srcWidth,o.srcHeight,null!=o.trgX?o.trgX:0,null!=o.trgY?o.trgY:0,o.trgWidth,o.trgHeight);var d=u.toDataURL("image/png");if(null!=a)return a(d,u)})},null!=a&&(l.onerror=a),l.src=e.dataURL}},{key:"processQueue",value:function(){var e=this.options.parallelUploads,t=this.getUploadingFiles().length,n=t;if(!(t>=e)){var i=this.getQueuedFiles();if(i.length>0){if(this.options.uploadMultiple)return this.processFiles(i.slice(0,e-t));for(;n<e;){if(!i.length)return;this.processFile(i.shift()),n++}}}}},{key:"processFile",value:function(e){return this.processFiles([e])}},{key:"processFiles",value:function(e){var t,n=l(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.processing=!0,i.status=o.UPLOADING,this.emit("processing",i)}}catch(r){n.e(r)}finally{n.f()}return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}},{key:"_getFilesWithXhr",value:function(e){return this.files.filter(function(t){return t.xhr===e}).map(function(e){return e})}},{key:"cancelUpload",value:function(e){if(e.status===o.UPLOADING){var t,n=this._getFilesWithXhr(e.xhr),i=l(n);try{for(i.s();!(t=i.n()).done;){t.value.status=o.CANCELED}}catch(u){i.e(u)}finally{i.f()}void 0!==e.xhr&&e.xhr.abort();var r,a=l(n);try{for(a.s();!(r=a.n()).done;){var s=r.value;this.emit("canceled",s)}}catch(u){a.e(u)}finally{a.f()}this.options.uploadMultiple&&this.emit("canceledmultiple",n)}else e.status!==o.ADDED&&e.status!==o.QUEUED||(e.status=o.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(e){if("function"==typeof 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 e.apply(this,n)}return e}},{key:"uploadFile",value:function(e){return this.uploadFiles([e])}},{key:"uploadFiles",value:function(e){var t=this;this._transformFiles(e,function(n){if(t.options.chunking){var i=n[0];e[0].upload.chunked=t.options.chunking&&(t.options.forceChunking||i.size>t.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(i.size/t.options.chunkSize)}if(e[0].upload.chunked){var r=e[0],a=n[0];r.upload.chunks=[];var s=function(){for(var n=0;void 0!==r.upload.chunks[n];)n++;if(!(n>=r.upload.totalChunkCount)){0;var i=n*t.options.chunkSize,s=Math.min(i+t.options.chunkSize,a.size),l={name:t._getParamName(0),data:a.webkitSlice?a.webkitSlice(i,s):a.slice(i,s),filename:r.upload.filename,chunkIndex:n};r.upload.chunks[n]={file:r,index:n,dataBlock:l,status:o.UPLOADING,progress:0,retries:0},t._uploadData(e,[l])}};if(r.upload.finishedChunkUpload=function(n){var i=!0;n.status=o.SUCCESS,n.dataBlock=null,n.xhr=null;for(var a=0;a<r.upload.totalChunkCount;a++){if(void 0===r.upload.chunks[a])return s();r.upload.chunks[a].status!==o.SUCCESS&&(i=!1)}i&&t.options.chunksUploaded(r,function(){t._finished(e,"",null)})},t.options.parallelChunkUploads)for(var l=0;l<r.upload.totalChunkCount;l++)s();else s()}else{for(var u=[],c=0;c<e.length;c++)u[c]={name:t._getParamName(c),data:n[c],filename:e[c].upload.filename};t._uploadData(e,u)}})}},{key:"_getChunk",value:function(e,t){for(var n=0;n<e.upload.totalChunkCount;n++)if(void 0!==e.upload.chunks[n]&&e.upload.chunks[n].xhr===t)return e.upload.chunks[n]}},{key:"_uploadData",value:function(e,t){var n,i=this,r=new XMLHttpRequest,a=l(e);try{for(a.s();!(n=a.n()).done;){n.value.xhr=r}}catch(E){a.e(E)}finally{a.f()}e[0].upload.chunked&&(e[0].upload.chunks[t[0].chunkIndex].xhr=r);var s=this.resolveOption(this.options.method,e),u=this.resolveOption(this.options.url,e);r.open(s,u,!0),r.timeout=this.resolveOption(this.options.timeout,e),r.withCredentials=!!this.options.withCredentials,r.onload=function(t){i._finishedUploading(e,r,t)},r.ontimeout=function(){i._handleUploadError(e,r,"Request timedout after ".concat(i.options.timeout/1e3," seconds"))},r.onerror=function(){i._handleUploadError(e,r)},(null!=r.upload?r.upload:r).onprogress=function(t){return i._updateFilesUploadProgress(e,r,t)};var c={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var d in this.options.headers&&o.extend(c,this.options.headers),c){var p=c[d];p&&r.setRequestHeader(d,p)}var h=new FormData;if(this.options.params){var f=this.options.params;for(var m in"function"==typeof f&&(f=f.call(this,e,r,e[0].upload.chunked?this._getChunk(e[0],r):null)),f){var v=f[m];if(Array.isArray(v))for(var g=0;g<v.length;g++)h.append(m,v[g]);else h.append(m,v)}}var y,k=l(e);try{for(k.s();!(y=k.n()).done;){var b=y.value;this.emit("sending",b,r,h)}}catch(E){k.e(E)}finally{k.f()}this.options.uploadMultiple&&this.emit("sendingmultiple",e,r,h),this._addFormElementData(h);for(var F=0;F<t.length;F++){var w=t[F];h.append(w.name,w.data,w.filename)}this.submitRequest(r,h,e)}},{key:"_transformFiles",value:function(e,t){for(var n=this,i=[],r=0,a=function(a){n.options.transformFile.call(n,e[a],function(n){i[a]=n,++r===e.length&&t(i)})},o=0;o<e.length;o++)a(o)}},{key:"_addFormElementData",value:function(e){if("FORM"===this.element.tagName){var t,n=l(this.element.querySelectorAll("input, textarea, select, button"));try{for(n.s();!(t=n.n()).done;){var i=t.value,r=i.getAttribute("name"),a=i.getAttribute("type");if(a&&(a=a.toLowerCase()),null!=r)if("SELECT"===i.tagName&&i.hasAttribute("multiple")){var o,s=l(i.options);try{for(s.s();!(o=s.n()).done;){var u=o.value;u.selected&&e.append(r,u.value)}}catch(c){s.e(c)}finally{s.f()}}else(!a||"checkbox"!==a&&"radio"!==a||i.checked)&&e.append(r,i.value)}}catch(c){n.e(c)}finally{n.f()}}}},{key:"_updateFilesUploadProgress",value:function(e,t,n){var i;if(void 0!==n){if(i=100*n.loaded/n.total,e[0].upload.chunked){var r=e[0],a=this._getChunk(r,t);a.progress=i,a.total=n.total,a.bytesSent=n.loaded;r.upload.progress=0,r.upload.total=0,r.upload.bytesSent=0;for(var o=0;o<r.upload.totalChunkCount;o++)void 0!==r.upload.chunks[o]&&void 0!==r.upload.chunks[o].progress&&(r.upload.progress+=r.upload.chunks[o].progress,r.upload.total+=r.upload.chunks[o].total,r.upload.bytesSent+=r.upload.chunks[o].bytesSent);r.upload.progress=r.upload.progress/r.upload.totalChunkCount}else{var s,u=l(e);try{for(u.s();!(s=u.n()).done;){var c=s.value;c.upload.progress=i,c.upload.total=n.total,c.upload.bytesSent=n.loaded}}catch(F){u.e(F)}finally{u.f()}}var d,p=l(e);try{for(p.s();!(d=p.n()).done;){var h=d.value;this.emit("uploadprogress",h,h.upload.progress,h.upload.bytesSent)}}catch(F){p.e(F)}finally{p.f()}}else{var f=!0;i=100;var m,v=l(e);try{for(v.s();!(m=v.n()).done;){var g=m.value;100===g.upload.progress&&g.upload.bytesSent===g.upload.total||(f=!1),g.upload.progress=i,g.upload.bytesSent=g.upload.total}}catch(F){v.e(F)}finally{v.f()}if(f)return;var y,k=l(e);try{for(k.s();!(y=k.n()).done;){var b=y.value;this.emit("uploadprogress",b,i,b.upload.bytesSent)}}catch(F){k.e(F)}finally{k.f()}}}},{key:"_finishedUploading",value:function(e,t,n){var i;if(e[0].status!==o.CANCELED&&4===t.readyState){if("arraybuffer"!==t.responseType&&"blob"!==t.responseType&&(i=t.responseText,t.getResponseHeader("content-type")&&~t.getResponseHeader("content-type").indexOf("application/json")))try{i=JSON.parse(i)}catch(r){n=r,i="Invalid JSON response from server."}this._updateFilesUploadProgress(e),200<=t.status&&t.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],t)):this._finished(e,i,n):this._handleUploadError(e,t,i)}}},{key:"_handleUploadError",value:function(e,t,n){if(e[0].status!==o.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){var i=this._getChunk(e[0],t);if(i.retries++<this.options.retryChunksLimit)return void this._uploadData(e,[i.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(e,n||this.options.dictResponseError.replace("{{statusCode}}",t.status),t)}}},{key:"submitRequest",value:function(e,t,n){e.send(t)}},{key:"_finished",value:function(e,t,n){var i,r=l(e);try{for(r.s();!(i=r.n()).done;){var a=i.value;a.status=o.SUCCESS,this.emit("success",a,t,n),this.emit("complete",a)}}catch(s){r.e(s)}finally{r.f()}if(this.options.uploadMultiple&&(this.emit("successmultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function(e,t,n){var i,r=l(e);try{for(r.s();!(i=r.n()).done;){var a=i.value;a.status=o.ERROR,this.emit("error",a,t,n),this.emit("complete",a)}}catch(s){r.e(s)}finally{r.f()}if(this.options.uploadMultiple&&(this.emit("errormultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}]),o}();m.initClass(),m.version="5.7.2",m.options={},m.optionsForElement=function(e){return e.getAttribute("id")?m.options[g(e.getAttribute("id"))]:void 0},m.instances=[],m.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},m.autoDiscover=!0,m.discover=function(){var e;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];var t=function(t){return function(){var n,i=[],r=l(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;/(^| )dropzone($| )/.test(a.className)?i.push(e.push(a)):i.push(void 0)}}catch(o){r.e(o)}finally{r.f()}return i}()};t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return function(){var t,n=[],i=l(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;!1!==m.optionsForElement(r)?n.push(new m(r)):n.push(void 0)}}catch(a){i.e(a)}finally{i.f()}return n}()},m.blacklistedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],m.isBrowserSupported=function(){var e=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){var t,n=l(m.blacklistedBrowsers);try{for(n.s();!(t=n.n()).done;){t.value.test(navigator.userAgent)&&(e=!1)}}catch(i){n.e(i)}finally{n.f()}}else e=!1;else e=!1;return e},m.dataURItoBlob=function(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],i=new ArrayBuffer(t.length),r=new Uint8Array(i),a=0,o=t.length,s=0<=o;s?a<=o:a>=o;s?a++:a--)r[a]=t.charCodeAt(a);return new Blob([i],{type:n})};var v=function(e,t){return e.filter(function(e){return e!==t}).map(function(e){return e})},g=function(e){return e.replace(/[\-_](\w)/g,function(e){return e.charAt(1).toUpperCase()})};m.createElement=function(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},m.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},m.getElement=function(e,t){var n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector or a plain HTML element."));return n},m.getElements=function(e,t){var n,i;if(e instanceof Array){i=[];try{var r,a=l(e);try{for(a.s();!(r=a.n()).done;)n=r.value,i.push(this.getElement(n,t))}catch(u){a.e(u)}finally{a.f()}}catch(c){i=null}}else if("string"==typeof e){i=[];var o,s=l(document.querySelectorAll(e));try{for(s.s();!(o=s.n()).done;)n=o.value,i.push(n)}catch(u){s.e(u)}finally{s.f()}}else null!=e.nodeType&&(i=[e]);if(null==i||!i.length)throw new Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));return i},m.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},m.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");var n,i=e.type,r=i.replace(/\/.*$/,""),a=l(t);try{for(a.s();!(n=a.n()).done;){var o=n.value;if("."===(o=o.trim()).charAt(0)){if(-1!==e.name.toLowerCase().indexOf(o.toLowerCase(),e.name.length-o.length))return!0}else if(/\/\*$/.test(o)){if(r===o.replace(/\/.*$/,""))return!0}else if(i===o)return!0}}catch(s){a.e(s)}finally{a.f()}return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each(function(){return new m(this,e)})}),"undefined"!=typeof module&&null!==module?module.exports=m:window.Dropzone=m,m.ADDED="added",m.QUEUED="queued",m.ACCEPTED=m.QUEUED,m.UPLOADING="uploading",m.PROCESSING=m.UPLOADING,m.CANCELED="canceled",m.ERROR="error",m.SUCCESS="success";var y=function(e){e.naturalWidth;var t=e.naturalHeight,n=document.createElement("canvas");n.width=1,n.height=t;var i=n.getContext("2d");i.drawImage(e,0,0);for(var r=i.getImageData(1,0,1,t).data,a=0,o=t,s=t;s>a;){0===r[4*(s-1)+3]?o=s:a=s,s=o+a>>1}var l=s/t;return 0===l?1:l},k=function(e,t,n,i,r,a,o,s,l,u){var c=y(t);return e.drawImage(t,n,i,r,a,o,s,l,u/c)},b=function(){function e(){d(this,e)}return h(e,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function(e){for(var t="",n=void 0,i=void 0,r="",a=void 0,o=void 0,s=void 0,l="",u=0;a=(n=e[u++])>>2,o=(3&n)<<4|(i=e[u++])>>4,s=(15&i)<<2|(r=e[u++])>>6,l=63&r,isNaN(i)?s=l=64:isNaN(r)&&(l=64),t=t+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(s)+this.KEY_STR.charAt(l),n=i=r="",a=o=s=l="",u<e.length;);return t}},{key:"restore",value:function(e,t){if(!e.match("data:image/jpeg;base64,"))return t;var n=this.decode64(e.replace("data:image/jpeg;base64,","")),i=this.slice2Segments(n),r=this.exifManipulation(t,i);return"data:image/jpeg;base64,".concat(this.encode64(r))}},{key:"exifManipulation",value:function(e,t){var n=this.getExifArray(t),i=this.insertExif(e,n);return new Uint8Array(i)}},{key:"getExifArray",value:function(e){for(var t=void 0,n=0;n<e.length;){if(255===(t=e[n])[0]&225===t[1])return t;n++}return[]}},{key:"insertExif",value:function(e,t){var n=e.replace("data:image/jpeg;base64,",""),i=this.decode64(n),r=i.indexOf(255,3),a=i.slice(0,r),o=i.slice(r),s=a;return s=(s=s.concat(t)).concat(o)}},{key:"slice2Segments",value:function(e){for(var t=0,n=[];;){if(255===e[t]&218===e[t+1])break;if(255===e[t]&216===e[t+1])t+=2;else{var i=t+(256*e[t+2]+e[t+3])+2,r=e.slice(t,i);n.push(r),t=i}if(t>e.length)break}return n}},{key:"decode64",value:function(e){var t=void 0,n=void 0,i="",r=void 0,a=void 0,o="",s=0,l=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");t=this.KEY_STR.indexOf(e.charAt(s++))<<2|(r=this.KEY_STR.indexOf(e.charAt(s++)))>>4,n=(15&r)<<4|(a=this.KEY_STR.indexOf(e.charAt(s++)))>>2,i=(3&a)<<6|(o=this.KEY_STR.indexOf(e.charAt(s++))),l.push(t),64!==a&&l.push(n),64!==o&&l.push(i),t=n=i="",r=a=o="",s<e.length;);return l}}]),e}();b.initClass();var F=function(e,t){var n=!1,i=!0,r=e.document,a=r.documentElement,o=r.addEventListener?"addEventListener":"attachEvent",s=r.addEventListener?"removeEventListener":"detachEvent",l=r.addEventListener?"":"on",u=function i(a){if("readystatechange"!==a.type||"complete"===r.readyState)return("load"===a.type?e:r)[s](l+a.type,i,!1),!n&&(n=!0)?t.call(e,a.type||a):void 0};if("complete"!==r.readyState){if(r.createEventObject&&a.doScroll){try{i=!e.frameElement}catch(c){}i&&function e(){try{a.doScroll("left")}catch(t){return void setTimeout(e,50)}return u("poll")}()}return r[o](l+"DOMContentLoaded",u,!1),r[o](l+"readystatechange",u,!1),e[o](l+"load",u,!1)}};function w(e,t){return null!=e?t(e):void 0}function E(e,t,n){return null!=e&&"function"==typeof e[t]?n(e,t):void 0}m._autoDiscoverFunction=function(){if(m.autoDiscover)return m.discover()},F(window,m._autoDiscoverFunction); },{}],"xIWz":[function(require,module,exports) { !function(t){"use strict";var e=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}();!function(t){var i="ekkoLightbox",o=t.fn[i],a={title:"",footer:"",maxWidth:9999,maxHeight:9999,showArrows:!0,wrapping:!0,type:null,alwaysShowClose:!1,loadingMessage:'<div class="ekko-lightbox-loader"><div><div></div><div></div></div></div>',leftArrow:"<span>❮</span>",rightArrow:"<span>❯</span>",strings:{close:"Close",fail:"Failed to load image:",type:"Could not detect remote target type. Force the type using data-type"},doc:document,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}},s=function(){function i(e,o){var s=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),this._config=t.extend({},a,o),this._$modalArrows=null,this._galleryIndex=0,this._galleryName=null,this._padding=null,this._border=null,this._titleIsShown=!1,this._footerIsShown=!1,this._wantedWidth=0,this._wantedHeight=0,this._touchstartX=0,this._touchendX=0,this._modalId="ekkoLightbox-"+Math.floor(1e3*Math.random()+1),this._$element=e instanceof jQuery?e:t(e),this._isBootstrap3=3==t.fn.modal.Constructor.VERSION[0];var n='<h4 class="modal-title">'+(this._config.title||" ")+"</h4>",l='<button type="button" class="close" data-dismiss="modal" aria-label="'+this._config.strings.close+'"><span aria-hidden="true">×</span></button>',r='<div class="modal-dialog" role="document"><div class="modal-content">'+('<div class="modal-header'+(this._config.title||this._config.alwaysShowClose?"":" hide")+'">'+(this._isBootstrap3?l+n:n+l)+"</div>")+'<div class="modal-body"><div class="ekko-lightbox-container"><div class="ekko-lightbox-item fade in show"></div><div class="ekko-lightbox-item fade"></div></div></div>'+('<div class="modal-footer'+(this._config.footer?"":" hide")+'">'+(this._config.footer||" ")+"</div>")+"</div></div>";t(this._config.doc.body).append('<div id="'+this._modalId+'" class="ekko-lightbox modal fade" tabindex="-1" tabindex="-1" role="dialog" aria-hidden="true">'+r+"</div>"),this._$modal=t("#"+this._modalId,this._config.doc),this._$modalDialog=this._$modal.find(".modal-dialog").first(),this._$modalContent=this._$modal.find(".modal-content").first(),this._$modalBody=this._$modal.find(".modal-body").first(),this._$modalHeader=this._$modal.find(".modal-header").first(),this._$modalFooter=this._$modal.find(".modal-footer").first(),this._$lightboxContainer=this._$modalBody.find(".ekko-lightbox-container").first(),this._$lightboxBodyOne=this._$lightboxContainer.find("> div:first-child").first(),this._$lightboxBodyTwo=this._$lightboxContainer.find("> div:last-child").first(),this._border=this._calculateBorders(),this._padding=this._calculatePadding(),this._galleryName=this._$element.data("gallery"),this._galleryName&&(this._$galleryItems=t(document.body).find('*[data-gallery="'+this._galleryName+'"]'),this._galleryIndex=this._$galleryItems.index(this._$element),t(document).on("keydown.ekkoLightbox",this._navigationalBinder.bind(this)),this._config.showArrows&&this._$galleryItems.length>1&&(this._$lightboxContainer.append('<div class="ekko-lightbox-nav-overlay"><a href="#">'+this._config.leftArrow+'</a><a href="#">'+this._config.rightArrow+"</a></div>"),this._$modalArrows=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay").first(),this._$lightboxContainer.on("click","a:first-child",function(t){return t.preventDefault(),s.navigateLeft()}),this._$lightboxContainer.on("click","a:last-child",function(t){return t.preventDefault(),s.navigateRight()}),this.updateNavigation())),this._$modal.on("show.bs.modal",this._config.onShow.bind(this)).on("shown.bs.modal",function(){return s._toggleLoading(!0),s._handle(),s._config.onShown.call(s)}).on("hide.bs.modal",this._config.onHide.bind(this)).on("hidden.bs.modal",function(){return s._galleryName&&(t(document).off("keydown.ekkoLightbox"),t(window).off("resize.ekkoLightbox")),s._$modal.remove(),s._config.onHidden.call(s)}).modal(this._config),t(window).on("resize.ekkoLightbox",function(){s._resize(s._wantedWidth,s._wantedHeight)}),this._$lightboxContainer.on("touchstart",function(){s._touchstartX=event.changedTouches[0].screenX}).on("touchend",function(){s._touchendX=event.changedTouches[0].screenX,s._swipeGesure()})}return e(i,null,[{key:"Default",get:function(){return a}}]),e(i,[{key:"element",value:function(){return this._$element}},{key:"modal",value:function(){return this._$modal}},{key:"navigateTo",value:function(e){if(e<0||e>this._$galleryItems.length-1)return this;this._galleryIndex=e,this.updateNavigation(),this._$element=t(this._$galleryItems.get(this._galleryIndex)),this._handle()}},{key:"navigateLeft",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(0===this._galleryIndex){if(!this._config.wrapping)return;this._galleryIndex=this._$galleryItems.length-1}else this._galleryIndex--;return this._config.onNavigate.call(this,"left",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"navigateRight",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(this._galleryIndex===this._$galleryItems.length-1){if(!this._config.wrapping)return;this._galleryIndex=0}else this._galleryIndex++;return this._config.onNavigate.call(this,"right",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"updateNavigation",value:function(){if(!this._config.wrapping){var t=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay");0===this._galleryIndex?t.find("a:first-child").addClass("disabled"):t.find("a:first-child").removeClass("disabled"),this._galleryIndex===this._$galleryItems.length-1?t.find("a:last-child").addClass("disabled"):t.find("a:last-child").removeClass("disabled")}}},{key:"close",value:function(){return this._$modal.modal("hide")}},{key:"_navigationalBinder",value:function(t){return 39===(t=t||window.event).keyCode?this.navigateRight():37===t.keyCode?this.navigateLeft():void 0}},{key:"_detectRemoteType",value:function(t,e){return!(e=e||!1)&&this._isImage(t)&&(e="image"),!e&&this._getYoutubeId(t)&&(e="youtube"),!e&&this._getVimeoId(t)&&(e="vimeo"),!e&&this._getInstagramId(t)&&(e="instagram"),(!e||["image","youtube","vimeo","instagram","video","url"].indexOf(e)<0)&&(e="url"),e}},{key:"_isImage",value:function(t){return t&&t.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)}},{key:"_containerToUse",value:function(){var t=this,e=this._$lightboxBodyTwo,i=this._$lightboxBodyOne;return this._$lightboxBodyTwo.hasClass("in")&&(e=this._$lightboxBodyOne,i=this._$lightboxBodyTwo),i.removeClass("in show"),setTimeout(function(){t._$lightboxBodyTwo.hasClass("in")||t._$lightboxBodyTwo.empty(),t._$lightboxBodyOne.hasClass("in")||t._$lightboxBodyOne.empty()},500),e.addClass("in show"),e}},{key:"_handle",value:function(){var t=this._containerToUse();this._updateTitleAndFooter();var e=this._$element.attr("data-remote")||this._$element.attr("href"),i=this._detectRemoteType(e,this._$element.attr("data-type")||!1);if(["image","youtube","vimeo","instagram","video","url"].indexOf(i)<0)return this._error(this._config.strings.type);switch(i){case"image":this._preloadImage(e,t),this._preloadImageByIndex(this._galleryIndex,3);break;case"youtube":this._showYoutubeVideo(e,t);break;case"vimeo":this._showVimeoVideo(this._getVimeoId(e),t);break;case"instagram":this._showInstagramVideo(this._getInstagramId(e),t);break;case"video":this._showHtml5Video(e,t);break;default:this._loadRemoteContent(e,t)}return this}},{key:"_getYoutubeId",value:function(t){if(!t)return!1;var e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!e||11!==e[2].length)&&e[2]}},{key:"_getVimeoId",value:function(t){return!!(t&&t.indexOf("vimeo")>0)&&t}},{key:"_getInstagramId",value:function(t){return!!(t&&t.indexOf("instagram")>0)&&t}},{key:"_toggleLoading",value:function(e){return(e=e||!1)?(this._$modalDialog.css("display","none"),this._$modal.removeClass("in show"),t(".modal-backdrop").append(this._config.loadingMessage)):(this._$modalDialog.css("display","block"),this._$modal.addClass("in show"),t(".modal-backdrop").find(".ekko-lightbox-loader").remove()),this}},{key:"_calculateBorders",value:function(){return{top:this._totalCssByAttribute("border-top-width"),right:this._totalCssByAttribute("border-right-width"),bottom:this._totalCssByAttribute("border-bottom-width"),left:this._totalCssByAttribute("border-left-width")}}},{key:"_calculatePadding",value:function(){return{top:this._totalCssByAttribute("padding-top"),right:this._totalCssByAttribute("padding-right"),bottom:this._totalCssByAttribute("padding-bottom"),left:this._totalCssByAttribute("padding-left")}}},{key:"_totalCssByAttribute",value:function(t){return parseInt(this._$modalDialog.css(t),10)+parseInt(this._$modalContent.css(t),10)+parseInt(this._$modalBody.css(t),10)}},{key:"_updateTitleAndFooter",value:function(){var t=this._$element.data("title")||"",e=this._$element.data("footer")||"";return this._titleIsShown=!1,t||this._config.alwaysShowClose?(this._titleIsShown=!0,this._$modalHeader.css("display","").find(".modal-title").html(t||" ")):this._$modalHeader.css("display","none"),this._footerIsShown=!1,e?(this._footerIsShown=!0,this._$modalFooter.css("display","").html(e)):this._$modalFooter.css("display","none"),this}},{key:"_showYoutubeVideo",value:function(t,e){var i=this._getYoutubeId(t),o=t.indexOf("&")>0?t.substr(t.indexOf("&")):"",a=this._$element.data("width")||560,s=this._$element.data("height")||a/(560/315);return this._showVideoIframe("//www.youtube.com/embed/"+i+"?badge=0&autoplay=1&html5=1"+o,a,s,e)}},{key:"_showVimeoVideo",value:function(t,e){var i=this._$element.data("width")||500,o=this._$element.data("height")||i/(560/315);return this._showVideoIframe(t+"?autoplay=1",i,o,e)}},{key:"_showInstagramVideo",value:function(t,e){var i=this._$element.data("width")||612,o=i+80;return t="/"!==t.substr(-1)?t+"/":t,e.html('<iframe width="'+i+'" height="'+o+'" src="'+t+'embed/" frameborder="0" allowfullscreen></iframe>'),this._resize(i,o),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showVideoIframe",value:function(t,e,i,o){return i=i||e,o.html('<div class="embed-responsive embed-responsive-16by9"><iframe width="'+e+'" height="'+i+'" src="'+t+'" frameborder="0" allowfullscreen class="embed-responsive-item"></iframe></div>'),this._resize(e,i),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showHtml5Video",value:function(t,e){var i=this._$element.data("width")||560,o=this._$element.data("height")||i/(560/315);return e.html('<div class="embed-responsive embed-responsive-16by9"><video width="'+i+'" height="'+o+'" src="'+t+'" preload="auto" autoplay controls class="embed-responsive-item"></video></div>'),this._resize(i,o),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_loadRemoteContent",value:function(e,i){var o=this,a=this._$element.data("width")||560,s=this._$element.data("height")||560,n=this._$element.data("disableExternalCheck")||!1;return this._toggleLoading(!1),n||this._isExternal(e)?(i.html('<iframe src="'+e+'" frameborder="0" allowfullscreen></iframe>'),this._config.onContentLoaded.call(this)):i.load(e,t.proxy(function(){return o._$element.trigger("loaded.bs.modal")})),this._$modalArrows&&this._$modalArrows.css("display","none"),this._resize(a,s),this}},{key:"_isExternal",value:function(t){var e=t.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof e[1]&&e[1].length>0&&e[1].toLowerCase()!==location.protocol||"string"==typeof e[2]&&e[2].length>0&&e[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host}},{key:"_error",value:function(t){return console.error(t),this._containerToUse().html(t),this._resize(300,300),this}},{key:"_preloadImageByIndex",value:function(e,i){if(this._$galleryItems){var o=t(this._$galleryItems.get(e),!1);if(void 0!==o){var a=o.attr("data-remote")||o.attr("href");return("image"===o.attr("data-type")||this._isImage(a))&&this._preloadImage(a,!1),i>0?this._preloadImageByIndex(e+1,i-1):void 0}}}},{key:"_preloadImage",value:function(e,i){var o=this;i=i||!1;var a,s=new Image;return i&&(a=setTimeout(function(){i.append(o._config.loadingMessage)},200),s.onload=function(){a&&clearTimeout(a),a=null;var e=t("<img />");return e.attr("src",s.src),e.addClass("img-fluid"),e.css("width","100%"),i.html(e),o._$modalArrows&&o._$modalArrows.css("display",""),o._resize(s.width,s.height),o._toggleLoading(!1),o._config.onContentLoaded.call(o)},s.onerror=function(){return o._toggleLoading(!1),o._error(o._config.strings.fail+" "+e)}),s.src=e,s}},{key:"_swipeGesure",value:function(){return this._touchendX<this._touchstartX?this.navigateRight():this._touchendX>this._touchstartX?this.navigateLeft():void 0}},{key:"_resize",value:function(e,i){i=i||e,this._wantedWidth=e,this._wantedHeight=i;var o=e/i,a=this._padding.left+this._padding.right+this._border.left+this._border.right,s=this._config.doc.body.clientWidth>575?20:0,n=this._config.doc.body.clientWidth>575?0:20,l=Math.min(e+a,this._config.doc.body.clientWidth-s,this._config.maxWidth);e+a>l?(i=(l-a-n)/o,e=l):e+=a;var r=0,d=0;this._footerIsShown&&(d=this._$modalFooter.outerHeight(!0)||55),this._titleIsShown&&(r=this._$modalHeader.outerHeight(!0)||67);var h=this._padding.top+this._padding.bottom+this._border.bottom+this._border.top,g=parseFloat(this._$modalDialog.css("margin-top"))+parseFloat(this._$modalDialog.css("margin-bottom")),_=Math.min(i,t(window).height()-h-g-r-d,this._config.maxHeight-h-r-d);i>_&&(e=Math.ceil(_*o)+a),this._$lightboxContainer.css("height",_),this._$modalDialog.css("flex",1).css("maxWidth",e);var c=this._$modal.data("bs.modal");if(c)try{c._handleUpdate()}catch(u){c.handleUpdate()}return this}}],[{key:"_jQueryInterface",value:function(e){var o=this;return e=e||{},this.each(function(){var a=t(o),s=t.extend({},i.Default,a.data(),"object"==typeof e&&e);new i(o,s)})}}]),i}();t.fn[i]=s._jQueryInterface,t.fn[i].Constructor=s,t.fn[i].noConflict=function(){return t.fn[i]=o,s._jQueryInterface}}(jQuery)}(jQuery); },{}],"kqo8":[function(require,module,exports) { },{"./vline.gif":[["vline.8e300eb4.gif","N9VW"],"N9VW"],"./icons.gif":[["icons.adf17e09.gif","A68Y"],"A68Y"],"./loading.gif":[["loading.3bb26a65.gif","FVsp"],"FVsp"],"./icons-rtl.gif":[["icons-rtl.82a051d2.gif","gogI"],"gogI"],"./vline-rtl.gif":[["vline-rtl.8e300eb4.gif","sKUR"],"sKUR"]}],"FxCd":[function(require,module,exports) { var define; var t;!function(e){"function"==typeof t&&t.amd?t(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(t){t.ui=t.ui||{};t.ui.version="1.12.1";var e,i=0,o=Array.prototype.slice;t.cleanData=t.cleanData||(e=t.cleanData,function(i){var o,n,s;for(s=0;null!=(n=i[s]);s++)try{(o=t._data(n,"events"))&&o.remove&&t(n).triggerHandler("remove")}catch(l){}e(i)}),t.widget=t.widget||function(e,i,o){var n,s,l,r={},a=e.split(".")[0],h=a+"-"+(e=e.split(".")[1]);return o||(o=i,i=t.Widget),t.isArray(o)&&(o=t.extend.apply(null,[{}].concat(o))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[a]=t[a]||{},n=t[a][e],s=t[a][e]=function(t,e){if(!this._createWidget)return new s(t,e);arguments.length&&this._createWidget(t,e)},t.extend(s,n,{version:o.version,_proto:t.extend({},o),_childConstructors:[]}),(l=new i).options=t.widget.extend({},l.options),t.each(o,function(e,o){t.isFunction(o)?r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,s=this._superApply;return this._super=t,this._superApply=n,e=o.apply(this,arguments),this._super=i,this._superApply=s,e}}():r[e]=o}),s.prototype=t.widget.extend(l,{widgetEventPrefix:n&&l.widgetEventPrefix||e},r,{constructor:s,namespace:a,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var o=i.prototype;t.widget(o.namespace+"."+o.widgetName,s,i._proto)}),delete n._childConstructors):i._childConstructors.push(s),t.widget.bridge(e,s),s},t.widget.extend=function(e){for(var i,n,s=o.call(arguments,1),l=0,r=s.length;l<r;l++)for(i in s[l])n=s[l][i],s[l].hasOwnProperty(i)&&void 0!==n&&(t.isPlainObject(n)?e[i]=t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):e[i]=n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(s){var l="string"==typeof s,r=o.call(arguments,1),a=this;return l?this.length||"instance"!==s?this.each(function(){var i,o=t.data(this,n);return"instance"===s?(a=o,!1):o?t.isFunction(o[s])&&"_"!==s.charAt(0)?(i=o[s].apply(o,r))!==o&&void 0!==i?(a=i&&i.jquery?a.pushStack(i.get()):i,!1):void 0:t.error("no such method '"+s+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+s+"'")}):a=void 0:(r.length&&(s=t.widget.extend.apply(null,[s].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(s||{}),e._init&&e._init()):t.data(this,n,new i(s,this))})),a}},t.Widget=t.Widget||function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,o){o=t(o||this.defaultElement||this)[0],this.element=t(o),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},o!==this&&(t.data(o,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===o&&this.destroy()}}),this.document=t(o.style?o.ownerDocument:o.document||o),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var o,n,s,l=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(l={},o=e.split("."),e=o.shift(),o.length){for(n=l[e]=t.widget.extend({},this.options[e]),s=0;s<o.length-1;s++)n[o[s]]=n[o[s]]||{},n=n[o[s]];if(e=o.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];l[e]=i}return this._setOptions(l),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,o,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(o=t(n.get()),this._removeClass(n,i),o.addClass(this._classes({element:o,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){var i=[],o=this;function n(n,s){var l,r;for(r=0;r<n.length;r++)l=o.classesElementLookup[n[r]]||t(),l=e.add?t(t.unique(l.get().concat(e.element.get()))):t(l.not(e.element).get()),o.classesElementLookup[n[r]]=l,i.push(n[r]),s&&e.classes[n[r]]&&i.push(e.classes[n[r]])}return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&n(e.keys.match(/\S+/g)||[],!0),e.extra&&n(e.extra.match(/\S+/g)||[]),i.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(o,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[o]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,o){o="boolean"==typeof o?o:i;var n="string"==typeof t||null===t,s={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:o};return s.element.toggleClass(this._classes(s),o),this},_on:function(e,i,o){var n,s=this;"boolean"!=typeof e&&(o=i,i=e,e=!1),o?(i=n=t(i),this.bindings=this.bindings.add(i)):(o=i,i=this.element,n=this.widget()),t.each(o,function(o,l){function r(){if(e||!0!==s.options.disabled&&!t(this).hasClass("ui-state-disabled"))return("string"==typeof l?s[l]:l).apply(s,arguments)}"string"!=typeof l&&(r.guid=l.guid=l.guid||r.guid||t.guid++);var a=o.match(/^([\w:-]*)\s*(.*)$/),h=a[1]+s.eventNamespace,c=a[2];c?n.on(h,c,r):i.on(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,o){var n,s,l=this.options[e];if(o=o||{},(i=t.Event(i)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],s=i.originalEvent)for(n in s)n in i||(i[n]=s[n]);return this.element.trigger(i,o),!(t.isFunction(l)&&!1===l.apply(this.element[0],[i].concat(o))||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(o,n,s){var l;"string"==typeof n&&(n={effect:n});var r=n?!0===n||"number"==typeof n?i:n.effect||i:e;"number"==typeof(n=n||{})&&(n={duration:n}),l=!t.isEmptyObject(n),n.complete=s,n.delay&&o.delay(n.delay),l&&t.effects&&t.effects.effect[r]?o[e](n):r!==e&&o[r]?o[r](n.duration,n.easing,s):o.queue(function(i){t(this)[e](),s&&s.call(o[0]),i()})}});t.widget;!function(){var e,i=Math.max,o=Math.abs,n=/left|center|right/,s=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,r=/^\w+/,a=/%$/,h=t.fn.position;function c(t,e,i){return[parseFloat(t[0])*(a.test(t[0])?e/100:1),parseFloat(t[1])*(a.test(t[1])?i/100:1)]}function f(e,i){return parseInt(t.css(e,i),10)||0}t.position=t.position||{scrollbarWidth:function(){if(void 0!==e)return e;var i,o,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),s=n.children()[0];return t("body").append(n),i=s.offsetWidth,n.css("overflow","scroll"),i===(o=s.offsetWidth)&&(o=n[0].clientWidth),n.remove(),e=i-o},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),o=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth;return{width:"scroll"===o||"auto"===o&&e.height<e.element[0].scrollHeight?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),o=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:o,isDocument:n,offset:!o&&!n?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return h.apply(this,arguments);e=t.extend({},e);var a,u,d,p,g,m,v,w,y=t(e.of),_=t.position.getWithinInfo(e.within),b=t.position.getScrollInfo(_),W=(e.collision||"flip").split(" "),x={};return m=9===(w=(v=y)[0]).nodeType?{width:v.width(),height:v.height(),offset:{top:0,left:0}}:t.isWindow(w)?{width:v.width(),height:v.height(),offset:{top:v.scrollTop(),left:v.scrollLeft()}}:w.preventDefault?{width:0,height:0,offset:{top:w.pageY,left:w.pageX}}:{width:v.outerWidth(),height:v.outerHeight(),offset:v.offset()},y[0].preventDefault&&(e.at="left top"),u=m.width,d=m.height,p=m.offset,g=t.extend({},p),t.each(["my","at"],function(){var t,i,o=(e[this]||"").split(" ");1===o.length&&(o=n.test(o[0])?o.concat(["center"]):s.test(o[0])?["center"].concat(o):["center","center"]),o[0]=n.test(o[0])?o[0]:"center",o[1]=s.test(o[1])?o[1]:"center",t=l.exec(o[0]),i=l.exec(o[1]),x[this]=[t?t[0]:0,i?i[0]:0],e[this]=[r.exec(o[0])[0],r.exec(o[1])[0]]}),1===W.length&&(W[1]=W[0]),"right"===e.at[0]?g.left+=u:"center"===e.at[0]&&(g.left+=u/2),"bottom"===e.at[1]?g.top+=d:"center"===e.at[1]&&(g.top+=d/2),a=c(x.at,u,d),g.left+=a[0],g.top+=a[1],this.each(function(){var n,s,l=t(this),r=l.outerWidth(),h=l.outerHeight(),m=f(this,"marginLeft"),v=f(this,"marginTop"),w=r+m+f(this,"marginRight")+b.width,C=h+v+f(this,"marginBottom")+b.height,E=t.extend({},g),P=c(x.my,l.outerWidth(),l.outerHeight());"right"===e.my[0]?E.left-=r:"center"===e.my[0]&&(E.left-=r/2),"bottom"===e.my[1]?E.top-=h:"center"===e.my[1]&&(E.top-=h/2),E.left+=P[0],E.top+=P[1],n={marginLeft:m,marginTop:v},t.each(["left","top"],function(i,o){t.ui.position[W[i]]&&t.ui.position[W[i]][o](E,{targetWidth:u,targetHeight:d,elemWidth:r,elemHeight:h,collisionPosition:n,collisionWidth:w,collisionHeight:C,offset:[a[0]+P[0],a[1]+P[1]],my:e.my,at:e.at,within:_,elem:l})}),e.using&&(s=function(t){var n=p.left-E.left,s=n+u-r,a=p.top-E.top,c=a+d-h,f={target:{element:y,left:p.left,top:p.top,width:u,height:d},element:{element:l,left:E.left,top:E.top,width:r,height:h},horizontal:s<0?"left":n>0?"right":"center",vertical:c<0?"top":a>0?"bottom":"middle"};u<r&&o(n+s)<u&&(f.horizontal="center"),d<h&&o(a+c)<d&&(f.vertical="middle"),i(o(n),o(s))>i(o(a),o(c))?f.important="horizontal":f.important="vertical",e.using.call(this,t,f)}),l.offset(t.extend(E,{using:s}))})},t.ui.position={fit:{left:function(t,e){var o,n=e.within,s=n.isWindow?n.scrollLeft:n.offset.left,l=n.width,r=t.left-e.collisionPosition.marginLeft,a=s-r,h=r+e.collisionWidth-l-s;e.collisionWidth>l?a>0&&h<=0?(o=t.left+a+e.collisionWidth-l-s,t.left+=a-o):t.left=h>0&&a<=0?s:a>h?s+l-e.collisionWidth:s:a>0?t.left+=a:h>0?t.left-=h:t.left=i(t.left-r,t.left)},top:function(t,e){var o,n=e.within,s=n.isWindow?n.scrollTop:n.offset.top,l=e.within.height,r=t.top-e.collisionPosition.marginTop,a=s-r,h=r+e.collisionHeight-l-s;e.collisionHeight>l?a>0&&h<=0?(o=t.top+a+e.collisionHeight-l-s,t.top+=a-o):t.top=h>0&&a<=0?s:a>h?s+l-e.collisionHeight:s:a>0?t.top+=a:h>0?t.top-=h:t.top=i(t.top-r,t.top)}},flip:{left:function(t,e){var i,n,s=e.within,l=s.offset.left+s.scrollLeft,r=s.width,a=s.isWindow?s.scrollLeft:s.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-a,f=h+e.collisionWidth-r-a,u="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,d="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,p=-2*e.offset[0];c<0?((i=t.left+u+d+p+e.collisionWidth-r-l)<0||i<o(c))&&(t.left+=u+d+p):f>0&&((n=t.left-e.collisionPosition.marginLeft+u+d+p-a)>0||o(n)<f)&&(t.left+=u+d+p)},top:function(t,e){var i,n,s=e.within,l=s.offset.top+s.scrollTop,r=s.height,a=s.isWindow?s.scrollTop:s.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-a,f=h+e.collisionHeight-r-a,u="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,d="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,p=-2*e.offset[1];c<0?((n=t.top+u+d+p+e.collisionHeight-r-l)<0||n<o(c))&&(t.top+=u+d+p):f>0&&((i=t.top-e.collisionPosition.marginTop+u+d+p-a)>0||o(i)<f)&&(t.top+=u+d+p)}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}();var n;t.ui.position,t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.fn.scrollParent=function(e){var i=this.css("position"),o="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var e=t(this);return(!o||"static"!==e.css("position"))&&n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&s.length?s:t(this[0].ownerDocument||document)},t.fn.extend({uniqueId:(n=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}})}); },{"jquery":"HlZQ"}],"laCd":[function(require,module,exports) { var define; var e;!function(t){"function"==typeof e&&e.amd?e(["jquery","./jquery.fancytree.ui-deps"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree.ui-deps"),module.exports=t(require("jquery"))):t(jQuery)}(function(e){"use strict";if(!e.ui||!e.ui.fancytree){var t,n,i=null,r=new RegExp(/\.|\//),o=/[&<>"'/]/g,s=/[<>"'/]/g,a={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},l={16:!0,17:!0,18:!0},d={8:"backspace",9:"tab",10:"return",13:"return",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",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:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},c={16:"shift",17:"ctrl",18:"alt",91:"meta",93:"meta"},u={0:"",1:"left",2:"middle",3:"right"},h="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),f={},p="columns types".split(" "),g="checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),v={},y={},m={active:!0,children:!0,data:!0,focus:!0};for(t=0;t<h.length;t++)f[h[t]]=!0;for(t=0;t<g.length;t++)n=g[t],v[n]=!0,n!==n.toLowerCase()&&(y[n.toLowerCase()]=n);return b(e.ui,"Fancytree requires jQuery UI (http://jqueryui.com)"),Date.now||(Date.now=function(){return(new Date).getTime()}),A.prototype={_findDirectChild:function(e){var t,n,i=this.children;if(i)if("string"==typeof e){for(t=0,n=i.length;t<n;t++)if(i[t].key===e)return i[t]}else{if("number"==typeof e)return this.children[e];if(e.parent===this)return e}return null},_setChildren:function(e){b(e&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var t=0,n=e.length;t<n;t++)this.children.push(new A(this,e[t]));this.tree._callHook("treeStructureChanged",this.tree,"setChildren")},addChildren:function(t,n){var i,r,o,s,a=this.getFirstChild(),l=this.getLastChild(),d=[];for(e.isPlainObject(t)&&(t=[t]),this.children||(this.children=[]),i=0,r=t.length;i<r;i++)d.push(new A(this,t[i]));if(s=d[0],null==n?this.children=this.children.concat(d):(n=this._findDirectChild(n),b((o=e.inArray(n,this.children))>=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[o,0].concat(d))),a&&!n){for(i=0,r=d.length;i<r;i++)d[i].render();a!==this.getFirstChild()&&a.renderStatus(),l!==this.getLastChild()&&l.renderStatus()}else(!this.parent||this.parent.ul||this.tr)&&this.render();return 3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),this.triggerModifyChild("add",1===d.length?d[0]:null),s},addClass:function(e){return this.toggleClass(e,!0)},addNode:function(e,t){switch(void 0!==t&&"over"!==t||(t="child"),t){case"after":return this.getParent().addChildren(e,this.getNextSibling());case"before":return this.getParent().addChildren(e,this);case"firstChild":var n=this.children?this.children[0]:null;return this.addChildren(e,n);case"child":case"over":return this.addChildren(e)}b(!1,"Invalid mode: "+t)},addPagingNode:function(t,n){var i,r;if(n=n||"child",!1!==t)return t=e.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},t),this.partload=!0,this.addNode(t,n);for(i=this.children.length-1;i>=0;i--)"paging"===(r=this.children[i]).statusNodeType&&this.removeChild(r);this.partload=!1},appendSibling:function(e){return this.addNode(e,"after")},applyCommand:function(e,t){return this.tree.applyCommand(e,this,t)},applyPatch:function(t){if(null===t)return this.remove(),C(this);var n,i,r={children:!0,expanded:!0,parent:!0};for(n in t)t.hasOwnProperty(n)&&(i=t[n],r[n]||e.isFunction(i)||(v[n]?this[n]=i:this.data[n]=i));return t.hasOwnProperty("children")&&(this.removeChildren(),t.children&&this._setChildren(t.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),t.hasOwnProperty("expanded")?this.setExpanded(t.expanded):C(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(e,t,n){return e.addNode(this.toDict(!0,n),t)},countChildren:function(e){var t,n,i,r=this.children;if(!r)return 0;if(i=r.length,!1!==e)for(t=0,n=i;t<n;t++)i+=r[t].countChildren();return i},debug:function(e){this.tree.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),x("log",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},discardMarkup:function(e){var t=e?"nodeRemoveMarkup":"nodeRemoveChildMarkup";this.tree._callHook(t,this)},error:function(e){this.tree.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),x("error",arguments))},findAll:function(t){t=e.isFunction(t)?t:L(t);var n=[];return this.visit(function(e){t(e)&&n.push(e)}),n},findFirst:function(t){t=e.isFunction(t)?t:L(t);var n=null;return this.visit(function(e){if(t(e))return n=e,!1}),n},findRelatedNode:function(e,t){return this.tree.findRelatedNode(this,e,t)},_changeSelectStatusAttrs:function(e){var t=!1,n=this.tree.options,r=i.evalOption("unselectable",this,this,n,!1),o=i.evalOption("unselectableStatus",this,this,n,void 0);switch(r&&null!=o&&(e=o),e){case!1:t=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:t=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case void 0:t=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:b(!1,"invalid state: "+e)}return t&&this.renderStatus(),t},fixSelection3AfterClick:function(e){var t=this.isSelected();this.visit(function(e){if(e._changeSelectStatusAttrs(t),e.radiogroup)return"skip"}),this.fixSelection3FromEndNodes(e)},fixSelection3FromEndNodes:function(e){var t=this.tree.options;b(3===t.selectMode,"expected selectMode 3"),function e(n){var r,o,s,a,l,d,c,u,h=n.children;if(h&&h.length){for(d=!0,c=!1,r=0,o=h.length;r<o;r++)a=e(s=h[r]),i.evalOption("unselectableIgnore",s,s,t,!1)||(!1!==a&&(c=!0),!0!==a&&(d=!1));l=!!d||!!c&&void 0}else l=null==(u=i.evalOption("unselectableStatus",n,n,t,void 0))?!!n.selected:!!u;return n.partsel&&!n.selected&&n.lazy&&null==n.children&&(l=void 0),n._changeSelectStatusAttrs(l),l}(this),this.visitParents(function(e){var n,r,o,s,a,l=e.children,d=!0,c=!1;for(n=0,r=l.length;n<r;n++)o=l[n],i.evalOption("unselectableIgnore",o,o,t,!1)||(((s=null==(a=i.evalOption("unselectableStatus",o,o,t,void 0))?!!o.selected:!!a)||o.partsel)&&(c=!0),s||(d=!1));s=!!d||!!c&&void 0,e._changeSelectStatusAttrs(s)})},fromDict:function(t){for(var n in t)v[n]?this[n]=t[n]:"data"===n?e.extend(this.data,t.data):e.isFunction(t[n])||m[n]||(this.data[n]=t[n]);t.children&&(this.removeChildren(),this.addChildren(t.children)),this.renderTitle()},getChildren:function(){if(void 0!==this.hasChildren())return this.children},getFirstChild:function(){return this.children?this.children[0]:null},getIndex:function(){return e.inArray(this,this.parent.children)},getIndexHier:function(t,n){t=t||".";var i,r=[];return e.each(this.getParentList(!1,!0),function(e,t){i=""+(t.getIndex()+1),n&&(i=("0000000"+i).substr(-n)),r.push(i)}),r.join(t)},getKeyPath:function(e){var t=this.tree.options.keyPathSeparator;return t+this.getPath(!e,"key",t)},getLastChild:function(){return this.children?this.children[this.children.length-1]:null},getLevel:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e},getNextSibling:function(){if(this.parent){var e,t,n=this.parent.children;for(e=0,t=n.length-1;e<t;e++)if(n[e]===this)return n[e+1]}return null},getParent:function(){return this.parent},getParentList:function(e,t){for(var n=[],i=t?this:this.parent;i;)(e||i.parent)&&n.unshift(i),i=i.parent;return n},getPath:function(t,n,i){t=!1!==t,n=n||"title",i=i||"/";var r,o=[],s=e.isFunction(n);return this.visitParents(function(e){e.parent&&(r=s?n(e):e[n],o.unshift(r))},t),o.join(i)},getPrevSibling:function(){if(this.parent){var e,t,n=this.parent.children;for(e=1,t=n.length;e<t;e++)if(n[e]===this)return n[e-1]}return null},getSelectedNodes:function(e){var t=[];return this.visit(function(n){if(n.selected&&(t.push(n),!0===e))return"skip"}),t},hasChildren:function(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)},hasClass:function(e){return(" "+(this.extraClasses||"")+" ").indexOf(" "+e+" ")>=0},hasFocus:function(){return this.tree.hasFocus()&&this.tree.focusNode===this},info:function(e){this.tree.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),x("info",arguments))},isActive:function(){return this.tree.activeNode===this},isBelowOf:function(e){return this.getIndexHier(".",5)>e.getIndexHier(".",5)},isChildOf:function(e){return this.parent&&this.parent===e},isDescendantOf:function(t){if(!t||t.tree!==this.tree)return!1;for(var n=this.parent;n;){if(n===t)return!0;n===n.parent&&e.error("Recursive parent link: "+n),n=n.parent}return!1},isExpanded:function(){return!!this.expanded},isFirstSibling:function(){var e=this.parent;return!e||e.children[0]===this},isFolder:function(){return!!this.folder},isLastSibling:function(){var e=this.parent;return!e||e.children[e.children.length-1]===this},isLazy:function(){return!!this.lazy},isLoaded:function(){return!this.lazy||void 0!==this.hasChildren()},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.isRootNode()},isPartsel:function(){return!this.selected&&!!this.partsel},isPartload:function(){return!!this.partload},isRootNode:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isPagingNode:function(){return"paging"===this.statusNodeType},isTopLevel:function(){return this.tree.rootNode===this.parent},isUndefined:function(){return void 0===this.hasChildren()},isVisible:function(){var e,t,n=this.tree.enableFilter,i=this.getParentList(!1,!1);if(n&&!this.match&&!this.subMatchCount)return!1;for(e=0,t=i.length;e<t;e++)if(!i[e].expanded)return!1;return!0},lazyLoad:function(t){e.error("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead.")},load:function(e){var t,n,i=this,r=this.isExpanded();return b(this.isLazy(),"load() requires a lazy node"),e||this.isUndefined()?(this.isLoaded()&&this.resetLazy(),!1===(n=this.tree._triggerNodeEvent("lazyLoad",this))?C(this):(b("boolean"!=typeof n,"lazyLoad event must return source in data.result"),t=this.tree._callHook("nodeLoadChildren",this,n),r?(this.expanded=!0,t.always(function(){i.render()})):t.always(function(){i.renderStatus()}),t)):C(this)},makeVisible:function(t){var n,i=this,r=[],o=new e.Deferred,s=this.getParentList(!1,!1),a=s.length,l=!(t&&!0===t.noAnimation),d=!(t&&!1===t.scrollIntoView);for(n=a-1;n>=0;n--)r.push(s[n].setExpanded(!0,t));return e.when.apply(e,r).done(function(){d?i.scrollIntoView(l).done(function(){o.resolve()}):o.resolve()}),o.promise()},moveTo:function(t,n,i){void 0===n||"over"===n?n="child":"firstChild"===n&&(t.children&&t.children.length?(n="before",t=t.children[0]):n="child");var r,o=this.tree,s=this.parent,a="child"===n?t:t.parent;if(this!==t){if(this.parent?a.isDescendantOf(this)&&e.error("Cannot move a node to its own descendant"):e.error("Cannot move system root"),a!==s&&s.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===a)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else b((r=e.inArray(this,this.parent.children))>=0,"invalid source parent"),this.parent.children.splice(r,1);if(this.parent=a,a.hasChildren())switch(n){case"child":a.children.push(this);break;case"before":b((r=e.inArray(t,a.children))>=0,"invalid target parent"),a.children.splice(r,0,this);break;case"after":b((r=e.inArray(t,a.children))>=0,"invalid target parent"),a.children.splice(r+1,0,this);break;default:e.error("Invalid mode "+n)}else a.children=[this];i&&t.visit(i,!0),a===s?a.triggerModifyChild("move",this):a.triggerModifyChild("add",this),o!==t.tree&&(this.warn("Cross-tree moveTo is experimental!"),this.visit(function(e){e.tree=t.tree},!0)),o._callHook("treeStructureChanged",o,"moveTo"),s.isDescendantOf(a)||s.render(),a.isDescendantOf(s)||a===s||a.render()}},navigate:function(t,n){var i,r=e.ui.keyCode;switch(t){case"left":case r.LEFT:if(this.expanded)return this.setExpanded(!1);break;case"right":case r.RIGHT:if(!this.expanded&&(this.children||this.lazy))return this.setExpanded()}if(i=this.findRelatedNode(t)){try{i.makeVisible({scrollIntoView:!1})}catch(o){}return!1===n?(i.setFocus(),C()):i.setActive()}return this.warn("Could not find related node '"+t+"'."),C()},remove:function(){return this.parent.removeChild(this)},removeChild:function(e){return this.tree._callHook("nodeRemoveChild",this,e)},removeChildren:function(){return this.tree._callHook("nodeRemoveChildren",this)},removeClass:function(e){return this.toggleClass(e,!1)},render:function(e,t){return this.tree._callHook("nodeRender",this,e,t)},renderTitle:function(){return this.tree._callHook("nodeRenderTitle",this)},renderStatus:function(){return this.tree._callHook("nodeRenderStatus",this)},replaceWith:function(n){var i,r=this.parent,o=e.inArray(this,r.children),s=this;return b(this.isPagingNode(),"replaceWith() currently requires a paging status node"),(i=this.tree._callHook("nodeLoadChildren",this,n)).done(function(e){var n=s.children;for(t=0;t<n.length;t++)n[t].parent=r;r.children.splice.apply(r.children,[o+1,0].concat(n)),s.children=null,s.remove(),r.render()}).fail(function(){s.setExpanded()}),i},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=void 0,this.renderStatus()},scheduleAction:function(t,n){this.tree.timer&&(clearTimeout(this.tree.timer),this.tree.debug("clearTimeout(%o)",this.tree.timer)),this.tree.timer=null;var i=this;switch(t){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){i.tree.debug("setTimeout: trigger expand"),i.setExpanded(!0)},n);break;case"activate":this.tree.timer=setTimeout(function(){i.tree.debug("setTimeout: trigger activate"),i.setActive(!0)},n);break;default:e.error("Invalid mode "+t)}},scrollIntoView:function(t,n){if(void 0!==n&&((i=n).tree&&void 0!==i.statusNodeType))throw Error("scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.");var i,r=e.extend({effects:!0===t?{duration:200,queue:!1}:t,scrollOfs:this.tree.options.scrollOfs,scrollParent:this.tree.options.scrollParent,topNode:null},n),o=r.scrollParent,s=this.tree.$container,a=s.css("overflow-y");o?o.jquery||(o=e(o)):o=this.tree.tbody?s.scrollParent():"scroll"===a||"auto"===a?s:s.scrollParent(),o[0]!==document&&o[0]!==document.body||(this.debug("scrollIntoView(): normalizing scrollParent to 'window':",o[0]),o=e(window));var l,d,c,u=new e.Deferred,h=this,f=e(this.span).height(),p=r.scrollOfs.top||0,g=r.scrollOfs.bottom||0,v=o.height(),y=o.scrollTop(),m=o,x=o[0]===window,k=r.topNode||null,N=null;return this.isRootNode()||!this.isVisible()?(this.info("scrollIntoView(): node is invisible."),C()):(x?(d=e(this.span).offset().top,l=k&&k.span?e(k.span).offset().top:0,m=e("html,body")):(b(o[0]!==document&&o[0]!==document.body,"scrollParent should be a simple element or `window`, not document or body."),c=o.offset().top,d=e(this.span).offset().top-c+y,l=k?e(k.span).offset().top-c+y:0,v-=Math.max(0,o.innerHeight()-o[0].clientHeight)),d<y+p?N=d-p:d+f>y+v-g&&(N=d+f-v+g,k&&(b(k.isRootNode()||k.isVisible(),"topNode must be visible"),l<N&&(N=l-p))),null===N?u.resolveWith(this):r.effects?(r.effects.complete=function(){u.resolveWith(h)},m.stop(!0).animate({scrollTop:N},r.effects)):(m[0].scrollTop=N,u.resolveWith(this)),u.promise())},setActive:function(e,t){return this.tree._callHook("nodeSetActive",this,e,t)},setExpanded:function(e,t){return this.tree._callHook("nodeSetExpanded",this,e,t)},setFocus:function(e){return this.tree._callHook("nodeSetFocus",this,e)},setSelected:function(e,t){return this.tree._callHook("nodeSetSelected",this,e,t)},setStatus:function(e,t,n){return this.tree._callHook("nodeSetStatus",this,e,t,n)},setTitle:function(e){this.title=e,this.renderTitle(),this.triggerModify("rename")},sortChildren:function(e,t){var n,i,r=this.children;if(r){if(e=e||function(e,t){var n=e.title.toLowerCase(),i=t.title.toLowerCase();return n===i?0:n>i?1:-1},r.sort(e),t)for(n=0,i=r.length;n<i;n++)r[n].children&&r[n].sortChildren(e,"$norender$");"$norender$"!==t&&this.render(),this.triggerModifyChild("sort")}},toDict:function(t,n){var i,r,o,s,a={},l=this;if(e.each(g,function(e,t){(l[t]||!1===l[t])&&(a[t]=l[t])}),e.isEmptyObject(this.data)||(a.data=e.extend({},this.data),e.isEmptyObject(a.data)&&delete a.data),n){if(!1===(s=n(a,l)))return!1;"skip"===s&&(t=!1)}if(t&&e.isArray(this.children))for(a.children=[],i=0,r=this.children.length;i<r;i++)(o=this.children[i]).isStatusNode()||!1!==(s=o.toDict(!0,n))&&a.children.push(s);return a},toggleClass:function(t,n){var i,r,o=t.match(/\S+/g)||[],s=0,a=!1,l=this[this.tree.statusClassPropName],d=" "+(this.extraClasses||"")+" ";for(l&&e(l).toggleClass(t,n);i=o[s++];)if(r=d.indexOf(" "+i+" ")>=0,n=void 0===n?!r:!!n)r||(d+=i+" ",a=!0);else for(;d.indexOf(" "+i+" ")>-1;)d=d.replace(" "+i+" "," ");return this.extraClasses=e.trim(d),a},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return"FancytreeNode@"+this.key+"[title='"+this.title+"']"},triggerModifyChild:function(t,n,i){var r,o=this.tree.options.modifyChild;o&&(n&&n.parent!==this&&e.error("childNode "+n+" is not a child of "+this),r={node:this,tree:this.tree,operation:t,childNode:n||null},i&&e.extend(r,i),o({type:"modifyChild"},r))},triggerModify:function(e,t){this.parent.triggerModifyChild(e,this,t)},visit:function(e,t){var n,i,r=!0,o=this.children;if(!0===t&&(!1===(r=e(this))||"skip"===r))return r;if(o)for(n=0,i=o.length;n<i&&!1!==(r=o[n].visit(e,!0));n++);return r},visitAndLoad:function(t,n,i){var r,o,s,a=this;return!t||!0!==n||!1!==(o=t(a))&&"skip"!==o?a.children||a.lazy?(r=new e.Deferred,s=[],a.load().done(function(){for(var n=0,i=a.children.length;n<i;n++){if(!1===(o=a.children[n].visitAndLoad(t,!0,!0))){r.reject();break}"skip"!==o&&s.push(o)}e.when.apply(this,s).then(function(){r.resolve()})}),r.promise()):C():i?o:C()},visitParents:function(e,t){if(t&&!1===e(this))return!1;for(var n=this.parent;n;){if(!1===e(n))return!1;n=n.parent}return!0},visitSiblings:function(e,t){var n,i,r,o=this.parent.children;for(n=0,i=o.length;n<i;n++)if(r=o[n],(t||r!==this)&&!1===e(r))return!1;return!0},warn:function(e){this.tree.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),x("warn",arguments))}},P.prototype={_makeHookContext:function(t,n,i){var r,o;return void 0!==t.node?(n&&t.originalEvent!==n&&e.error("invalid args"),r=t):t.tree?r={node:t,tree:o=t.tree,widget:o.widget,options:o.widget.options,originalEvent:n,typeInfo:o.types[t.type]||{}}:t.widget?r={node:null,tree:t,widget:t.widget,options:t.widget.options,originalEvent:n}:e.error("invalid args"),i&&e.extend(r,i),r},_callHook:function(t,n,i){var r=this._makeHookContext(n),o=this[t],s=Array.prototype.slice.call(arguments,2);return e.isFunction(o)||e.error("_callHook('"+t+"') is not a function"),s.unshift(r),o.apply(this,s)},_setExpiringValue:function(e,t,n){this._tempCache[e]={value:t,expire:Date.now()+(+n||50)}},_getExpiringValue:function(e){var t=this._tempCache[e];return t&&t.expire>Date.now()?t.value:(delete this._tempCache[e],null)},_usesExtension:function(t){return e.inArray(t,this.options.extensions)>=0},_requireExtension:function(t,n,i,r){null!=i&&(i=!!i);var o=this._local.name,s=this.options.extensions,a=e.inArray(t,s)<e.inArray(o,s),l=n&&null==this.ext[t],d=!l&&null!=i&&i!==a;return b(o&&o!==t,"invalid or same name '"+o+"' (require yourself?)"),!l&&!d||(r||(l||n?(r="'"+o+"' extension requires '"+t+"'",d&&(r+=" to be registered "+(i?"before":"after")+" itself")):r="If used together, `"+t+"` must be registered "+(i?"before":"after")+" `"+o+"`"),e.error(r),!1)},activateKey:function(e,t){var n=this.getNodeByKey(e);return n?n.setActive(!0,t):this.activeNode&&this.activeNode.setActive(!1,t),n},addPagingNode:function(e,t){return this.rootNode.addPagingNode(e,t)},applyCommand:function(t,n,i){var r;switch(n=n||this.getActiveNode(),t){case"moveUp":(r=n.getPrevSibling())&&(n.moveTo(r,"before"),n.setActive());break;case"moveDown":(r=n.getNextSibling())&&(n.moveTo(r,"after"),n.setActive());break;case"indent":(r=n.getPrevSibling())&&(n.moveTo(r,"child"),r.setExpanded(),n.setActive());break;case"outdent":n.isTopLevel()||(n.moveTo(n.getParent(),"after"),n.setActive());break;case"remove":r=n.getPrevSibling()||n.getParent(),n.remove(),r&&r.setActive();break;case"addChild":n.editCreateNode("child","");break;case"addSibling":n.editCreateNode("after","");break;case"rename":n.editStart();break;case"down":case"first":case"last":case"left":case"parent":case"right":case"up":return n.navigate(t);default:e.error("Unhandled command: '"+t+"'")}},applyPatch:function(t){var n,i,r,o,s,a,l=t.length,d=[];for(i=0;i<l;i++)b(2===(r=t[i]).length,"patchList must be an array of length-2-arrays"),o=r[0],s=r[1],(a=null===o?this.rootNode:this.getNodeByKey(o))?(n=new e.Deferred,d.push(n),a.applyPatch(s).always(S(n,a))):this.warn("could not find node with key '"+o+"'");return e.when.apply(e,d).promise()},clear:function(e){this._callHook("treeClear",this)},count:function(){return this.rootNode.countChildren()},debug:function(e){this.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),x("log",arguments))},destroy:function(){this.widget.destroy()},enable:function(e){!1===e?this.widget.disable():this.widget.enable()},enableUpdate:function(e){return e=!1!==e,!!this._enableUpdate==!!e?e:(this._enableUpdate=e,e?(this.debug("enableUpdate(true): redraw "),this._callHook("treeStructureChanged",this,"enableUpdate"),this.render()):this.debug("enableUpdate(false)..."),!e)},error:function(e){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),x("error",arguments))},expandAll:function(e,t){var n=this.enableUpdate(!1);e=!1!==e,this.visit(function(n){!1!==n.hasChildren()&&n.isExpanded()!==e&&n.setExpanded(e,t)}),this.enableUpdate(n)},findAll:function(e){return this.rootNode.findAll(e)},findFirst:function(e){return this.rootNode.findFirst(e)},findNextNode:function(e,t){var n,i=null,r=this.getFirstChild();function o(n){if(e(n)&&(i=n),i||n===t)return!1}return e="string"==typeof e?(n=new RegExp("^"+e,"i"),function(e){return n.test(e.title)}):e,t=t||r,this.visitRows(o,{start:t,includeSelf:!1}),i||t===r||this.visitRows(o,{start:r,includeSelf:!0}),i},findRelatedNode:function(t,n,i){var r=null,o=e.ui.keyCode;switch(n){case"parent":case o.BACKSPACE:t.parent&&t.parent.parent&&(r=t.parent);break;case"first":case o.HOME:this.visit(function(e){if(e.isVisible())return r=e,!1});break;case"last":case o.END:this.visit(function(e){e.isVisible()&&(r=e)});break;case"left":case o.LEFT:t.expanded?t.setExpanded(!1):t.parent&&t.parent.parent&&(r=t.parent);break;case"right":case o.RIGHT:t.expanded||!t.children&&!t.lazy?t.children&&t.children.length&&(r=t.children[0]):(t.setExpanded(),r=t);break;case"up":case o.UP:this.visitRows(function(e){return r=e,!1},{start:t,reverse:!0,includeSelf:!1});break;case"down":case o.DOWN:this.visitRows(function(e){return r=e,!1},{start:t,includeSelf:!1});break;default:this.tree.warn("Unknown relation '"+n+"'.")}return r},generateFormElements:function(t,n,i){i=i||{};var r,o="string"==typeof t?t:"ft_"+this._id+"[]",s="string"==typeof n?n:"ft_"+this._id+"_active",a="fancytree_result_"+this._id,l=e("#"+a),d=3===this.options.selectMode&&!1!==i.stopOnParents;function c(t){l.append(e("<input>",{type:"checkbox",name:o,value:t.key,checked:!0}))}l.length?l.empty():l=e("<div>",{id:a}).hide().insertAfter(this.$container),!1!==n&&this.activeNode&&l.append(e("<input>",{type:"radio",name:s,value:this.activeNode.key,checked:!0})),i.filter?this.visit(function(e){var t=i.filter(e);if("skip"===t)return t;!1!==t&&c(e)}):!1!==t&&(r=this.getSelectedNodes(d),e.each(r,function(e,t){c(t)}))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getOption:function(e){return this.widget.option(e)},getNodeByKey:function(e,t){var n,i;return!t&&(n=document.getElementById(this.options.idPrefix+e))?n.ftnode?n.ftnode:null:(t=t||this.rootNode,i=null,e=""+e,t.visit(function(t){if(t.key===e)return i=t,!1},!0),i)},getRootNode:function(){return this.rootNode},getSelectedNodes:function(e){return this.rootNode.getSelectedNodes(e)},hasFocus:function(){return!!this._hasFocus},info:function(e){this.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),x("info",arguments))},isLoading:function(){var e=!1;return this.rootNode.visit(function(t){if(t._isLoading||t._requestId)return e=!0,!1},!0),e},loadKeyPath:function(t,n){var i,r,o,s=this,a=new e.Deferred,l=this.getRootNode(),d=this.options.keyPathSeparator,c=[],u=e.extend({},n);for("function"==typeof n?i=n:n&&n.callback&&(i=n.callback),u.callback=function(e,t,n){i&&i.call(e,t,n),a.notifyWith(e,[{node:t,status:n}])},null==u.matchKey&&(u.matchKey=function(e,t){return e.key===t}),e.isArray(t)||(t=[t]),r=0;r<t.length;r++)(o=t[r]).charAt(0)===d&&(o=o.substr(1)),c.push(o.split(d));return setTimeout(function(){s._loadKeyPathImpl(a,u,l,c).done(function(){a.resolve()})},0),a.promise()},_loadKeyPathImpl:function(t,n,i,r){var o,s,a,l,d,c,u,h,f,p,g=this;function v(e,t){var i,r,o=e.children;if(o)for(i=0,r=o.length;i<r;i++)if(n.matchKey(o[i],t))return o[i];return null}for(u={},s=0;s<r.length;s++)for(f=r[s],h=i;f.length;){if(a=f.shift(),!(l=v(h,a))){this.warn("loadKeyPath: key not found: "+a+" (parent: "+h+")"),n.callback(this,a,"error");break}if(0===f.length){n.callback(this,l,"ok");break}if(l.lazy&&void 0===l.hasChildren()){n.callback(this,l,"loaded"),u[a=l.key]?u[a].pathSegList.push(f):u[a]={parent:l,pathSegList:[f]};break}n.callback(this,l,"loaded"),h=l}function y(e,t,i){n.callback(g,t,"loading"),t.load().done(function(){g._loadKeyPathImpl.call(g,e,n,t,i).always(S(e,g))}).fail(function(i){g.warn("loadKeyPath: error loading lazy "+t),n.callback(g,l,"error"),e.rejectWith(g)})}for(d in o=[],u)u.hasOwnProperty(d)&&(c=u[d],p=new e.Deferred,o.push(p),y(p,c.parent,c.pathSegList));return e.when.apply(e,o).promise()},reactivate:function(e){var t,n=this.activeNode;return n?(this.activeNode=null,t=n.setActive(!0,{noFocus:!0}),e&&n.setFocus(),t):C()},reload:function(e){return this._callHook("treeClear",this),this._callHook("treeLoad",this,e)},render:function(e,t){return this.rootNode.render(e,t)},selectAll:function(e){this.visit(function(t){t.setSelected(e)})},setFocus:function(e){return this._callHook("treeSetFocus",this,e)},setOption:function(e,t){return this.widget.option(e,t)},debugTime:function(e){this.options.debugLevel>=4&&window.console.time(this+" - "+e)},debugTimeEnd:function(e){this.options.debugLevel>=4&&window.console.timeEnd(this+" - "+e)},toDict:function(e,t){var n=this.rootNode.toDict(!0,t);return e?n:n.children},toString:function(){return"Fancytree@"+this._id},_triggerNodeEvent:function(e,t,n,i){var r=this._makeHookContext(t,n,i),o=this.widget._trigger(e,n,r);return!1!==o&&void 0!==r.result?r.result:o},_triggerTreeEvent:function(e,t,n){var i=this._makeHookContext(this,t,n),r=this.widget._trigger(e,t,i);return!1!==r&&void 0!==i.result?i.result:r},visit:function(e){return this.rootNode.visit(e,!1)},visitRows:function(e,t){if(!this.rootNode.hasChildren())return!1;if(t&&t.reverse)return delete t.reverse,this._visitRowsUp(e,t);var n,i,r,o=0,s=!1===(t=t||{}).includeSelf,a=!!t.includeHidden,l=!a&&this.enableFilter,d=t.start||this.rootNode.children[0];for(i=d.parent;i;){for(n=(r=i.children).indexOf(d)+o;n<r.length;n++)if(d=r[n],!l||d.match||d.subMatchCount){if(!s&&!1===e(d))return!1;if(s=!1,d.children&&d.children.length&&(a||d.expanded)&&!1===d.visit(function(t){return!l||t.match||t.subMatchCount?!1!==e(t)&&(a||!t.children||t.expanded?void 0:"skip"):"skip"},!1))return!1}d=i,i=i.parent,o=1}return!0},_visitRowsUp:function(e,t){for(var n,i,r,o=!!t.includeHidden,s=t.start||this.rootNode.children[0];;){if((n=(r=s.parent).children)[0]===s){if(!(s=r).parent)break;n=r.children}else for(i=n.indexOf(s),s=n[i-1];(o||s.expanded)&&s.children&&s.children.length;)r=s,s=(n=s.children)[n.length-1];if((o||s.isVisible())&&!1===e(s))return!1}},warn:function(e){this.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),x("warn",arguments))}},e.extend(P.prototype,{nodeClick:function(e){var t,n,i=e.targetType,r=e.node;if("expander"===i){if(r.isLoading())return void r.debug("Got 2nd click while loading: ignored");this._callHook("nodeToggleExpanded",e)}else if("checkbox"===i)this._callHook("nodeToggleSelected",e),e.options.focusOnSelect&&this._callHook("nodeSetFocus",e,!0);else{if(n=!1,t=!0,r.folder)switch(e.options.clickFolderMode){case 2:n=!0,t=!1;break;case 3:t=!0,n=!0}t&&(this.nodeSetFocus(e),this._callHook("nodeSetActive",e,!0)),n&&this._callHook("nodeToggleExpanded",e)}},nodeCollapseSiblings:function(e,t){var n,i,r,o=e.node;if(o.parent)for(i=0,r=(n=o.parent.children).length;i<r;i++)n[i]!==o&&n[i].expanded&&this._callHook("nodeSetExpanded",n[i],!1,t)},nodeDblclick:function(e){"title"===e.targetType&&4===e.options.clickFolderMode&&this._callHook("nodeToggleExpanded",e),"title"===e.targetType&&e.originalEvent.preventDefault()},nodeKeydown:function(t){var n,r,o,s=t.originalEvent,a=t.node,l=t.tree,u=t.options,h=s.which,f=s.key||String.fromCharCode(h),p=!!(s.altKey||s.ctrlKey||s.metaKey),g=!c[h]&&!d[h]&&!p,v=e(s.target),y=!0,m=!(s.ctrlKey||!u.autoActivate);if(a||(o=this.getActiveNode()||this.getFirstChild())&&(o.setFocus(),(a=t.node=this.focusNode).debug("Keydown force focus on active node")),u.quicksearch&&g&&!v.is(":input:enabled"))return(r=Date.now())-l.lastQuicksearchTime>500&&(l.lastQuicksearchTerm=""),l.lastQuicksearchTime=r,l.lastQuicksearchTerm+=f,(n=l.findNextNode(l.lastQuicksearchTerm,l.getActiveNode()))&&n.setActive(),void s.preventDefault();switch(i.eventToString(s)){case"+":case"=":l.nodeSetExpanded(t,!0);break;case"-":l.nodeSetExpanded(t,!1);break;case"space":a.isPagingNode()?l._triggerNodeEvent("clickPaging",t,s):i.evalOption("checkbox",a,a,u,!1)?l.nodeToggleSelected(t):l.nodeSetActive(t,!0);break;case"return":l.nodeSetActive(t,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":a.navigate(s.which,m);break;default:y=!1}y&&s.preventDefault()},nodeLoadChildren:function(t,n){var i,r,o,s=null,a=!0,l=t.tree,d=t.node,c=d.parent,u="nodeLoadChildren",h=Date.now();return e.isFunction(n)&&(n=n.call(l,{type:"source"},t),b(!e.isFunction(n),"source callback must not return another function")),e.isFunction(n.then)?s=n:n.url?(i=e.extend({},t.options.ajax,n)).debugDelay?(r=i.debugDelay,delete i.debugDelay,e.isArray(r)&&(r=r[0]+Math.random()*(r[1]-r[0])),d.warn("nodeLoadChildren waiting debugDelay "+Math.round(r)+" ms ..."),s=e.Deferred(function(t){setTimeout(function(){e.ajax(i).done(function(){t.resolveWith(this,arguments)}).fail(function(){t.rejectWith(this,arguments)})},r)})):s=e.ajax(i):e.isPlainObject(n)||e.isArray(n)?(s={then:function(e,t){e(n,null,null)}},a=!1):e.error("Invalid source type: "+n),d._requestId&&(d.warn("Recursive load request #"+h+" while #"+d._requestId+" is pending."),d._requestId=h),a&&(l.debugTime(u),l.nodeSetStatus(t,"loading")),o=new e.Deferred,s.then(function(i,r,s){var a,u;if("json"!==n.dataType&&"jsonp"!==n.dataType||"string"!=typeof i||e.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),d._requestId&&d._requestId>h)o.rejectWith(this,["$recursive_request"]);else if(null!==d.parent||null===c){if(t.options.postProcess){try{(u=l._triggerNodeEvent("postProcess",t,t.originalEvent,{response:i,error:null,dataType:n.dataType})).error&&l.warn("postProcess returned error:",u)}catch(f){u={error:f,message:""+f,details:"postProcess failed"}}if(u.error)return a=e.isPlainObject(u.error)?u.error:{message:u.error},a=l._makeHookContext(d,null,a),void o.rejectWith(this,[a]);(e.isArray(u)||e.isPlainObject(u)&&e.isArray(u.children))&&(i=u)}else i&&i.hasOwnProperty("d")&&t.options.enableAspx&&(42===t.options.enableAspx&&l.warn("The default for enableAspx will change to `false` in the fututure. Pass `enableAspx: true` or implement postProcess to silence this warning."),i="string"==typeof i.d?e.parseJSON(i.d):i.d);o.resolveWith(this,[i])}else o.rejectWith(this,["$request_target_invalid"])},function(e,t,n){var i=l._makeHookContext(d,null,{error:e,args:Array.prototype.slice.call(arguments),message:n,details:e.status+": "+n});o.rejectWith(this,[i])}),o.done(function(n){var i,r,o;l.nodeSetStatus(t,"ok"),e.isPlainObject(n)?(b(d.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),b(e.isArray(n.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),r=n,i=n.children,delete r.children,e.each(p,function(e,t){void 0!==r[t]&&(l[t]=r[t],delete r[t])}),e.extend(l.data,r)):i=n,b(e.isArray(i),"expected array of children"),d._setChildren(i),l.options.nodata&&0===i.length&&(e.isFunction(l.options.nodata)?o=l.options.nodata.call(l,{type:"nodata"},t):!0===l.options.nodata&&d.isRootNode()?o=l.options.strings.noData:"string"==typeof l.options.nodata&&d.isRootNode()&&(o=l.options.nodata),o&&d.setStatus("nodata",o)),l._triggerNodeEvent("loadChildren",d)}).fail(function(e){var n;"$recursive_request"!==e?"$request_target_invalid"!==e?(e.node&&e.error&&e.message?n=e:"[object Object]"===(n=l._makeHookContext(d,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""})).message&&(n.message=""),d.warn("Load children failed ("+n.message+")",n),!1!==l._triggerNodeEvent("loadError",n,null)&&l.nodeSetStatus(t,"error",n.message,n.details)):d.warn("Lazy parent node was removed while loading: discarding response."):d.warn("Ignored response for obsolete load request #"+h+" (expected #"+d._requestId+")")}).always(function(){d._requestId=null,a&&l.debugTimeEnd(u)}),o.promise()},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(t,n){var i,r=t.node,o=e.extend({},t,{node:n}),s=r.children;if(1===s.length)return b(n===s[0],"invalid single child"),this.nodeRemoveChildren(t);this.activeNode&&(n===this.activeNode||this.activeNode.isDescendantOf(n))&&this.activeNode.setActive(!1),this.focusNode&&(n===this.focusNode||this.focusNode.isDescendantOf(n))&&(this.focusNode=null),this.nodeRemoveMarkup(o),this.nodeRemoveChildren(o),b((i=e.inArray(n,s))>=0,"invalid child"),r.triggerModifyChild("remove",n),n.visit(function(e){e.parent=null},!0),this._callHook("treeRegisterNode",this,!1,n),s.splice(i,1)},nodeRemoveChildMarkup:function(t){var n=t.node;n.ul&&(n.isRootNode()?e(n.ul).empty():(e(n.ul).remove(),n.ul=null),n.visit(function(e){e.li=e.ul=null}))},nodeRemoveChildren:function(e){var t=e.tree,n=e.node;n.children&&(this.activeNode&&this.activeNode.isDescendantOf(n)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(n)&&(this.focusNode=null),this.nodeRemoveChildMarkup(e),n.triggerModifyChild("remove",null),n.visit(function(e){e.parent=null,t._callHook("treeRegisterNode",t,!1,e)}),n.lazy?n.children=[]:n.children=null,n.isRootNode()||(n.expanded=!1),this.nodeRenderStatus(e))},nodeRemoveMarkup:function(t){var n=t.node;n.li&&(e(n.li).remove(),n.li=null),this.nodeRemoveChildMarkup(t)},nodeRender:function(t,n,i,r,o){var s,a,l,d,c,u,h,f=t.node,p=t.tree,g=t.options,v=g.aria,y=!1,m=f.parent,x=!m,k=f.children,N=null;if(!1!==p._enableUpdate&&(x||m.ul)){if(b(x||m.ul,"parent UL must exist"),x||(f.li&&(n||f.li.parentNode!==f.parent.ul)&&(f.li.parentNode===f.parent.ul?N=f.li.nextSibling:this.debug("Unlinking "+f+" (must be child of "+f.parent+")"),this.nodeRemoveMarkup(t)),f.li?this.nodeRenderStatus(t):(y=!0,f.li=document.createElement("li"),f.li.ftnode=f,f.key&&g.generateIds&&(f.li.id=g.idPrefix+f.key),f.span=document.createElement("span"),f.span.className="fancytree-node",v&&!f.tr&&e(f.li).attr("role","treeitem"),f.li.appendChild(f.span),this.nodeRenderTitle(t),g.createNode&&g.createNode.call(p,{type:"createNode"},t)),g.renderNode&&g.renderNode.call(p,{type:"renderNode"},t)),k){if(x||f.expanded||!0===i){for(f.ul||(f.ul=document.createElement("ul"),(!0!==r||o)&&f.expanded||(f.ul.style.display="none"),v&&e(f.ul).attr("role","group"),f.li?f.li.appendChild(f.ul):f.tree.$div.append(f.ul)),d=0,c=k.length;d<c;d++)h=e.extend({},t,{node:k[d]}),this.nodeRender(h,n,i,!1,!0);for(s=f.ul.firstChild;s;)(l=s.ftnode)&&l.parent!==f?(f.debug("_fixParent: remove missing "+l,s),u=s.nextSibling,s.parentNode.removeChild(s),s=u):s=s.nextSibling;for(s=f.ul.firstChild,d=0,c=k.length-1;d<c;d++)(a=k[d])===(l=s.ftnode)?s=s.nextSibling:f.ul.insertBefore(a.li,l.li)}}else f.ul&&(this.warn("remove child markup for "+f),this.nodeRemoveChildMarkup(t));x||y&&m.ul.insertBefore(f.li,N)}},nodeRenderTitle:function(t,n){var o,s,a,l,d,c,u,h=t.node,f=t.tree,p=t.options,g=p.aria,v=h.getLevel(),y=[];void 0!==n&&(h.title=n),h.span&&!1!==f._enableUpdate&&(d=g&&!1!==h.hasChildren()?" role='button'":"",v<p.minExpandLevel?(h.lazy||(h.expanded=!0),v>1&&y.push("<span "+d+" class='fancytree-expander fancytree-expander-fixed'></span>")):y.push("<span "+d+" class='fancytree-expander'></span>"),(o=i.evalOption("checkbox",h,h,p,!1))&&!h.isStatusNode()&&(d=g?" role='checkbox'":"",s="fancytree-checkbox",("radio"===o||h.parent&&h.parent.radiogroup)&&(s+=" fancytree-radio"),y.push("<span "+d+" class='"+s+"'></span>")),void 0!==h.data.iconClass&&(h.icon?e.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(h.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),h.icon=h.data.iconClass)),!1!==(a=i.evalOption("icon",h,h,p,!0))&&(d=g?" role='presentation'":"",u=(u=i.evalOption("iconTooltip",h,h,p,null))?" title='"+T(u)+"'":"","string"==typeof a?r.test(a)?(a="/"===a.charAt(0)?a:(p.imagePath||"")+a,y.push("<img src='"+a+"' class='fancytree-icon'"+u+" alt='' />")):y.push("<span "+d+" class='fancytree-custom-icon "+a+"'"+u+"></span>"):a.text?y.push("<span "+d+" class='fancytree-custom-icon "+(a.addClass||"")+"'"+u+">"+i.escapeHtml(a.text)+"</span>"):a.html?y.push("<span "+d+" class='fancytree-custom-icon "+(a.addClass||"")+"'"+u+">"+a.html+"</span>"):y.push("<span "+d+" class='fancytree-icon'"+u+"></span>")),l="",p.renderTitle&&(l=p.renderTitle.call(f,{type:"renderTitle"},t)||""),l||(!0===(c=i.evalOption("tooltip",h,h,p,null))&&(c=h.title),l="<span class='fancytree-title'"+(c=c?" title='"+T(c)+"'":"")+(p.titlesTabbable?" tabindex='0'":"")+">"+(p.escapeTitles?i.escapeHtml(h.title):h.title)+"</span>"),y.push(l),h.span.innerHTML=y.join(""),this.nodeRenderStatus(t),p.enhanceTitle&&(t.$title=e(">span.fancytree-title",h.span),l=p.enhanceTitle.call(f,{type:"enhanceTitle"},t)||""))},nodeRenderStatus:function(t){var n,r=t.node,o=t.tree,s=t.options,a=r.hasChildren(),l=r.isLastSibling(),d=s.aria,c=s._classNames,u=[],h=r[o.statusClassPropName];h&&!1!==o._enableUpdate&&(d&&(n=e(r.tr||r.li)),u.push(c.node),o.activeNode===r&&u.push(c.active),o.focusNode===r&&u.push(c.focused),r.expanded&&u.push(c.expanded),d&&(!1===a?n.removeAttr("aria-expanded"):n.attr("aria-expanded",Boolean(r.expanded))),r.folder&&u.push(c.folder),!1!==a&&u.push(c.hasChildren),l&&u.push(c.lastsib),r.lazy&&null==r.children&&u.push(c.lazy),r.partload&&u.push(c.partload),r.partsel&&u.push(c.partsel),i.evalOption("unselectable",r,r,s,!1)&&u.push(c.unselectable),r._isLoading&&u.push(c.loading),r._error&&u.push(c.error),r.statusNodeType&&u.push(c.statusNodePrefix+r.statusNodeType),r.selected?(u.push(c.selected),d&&n.attr("aria-selected",!0)):d&&n.attr("aria-selected",!1),r.extraClasses&&u.push(r.extraClasses),!1===a?u.push(c.combinedExpanderPrefix+"n"+(l?"l":"")):u.push(c.combinedExpanderPrefix+(r.expanded?"e":"c")+(r.lazy&&null==r.children?"d":"")+(l?"l":"")),u.push(c.combinedIconPrefix+(r.expanded?"e":"c")+(r.folder?"f":"")),h.className=u.join(" "),r.li&&e(r.li).toggleClass(c.lastsib,l))},nodeSetActive:function(t,n,i){i=i||{};var r,o=t.node,s=t.tree,a=t.options,l=!0===i.noEvents,d=!0===i.noFocus,c=!1!==i.scrollIntoView;return o===s.activeNode===(n=!1!==n)?C(o):n&&!l&&!1===this._triggerNodeEvent("beforeActivate",o,t.originalEvent)?w(o,["rejected"]):(n?(s.activeNode&&(b(s.activeNode!==o,"node was active (inconsistency)"),r=e.extend({},t,{node:s.activeNode}),s.nodeSetActive(r,!1),b(null===s.activeNode,"deactivate was out of sync?")),a.activeVisible&&o.makeVisible({scrollIntoView:c}),s.activeNode=o,s.nodeRenderStatus(t),d||s.nodeSetFocus(t),l||s._triggerNodeEvent("activate",o,t.originalEvent)):(b(s.activeNode===o,"node was not active (inconsistency)"),s.activeNode=null,this.nodeRenderStatus(t),l||t.tree._triggerNodeEvent("deactivate",o,t.originalEvent)),C(o))},nodeSetExpanded:function(t,n,i){i=i||{};var r,o,s,a,l,d,c=t.node,u=t.tree,h=t.options,f=!0===i.noAnimation,p=!0===i.noEvents;if(n=!1!==n,e(c.li).hasClass(h._classNames.animating))return c.warn("setExpanded("+n+") while animating: ignored."),w(c,["recursion"]);if(c.expanded&&n||!c.expanded&&!n)return C(c);if(n&&!c.lazy&&!c.hasChildren())return C(c);if(!n&&c.getLevel()<h.minExpandLevel)return w(c,["locked"]);if(!p&&!1===this._triggerNodeEvent("beforeExpand",c,t.originalEvent))return w(c,["rejected"]);if(f||c.isVisible()||(f=i.noAnimation=!0),o=new e.Deferred,n&&!c.expanded&&h.autoCollapse){l=c.getParentList(!1,!0),d=h.autoCollapse;try{for(h.autoCollapse=!1,s=0,a=l.length;s<a;s++)this._callHook("nodeCollapseSiblings",l[s],i)}finally{h.autoCollapse=d}}return o.done(function(){var e=c.getLastChild();n&&h.autoScroll&&!f&&e&&u._enableUpdate?e.scrollIntoView(!0,{topNode:c}).always(function(){p||t.tree._triggerNodeEvent(n?"expand":"collapse",t)}):p||t.tree._triggerNodeEvent(n?"expand":"collapse",t)}),r=function(i){var r=h._classNames,o=h.toggleEffect;if(c.expanded=n,u._callHook("treeStructureChanged",t,n?"expand":"collapse"),u._callHook("nodeRender",t,!1,!1,!0),c.ul)if("none"!==c.ul.style.display===!!c.expanded)c.warn("nodeSetExpanded: UL.style.display already set");else{if(o&&!f)return e(c.li).addClass(r.animating),void(e.isFunction(e(c.ul)[o.effect])?e(c.ul)[o.effect]({duration:o.duration,always:function(){e(this).removeClass(r.animating),e(c.li).removeClass(r.animating),i()}}):(e(c.ul).stop(!0,!0),e(c.ul).parent().find(".ui-effects-placeholder").remove(),e(c.ul).toggle(o.effect,o.options,o.duration,function(){e(this).removeClass(r.animating),e(c.li).removeClass(r.animating),i()})));c.ul.style.display=c.expanded||!parent?"":"none"}i()},n&&c.lazy&&void 0===c.hasChildren()?c.load().done(function(){o.notifyWith&&o.notifyWith(c,["loaded"]),r(function(){o.resolveWith(c)})}).fail(function(e){r(function(){o.rejectWith(c,["load failed ("+e+")"])})}):r(function(){o.resolveWith(c)}),o.promise()},nodeSetFocus:function(t,n){var i,r=t.tree,o=t.node,s=r.options,a=!!t.originalEvent&&e(t.originalEvent.target).is(":input");if(n=!1!==n,r.focusNode){if(r.focusNode===o&&n)return;i=e.extend({},t,{node:r.focusNode}),r.focusNode=null,this._triggerNodeEvent("blur",i),this._callHook("nodeRenderStatus",i)}n&&(this.hasFocus()||(o.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",t,!0,{calledByNode:!0})),o.makeVisible({scrollIntoView:!1}),r.focusNode=o,s.titlesTabbable&&(a||e(o.span).find(".fancytree-title").focus()),s.aria&&e(r.$container).attr("aria-activedescendant",e(o.tr||o.li).uniqueId().attr("id")),this._triggerNodeEvent("focus",t),document.activeElement===r.$container.get(0)||e(document.activeElement,r.$container).length>=1||e(r.$container).focus(),s.autoScroll&&o.scrollIntoView(),this._callHook("nodeRenderStatus",t))},nodeSetSelected:function(e,t,n){n=n||{};var r=e.node,o=e.tree,s=e.options,a=!0===n.noEvents,l=r.parent;if(t=!1!==t,!i.evalOption("unselectable",r,r,s,!1)){if(r._lastSelectIntent=t,!!r.selected===t&&(3!==s.selectMode||!r.partsel||t))return t;if(!a&&!1===this._triggerNodeEvent("beforeSelect",r,e.originalEvent))return!!r.selected;t&&1===s.selectMode?(o.lastSelectedNode&&o.lastSelectedNode.setSelected(!1),r.selected=t):3!==s.selectMode||!l||l.radiogroup||r.radiogroup?l&&l.radiogroup?r.visitSiblings(function(e){e._changeSelectStatusAttrs(t&&e===r)},!0):r.selected=t:(r.selected=t,r.fixSelection3AfterClick(n)),this.nodeRenderStatus(e),o.lastSelectedNode=t?r:null,a||o._triggerNodeEvent("select",e)}},nodeSetStatus:function(t,n,i,r){var o=t.node,s=t.tree;function a(n,i){var r=o.children?o.children[0]:null;return r&&r.isStatusNode()?(e.extend(r,n),r.statusNodeType=i,s._callHook("nodeRenderTitle",r)):(o._setChildren([n]),s._callHook("treeStructureChanged",t,"setStatusNode"),o.children[0].statusNodeType=i,s.render()),o.children[0]}switch(n){case"ok":!function(){var e=o.children?o.children[0]:null;if(e&&e.isStatusNode()){try{o.ul&&(o.ul.removeChild(e.li),e.li=null)}catch(n){}1===o.children.length?o.children=[]:o.children.shift(),s._callHook("treeStructureChanged",t,"clearStatusNode")}}(),o._isLoading=!1,o._error=null,o.renderStatus();break;case"loading":o.parent||a({title:s.options.strings.loading+(i?" ("+i+")":""),checkbox:!1,tooltip:r},n),o._isLoading=!0,o._error=null,o.renderStatus();break;case"error":a({title:s.options.strings.loadError+(i?" ("+i+")":""),checkbox:!1,tooltip:r},n),o._isLoading=!1,o._error={message:i,details:r},o.renderStatus();break;case"nodata":a({title:i||s.options.strings.noData,checkbox:!1,tooltip:r},n),o._isLoading=!1,o._error=null,o.renderStatus();break;default:e.error("invalid node status "+n)}},nodeToggleExpanded:function(e){return this.nodeSetExpanded(e,!e.node.expanded)},nodeToggleSelected:function(e){var t=e.node,n=!t.selected;return t.partsel&&!t.selected&&!0===t._lastSelectIntent&&(n=!1,t.selected=!0),t._lastSelectIntent=n,this.nodeSetSelected(e,n)},treeClear:function(e){var t=e.tree;t.activeNode=null,t.focusNode=null,t.$div.find(">ul.fancytree-container").empty(),t.rootNode.children=null,t._callHook("treeStructureChanged",e,"clear")},treeCreate:function(e){},treeDestroy:function(e){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("fancytree-helper-hidden")},treeInit:function(t){var n=t.tree,i=n.options;n.$container.attr("tabindex",i.tabindex),e.each(p,function(e,t){void 0!==i[t]&&(n.info("Move option "+t+" to tree"),n[t]=i[t],delete i[t])}),i.checkboxAutoHide&&n.$container.addClass("fancytree-checkbox-auto-hide"),i.rtl?n.$container.attr("DIR","RTL").addClass("fancytree-rtl"):n.$container.removeAttr("DIR").removeClass("fancytree-rtl"),i.aria&&(n.$container.attr("role","tree"),1!==i.selectMode&&n.$container.attr("aria-multiselectable",!0)),this.treeLoad(t)},treeLoad:function(t,n){var r,o,s,a=t.tree,l=t.widget.element,d=e.extend({},t,{node:this.rootNode});if(a.rootNode.children&&this.treeClear(t),n=n||this.options.source)"string"==typeof n&&e.error("Not implemented");else switch(o=l.data("type")||"html"){case"html":(s=l.find(">ul").not(".fancytree-container").first()).length?(s.addClass("ui-fancytree-source fancytree-helper-hidden"),n=e.ui.fancytree.parseHtml(s),this.data=e.extend(this.data,E(s))):(i.warn("No `source` option was passed and container does not contain `<ul>`: assuming `source: []`."),n=[]);break;case"json":n=e.parseJSON(l.text()),l.contents().filter(function(){return 3===this.nodeType}).remove(),e.isPlainObject(n)&&(b(e.isArray(n.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),r=n,n=n.children,delete r.children,e.each(p,function(e,t){void 0!==r[t]&&(a[t]=r[t],delete r[t])}),e.extend(a.data,r));break;default:e.error("Invalid data-type: "+o)}return a._triggerTreeEvent("preInit",null),this.nodeLoadChildren(d,n).done(function(){a._callHook("treeStructureChanged",t,"loadChildren"),a.render(),3===t.options.selectMode&&a.rootNode.fixSelection3FromEndNodes(),a.activeNode&&a.options.activeVisible&&a.activeNode.makeVisible(),a._triggerTreeEvent("init",null,{status:!0})}).fail(function(){a.render(),a._triggerTreeEvent("init",null,{status:!1})})},treeRegisterNode:function(e,t,n){e.tree._callHook("treeStructureChanged",e,t?"addNode":"removeNode")},treeSetFocus:function(t,n,i){var r;(n=!1!==n)!==this.hasFocus()&&(this._hasFocus=n,!n&&this.focusNode?this.focusNode.setFocus(!1):!n||i&&i.calledByNode||e(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",n),this._triggerTreeEvent(n?"focusTree":"blurTree"),n&&!this.activeNode&&(r=this._lastMousedownNode||this.getFirstChild())&&r.setFocus())},treeSetOption:function(t,n,i){var r=t.tree,o=!0,s=!1,a=!1;switch(n){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":s=!0,a=!0;break;case"checkboxAutoHide":r.$container.toggleClass("fancytree-checkbox-auto-hide",!!i);break;case"escapeTitles":case"tooltip":a=!0;break;case"rtl":!1===i?r.$container.removeAttr("DIR").removeClass("fancytree-rtl"):r.$container.attr("DIR","RTL").addClass("fancytree-rtl"),a=!0;break;case"source":o=!1,r._callHook("treeLoad",r,i),a=!0}r.debug("set option "+n+"="+i+" <"+typeof i+">"),o&&(this.widget._super?this.widget._super.call(this.widget,n,i):e.Widget.prototype._setOption.call(this.widget,n,i)),s&&r._callHook("treeCreate",r),a&&r.render(!0,!1)},treeStructureChanged:function(e,t){}}),e.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!0,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,copyFunctionsToData:!1,debugLevel:null,disabled:!1,enableAspx:42,escapeTitles:!1,extensions:[],focusOnSelect:!1,generateIds:!1,icon:!0,idPrefix:"ft_",keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,nodata:!0,quicksearch:!1,rtl:!1,scrollOfs:{top:0,bottom:0},scrollParent:null,selectMode:2,strings:{loading:"Loading...",loadError:"Load error!",moreData:"More...",noData:"No data."},tabindex:"0",titlesTabbable:!1,toggleEffect:{effect:"slideToggle",duration:200},tooltip:!1,treeId:null,_classNames:{active:"fancytree-active",animating:"fancytree-animating",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",error:"fancytree-error",expanded:"fancytree-expanded",focused:"fancytree-focused",folder:"fancytree-folder",hasChildren:"fancytree-has-children",lastsib:"fancytree-lastsib",lazy:"fancytree-lazy",loading:"fancytree-loading",node:"fancytree-node",partload:"fancytree-partload",partsel:"fancytree-partsel",radio:"fancytree-radio",selected:"fancytree-selected",statusNodePrefix:"fancytree-statusnode-",unselectable:"fancytree-unselectable"},lazyLoad:null,postProcess:null},_deprecationWarning:function(e){var t=this.tree;t&&t.options.debugLevel>=3&&t.warn("$().fancytree('"+e+"') is deprecated (see https://wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Widget.html")},_create:function(){this.tree=new P(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul").first();var t,n,i,r=this.options,o=r.extensions;this.tree;for(i=0;i<o.length;i++)n=o[i],(t=e.ui.fancytree._extensions[n])||e.error("Could not apply extension '"+n+"' (it is not registered, did you forget to include it?)"),this.tree.options[n]=k({},t.options,this.tree.options[n]),b(void 0===this.tree.ext[n],"Extension name must not exist as Fancytree.ext attribute: '"+n+"'"),this.tree.ext[n]={},_(this.tree,0,t,n),t;void 0!==r.icons&&(!0===r.icon?(this.tree.warn("'icons' tree option is deprecated since v2.14.0: use 'icon' instead"),r.icon=r.icons):e.error("'icons' tree option is deprecated since v2.14.0: use 'icon' only instead")),void 0!==r.iconClass&&(r.icon?e.error("'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead"),r.icon=r.iconClass)),void 0!==r.tabbable&&(r.tabindex=r.tabbable?"0":"-1",this.tree.warn("'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='"+r.tabindex+"' instead")),this.tree._callHook("treeCreate",this.tree)},_init:function(){this.tree._callHook("treeInit",this.tree),this._bind()},_setOption:function(e,t){return this.tree._callHook("treeSetOption",this.tree,e,t)},_destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree)},_unbind:function(){var t=this.tree._ns;this.element.off(t),this.tree.$container.off(t),e(document).off(t)},_bind:function(){var t=this,n=this.options,r=this.tree,o=r._ns;this._unbind(),r.$container.on("focusin"+o+" focusout"+o,function(t){var n=i.getNode(t),o="focusin"===t.type;if(!o&&n&&e(t.target).is("a"))n.debug("Ignored focusout on embedded <a> element.");else{if(o){if(r._getExpiringValue("focusin"))return void r.debug("Ignored double focusin.");r._setExpiringValue("focusin",!0,50),n||(n=r._getExpiringValue("mouseDownNode"))&&r.debug("Reconstruct mouse target for focusin from recent event.")}n?r._callHook("nodeSetFocus",r._makeHookContext(n,t),o):r.tbody&&e(t.target).parents("table.fancytree-container > thead").length?r.debug("Ignore focus event outside table body.",t):r._callHook("treeSetFocus",r,o)}}).on("selectstart"+o,"span.fancytree-title",function(e){e.preventDefault()}).on("keydown"+o,function(e){if(n.disabled||!1===n.keyboard)return!0;var t,i=r.focusNode,o=r._makeHookContext(i||r,e),s=r.phase;try{return r.phase="userEvent","preventNav"===(t=i?r._triggerNodeEvent("keydown",i,e):r._triggerTreeEvent("keydown",e))?t=!0:!1!==t&&(t=r._callHook("nodeKeydown",o)),t}finally{r.phase=s}}).on("mousedown"+o,function(e){var t=i.getEventTarget(e);r._lastMousedownNode=t?t.node:null,r._setExpiringValue("mouseDownNode",r._lastMousedownNode)}).on("click"+o+" dblclick"+o,function(e){if(n.disabled)return!0;var r,o=i.getEventTarget(e),s=o.node,a=t.tree,l=a.phase;if(!s)return!0;r=a._makeHookContext(s,e);try{switch(a.phase="userEvent",e.type){case"click":return r.targetType=o.type,s.isPagingNode()?!0===a._triggerNodeEvent("clickPaging",r,e):!1!==a._triggerNodeEvent("click",r,e)&&a._callHook("nodeClick",r);case"dblclick":return r.targetType=o.type,!1!==a._triggerNodeEvent("dblclick",r,e)&&a._callHook("nodeDblclick",r)}}finally{a.phase=l}})},getActiveNode:function(){return this._deprecationWarning("getActiveNode"),this.tree.activeNode},getNodeByKey:function(e){return this._deprecationWarning("getNodeByKey"),this.tree.getNodeByKey(e)},getRootNode:function(){return this._deprecationWarning("getRootNode"),this.tree.rootNode},getTree:function(){return this._deprecationWarning("getTree"),this.tree}}),i=e.ui.fancytree,e.extend(e.ui.fancytree,{version:"2.37.0",buildType:"production",debugLevel:3,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:P,_FancytreeNodeClass:A,jquerySupports:{positionMyOfs:function(t,n,i,r){var o,s,a,l=e.map(e.trim(t).split("."),function(e){return parseInt(e,10)}),d=e.map(Array.prototype.slice.call(arguments,1),function(e){return parseInt(e,10)});for(o=0;o<d.length;o++)if((s=l[o]||0)!==(a=d[o]||0))return s>a;return!0}(e.ui.version,1,9)},assert:function(e,t){return b(e,t)},createTree:function(t,n){var r=e(t).fancytree(n);return i.getTree(r)},debounce:function(e,t,n,i){var r;return 3===arguments.length&&"boolean"!=typeof n&&(i=n,n=!1),function(){var o=arguments;i=i||this,n&&!r&&t.apply(i,o),clearTimeout(r),r=setTimeout(function(){n||t.apply(i,o),r=null},e)}},debug:function(t){e.ui.fancytree.debugLevel>=4&&x("log",arguments)},error:function(t){e.ui.fancytree.debugLevel>=1&&x("error",arguments)},escapeHtml:function(e){return(""+e).replace(o,function(e){return a[e]})},fixPositionOptions:function(t){if((t.offset||(""+t.my+t.at).indexOf("%")>=0)&&e.error("expected new position syntax (but '%' is not supported)"),!e.ui.fancytree.jquerySupports.positionMyOfs){var n=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.my),i=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.at),r=(n[2]?+n[2]:0)+(i[2]?+i[2]:0),o=(n[4]?+n[4]:0)+(i[4]?+i[4]:0);t=e.extend({},t,{my:n[1]+" "+n[3],at:i[1]+" "+i[3]}),(r||o)&&(t.offset=r+" "+o)}return t},getEventTarget:function(t){var n,r=t&&t.target?t.target.className:"",o={node:this.getNode(t.target),type:void 0};return/\bfancytree-title\b/.test(r)?o.type="title":/\bfancytree-expander\b/.test(r)?o.type=!1===o.node.hasChildren()?"prefix":"expander":/\bfancytree-checkbox\b/.test(r)?o.type="checkbox":/\bfancytree(-custom)?-icon\b/.test(r)?o.type="icon":/\bfancytree-node\b/.test(r)?o.type="title":t&&t.target&&((n=e(t.target)).is("ul[role=group]")?((o.node&&o.node.tree||i).debug("Ignoring click on outer UL."),o.node=null):n.closest(".fancytree-title").length?o.type="title":n.closest(".fancytree-checkbox").length?o.type="checkbox":n.closest(".fancytree-expander").length&&(o.type="expander")),o},getEventTargetType:function(e){return this.getEventTarget(e).type},getNode:function(t){if(t instanceof A)return t;for(t instanceof e?t=t[0]:void 0!==t.originalEvent&&(t=t.target);t;){if(t.ftnode)return t.ftnode;t=t.parentNode}return null},getTree:function(t){var n,i=t;return t instanceof P?t:(void 0===t&&(t=0),"number"==typeof t?t=e(".fancytree-container").eq(t):"string"==typeof t?(t=e("#ft-id-"+i).eq(0)).length||(t=e(i).eq(0)):t instanceof Element||t instanceof HTMLDocument?t=e(t):t instanceof e?t=t.eq(0):void 0!==t.originalEvent&&(t=e(t.target)),(n=(t=t.closest(":ui-fancytree")).data("ui-fancytree")||t.data("fancytree"))?n.tree:null)},evalOption:function(t,n,i,r,o){var s,a,l=n.tree,d=r[t],c=i[t];return e.isFunction(d)?(s={node:n,tree:l,widget:l.widget,options:l.widget.options,typeInfo:l.types[n.type]||{}},null==(a=d.call(l,{type:t},s))&&(a=c)):a=null==c?d:c,null==a&&(a=o),a},setSpanIcon:function(t,n,i){var r=e(t);"string"==typeof i?r.attr("class",n+" "+i):(i.text?r.text(""+i.text):i.html&&(t.innerHTML=i.html),r.attr("class",n+" "+(i.addClass||"")))},eventToString:function(e){var t=e.which,n=e.type,i=[];return e.altKey&&i.push("alt"),e.ctrlKey&&i.push("ctrl"),e.metaKey&&i.push("meta"),e.shiftKey&&i.push("shift"),"click"===n||"dblclick"===n?i.push(u[e.button]+n):"wheel"===n?i.push(n):l[t]||i.push(d[t]||String.fromCharCode(t).toLowerCase()),i.join("+")},info:function(t){e.ui.fancytree.debugLevel>=3&&x("info",arguments)},keyEventToString:function(e){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(e)},overrideMethod:function(t,n,i,r){var o,s=t[n]||e.noop;t[n]=function(){var e=r||this;try{return o=e._super,e._super=s,i.apply(e,arguments)}finally{e._super=o}}},parseHtml:function(t){var n,i,r,o,s,a,l,d,c=t.find(">li"),u=[];return c.each(function(){var c,p,v=e(this),m=v.find(">span",this).first(),b=m.length?null:v.find(">a").first(),x={tooltip:null,data:{}};for(m.length?x.title=m.html():b&&b.length?(x.title=b.html(),x.data.href=b.attr("href"),x.data.target=b.attr("target"),x.tooltip=b.attr("title")):(x.title=v.html(),(s=x.title.search(/<ul/i))>=0&&(x.title=x.title.substring(0,s))),x.title=e.trim(x.title),o=0,a=h.length;o<a;o++)x[h[o]]=void 0;for(n=this.className.split(" "),r=[],o=0,a=n.length;o<a;o++)i=n[o],f[i]?x[i]=!0:r.push(i);if(x.extraClasses=r.join(" "),(l=v.attr("title"))&&(x.tooltip=l),(l=v.attr("id"))&&(x.key=l),v.attr("hideCheckbox")&&(x.checkbox=!1),(c=E(v))&&!e.isEmptyObject(c)){for(p in y)c.hasOwnProperty(p)&&(c[y[p]]=c[p],delete c[p]);for(o=0,a=g.length;o<a;o++)l=g[o],null!=(d=c[l])&&(delete c[l],x[l]=d);e.extend(x.data,c)}(t=v.find(">ul").first()).length?x.children=e.ui.fancytree.parseHtml(t):x.children=x.lazy?void 0:null,u.push(x)}),u},registerExtension:function(t){b(null!=t.name,"extensions must have a `name` property."),b(null!=t.version,"extensions must have a `version` property."),e.ui.fancytree._extensions[t.name]=t},unescapeHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue},warn:function(t){e.ui.fancytree.debugLevel>=2&&x("warn",arguments)}}),e.ui.fancytree}function b(t,n){t||(n=n?": "+n:"",e.error("Fancytree assertion failed"+n))}function x(e,t){var n,i,r=window.console?window.console[e]:null;if(r)try{r.apply(window.console,t)}catch(o){for(i="",n=0;n<t.length;n++)i+=t[n];r(i)}}function k(){var t,n,i,r,o,s=arguments[0]||{},a=1,l=arguments.length;if("object"==typeof s||e.isFunction(s)||(s={}),a===l)throw Error("need at least two args");for(;a<l;a++)if(null!=(t=arguments[a]))for(n in t)if(t.hasOwnProperty(n)){if(i=s[n],s===(r=t[n]))continue;r&&e.isPlainObject(r)?(o=i&&e.isPlainObject(i)?i:{},s[n]=k(o,r)):void 0!==r&&(s[n]=r)}return s}function N(e,t,n,i,r){var o,s,a,l,d;return o=t[e],s=i[e],a=t.ext[r],l=function(){return o.apply(t,arguments)},d=function(e){return o.apply(t,e)},function(){var e=t._local,n=t._super,i=t._superApply;try{return t._local=a,t._super=l,t._superApply=d,s.apply(t,arguments)}finally{t._local=e,t._super=n,t._superApply=i}}}function _(t,n,i,r){for(var o in i)"function"==typeof i[o]?"function"==typeof t[o]?t[o]=N(o,t,0,i,r):"_"===o.charAt(0)?t.ext[r][o]=N(o,t,0,i,r):e.error("Could not override tree."+o+". Use prefix '_' to create tree."+r+"._"+o):"options"!==o&&(t.ext[r][o]=i[o])}function C(t,n){return void 0===t?e.Deferred(function(){this.resolve()}).promise():e.Deferred(function(){this.resolveWith(t,n)}).promise()}function w(t,n){return void 0===t?e.Deferred(function(){this.reject()}).promise():e.Deferred(function(){this.rejectWith(t,n)}).promise()}function S(e,t){return function(){e.resolveWith(t)}}function E(t){var n=e.extend({},t.data()),i=n.json;return delete n.fancytree,delete n.uiFancytree,i&&(delete n.json,n=e.extend(n,i)),n}function T(e){return(""+e).replace(s,function(e){return a[e]})}function L(e){return e=e.toLowerCase(),function(t){return t.title.toLowerCase().indexOf(e)>=0}}function A(t,n){var r,o,s,a;for(this.parent=t,this.tree=t.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},r=0,o=g.length;r<o;r++)this[s=g[r]]=n[s];for(s in null==this.unselectableIgnore&&null==this.unselectableStatus||(this.unselectable=!0),n.hideCheckbox&&e.error("'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'"),n.data&&e.extend(this.data,n.data),n)v[s]||!this.tree.options.copyFunctionsToData&&e.isFunction(n[s])||m[s]||(this.data[s]=n[s]);null==this.key?this.tree.options.defaultKey?(this.key=""+this.tree.options.defaultKey(this),b(this.key,"defaultKey() must return a unique key")):this.key="_"+i._nextNodeKey++:this.key=""+this.key,n.active&&(b(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),n.selected&&(this.tree.lastSelectedNode=this),(a=n.children)?a.length?this._setChildren(a):this.children=this.lazy?[]:null:this.children=null,this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function P(t){this.widget=t,this.$div=t.element,this.options=t.options,this.options&&(void 0!==this.options.lazyload&&e.error("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),void 0!==this.options.loaderror&&e.error("The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."),void 0!==this.options.fx&&e.error("The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."),void 0!==this.options.removeNode&&e.error("The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).")),this.ext={},this.types={},this.columns={},this.data=E(this.$div),this._id=""+(this.options.treeId||e.ui.fancytree._nextId++),this._ns=".fancytree-"+this._id,this.activeNode=null,this.focusNode=null,this._hasFocus=null,this._tempCache={},this._lastMousedownNode=null,this._enableUpdate=!0,this.lastSelectedNode=null,this.systemFocusElement=null,this.lastQuicksearchTerm="",this.lastQuicksearchTime=0,this.viewport=null,this.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove();var n,r={tree:this};this.rootNode=new A(r,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,n=e("<ul>",{id:"ft-id-"+this._id,class:"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=n,this.rootNode.ul=n[0],null==this.options.debugLevel&&(this.options.debugLevel=i.debugLevel)}e.ui.fancytree.warn("Fancytree: ignored duplicate include")}); },{"./jquery.fancytree.ui-deps":"FxCd","jquery":"HlZQ"}],"kCJZ":[function(require,module,exports) { var define; var e;!function(r){"function"==typeof e&&e.amd?e(["jquery","./jquery.fancytree"],r):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=r(require("jquery"))):r(jQuery)}(function(e){"use strict";var r,t,o=e.ui.fancytree,a=/Mac/.test(navigator.platform),n="fancytree-drag-source",d="fancytree-drag-remove",s="fancytree-drop-accept",l="fancytree-drop-after",i="fancytree-drop-before",f="fancytree-drop-over",p="fancytree-drop-reject",g="fancytree-drop-target",c="application/x-fancytree-node",u=null,v=null,y=null,h=null,b=null,m=null,D=null,E=null,w=null,N=null;function x(){b=null,N=null,D=null,E=null,m=null,v=null,y=null,h&&h.removeClass(n+" "+d),h=null,u&&u.hide(),t&&(t.remove(),t=null)}function S(e){return 0===e?"":e>0?"+"+e:""+e}function k(e,r){var t=r.tree,o=r.dataTransfer;"dragstart"===e.type?(r.effectAllowed=t.options.dnd5.effectAllowed,r.dropEffect=t.options.dnd5.dropEffectDefault):(r.effectAllowed=E,r.dropEffect=D),r.dropEffectSuggested=function(e,r,t){var o=t;return a?r.metaKey&&r.altKey?o="link":r.ctrlKey?o="link":r.metaKey?o="move":r.altKey&&(o="copy"):r.ctrlKey?o="copy":r.shiftKey?o="move":r.altKey&&(o="link"),o!==m&&e.info("evalEffectModifiers: "+r.type+" - evalEffectModifiers(): "+m+" -> "+o),m=o,o}(t,e,t.options.dnd5.dropEffectDefault),r.isMove="move"===r.dropEffect,r.files=o.files||[]}function M(e,r,t){var o=r.tree,a=r.dataTransfer;return"dragstart"!==e.type&&E!==r.effectAllowed&&o.warn("effectAllowed should only be changed in dragstart event: "+e.type+": data.effectAllowed changed from "+E+" -> "+r.effectAllowed),!1===t&&(o.info("applyDropEffectCallback: allowDrop === false"),r.effectAllowed="none",r.dropEffect="none"),r.isMove="move"===r.dropEffect,"dragstart"===e.type&&(E=r.effectAllowed,D=r.dropEffect),a.effectAllowed=E,a.dropEffect=D,D}function C(r,t){if(t.options.dnd5.scroll&&function(r,t){var o,a,n=r.options.dnd5,d=r.$scrollParent[0],s=n.scrollSensitivity,l=n.scrollSpeed,i=0;d!==document&&"HTML"!==d.tagName?(o=r.$scrollParent.offset(),a=d.scrollTop,o.top+d.offsetHeight-t.pageY<s?d.scrollHeight-r.$scrollParent.innerHeight()-a>0&&(d.scrollTop=i=a+l):a>0&&t.pageY-o.top<s&&(d.scrollTop=i=a-l)):(a=e(document).scrollTop())>0&&t.pageY-a<s?(i=a-l,e(document).scrollTop(i)):e(window).height()-(t.pageY-a)<s&&(i=a+l,e(document).scrollTop(i)),i&&r.debug("autoScroll: "+i+"px")}(t.tree,r),!t.node)return t.tree.warn("Ignored dragover for non-node"),w;var a,n,d,c,v=null,y=t.tree,h=y.options,m=h.dnd5,D=t.node,E=t.otherNode,N="center",x=e(D.span),C=x.find("span.fancytree-title");if(!1===b)return y.debug("Ignored dragover, since dragenter returned false."),!1;("string"==typeof b&&e.error("assert failed: dragenter returned string"),n=x.offset(),c=(r.pageY-n.top)/x.height(),void 0===r.pageY&&y.warn("event.pageY is undefined: see issue #1013."),b.after&&c>.75?v="after":!b.over&&b.after&&c>.5?v="after":b.before&&c<=.25?v="before":!b.over&&b.before&&c<=.5?v="before":b.over&&(v="over"),m.preventVoidMoves&&"move"===t.dropEffect&&(D===E?(D.debug("Drop over source node prevented."),v=null):"before"===v&&E&&D===E.getNextSibling()?(D.debug("Drop after source node prevented."),v=null):"after"===v&&E&&D===E.getPrevSibling()?(D.debug("Drop before source node prevented."),v=null):"over"===v&&E&&E.parent===D&&E.isLastSibling()&&(D.debug("Drop last child over own parent prevented."),v=null)),t.hitMode=v,v&&m.dragOver)&&(k(r,t),m.dragOver(D,t),M(r,t,!!v),v=t.hitMode);if(w=v,"after"===v||"before"===v||"over"===v){switch(a=m.dropMarkerOffsetX||0,v){case"before":N="top",a+=m.dropMarkerInsertOffsetX||0;break;case"after":N="bottom",a+=m.dropMarkerInsertOffsetX||0}d={my:"left"+S(a)+" center",at:"left "+N,of:C},h.rtl&&(d.my="right"+S(-a)+" center",d.at="right "+N),u.toggleClass(l,"after"===v).toggleClass(f,"over"===v).toggleClass(i,"before"===v).show().position(o.fixPositionOptions(d))}else u.hide();return e(D.span).toggleClass(g,"after"===v||"before"===v||"over"===v).toggleClass(l,"after"===v).toggleClass(i,"before"===v).toggleClass(s,"over"===v).toggleClass(p,!1===v),v}function A(r){var t,a,n,d,l=this.options.dnd5,i=null,g=o.getNode(r),h=r.dataTransfer||r.originalEvent.dataTransfer,m={tree:this,node:g,options:this.options,originalEvent:r.originalEvent,widget:this.widget,hitMode:b,dataTransfer:h,otherNode:v||null,otherNodeList:y||null,otherNodeData:null,useDefaultImage:!0,dropEffect:void 0,dropEffectSuggested:void 0,effectAllowed:void 0,files:null,isCancelled:void 0,isMove:void 0};switch(r.type){case"dragenter":if(N=null,!g){this.debug("Ignore non-node "+r.type+": "+r.target.tagName+"."+r.target.className),b=!1;break}if(e(g.span).addClass(f).removeClass(s+" "+p),n=e.inArray(c,h.types)>=0,l.preventNonNodes&&!n){g.debug("Reject dropping a non-node."),b=!1;break}if(l.preventForeignNodes&&(!v||v.tree!==g.tree)){g.debug("Reject dropping a foreign node."),b=!1;break}if(l.preventSameParent&&m.otherNode&&m.otherNode.tree===g.tree&&g.parent===m.otherNode.parent){g.debug("Reject dropping as sibling (same parent)."),b=!1;break}if(l.preventRecursion&&m.otherNode&&m.otherNode.tree===g.tree&&g.isDescendantOf(m.otherNode)){g.debug("Reject dropping below own ancestor."),b=!1;break}if(l.preventLazyParents&&!g.isLoaded()){g.warn("Drop over unloaded target node prevented."),b=!1;break}u.show(),k(r,m),d=function(r){var t;return!!r&&(t=e.isPlainObject(r)?{over:!!r.over,before:!!r.before,after:!!r.after}:e.isArray(r)?{over:e.inArray("over",r)>=0,before:e.inArray("before",r)>=0,after:e.inArray("after",r)>=0}:{over:!0===r||"over"===r,before:!0===r||"before"===r,after:!0===r||"after"===r},0!==Object.keys(t).length&&t)}(l.dragEnter(g,m)),b=d,M(r,m,i=d&&(d.over||d.before||d.after));break;case"dragover":if(!g){this.debug("Ignore non-node "+r.type+": "+r.target.tagName+"."+r.target.className);break}k(r,m),i=!!(w=C(r,m)),("over"===w||!1===w)&&!g.expanded&&!1!==g.hasChildren()?N?!(l.autoExpandMS&&Date.now()-N>l.autoExpandMS)||g.isLoading()||l.dragExpand&&!1===l.dragExpand(g,m)||g.setExpanded():N=Date.now():N=null;break;case"dragleave":if(!g){this.debug("Ignore non-node "+r.type+": "+r.target.tagName+"."+r.target.className);break}if(!e(g.span).hasClass(f)){g.debug("Ignore dragleave (multi).");break}e(g.span).removeClass(f+" "+s+" "+p),g.scheduleAction("cancel"),l.dragLeave(g,m),u.hide();break;case"drop":if(e.inArray(c,h.types)>=0&&(a=h.getData(c),this.info(r.type+": getData('application/x-fancytree-node'): '"+a+"'")),a||(a=h.getData("text"),this.info(r.type+": getData('text'): '"+a+"'")),a)try{void 0!==(t=JSON.parse(a)).title&&(m.otherNodeData=t)}catch(S){}this.debug(r.type+": nodeData: '"+a+"', otherNodeData: ",m.otherNodeData),e(g.span).removeClass(f+" "+s+" "+p),m.hitMode=w,k(r,m),m.isCancelled=!w;var D=v&&v.span,E=v&&v.tree;l.dragDrop(g,m),r.preventDefault(),D&&!document.body.contains(D)&&(E===this?(this.debug("Drop handler removed source element: generating dragEnd."),l.dragEnd(v,m)):this.warn("Drop handler removed source element: dragend event may be lost.")),x()}if(i)return r.preventDefault(),!1}return e.ui.fancytree.getDragNodeList=function(){return y||[]},e.ui.fancytree.getDragNode=function(){return v},e.ui.fancytree.registerExtension({name:"dnd5",version:"2.37.0",options:{autoExpandMS:1500,dropMarkerInsertOffsetX:-16,dropMarkerOffsetX:-24,dropMarkerParent:"body",multiSource:!1,effectAllowed:"all",dropEffectDefault:"move",preventForeignNodes:!1,preventLazyParents:!0,preventNonNodes:!1,preventRecursion:!0,preventSameParent:!1,preventVoidMoves:!0,scroll:!0,scrollSensitivity:20,scrollSpeed:5,setTextTypeJson:!1,dragStart:null,dragDrag:e.noop,dragEnd:e.noop,dragEnter:null,dragOver:e.noop,dragExpand:e.noop,dragDrop:e.noop,dragLeave:e.noop},treeInit:function(a){var s,l=a.tree,i=a.options,f=i.glyph||null,p=i.dnd5;e.inArray("dnd",i.extensions)>=0&&e.error("Extensions 'dnd' and 'dnd5' are mutually exclusive."),p.dragStop&&e.error("dragStop is not used by ext-dnd5. Use dragEnd instead."),null!=p.preventRecursiveMoves&&e.error("preventRecursiveMoves was renamed to preventRecursion."),p.dragStart&&o.overrideMethod(a.options,"createNode",function(e,r){this._super.apply(this,arguments),r.node.span?r.node.span.draggable=!0:r.node.warn("Cannot add `draggable`: no span tag")}),this._superApply(arguments),this.$container.addClass("fancytree-ext-dnd5"),s=e("<span>").appendTo(this.$container),this.$scrollParent=s.scrollParent(),s.remove(),(u=e("#fancytree-drop-marker")).length||(u=e("<div id='fancytree-drop-marker'></div>").hide().css({"z-index":1e3,"pointer-events":"none"}).prependTo(p.dropMarkerParent),f&&o.setSpanIcon(u[0],f.map._addClass,f.map.dropMarker)),u.toggleClass("fancytree-rtl",!!i.rtl),p.dragStart&&l.$container.on("dragstart drag dragend",function(a){var s,l=this.options.dnd5,i=o.getNode(a),f=a.dataTransfer||a.originalEvent.dataTransfer,p={tree:this,node:i,options:this.options,originalEvent:a.originalEvent,widget:this.widget,dataTransfer:f,useDefaultImage:!0,dropEffect:void 0,dropEffectSuggested:void 0,effectAllowed:void 0,files:void 0,isCancelled:void 0,isMove:void 0};switch(a.type){case"dragstart":if(!i)return this.info("Ignored dragstart on a non-node."),!1;v=i,y=!1===l.multiSource?[i]:!0===l.multiSource?i.isSelected()?this.getSelectedNodes():[i]:l.multiSource(i,p),(h=e(e.map(y,function(e){return e.span}))).addClass(n);var g=i.toDict();g.treeId=i.tree._id,s=JSON.stringify(g);try{f.setData(c,s),f.setData("text/html",e(i.span).html()),f.setData("text/plain",i.title)}catch(u){this.warn("Could not set data (IE only accepts 'text') - "+u)}return l.setTextTypeJson?f.setData("text",s):f.setData("text",i.title),k(a,p),!1===l.dragStart(i,p)?(x(),!1):(M(a,p),t=null,p.useDefaultImage&&(r=e(i.span).find(".fancytree-title"),y&&y.length>1&&(t=e("<span class='fancytree-childcounter'/>").text("+"+(y.length-1)).appendTo(r)),f.setDragImage&&f.setDragImage(r[0],-10,-10)),!0);case"drag":k(a,p),l.dragDrag(i,p),M(a,p),h.toggleClass(d,p.isMove);break;case"dragend":k(a,p),x(),p.isCancelled=!w,l.dragEnd(i,p,!w)}}.bind(l)),p.dragEnter&&l.$container.on("dragenter dragover dragleave drop",A.bind(l))}}),e.ui.fancytree}); },{"./jquery.fancytree":"laCd","jquery":"HlZQ"}],"kHDm":[function(require,module,exports) { var define; var e;!function(t){"function"==typeof e&&e.amd?e(["jquery","./jquery.fancytree"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=t(require("jquery"))):t(jQuery)}(function(e){"use strict";var t=/Mac/.test(navigator.platform),i=e.ui.fancytree.escapeHtml,n=e.ui.fancytree.unescapeHtml;return e.ui.fancytree._FancytreeNodeClass.prototype.editStart=function(){var t,i=this,r=this.tree,a=r.ext.edit,s=r.options.edit,o=e(".fancytree-title",i.span),d={node:i,tree:r,options:r.options,isNew:e(i[r.statusClassPropName]).hasClass("fancytree-edit-new"),orgTitle:i.title,input:null,dirty:!1};if(!1===s.beforeEdit.call(i,{type:"beforeEdit"},d))return!1;e.ui.fancytree.assert(!a.currentNode,"recursive edit"),a.currentNode=this,a.eventData=d,r.widget._unbind(),a.lastDraggableAttrValue=i.span.draggable,a.lastDraggableAttrValue&&(i.span.draggable=!1),e(document).on("mousedown.fancytree-edit",function(t){e(t.target).hasClass("fancytree-edit-input")||i.editEnd(!0,t)}),t=e("<input />",{class:"fancytree-edit-input",type:"text",value:r.options.escapeTitles?d.orgTitle:n(d.orgTitle)}),a.eventData.input=t,null!=s.adjustWidthOfs&&t.width(o.width()+s.adjustWidthOfs),null!=s.inputCss&&t.css(s.inputCss),o.html(t),t.focus().change(function(e){t.addClass("fancytree-edit-dirty")}).on("keydown",function(t){switch(t.which){case e.ui.keyCode.ESCAPE:i.editEnd(!1,t);break;case e.ui.keyCode.ENTER:return i.editEnd(!0,t),!1}t.stopPropagation()}).blur(function(e){return i.editEnd(!0,e)}),s.edit.call(i,{type:"edit"},d)},e.ui.fancytree._FancytreeNodeClass.prototype.editEnd=function(t,n){var r,a=this,s=this.tree,o=s.ext.edit,d=o.eventData,l=s.options.edit,c=e(".fancytree-title",a.span).find("input.fancytree-edit-input");return l.trim&&c.val(e.trim(c.val())),r=c.val(),d.dirty=r!==a.title,d.originalEvent=n,!1===t?d.save=!1:d.isNew?d.save=""!==r:d.save=d.dirty&&""!==r,!1!==l.beforeClose.call(a,{type:"beforeClose"},d)&&((!d.save||!1!==l.save.call(a,{type:"save"},d))&&(c.removeClass("fancytree-edit-dirty").off(),e(document).off(".fancytree-edit"),d.save?(a.setTitle(s.options.escapeTitles?r:i(r)),a.setFocus()):d.isNew?(a.remove(),a=d.node=null,o.relatedNode.setFocus()):(a.renderTitle(),a.setFocus()),o.eventData=null,o.currentNode=null,o.relatedNode=null,s.widget._bind(),a&&o.lastDraggableAttrValue&&(a.span.draggable=!0),s.$container.get(0).focus({preventScroll:!0}),d.input=null,l.close.call(a,{type:"close"},d),!0))},e.ui.fancytree._FancytreeNodeClass.prototype.editCreateNode=function(t,i){var n,r=this.tree,a=this;t=t||"child",null==i?i={title:""}:"string"==typeof i?i={title:i}:e.ui.fancytree.assert(e.isPlainObject(i)),"child"!==t||this.isExpanded()||!1===this.hasChildren()?((n=this.addNode(i,t)).match=!0,e(n[r.statusClassPropName]).removeClass("fancytree-hide").addClass("fancytree-match"),n.makeVisible().done(function(){e(n[r.statusClassPropName]).addClass("fancytree-edit-new"),a.tree.ext.edit.relatedNode=a,n.editStart()})):this.setExpanded().done(function(){a.editCreateNode(t,i)})},e.ui.fancytree._FancytreeClass.prototype.isEditing=function(){return this.ext.edit?this.ext.edit.currentNode:null},e.ui.fancytree._FancytreeNodeClass.prototype.isEditing=function(){return!!this.tree.ext.edit&&this.tree.ext.edit.currentNode===this},e.ui.fancytree.registerExtension({name:"edit",version:"2.37.0",options:{adjustWidthOfs:4,allowEmpty:!1,inputCss:{minWidth:"3em"},triggerStart:["f2","mac+enter","shift+click"],trim:!0,beforeClose:e.noop,beforeEdit:e.noop,close:e.noop,edit:e.noop,save:e.noop},currentNode:null,treeInit:function(e){var t=e.tree;this._superApply(arguments),this.$container.addClass("fancytree-ext-edit").on("fancytreebeforeupdateviewport",function(e,i){var n=t.isEditing();n&&(n.info("Cancel edit due to scroll event."),n.editEnd(!1,e))})},nodeClick:function(t){var i=e.ui.fancytree.eventToString(t.originalEvent),n=t.options.edit.triggerStart;return"shift+click"===i&&e.inArray("shift+click",n)>=0&&t.originalEvent.shiftKey?(t.node.editStart(),!1):"click"===i&&e.inArray("clickActive",n)>=0&&t.node.isActive()&&!t.node.isEditing()&&e(t.originalEvent.target).hasClass("fancytree-title")?(t.node.editStart(),!1):this._superApply(arguments)},nodeDblclick:function(t){return e.inArray("dblclick",t.options.edit.triggerStart)>=0?(t.node.editStart(),!1):this._superApply(arguments)},nodeKeydown:function(i){switch(i.originalEvent.which){case 113:if(e.inArray("f2",i.options.edit.triggerStart)>=0)return i.node.editStart(),!1;break;case e.ui.keyCode.ENTER:if(e.inArray("mac+enter",i.options.edit.triggerStart)>=0&&t)return i.node.editStart(),!1}return this._superApply(arguments)}}),e.ui.fancytree}); },{"./jquery.fancytree":"laCd","jquery":"HlZQ"}],"ovbB":[function(require,module,exports) { var define; var e;!function(t){"function"==typeof e&&e.amd?e(["jquery","./jquery.fancytree"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=t(require("jquery"))):t(jQuery)}(function(e){"use strict";function t(t,n){n=n||"",t||e.error("Assertion failed "+n)}function n(e,t){e.visit(function(e){var n=e.tr;if(n&&(n.style.display=e.hide||!t?"none":""),!e.expanded)return"skip"})}return e.ui.fancytree.registerExtension({name:"table",version:"2.37.0",options:{checkboxColumnIdx:null,indentation:16,mergeStatusColumns:!0,nodeColumnIdx:0},treeInit:function(n){var r,o,d,s,a=n.tree,i=n.options,l=i.table,u=a.widget.element;if(null!=l.customStatus&&(null==i.renderStatusColumns?(a.warn("The 'customStatus' option is deprecated since v2.15.0. Use 'renderStatusColumns' instead."),i.renderStatusColumns=l.customStatus):e.error("The 'customStatus' option is deprecated since v2.15.0. Use 'renderStatusColumns' only instead.")),i.renderStatusColumns&&!0===i.renderStatusColumns&&(i.renderStatusColumns=i.renderColumns),u.addClass("fancytree-container fancytree-ext-table"),(s=u.find(">tbody")).length||(u.find(">tr").length&&e.error("Expected table > tbody > tr. If you see this please open an issue."),s=e("<tbody>").appendTo(u)),a.tbody=s[0],a.columnCount=e("thead >tr",u).last().find(">th",u).length,(d=s.children("tr").first()).length)o=d.children("td").length,a.columnCount&&o!==a.columnCount&&(a.warn("Column count mismatch between thead ("+a.columnCount+") and tbody ("+o+"): using tbody."),a.columnCount=o),d=d.clone();else for(t(a.columnCount>=1,"Need either <thead> or <tbody> with <td> elements to determine column count."),d=e("<tr />"),r=0;r<a.columnCount;r++)d.append("<td />");d.find(">td").eq(l.nodeColumnIdx).html("<span class='fancytree-node' />"),i.aria&&(d.attr("role","row"),d.find("td").attr("role","gridcell")),a.rowFragment=document.createDocumentFragment(),a.rowFragment.appendChild(d.get(0)),s.empty(),a.statusClassPropName="tr",a.ariaPropName="tr",this.nodeContainerAttrName="tr",a.$container=u,this._superApply(arguments),e(a.rootNode.ul).remove(),a.rootNode.ul=null,this.$container.attr("tabindex",i.tabindex),i.aria&&a.$container.attr("role","treegrid").attr("aria-readonly",!0)},nodeRemoveChildMarkup:function(t){t.node.visit(function(t){t.tr&&(e(t.tr).remove(),t.tr=null)})},nodeRemoveMarkup:function(t){var n=t.node;n.tr&&(e(n.tr).remove(),n.tr=null),this.nodeRemoveChildMarkup(t)},nodeRender:function(r,o,d,s,a){var i,l,u,c,p,h,m,f,y=r.tree,C=r.node,v=r.options,g=!C.parent;if(!1!==y._enableUpdate){if(a||(r.hasCollapsedParents=C.parent&&!C.parent.expanded),!g)if(C.tr&&o&&this.nodeRemoveMarkup(r),C.tr)o?this.nodeRenderTitle(r):this.nodeRenderStatus(r);else{if(r.hasCollapsedParents&&!d)return;p=y.rowFragment.firstChild.cloneNode(!0),h=function(n){var r,o,d=n.parent,s=d?d.children:null;if(s&&s.length>1&&s[0]!==n)for(t((o=s[e.inArray(n,s)-1]).tr);o.children&&o.children.length&&(r=o.children[o.children.length-1]).tr;)o=r;else o=d;return o}(C),t(h),!0===s&&a?p.style.display="none":d&&r.hasCollapsedParents&&(p.style.display="none"),h.tr?(x=h.tr,b=p,x.parentNode.insertBefore(b,x.nextSibling)):(t(!h.parent,"prev. row must have a tr, or be system root"),function(e,t){e.insertBefore(t,e.firstChild)}(y.tbody,p)),C.tr=p,C.key&&v.generateIds&&(C.tr.id=v.idPrefix+C.key),C.tr.ftnode=C,C.span=e("span.fancytree-node",C.tr).get(0),this.nodeRenderTitle(r),v.createNode&&v.createNode.call(y,{type:"createNode"},r)}var x,b;if(v.renderNode&&v.renderNode.call(y,{type:"renderNode"},r),(i=C.children)&&(g||d||C.expanded))for(u=0,c=i.length;u<c;u++)(f=e.extend({},r,{node:i[u]})).hasCollapsedParents=f.hasCollapsedParents||!C.expanded,this.nodeRender(f,o,d,s,!0);i&&!a&&(m=C.tr||null,l=y.tbody.firstChild,C.visit(function(e){if(e.tr){if(e.parent.expanded||"none"===e.tr.style.display||(e.tr.style.display="none",n(e,!1)),e.tr.previousSibling!==m){C.debug("_fixOrder: mismatch at node: "+e);var t=m?m.nextSibling:l;y.tbody.insertBefore(e.tr,t)}m=e.tr}}))}},nodeRenderTitle:function(t,n){var r,o,d=t.tree,s=t.node,a=t.options,i=s.isStatusNode();return o=this._super(t,n),s.isRootNode()?o:(a.checkbox&&!i&&null!=a.table.checkboxColumnIdx&&(r=e("span.fancytree-checkbox",s.span),e(s.tr).find("td").eq(+a.table.checkboxColumnIdx).html(r)),this.nodeRenderStatus(t),i?a.renderStatusColumns?a.renderStatusColumns.call(d,{type:"renderStatusColumns"},t):a.table.mergeStatusColumns&&s.isTopLevel()&&e(s.tr).find(">td").eq(0).prop("colspan",d.columnCount).text(s.title).addClass("fancytree-status-merged").nextAll().remove():a.renderColumns&&a.renderColumns.call(d,{type:"renderColumns"},t),o)},nodeRenderStatus:function(t){var n,r=t.node,o=t.options;this._super(t),e(r.tr).removeClass("fancytree-node"),n=(r.getLevel()-1)*o.table.indentation,o.rtl?e(r.span).css({paddingRight:n+"px"}):e(r.span).css({paddingLeft:n+"px"})},nodeSetExpanded:function(t,r,o){if(r=!1!==r,t.node.expanded&&r||!t.node.expanded&&!r)return this._superApply(arguments);var d=new e.Deferred,s=e.extend({},o,{noEvents:!0,noAnimation:!0});function a(e){n(t.node,r),e?r&&t.options.autoScroll&&!o.noAnimation&&t.node.hasChildren()?t.node.getLastChild().scrollIntoView(!0,{topNode:t.node}).always(function(){o.noEvents||t.tree._triggerNodeEvent(r?"expand":"collapse",t),d.resolveWith(t.node)}):(o.noEvents||t.tree._triggerNodeEvent(r?"expand":"collapse",t),d.resolveWith(t.node)):(o.noEvents||t.tree._triggerNodeEvent(r?"expand":"collapse",t),d.rejectWith(t.node))}return o=o||{},this._super(t,r,s).done(function(){a(!0)}).fail(function(){a(!1)}),d.promise()},nodeSetStatus:function(t,n,r,o){if("ok"===n){var d=t.node,s=d.children?d.children[0]:null;s&&s.isStatusNode()&&e(s.tr).remove()}return this._superApply(arguments)},treeClear:function(e){return this.nodeRemoveChildMarkup(this._makeHookContext(this.rootNode)),this._superApply(arguments)},treeDestroy:function(e){return this.$container.find("tbody").empty(),this.$source&&this.$source.removeClass("fancytree-helper-hidden"),this._superApply(arguments)}}),e.ui.fancytree}); },{"./jquery.fancytree":"laCd","jquery":"HlZQ"}],"ICrm":[function(require,module,exports) { var define; var e;!function(t){"function"==typeof e&&e.amd?e(["jquery","./jquery.fancytree","./jquery.fancytree.table"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree.table"),module.exports=t(require("jquery"))):t(jQuery)}(function(e){"use strict";var t=e.ui.keyCode,n={text:[t.UP,t.DOWN],checkbox:[t.UP,t.DOWN,t.LEFT,t.RIGHT],link:[t.UP,t.DOWN,t.LEFT,t.RIGHT],radiobutton:[t.UP,t.DOWN,t.LEFT,t.RIGHT],"select-one":[t.LEFT,t.RIGHT],"select-multiple":[t.LEFT,t.RIGHT]};function r(t,n){var r,i=null,o=0;return t.children().each(function(){if(o>=n)return i=e(this),!1;r=e(this).prop("colspan"),o+=r||1}),i}function i(n,i){var o,a,u=n.closest("td"),s=null;switch(i){case t.LEFT:s=u.prev();break;case t.RIGHT:s=u.next();break;case t.UP:case t.DOWN:for(a=function(t,n){var r,i=n.get(0),o=0;return t.children().each(function(){if(this===i)return!1;r=e(this).prop("colspan"),o+=r||1}),o}(o=u.parent(),u);(o=i===t.UP?o.prev():o.next()).length&&(o.is(":hidden")||!(s=r(o,a))||!s.find(":input,a").length););}return s}return e.ui.fancytree.registerExtension({name:"gridnav",version:"2.37.0",options:{autofocusInput:!1,handleCursorKeys:!0},treeInit:function(t){this._requireExtension("table",!0,!0),this._superApply(arguments),this.$container.addClass("fancytree-ext-gridnav"),this.$container.on("focusin",function(n){var r,i=e.ui.fancytree.getNode(n.target);i&&!i.isActive()&&(r=t.tree._makeHookContext(i,n),t.tree._callHook("nodeSetActive",r,!0))})},nodeSetActive:function(t,n,r){var i=t.options.gridnav,o=t.node,a=t.originalEvent||{},u=e(a.target).is(":input");n=!1!==n,this._superApply(arguments),n&&(t.options.titlesTabbable?(u||(e(o.span).find("span.fancytree-title").focus(),o.setFocus()),t.tree.$container.attr("tabindex","-1")):i.autofocusInput&&!u&&e(o.tr||o.span).find(":input:enabled").first().focus())},nodeKeydown:function(t){var r,o,a,u=t.options.gridnav,s=t.originalEvent,c=e(s.target);return c.is(":input:enabled")?r=c.prop("type"):c.is("a")&&(r="link"),r&&u.handleCursorKeys?!((o=n[r])&&e.inArray(s.which,o)>=0&&(a=i(c,s.which))&&a.length)||(a.find(":input:enabled,a").focus(),!1):this._superApply(arguments)}}),e.ui.fancytree}); },{"./jquery.fancytree.table":"ovbB","jquery":"HlZQ"}],"MKUk":[function(require,module,exports) { var define; var e;!function(t){"function"==typeof e&&e.amd?e(["jquery","./jquery.fancytree"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=t(require("jquery"))):t(jQuery)}(function(e){"use strict";var t=null,o=null,i=null,s=e.ui.fancytree.assert,r="expanded";try{s(window.localStorage&&window.localStorage.getItem),o={get:function(e){return window.localStorage.getItem(e)},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)}}}catch(n){e.ui.fancytree.warn("Could not access window.localStorage",n)}try{s(window.sessionStorage&&window.sessionStorage.getItem),i={get:function(e){return window.sessionStorage.getItem(e)},set:function(e,t){window.sessionStorage.setItem(e,t)},remove:function(e){window.sessionStorage.removeItem(e)}}}catch(n){e.ui.fancytree.warn("Could not access window.sessionStorage",n)}return"function"==typeof Cookies?t={get:Cookies.get,set:function(e,t){Cookies.set(e,t,this.options.persist.cookie)},remove:Cookies.remove}:e&&"function"==typeof e.cookie&&(t={get:e.cookie,set:function(t,o){e.cookie.set(t,o,this.options.persist.cookie)},remove:e.removeCookie}),e.ui.fancytree._FancytreeClass.prototype.clearPersistData=function(e){var t=this.ext.persist,o=t.cookiePrefix;(e=e||"active expanded focus selected").indexOf("active")>=0&&t._data(o+"active",null),e.indexOf(r)>=0&&t._data(o+r,null),e.indexOf("focus")>=0&&t._data(o+"focus",null),e.indexOf("selected")>=0&&t._data(o+"selected",null)},e.ui.fancytree._FancytreeClass.prototype.clearCookies=function(e){return this.warn("'tree.clearCookies()' is deprecated since v2.27.0: use 'clearPersistData()' instead."),this.clearPersistData(e)},e.ui.fancytree._FancytreeClass.prototype.getPersistData=function(){var e=this.ext.persist,t=e.cookiePrefix,o=e.cookieDelimiter,i={};return i.active=e._data(t+"active"),i[r]=(e._data(t+r)||"").split(o),i.selected=(e._data(t+"selected")||"").split(o),i.focus=e._data(t+"focus"),i},e.ui.fancytree.registerExtension({name:"persist",version:"2.37.0",options:{cookieDelimiter:"~",cookiePrefix:void 0,cookie:{raw:!1,expires:"",path:"",domain:"",secure:!1},expandLazy:!1,expandOpts:void 0,fireActivate:!0,overrideSource:!0,store:"auto",types:"active expanded focus selected"},_data:function(e,t){var o=this._local.store;if(void 0===t)return o.get.call(this,e);null===t?o.remove.call(this,e):o.set.call(this,e,t)},_appendKey:function(t,o,i){o=""+o;var s=this._local,r=this.options.persist.cookieDelimiter,n=s.cookiePrefix+t,a=s._data(n),c=a?a.split(r):[],d=e.inArray(o,c);d>=0&&c.splice(d,1),i&&c.push(o),s._data(n,c.join(r))},treeInit:function(n){var a=n.tree,c=n.options,d=this._local,l=this.options.persist;return d.cookiePrefix=l.cookiePrefix||"fancytree-"+a._id+"-",d.storeActive=l.types.indexOf("active")>=0,d.storeExpanded=l.types.indexOf(r)>=0,d.storeSelected=l.types.indexOf("selected")>=0,d.storeFocus=l.types.indexOf("focus")>=0,d.store=null,"auto"===l.store&&(l.store=o?"local":"cookie"),e.isPlainObject(l.store)?d.store=l.store:"cookie"===l.store?d.store=t:"local"===l.store?d.store="local"===l.store?o:i:"session"===l.store&&(d.store="local"===l.store?o:i),s(d.store,"Need a valid store."),a.$div.on("fancytreeinit",function(t){if(!1!==a._triggerTreeEvent("beforeRestore",null,{})){var o,i,s,n,u=d._data(d.cookiePrefix+"focus"),f=!1===l.fireActivate;o=d._data(d.cookiePrefix+r),s=o&&o.split(l.cookieDelimiter),(d.storeExpanded?function t(o,i,s,n,a){var c,d,l,u,f=!1,p=o.options.persist.expandOpts,y=[],v=[];for(s=s||[],a=a||e.Deferred(),c=0,l=s.length;c<l;c++)d=s[c],(u=o.getNodeByKey(d))?n&&u.isUndefined()?(f=!0,o.debug("_loadLazyNodes: "+u+" is lazy: loading..."),"expand"===n?y.push(u.setExpanded(!0,p)):y.push(u.load())):(o.debug("_loadLazyNodes: "+u+" already loaded."),u.setExpanded(!0,p)):(v.push(d),o.debug("_loadLazyNodes: "+u+" was not yet found."));return e.when.apply(e,y).always(function(){if(f&&v.length>0)t(o,i,v,n,a);else{if(v.length)for(o.warn("_loadLazyNodes: could not load those keys: ",v),c=0,l=v.length;c<l;c++)d=s[c],i._appendKey(r,s[c],!1);a.resolve()}}),a}(a,d,s,!!l.expandLazy&&"expand",null):(new e.Deferred).resolve()).done(function(){if(d.storeSelected){if(o=d._data(d.cookiePrefix+"selected"))for(s=o.split(l.cookieDelimiter),i=0;i<s.length;i++)(n=a.getNodeByKey(s[i]))?(void 0===n.selected||l.overrideSource&&!1===n.selected)&&(n.selected=!0,n.renderStatus()):d._appendKey("selected",s[i],!1);3===a.options.selectMode&&a.visit(function(e){if(e.selected)return e.fixSelection3AfterClick(),"skip"})}d.storeActive&&(!(o=d._data(d.cookiePrefix+"active"))||!c.persist.overrideSource&&a.activeNode||(n=a.getNodeByKey(o))&&(n.debug("persist: set active",o),n.setActive(!0,{noFocus:!0,noEvents:f}))),d.storeFocus&&u&&(n=a.getNodeByKey(u))&&(a.options.titlesTabbable?e(n.span).find(".fancytree-title").focus():e(a.$container).focus()),a._triggerTreeEvent("restore",null,{})})}}),this._superApply(arguments)},nodeSetActive:function(e,t,o){var i,s=this._local;return t=!1!==t,i=this._superApply(arguments),s.storeActive&&s._data(s.cookiePrefix+"active",this.activeNode?this.activeNode.key:null),i},nodeSetExpanded:function(e,t,o){var i,s=e.node,n=this._local;return t=!1!==t,i=this._superApply(arguments),n.storeExpanded&&n._appendKey(r,s.key,t),i},nodeSetFocus:function(e,t){var o,i=this._local;return t=!1!==t,o=this._superApply(arguments),i.storeFocus&&i._data(i.cookiePrefix+"focus",this.focusNode?this.focusNode.key:null),o},nodeSetSelected:function(t,o,i){var s,r,n=t.tree,a=t.node,c=this._local;return o=!1!==o,s=this._superApply(arguments),c.storeSelected&&(3===n.options.selectMode?(r=(r=e.map(n.getSelectedNodes(!0),function(e){return e.key})).join(t.options.persist.cookieDelimiter),c._data(c.cookiePrefix+"selected",r)):c._appendKey("selected",a.key,a.selected)),s}}),e.ui.fancytree}); },{"./jquery.fancytree":"laCd","jquery":"HlZQ"}],"MaIk":[function(require,module,exports) { var define; var e;!function(t){"function"==typeof e&&e.amd?e(["jquery","./jquery.fancytree"],t):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=t(require("jquery"))):t(jQuery)}(function(e){"use strict";var t=e.ui.fancytree.escapeHtml;function i(e){return(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return e.ui.fancytree._FancytreeClass.prototype._applyFilterImpl=function(n,a,r){var s,l,o,d,c,h,u=0,p=this.options,f=p.escapeTitles,y=p.autoCollapse,g=e.extend({},p.filter,r),m="hide"===g.mode,x=!!g.leavesOnly&&!a;if("string"==typeof n){if(""===n)return this.warn("Fancytree passing an empty string as a filter is handled as clearFilter()."),void this.clearFilter();s=g.fuzzy?n.split("").reduce(function(e,t){return e+"[^"+t+"]*"+t}):i(n),o=new RegExp(".*"+s+".*","i"),d=new RegExp(i(n),"gi"),n=function(i){if(!i.title)return!1;var n,a=f?i.title:(n=i.title).indexOf(">")>=0?e("<div/>").html(n).text():n,r=!!o.test(a);return r&&g.highlight&&(f?(c=a.replace(d,function(e){return""+e+""}),i.titleWithHighlight=t(c).replace(/\uFFF7/g,"<mark>").replace(/\uFFF8/g,"</mark>")):i.titleWithHighlight=a.replace(d,function(e){return"<mark>"+e+"</mark>"})),r}}return this.enableFilter=!0,this.lastFilterArgs=arguments,h=this.enableUpdate(!1),this.$div.addClass("fancytree-ext-filter"),m?this.$div.addClass("fancytree-ext-filter-hide"):this.$div.addClass("fancytree-ext-filter-dimm"),this.$div.toggleClass("fancytree-ext-filter-hide-expanders",!!g.hideExpanders),this.rootNode.subMatchCount=0,this.visit(function(e){delete e.match,delete e.titleWithHighlight,e.subMatchCount=0}),(l=this.getRootNode()._findDirectChild("__not_found__"))&&l.remove(),p.autoCollapse=!1,this.visit(function(e){if(!x||null==e.children){var t=n(e),i=!1;if("skip"===t)return e.visit(function(e){e.match=!1},!0),"skip";t||!a&&"branch"!==t||!e.parent.match||(t=!0,i=!0),t&&(u++,e.match=!0,e.visitParents(function(t){t!==e&&(t.subMatchCount+=1),!g.autoExpand||i||t.expanded||(t.setExpanded(!0,{noAnimation:!0,noEvents:!0,scrollIntoView:!1}),t._filterAutoExpanded=!0)},!0))}}),p.autoCollapse=y,0===u&&g.nodata&&m&&(l=g.nodata,e.isFunction(l)&&(l=l()),!0===l?l={}:"string"==typeof l&&(l={title:l}),l=e.extend({statusNodeType:"nodata",key:"__not_found__",title:this.options.strings.noData},l),this.getRootNode().addNode(l).match=!0),this._callHook("treeStructureChanged",this,"applyFilter"),this.enableUpdate(h),u},e.ui.fancytree._FancytreeClass.prototype.filterNodes=function(e,t){return"boolean"==typeof t&&(t={leavesOnly:t},this.warn("Fancytree.filterNodes() leavesOnly option is deprecated since 2.9.0 / 2015-04-19. Use opts.leavesOnly instead.")),this._applyFilterImpl(e,!1,t)},e.ui.fancytree._FancytreeClass.prototype.filterBranches=function(e,t){return this._applyFilterImpl(e,!0,t)},e.ui.fancytree._FancytreeClass.prototype.clearFilter=function(){var t,i=this.getRootNode()._findDirectChild("__not_found__"),n=this.options.escapeTitles,a=this.options.enhanceTitle,r=this.enableUpdate(!1);i&&i.remove(),delete this.rootNode.match,delete this.rootNode.subMatchCount,this.visit(function(i){i.match&&i.span&&(t=e(i.span).find(">span.fancytree-title"),n?t.text(i.title):t.html(i.title),a&&a({type:"enhanceTitle"},{node:i,$title:t})),delete i.match,delete i.subMatchCount,delete i.titleWithHighlight,i.$subMatchBadge&&(i.$subMatchBadge.remove(),delete i.$subMatchBadge),i._filterAutoExpanded&&i.expanded&&i.setExpanded(!1,{noAnimation:!0,noEvents:!0,scrollIntoView:!1}),delete i._filterAutoExpanded}),this.enableFilter=!1,this.lastFilterArgs=null,this.$div.removeClass("fancytree-ext-filter fancytree-ext-filter-dimm fancytree-ext-filter-hide"),this._callHook("treeStructureChanged",this,"clearFilter"),this.enableUpdate(r)},e.ui.fancytree._FancytreeClass.prototype.isFilterActive=function(){return!!this.enableFilter},e.ui.fancytree._FancytreeNodeClass.prototype.isMatched=function(){return!(this.tree.enableFilter&&!this.match)},e.ui.fancytree.registerExtension({name:"filter",version:"2.37.0",options:{autoApply:!0,autoExpand:!1,counter:!0,fuzzy:!1,hideExpandedCounter:!0,hideExpanders:!1,highlight:!0,leavesOnly:!1,nodata:!0,mode:"dimm"},nodeLoadChildren:function(e,t){var i=e.tree;return this._superApply(arguments).done(function(){i.enableFilter&&i.lastFilterArgs&&e.options.filter.autoApply&&i._applyFilterImpl.apply(i,i.lastFilterArgs)})},nodeSetExpanded:function(e,t,i){var n=e.node;return delete n._filterAutoExpanded,!t&&e.options.filter.hideExpandedCounter&&n.$subMatchBadge&&n.$subMatchBadge.show(),this._superApply(arguments)},nodeRenderStatus:function(t){var i,n=t.node,a=t.tree,r=t.options.filter,s=e(n.span).find("span.fancytree-title"),l=e(n[a.statusClassPropName]),o=t.options.enhanceTitle,d=t.options.escapeTitles;return i=this._super(t),l.length&&a.enableFilter?(l.toggleClass("fancytree-match",!!n.match).toggleClass("fancytree-submatch",!!n.subMatchCount).toggleClass("fancytree-hide",!(n.match||n.subMatchCount)),!r.counter||!n.subMatchCount||n.isExpanded()&&r.hideExpandedCounter?n.$subMatchBadge&&n.$subMatchBadge.hide():(n.$subMatchBadge||(n.$subMatchBadge=e("<span class='fancytree-childcounter'/>"),e("span.fancytree-icon, span.fancytree-custom-icon",n.span).append(n.$subMatchBadge)),n.$subMatchBadge.show().text(n.subMatchCount)),!n.span||n.isEditing&&n.isEditing.call(n)||(n.titleWithHighlight?s.html(n.titleWithHighlight):d?s.text(n.title):s.html(n.title),o&&o({type:"enhanceTitle"},{node:n,$title:s})),i):i}}),e.ui.fancytree}); },{"./jquery.fancytree":"laCd","jquery":"HlZQ"}],"MXTL":[function(require,module,exports) { var process = require("process"); var e=require("process");Object.defineProperty(exports,"__esModule",{value:!0}),exports.detect=w,exports.browserName=v,exports.parseUserAgent=p,exports.detectOS=l,exports.getNodeVersion=S,exports.ReactNativeInfo=exports.BotInfo=exports.SearchBotDeviceInfo=exports.NodeInfo=exports.BrowserInfo=void 0;var o=function(){for(var e=0,o=0,n=arguments.length;o<n;o++)e+=arguments[o].length;var r=Array(e),i=0;for(o=0;o<n;o++)for(var t=arguments[o],s=0,a=t.length;s<a;s++,i++)r[i]=t[s];return r},n=function(){return function(e,o,n){this.name=e,this.version=o,this.os=n,this.type="browser"}}();exports.BrowserInfo=n;var r=function(){return function(o){this.version=o,this.type="node",this.name="node",this.os=e.platform}}();exports.NodeInfo=r;var i=function(){return function(e,o,n,r){this.name=e,this.version=o,this.os=n,this.bot=r,this.type="bot-device"}}();exports.SearchBotDeviceInfo=i;var t=function(){return function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}}();exports.BotInfo=t;var s=function(){return function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}}();exports.ReactNativeInfo=s;var a=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,d=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,u=3,c=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/Edg\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",a]],f=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function w(e){return e?p(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new s:"undefined"!=typeof navigator?p(navigator.userAgent):S()}function h(e){return""!==e&&c.reduce(function(o,n){var r=n[0],i=n[1];if(o)return o;var t=i.exec(e);return!!t&&[r,t]},!1)}function v(e){var o=h(e);return o?o[0]:null}function p(e){var r=h(e);if(!r)return null;var s=r[0],a=r[1];if("searchbot"===s)return new t;var c=a[1]&&a[1].split(/[._]/).slice(0,3);c?c.length<u&&(c=o(c,b(u-c.length))):c=[];var f=c.join("."),w=l(e),v=d.exec(e);return v&&v[1]?new i(s,f,w,v[1]):new n(s,f,w)}function l(e){for(var o=0,n=f.length;o<n;o++){var r=f[o],i=r[0];if(r[1].exec(e))return i}return null}function S(){return void 0!==e&&e.version?new r(e.version.slice(1)):null}function b(e){for(var o=[],n=0;n<e;n++)o.push("0");return o} },{"process":"g5IB"}],"PBio":[function(require,module,exports) { var define; var global = arguments[3]; var process = require("process"); var e,t=arguments[3],n=require("process");!function(e){"use strict";var n=function(e){if(null===e)return"null";if(void 0===e)return"undefined";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},r=function(e){return{eq:e}},o=r(function(e,t){return e===t}),i=function(e){return r(function(t,n){if(t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e.eq(t[o],n[o]))return!1;return!0})},a=function(e,t){return function(e,t){return r(function(n,r){return e.eq(t(n),t(r))})}(i(e),function(e){return function(e,t){return Array.prototype.slice.call(e).sort(t)}(e,t)})},u=function(e){return r(function(t,n){var r=Object.keys(t),i=Object.keys(n);if(!a(o).eq(r,i))return!1;for(var u=r.length,c=0;c<u;c++){var s=r[c];if(!e.eq(t[s],n[s]))return!1}return!0})},c=r(function(e,t){if(e===t)return!0;var r=n(e);return r===n(t)&&(function(e){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(e)}(r)?e===t:"array"===r?i(c).eq(e,t):"object"===r&&u(c).eq(e,t))}),s=function(){},f=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e(t.apply(null,n))}},l=function(e){return function(){return e}},d=function(e){return e};function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}var p=function(e){return function(t){return!e(t)}},g=function(e){return function(){throw new Error(e)}},h=l(!1),v=l(!0),y=function(){return b},b=function(){var e=function(e){return e.isNone()},t=function(e){return e()},n=function(e){return e};return{fold:function(e,t){return e()},is:h,isSome:h,isNone:v,getOr:n,getOrThunk:t,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(void 0),or:n,orThunk:t,map:y,each:s,bind:y,exists:h,forall:v,filter:y,equals:e,equals_:e,toArray:function(){return[]},toString:l("none()")}}(),C=function(e){var t=l(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:v,isNone:h,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return C(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:b},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(h,function(t){return n(e,t)})}};return o},w={some:C,none:y,from:function(e){return null==e?b:C(e)}},x=function(e){return function(t){return r=typeof(n=t),(null===n?"null":"object"===r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===e;var n,r}},S=function(e){return function(t){return typeof t===e}},N=function(e){return function(t){return e===t}},E=x("string"),k=x("object"),_=x("array"),T=N(null),R=S("boolean"),A=N(void 0),D=S("function"),O=S("number"),B=Array.prototype.slice,P=Array.prototype.indexOf,L=Array.prototype.push,I=function(e,t){return P.call(e,t)},M=function(e,t){return I(e,t)>-1},F=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return!0}return!1},U=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},z=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},j=function(e,t){for(var n=e.length-1;n>=0;n--){t(e[n],n)}},H=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o)?n:r).push(a)}return{pass:n,fail:r}},V=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},q=function(e,t,n){return j(e,function(e){n=t(n,e)}),n},$=function(e,t,n){return z(e,function(e){n=t(n,e)}),n},W=function(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return w.some(i);if(n(i,r))break}return w.none()}(e,t,h)},K=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return w.some(n)}return w.none()},X=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!_(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);L.apply(t,e[n])}return t}(U(e,t))},Y=function(e,t){for(var n=0,r=e.length;n<r;++n){if(!0!==t(e[n],n))return!1}return!0},G=function(e){var t=B.call(e,0);return t.reverse(),t},J=function(e,t){return V(e,function(e){return!M(t,e)})},Q=function(e){return 0===e.length?w.none():w.some(e[0])},Z=function(e){return 0===e.length?w.none():w.some(e[e.length-1])},ee=D(Array.from)?Array.from:function(e){return B.call(e)},te=Object.keys,ne=Object.hasOwnProperty,re=function(e,t){for(var n=te(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}},oe=function(e,t){return ie(e,function(e,n){return{k:n,v:t(e,n)}})},ie=function(e,t){var n={};return re(e,function(e,r){var o=t(e,r);n[o.k]=o.v}),n},ae=function(e){return function(t,n){e[n]=t}},ue=function(e,t,n,r){return re(e,function(e,o){(t(e,o)?n:r)(e,o)}),{}},ce=function(e,t){var n={},r={};return ue(e,t,ae(n),ae(r)),{t:n,f:r}},se=function(e,t){var n={};return ue(e,t,ae(n),s),n},fe=function(e){return function(e,t){var n=[];return re(e,function(e,r){n.push(t(e,r))}),n}(e,function(e){return e})},le=function(e,t){return de(e,t)?w.from(e[t]):w.none()},de=function(e,t){return ne.call(e,t)},me=Array.isArray,pe=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,void 0!==e.length){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},ge=function(e,t){var n=[];return pe(e,function(r,o){n.push(t(r,o,e))}),n},he=function(e,t){var n=[];return pe(e,function(r,o){t&&!t(r,o,e)||n.push(r)}),n},ve=function(e,t){var n,r;if(e)for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},ye=function(e,t,n,r){var o=0;for(arguments.length<3&&(n=e[0]);o<e.length;o++)n=t.call(r,n,e[o],o);return n},be=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1},Ce=function(e){return e[e.length-1]},we=function(){return(we=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function xe(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}var Se=function(){return Ne(0,0)},Ne=function(e,t){return{major:e,minor:t}},Ee={nu:Ne,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Se():function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Ne(r(1),r(2))}(e,n)},unknown:Se},ke=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},_e={unknown:function(){return ke({current:void 0,version:Ee.unknown()})},nu:ke,edge:l("Edge"),chrome:l("Chrome"),ie:l("IE"),opera:l("Opera"),firefox:l("Firefox"),safari:l("Safari")},Te=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},Re={unknown:function(){return Te({current:void 0,version:Ee.unknown()})},nu:Te,windows:l("Windows"),ios:l("iOS"),android:l("Android"),linux:l("Linux"),osx:l("OSX"),solaris:l("Solaris"),freebsd:l("FreeBSD"),chromeos:l("ChromeOS")},Ae=function(e,t){var n=String(t).toLowerCase();return W(e,function(e){return e.search(n)})},De=function(e,t){return Ae(e,t).map(function(e){var n=Ee.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Oe=function(e,t){return Ae(e,t).map(function(e){var n=Ee.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Be=function(e,t){return-1!==e.indexOf(t)},Pe=function(e,t){return function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t}(e,t,0)},Le=function(e){return function(t){return t.replace(e,"")}},Ie=Le(/^\s+|\s+$/g),Me=Le(/^\s+/g),Fe=Le(/\s+$/g),Ue=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ze=function(e){return function(t){return Be(t,e)}},je=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Be(e,"edge/")&&Be(e,"chrome")&&Be(e,"safari")&&Be(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ue],search:function(e){return Be(e,"chrome")&&!Be(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Be(e,"msie")||Be(e,"trident")}},{name:"Opera",versionRegexes:[Ue,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ze("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ze("firefox")},{name:"Safari",versionRegexes:[Ue,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Be(e,"safari")||Be(e,"mobile/"))&&Be(e,"applewebkit")}}],He=[{name:"Windows",search:ze("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Be(e,"iphone")||Be(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ze("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ze("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ze("linux"),versionRegexes:[]},{name:"Solaris",search:ze("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ze("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ze("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ve={browsers:l(je),oses:l(He)},qe=function(e,t){var n=Ve.browsers(),r=Ve.oses(),o=De(n,e).fold(_e.unknown,_e.nu),i=Oe(r,e).fold(Re.unknown,Re.nu),a=function(e,t,n,r){var o=e.isiOS()&&!0===/ipad/i.test(n),i=e.isiOS()&&!o,a=e.isiOS()||e.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,f=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),d=!s&&!c&&!f;return{isiPad:l(o),isiPhone:l(i),isTablet:l(c),isPhone:l(s),isTouch:l(u),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:l(f),isDesktop:l(d)}}(i,o,e,t);return{browser:o,os:i,deviceType:a}},$e=function(t){return e.window.matchMedia(t).matches},We=function(e){var t,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,t=e.apply(null,r)),t}}(function(){return qe(e.navigator.userAgent,$e)}),Ke=function(){return We()},Xe=e.navigator.userAgent,Ye=Ke(),Ge=Ye.browser,Je=Ye.os,Qe=Ye.deviceType,Ze=/WebKit/.test(Xe)&&!Ge.isEdge(),et="FormData"in e.window&&"FileReader"in e.window&&"URL"in e.window&&!!e.URL.createObjectURL,tt=-1!==Xe.indexOf("Windows Phone"),nt={opera:Ge.isOpera(),webkit:Ze,ie:!(!Ge.isIE()&&!Ge.isEdge())&&Ge.version.major,gecko:Ge.isFirefox(),mac:Je.isOSX()||Je.isiOS(),iOS:Qe.isiPad()||Qe.isiPhone(),android:Je.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:e.window.getSelection&&"Range"in e.window,documentMode:Ge.isIE()?e.document.documentMode||7:10,fileApi:et,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!Ge.isIE(),desktop:Qe.isDesktop(),windowsPhone:tt,browser:{current:Ge.current,version:Ge.version,isChrome:Ge.isChrome,isEdge:Ge.isEdge,isFirefox:Ge.isFirefox,isIE:Ge.isIE,isOpera:Ge.isOpera,isSafari:Ge.isSafari},os:{current:Je.current,version:Je.version,isAndroid:Je.isAndroid,isChromeOS:Je.isChromeOS,isFreeBSD:Je.isFreeBSD,isiOS:Je.isiOS,isLinux:Je.isLinux,isOSX:Je.isOSX,isSolaris:Je.isSolaris,isWindows:Je.isWindows},deviceType:{isDesktop:Qe.isDesktop,isiPad:Qe.isiPad,isiPhone:Qe.isiPhone,isPhone:Qe.isPhone,isTablet:Qe.isTablet,isTouch:Qe.isTouch,isWebView:Qe.isWebView}},rt=/^\s*|\s*$/g,ot=function(e){return null==e?"":(""+e).replace(rt,"")},it=function(e,t){return t?!("array"!==t||!me(e))||typeof e===t:void 0!==e},at=function(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),pe(e,function(e,o){if(!1===t.call(r,e,o,n))return!1;at(e,t,n,r)}))},ut={trim:ot,isArray:me,is:it,toArray:function(e){var t,n,r=e;if(!me(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:pe,map:ge,grep:he,inArray:ve,hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var o=t[r];for(var i in o)if(o.hasOwnProperty(i)){var a=o[i];void 0!==a&&(e[i]=a)}}return e},create:function(e,t,n){var r,o,i,a=0,u=(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e))[3].match(/(^|\.)(\w+)$/i)[2],c=this.createNS(e[3].replace(/\.\w+$/,""),n);if(!c[u]){if("static"===e[2])return c[u]=t,void(this.onCreate&&this.onCreate(e[2],e[3],c[u]));t[u]||(t[u]=function(){},a=1),c[u]=t[u],this.extend(c[u].prototype,t),e[5]&&(r=this.resolve(e[5]).prototype,o=e[5].match(/\.(\w+)$/i)[1],i=c[u],c[u]=a?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},c[u].prototype[u]=c[u],this.each(r,function(e,t){c[u].prototype[t]=r[t]}),this.each(t,function(e,t){r[t]?c[u].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==u&&(c[u].prototype[t]=e)})),this.each(t.static,function(e,t){c[u][t]=e})}},walk:at,createNS:function(t,n){var r,o;for(n=n||e.window,t=t.split("."),r=0;r<t.length;r++)n[o=t[r]]||(n[o]={}),n=n[o];return n},resolve:function(t,n){var r,o;for(n=n||e.window,r=0,o=(t=t.split(".")).length;r<o&&(n=n[t[r]]);r++);return n},explode:function(e,t){return!e||it(e,"array")?e:ge(e.split(t||","),ot)},_addCacheSuffix:function(e){var t=nt.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},ct=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:l(e)}},st={fromHtml:function(t,n){var r=(n||e.document).createElement("div");if(r.innerHTML=t,!r.hasChildNodes()||r.childNodes.length>1)throw e.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return ct(r.childNodes[0])},fromTag:function(t,n){var r=(n||e.document).createElement(t);return ct(r)},fromText:function(t,n){var r=(n||e.document).createTextNode(t);return ct(r)},fromDom:ct,fromPoint:function(e,t,n){var r=e.dom();return w.from(r.elementFromPoint(t,n)).map(ct)}},ft=(void 0!==e.window?e.window:Function("return this;")(),function(e){return e.dom().nodeName.toLowerCase()}),lt=function(e){return e.dom().nodeType},dt=function(e){return function(t){return lt(t)===e}},mt=dt(1),pt=dt(3),gt=dt(9),ht=dt(11),vt=function(e,t){var n=[],r=function(e){return n.push(e),t(e)},o=t(e);do{o=o.bind(r)}while(o.isSome());return n},yt=function(e,t){var n=e.dom();if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(t);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(t);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},bt=function(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount},Ct=function(e,t){return e.dom()===t.dom()},wt=function(t,n){return r=t.dom(),o=n.dom(),function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)}(r,o,e.Node.DOCUMENT_POSITION_CONTAINED_BY);var r,o},xt=function(e,t){return Ke().browser.isIE()?wt(e,t):function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)}(e,t)},St=function(e){return st.fromDom(e.dom().ownerDocument)},Nt=function(e){return gt(e)?e:St(e)},Et=function(e){return st.fromDom(e.dom().ownerDocument.defaultView)},kt=function(e){return w.from(e.dom().parentNode).map(st.fromDom)},_t=function(e){return w.from(e.dom().previousSibling).map(st.fromDom)},Tt=function(e){return w.from(e.dom().nextSibling).map(st.fromDom)},Rt=function(e){return G(vt(e,_t))},At=function(e){return vt(e,Tt)},Dt=function(e){return U(e.dom().childNodes,st.fromDom)},Ot=function(e,t){var n=e.dom().childNodes;return w.from(n[t]).map(st.fromDom)},Bt=function(e){return Ot(e,0)},Pt=function(e){return Ot(e,e.dom().childNodes.length-1)},Lt=function(e){return ht(e)},It=D(e.Element.prototype.attachShadow)&&D(e.Node.prototype.getRootNode)?function(e){return st.fromDom(e.dom().getRootNode())}:Nt,Mt=function(e){return Lt(e)?e:function(e){var t=e.dom().head;if(null==t)throw new Error("Head is not available yet");return st.fromDom(t)}(Nt(e))},Ft=function(e){return st.fromDom(e.dom().host)},Ut=function(e,t){kt(e).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})},zt=function(e,t){Tt(e).fold(function(){kt(e).each(function(e){Ht(e,t)})},function(e){Ut(e,t)})},jt=function(e,t){Bt(e).fold(function(){Ht(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})},Ht=function(e,t){e.dom().appendChild(t.dom())},Vt=function(e,t){z(t,function(t){Ht(e,t)})},qt=function(e){e.dom().textContent="",z(Dt(e),function(e){$t(e)})},$t=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Wt=function(e){var t,n=Dt(e);n.length>0&&(t=e,z(n,function(e){Ut(t,e)})),$t(e)},Kt=function(e){var t,n,r,o,i=pt(e)?e.dom().parentNode:e.dom();return null!=i&&null!==i.ownerDocument&&(r=st.fromDom(i),o=It(r),Lt(o)?w.some(o):w.none()).fold(function(){return i.ownerDocument.body.contains(i)},(t=Kt,n=Ft,function(e){return t(n(e))}))},Xt=function(e,t){return{left:l(e),top:l(t),translate:function(n,r){return Xt(e+n,t+r)}}},Yt=Xt,Gt=function(e,t){return void 0!==e?e:void 0!==t?t:0},Jt=function(e){var t=e.dom(),n=t.ownerDocument.body;return n===t?Yt(n.offsetLeft,n.offsetTop):Kt(e)?function(e){var t=e.getBoundingClientRect();return Yt(t.left,t.top)}(t):Yt(0,0)},Qt=function(t){var n=void 0!==t?t.dom():e.document,r=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return Yt(r,o)},Zt=function(t,n,r){(void 0!==r?r.dom():e.document).defaultView.scrollTo(t,n)},en=function(e,t){Ke().browser.isSafari()&&D(e.dom().scrollIntoViewIfNeeded)?e.dom().scrollIntoViewIfNeeded(!1):e.dom().scrollIntoView(t)},tn=function(e,t,n,r){return{x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}},nn=function(t){var n=void 0===t?e.window:t,r=n.document,o=Qt(st.fromDom(r));return function(t){var n=void 0===t?e.window:t;return w.from(n.visualViewport)}(n).fold(function(){var e=n.document.documentElement,t=e.clientWidth,r=e.clientHeight;return tn(o.left(),o.top(),t,r)},function(e){return tn(Math.max(e.pageLeft,o.left()),Math.max(e.pageTop,o.top()),e.width,e.height)})},rn=function(e){return function(t){return!!t&&t.nodeType===e}},on=function(e){return!!e&&!Object.getPrototypeOf(e)},an=rn(1),un=function(e){var t=e.map(function(e){return e.toLowerCase()});return function(e){if(e&&e.nodeName){var n=e.nodeName.toLowerCase();return M(t,n)}return!1}},cn=function(e,t){var n=t.toLowerCase().split(" ");return function(t){var r;if(an(t))for(r=0;r<n.length;r++){var o=t.ownerDocument.defaultView.getComputedStyle(t,null);if((o?o.getPropertyValue(e):null)===n[r])return!0}return!1}},sn=function(e){return function(t){return an(t)&&t.hasAttribute(e)}},fn=function(e){return an(e)&&e.hasAttribute("data-mce-bogus")},ln=function(e){return an(e)&&"TABLE"===e.tagName},dn=function(e){return function(t){if(an(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}},mn=un(["textarea","input"]),pn=rn(3),gn=rn(8),hn=rn(9),vn=rn(11),yn=un(["br"]),bn=dn("true"),Cn=dn("false"),wn=function(e){return void 0!==e.style&&D(e.style.getPropertyValue)},xn=function(t,n,r){if(!(E(r)||R(r)||O(r)))throw e.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,r+"")},Sn=function(e,t,n){xn(e.dom(),t,n)},Nn=function(e,t){var n=e.dom();re(t,function(e,t){xn(n,t,e)})},En=function(e,t){var n=e.dom().getAttribute(t);return null===n?void 0:n},kn=function(e,t){e.dom().removeAttribute(t)},_n=function(t,n){var r=t.dom();re(n,function(t,n){!function(t,n,r){if(!E(r))throw e.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",t),new Error("CSS value must be a string: "+r);wn(t)&&t.style.setProperty(n,r)}(r,n,t)})},Tn=function(t,n){var r=t.dom(),o=e.window.getComputedStyle(r).getPropertyValue(n);return""!==o||Kt(t)?o:Rn(r,n)},Rn=function(e,t){return wn(e)?e.style.getPropertyValue(t):""},An=function(e,t){var n=e.dom(),r=Rn(n,t);return w.from(r).filter(function(e){return e.length>0})},Dn=function(e){var t={},n=e.dom();if(wn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);t[o]=n.style[o]}return t},On=Ke().browser,Bn=function(e){return W(e,mt)},Pn=function(e,t){return e.children&&M(e.children,t)},Ln=function(e,t,n){var r,o,i=0,a=0,u=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===Tn(st.fromDom(e),"position"))return{x:i=(o=t.getBoundingClientRect()).left+(u.documentElement.scrollLeft||e.scrollLeft)-u.documentElement.clientLeft,y:a=o.top+(u.documentElement.scrollTop||e.scrollTop)-u.documentElement.clientTop};for(r=t;r&&r!==n&&r.nodeType&&!Pn(r,n);)i+=r.offsetLeft||0,a+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType&&!Pn(r,n);)i-=r.scrollLeft||0,a-=r.scrollTop||0,r=r.parentNode;a+=function(e){return On.isFirefox()&&"table"===ft(e)?Bn(Dt(e)).filter(function(e){return"caption"===ft(e)}).bind(function(e){return Bn(At(e)).map(function(t){var n=t.dom().offsetTop,r=e.dom().offsetTop,o=e.dom().offsetHeight;return n<=r?-o:0})}).getOr(0):0}(st.fromDom(t))}return{x:i,y:a}},In=function(e){var t;return function(n){return(t=t||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(e,l(!0))).hasOwnProperty(ft(n))}},Mn=In(["h1","h2","h3","h4","h5","h6"]),Fn=In(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),Un=function(e){return mt(e)&&!Fn(e)},zn=function(e){return mt(e)&&"br"===ft(e)},jn=In(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),Hn=In(["ul","ol","dl"]),Vn=In(["li","dd","dt"]),qn=In(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),$n=In(["thead","tbody","tfoot"]),Wn=In(["td","th"]),Kn=In(["pre","script","textarea","style"]),Xn=/^[ \t\r\n]*$/,Yn=function(e){return Xn.test(e)},Gn=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Jn=function(e,t){var n,r=t.childNodes;if(!an(t)||!Gn(t)){for(n=r.length-1;n>=0;n--)Jn(e,r[n]);if(!1===hn(t)){if(pn(t)&&t.nodeValue.length>0){var o=Yn(t.nodeValue);if(e.isBlock(t.parentNode)||!o)return;if(function(e){var t=e.previousSibling&&"SPAN"===e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"===e.nextSibling.nodeName;return t&&n}(t))return}else if(an(t)&&(1===(r=t.childNodes).length&&Gn(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||qn(st.fromDom(t))))return;e.remove(t)}return t}},Qn=ut.makeMap,Zn=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,er=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,tr=/[<>&\"\']/g,nr=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,rr={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},or={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},ir={"<":"<",">":">","&":"&",""":'"',"'":"'"},ar=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),or[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}},ur=ar("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),cr=function(e,t){return e.replace(t?Zn:er,function(e){return or[e]||e})},sr=function(e,t){return e.replace(t?Zn:er,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":or[e]||"&#"+e.charCodeAt(0)+";"})},fr=function(e,t,n){return n=n||ur,e.replace(t?Zn:er,function(e){return or[e]||n[e]||e})},lr={encodeRaw:cr,encodeAllRaw:function(e){return(""+e).replace(tr,function(e){return or[e]||e})},encodeNumeric:sr,encodeNamed:fr,getEncodeFunc:function(e,t){var n=ar(t)||ur,r=Qn(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?Zn:er,function(e){return void 0!==or[e]?or[e]:void 0!==n[e]?n[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:r.named?t?function(e,t){return fr(e,t,n)}:fr:r.numeric?sr:cr},decode:function(e){return e.replace(nr,function(e,t){return t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):rr[t]||String.fromCharCode(t):ir[e]||ur[e]||(n=e,(r=st.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},dr={},mr={},pr=ut.makeMap,gr=ut.each,hr=ut.extend,vr=ut.explode,yr=ut.inArray,br=function(e,t){return(e=ut.trim(e))?e.split(t||" "):[]},Cr=function(e){var t,n,r,o,i,a,u={},c=function(e,n,r){var o,i,a,c=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};for(n=n||"","string"==typeof(r=r||[])&&(r=br(r)),o=(e=br(e)).length;o--;)a={attributes:c(i=br([t,n].join(" "))),attributesOrder:i,children:c(r,mr)},u[e[o]]=a},s=function(e,t){var n,r,o,i;for(n=(e=br(e)).length,t=br(t);n--;)for(r=u[e[n]],o=0,i=t.length;o<i;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o])};return dr[e]?dr[e]:(t="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(t+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(t+=" xml:lang",r=[r,a="acronym applet basefont big font strike tt"].join(" "),gr(br(a),function(e){c(e,"",r)}),n=[n,i="center dir isindex noframes"].join(" "),o=[n,r].join(" "),gr(br(i),function(e){c(e,"",o)})),o=o||[n,r].join(" "),c("html","manifest","head body"),c("head","","base command link meta noscript script style title"),c("title hr noscript br"),c("base","href target"),c("link","href rel media hreflang type sizes hreflang"),c("meta","name http-equiv content charset"),c("style","media type scoped"),c("script","src async defer type charset"),c("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),c("address dt dd div caption","",o),c("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",r),c("blockquote","cite",o),c("ol","reversed start type","li"),c("ul","","li"),c("li","value",o),c("dl","","dt dd"),c("a","href target rel media hreflang type",r),c("q","cite",r),c("ins del","cite datetime",o),c("img","src sizes srcset alt usemap ismap width height"),c("iframe","src name width height",o),c("embed","src type width height"),c("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),c("param","name value"),c("map","name",[o,"area"].join(" ")),c("area","alt coords shape href target rel media hreflang type"),c("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),c("colgroup","span","col"),c("col","span"),c("tbody thead tfoot","","tr"),c("tr","","td th"),c("td","colspan rowspan headers",o),c("th","colspan rowspan headers scope abbr",o),c("form","accept-charset action autocomplete enctype method name novalidate target",o),c("fieldset","disabled form name",[o,"legend"].join(" ")),c("label","form for",r),c("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),c("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?o:r),c("select","disabled form multiple name required size","option optgroup"),c("optgroup","disabled label","option"),c("option","disabled label selected value"),c("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),c("menu","type label",[o,"li"].join(" ")),c("noscript","",o),"html4"!==e&&(c("wbr"),c("ruby","",[r,"rt rp"].join(" ")),c("figcaption","",o),c("mark rt rp summary bdi","",r),c("canvas","width height",o),c("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),c("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),c("picture","","img source"),c("source","src srcset type media sizes"),c("track","kind src srclang label default"),c("datalist","",[r,"option"].join(" ")),c("article section nav aside main header footer","",o),c("hgroup","","h1 h2 h3 h4 h5 h6"),c("figure","",[o,"figcaption"].join(" ")),c("time","datetime",r),c("dialog","open",o),c("command","type label icon disabled checked radiogroup command"),c("output","for form name",r),c("progress","value max",r),c("meter","value min max low high optimum",r),c("details","open",[o,"summary"].join(" ")),c("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(s("script","language xml:space"),s("style","xml:space"),s("object","declare classid code codebase codetype archive standby align border hspace vspace"),s("embed","align name hspace vspace"),s("param","valuetype type"),s("a","charset name rev shape coords"),s("br","clear"),s("applet","codebase archive code object alt name width height align hspace vspace"),s("img","name longdesc align border hspace vspace"),s("iframe","longdesc frameborder marginwidth marginheight scrolling align"),s("font basefont","size color face"),s("input","usemap align"),s("select"),s("textarea"),s("h1 h2 h3 h4 h5 h6 div p legend caption","align"),s("ul","type compact"),s("li","type"),s("ol dl menu dir","compact"),s("pre","width xml:space"),s("hr","align noshade size width"),s("isindex","prompt"),s("table","summary width frame rules cellspacing cellpadding align bgcolor"),s("col","width align char charoff valign"),s("colgroup","width align char charoff valign"),s("thead","align char charoff valign"),s("tr","align char charoff valign bgcolor"),s("th","axis align char charoff valign nowrap bgcolor width height"),s("form","accept"),s("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),s("tfoot","align char charoff valign"),s("tbody","align char charoff valign"),s("area","nohref"),s("body","background bgcolor text link vlink alink")),"html4"!==e&&(s("input button select textarea","autofocus"),s("input textarea","placeholder"),s("a","download"),s("link script img","crossorigin"),s("img","loading"),s("iframe","sandbox seamless allowfullscreen loading")),gr(br("a form meter progress dfn"),function(e){u[e]&&delete u[e].children[e]}),delete u.caption.children.table,delete u.script,dr[e]=u,u)},wr=function(e,t){var n;return e&&(n={},"string"==typeof e&&(e={"*":e}),gr(e,function(e,r){n[r]=n[r.toUpperCase()]="map"===t?pr(e,/[, ]/):vr(e,/[, ]/)})),n};function xr(e){var t={},n={},r=[],o={},i={},a=function(t,n,r){var o=e[t];return o?o=pr(o,/[, ]/,pr(o.toUpperCase(),/[, ]/)):(o=dr[t])||(o=pr(n," ",pr(n.toUpperCase()," ")),o=hr(o,r),dr[t]=o),o},u=Cr((e=e||{}).schema);!1===e.verify_html&&(e.valid_elements="*[*]");var c=wr(e.valid_styles),s=wr(e.invalid_styles,"map"),f=wr(e.valid_classes,"map"),l=a("whitespace_elements","pre script noscript style textarea video audio iframe object code"),d=a("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),m=a("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),p=a("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),g=a("non_empty_elements","td th iframe video audio object script pre code",m),h=a("move_caret_before_on_enter_elements","table",g),v=a("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),y=a("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",v),b=a("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp");gr((e.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),function(e){i[e]=new RegExp("</"+e+"[^>]*>","gi")});var C=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},w=function(e){var n,o,i,a,u,c,s,f,l,d,m,p,g,h,v,y,b,w,x=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,S=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,N=/[*?+]/;if(e)for(e=br(e,","),t["@"]&&(y=t["@"].attributes,b=t["@"].attributesOrder),n=0,o=e.length;n<o;n++)if(u=x.exec(e[n])){if(h=u[1],l=u[2],v=u[3],f=u[5],c={attributes:p={},attributesOrder:g=[]},"#"===h&&(c.paddEmpty=!0),"-"===h&&(c.removeEmpty=!0),"!"===u[4]&&(c.removeEmptyAttrs=!0),y&&(re(y,function(e,t){p[t]=e}),g.push.apply(g,b)),f)for(i=0,a=(f=br(f,"|")).length;i<a;i++)if(u=S.exec(f[i])){if(s={},m=u[1],d=u[2].replace(/[\\:]:/g,":"),h=u[3],w=u[4],"!"===m&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(d),s.required=!0),"-"===m){delete p[d],g.splice(yr(g,d),1);continue}h&&("="===h&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:d,value:w}),s.defaultValue=w),":"===h&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:d,value:w}),s.forcedValue=w),"<"===h&&(s.validValues=pr(w,"?"))),N.test(d)?(c.attributePatterns=c.attributePatterns||[],s.pattern=C(d),c.attributePatterns.push(s)):(p[d]||g.push(d),p[d]=s)}y||"@"!==l||(y=p,b=g),v&&(c.outputName=l,t[v]=c),N.test(l)?(c.pattern=C(l),r.push(c)):t[l]=c}},x=function(e){t={},r=[],w(e),gr(u,function(e,t){n[t]=e.children})},S=function(e){var r=/^(~)?(.+)$/;e&&(dr.text_block_elements=dr.block_elements=null,gr(br(e,","),function(e){var i=r.exec(e),a="~"===i[1],u=a?"span":"div",c=i[2];if(n[c]=n[u],o[c]=u,a||(y[c.toUpperCase()]={},y[c]={}),!t[c]){var s=t[u];delete(s=hr({},s)).removeEmptyAttrs,delete s.removeEmpty,t[c]=s}gr(n,function(e,t){e[u]&&(n[t]=e=hr({},n[t]),e[c]=e[u])})}))},N=function(t){var r=/^([+\-]?)([A-Za-z0-9_\-\.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)\]$/;dr[e.schema]=null,t&&gr(br(t,","),function(e){var t,o,i=r.exec(e);i&&(o=i[1],t=o?n[i[2]]:n[i[2]]={"#comment":{}},t=n[i[2]],gr(br(i[3],"|"),function(e){"-"===o?delete t[e]:t[e]={}}))})},E=function(e){var n,o=t[e];if(o)return o;for(n=r.length;n--;)if((o=r[n]).pattern.test(e))return o};e.valid_elements?x(e.valid_elements):(gr(u,function(e,r){t[r]={attributes:e.attributes,attributesOrder:e.attributesOrder},n[r]=e.children}),"html5"!==e.schema&&gr(br("strong/b em/i"),function(e){e=br(e,"/"),t[e[1]].outputName=e[0]}),gr(br("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){t[e]&&(t[e].removeEmpty=!0)}),gr(br("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){t[e].paddEmpty=!0}),gr(br("span"),function(e){t[e].removeEmptyAttrs=!0})),S(e.custom_elements),N(e.valid_children),w(e.extended_valid_elements),N("+ol[ul|ol],+ul[ul|ol]"),gr({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},function(e,n){t[n]&&(t[n].parentsRequired=br(e))}),e.invalid_elements&&gr(vr(e.invalid_elements),function(e){t[e]&&delete t[e]}),E("span")||w("span[!data-mce-type|*]");return{children:n,elements:t,getValidStyles:function(){return c},getValidClasses:function(){return f},getBlockElements:function(){return y},getInvalidStyles:function(){return s},getShortEndedElements:function(){return m},getTextBlockElements:function(){return v},getTextInlineElements:function(){return b},getBoolAttrs:function(){return p},getElementRule:E,getSelfClosingElements:function(){return d},getNonEmptyElements:function(){return g},getMoveCaretBeforeOnEnterElements:function(){return h},getWhiteSpaceElements:function(){return l},getSpecialElements:function(){return i},isValidChild:function(e,t){var r=n[e.toLowerCase()];return!(!r||!r[t.toLowerCase()])},isValid:function(e,t){var n,r,o=E(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:function(){return o},addValidElements:w,setValidElements:x,addCustomElements:S,addValidChildren:N}}var Sr,Nr,Er,kr,_r,Tr,Rr,Ar,Dr,Or,Br,Pr,Lr,Ir,Mr,Fr,Ur,zr=function(e,t,n,r){var o=function(e){return(e=parseInt(e,10).toString(16)).length>1?e:"0"+e};return"#"+o(t)+o(n)+o(r)},jr=function(e,t){var n,r,o,i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,a=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,u=/\s*([^:]+):\s*([^;]+);?/g,c=/\s+$/,s={};e=e||{},t&&(r=t.getValidStyles(),o=t.getInvalidStyles());var f="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(n=0;n<f.length;n++)s[f[n]]="\ufeff"+n,s["\ufeff"+n]=f[n];return{toHex:function(e){return e.replace(i,zr)},parse:function(t){var r,o,f,l,d,m,p,g,h={},v=e.url_converter,y=e.url_converter_scope||this,b=function(e,t,r){var o=h[e+"-top"+t];if(o){var i=h[e+"-right"+t];if(i){var a=h[e+"-bottom"+t];if(a){var u=h[e+"-left"+t];if(u){var c=[o,i,a,u];for(n=c.length-1;n--&&c[n]===c[n+1];);n>-1&&r||(h[e+t]=-1===n?c[0]:c.join(" "),delete h[e+"-top"+t],delete h[e+"-right"+t],delete h[e+"-bottom"+t],delete h[e+"-left"+t])}}}}},C=function(e){var t,n=h[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return h[e]=n[0],!0}},w=function(e){return l=!0,s[e]},x=function(e,t){return l&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return s[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},S=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},N=function(e){return e.replace(/\\[0-9a-f]+/gi,S)},E=function(t,n,r,o,i,a){if(i=i||a)return"'"+(i=x(i)).replace(/\'/g,"\\'")+"'";if(n=x(n||r||o),!e.allow_script_urls){var u=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(u))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(u))return""}return v&&(n=v.call(y,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(t){for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,w).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,w)});r=u.exec(t);)if(u.lastIndex=r.index+r[0].length,o=r[1].replace(c,"").toLowerCase(),f=r[2].replace(c,""),o&&f){if(o=N(o),f=N(f),-1!==o.indexOf("\ufeff")||-1!==o.indexOf('"'))continue;if(!e.allow_script_urls&&("behavior"===o||/expression\s*\(|\/\*|\*\//.test(f)))continue;"font-weight"===o&&"700"===f?f="bold":"color"!==o&&"background-color"!==o||(f=f.toLowerCase()),f=(f=f.replace(i,zr)).replace(a,E),h[o]=l?x(f,!0):f}b("border","",!0),b("border","-width"),b("border","-color"),b("border","-style"),b("padding",""),b("margin",""),d="border",p="border-style",g="border-color",C(m="border-width")&&C(p)&&C(g)&&(h[d]=h[m]+" "+h[p]+" "+h[g],delete h[m],delete h[p],delete h[g]),"medium none"===h.border&&delete h.border,"none"===h["border-image"]&&delete h["border-image"]}return h},serialize:function(e,t){var n="",i=function(t){var o,i=r[t];if(i)for(var a=0,u=i.length;a<u;a++)t=i[a],(o=e[t])&&(n+=(n.length>0?" ":"")+t+": "+o+";")};return t&&r?(i("*"),i(t)):re(e,function(e,r){!e||o&&!function(e,t){var n=o["*"];return!(n&&n[e]||(n=o[t])&&n[e])}(r,t)||(n+=(n.length>0?" ":"")+r+": "+e+";")}),n}}},Hr="mce-data-",Vr=/^(?:mouse|contextmenu)|click/,qr={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1,mozPressure:1},$r=function(){return!1},Wr=function(){return!0},Kr=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},Xr=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},Yr=function(t,n){var r,o=n||{};for(r in t)qr[r]||(o[r]=t[r]);if(o.target||(o.target=o.srcElement||e.document),nt.experimentalShadowDom&&(o.target=function(e,t){if(e.composedPath){var n=e.composedPath();if(n&&n.length>0)return n[0]}return t}(t,o.target)),t&&Vr.test(t.type)&&void 0===t.pageX&&void 0!==t.clientX){var i=o.target.ownerDocument||e.document,a=i.documentElement,u=i.body;o.pageX=t.clientX+(a&&a.scrollLeft||u&&u.scrollLeft||0)-(a&&a.clientLeft||u&&u.clientLeft||0),o.pageY=t.clientY+(a&&a.scrollTop||u&&u.scrollTop||0)-(a&&a.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=Wr,t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=Wr,t&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)},o.stopImmediatePropagation=function(){o.isImmediatePropagationStopped=Wr,o.stopPropagation()},!1===function(e){return e.isDefaultPrevented===Wr||e.isDefaultPrevented===$r}(o)&&(o.isDefaultPrevented=$r,o.isPropagationStopped=$r,o.isImmediatePropagationStopped=$r),void 0===o.metaKey&&(o.metaKey=!1),o},Gr=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else{var i=function(){Xr(e,"DOMContentLoaded",i),Xr(e,"load",i),n.domLoaded||(n.domLoaded=!0,t(o))};"complete"===r.readyState||"interactive"===r.readyState&&r.body?i():Kr(e,"DOMContentLoaded",i),Kr(e,"load",i)}},Jr=function(){function t(){this.domLoaded=!1,this.events={},this.count=1,this.expando=Hr+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in e.document.documentElement,this.hasFocusIn="onfocusin"in e.document.documentElement,this.count=1}return t.prototype.bind=function(t,n,r,o){var i,a,u,c,s,f,l,d=this,m=e.window,p=function(e){d.executeHandlers(Yr(e||m.event),i)};if(t&&3!==t.nodeType&&8!==t.nodeType){t[d.expando]?i=t[d.expando]:(i=d.count++,t[d.expando]=i,d.events[i]={}),o=o||t;var g=n.split(" ");for(u=g.length;u--;)f=p,s=l=!1,"DOMContentLoaded"===(c=g[u])&&(c="ready"),d.domLoaded&&"ready"===c&&"complete"===t.readyState?r.call(o,Yr({type:c})):(d.hasMouseEnterLeave||(s=d.mouseEnterLeave[c])&&(f=function(e){var t=e.currentTarget,n=e.relatedTarget;if(n&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=Yr(e||m.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,d.executeHandlers(e,i))}),d.hasFocusIn||"focusin"!==c&&"focusout"!==c||(l=!0,s="focusin"===c?"focus":"blur",f=function(e){(e=Yr(e||m.event)).type="focus"===e.type?"focusin":"focusout",d.executeHandlers(e,i)}),(a=d.events[i][c])?"ready"===c&&d.domLoaded?r(Yr({type:c})):a.push({func:r,scope:o}):(d.events[i][c]=a=[{func:r,scope:o}],a.fakeName=s,a.capture=l,a.nativeHandler=f,"ready"===c?Gr(t,f,d):Kr(t,s||c,f,l)));return t=a=0,r}},t.prototype.unbind=function(e,t,n){var r,o,i,a,u;if(!e||3===e.nodeType||8===e.nodeType)return this;var c=e[this.expando];if(c){if(u=this.events[c],t){var s=t.split(" ");for(o=s.length;o--;)if(r=u[a=s[o]]){if(n)for(i=r.length;i--;)if(r[i].func===n){var f=r.nativeHandler,l=r.fakeName,d=r.capture;(r=r.slice(0,i).concat(r.slice(i+1))).nativeHandler=f,r.fakeName=l,r.capture=d,u[a]=r}n&&0!==r.length||(delete u[a],Xr(e,r.fakeName||a,r.nativeHandler,r.capture))}}else re(u,function(t,n){Xr(e,t.fakeName||n,t.nativeHandler,t.capture)}),u={};for(a in u)if(de(u,a))return this;delete this.events[c];try{delete e[this.expando]}catch(m){e[this.expando]=null}}return this},t.prototype.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return this;var o=Yr(null,n);o.type=t,o.target=e;do{(r=e[this.expando])&&this.executeHandlers(o,r),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow}while(e&&!o.isPropagationStopped());return this},t.prototype.clean=function(e){var t,n;if(!e||3===e.nodeType||8===e.nodeType)return this;if(e[this.expando]&&this.unbind(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(this.unbind(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[this.expando]&&this.unbind(e);return this},t.prototype.destroy=function(){this.events={}},t.prototype.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1},t.prototype.executeHandlers=function(e,t){var n=this.events[t],r=n&&n[e.type];if(r)for(var o=0,i=r.length;o<i;o++){var a=r[o];if(a&&!1===a.func.call(a.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return}},t.Event=new t,t}(),Qr="sizzle"+-new Date,Zr=e.window.document,eo=0,to=0,no=Io(),ro=Io(),oo=Io(),io=function(e,t){return e===t&&(Or=!0),0},ao="undefined",uo=1<<31,co={}.hasOwnProperty,so=[],fo=so.pop,lo=so.push,mo=so.push,po=so.slice,go=so.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},ho="[\\x20\\t\\r\\n\\f]",vo="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",yo="\\["+ho+"*("+vo+")(?:"+ho+"*([*^$|!~]?=)"+ho+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+vo+"))|)"+ho+"*\\]",bo=":("+vo+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+yo+")*)|.*)\\)|)",Co=new RegExp("^"+ho+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ho+"+$","g"),wo=new RegExp("^"+ho+"*,"+ho+"*"),xo=new RegExp("^"+ho+"*([>+~]|"+ho+")"+ho+"*"),So=new RegExp("="+ho+"*([^\\]'\"]*?)"+ho+"*\\]","g"),No=new RegExp(bo),Eo=new RegExp("^"+vo+"$"),ko={ID:new RegExp("^#("+vo+")"),CLASS:new RegExp("^\\.("+vo+")"),TAG:new RegExp("^("+vo+"|[*])"),ATTR:new RegExp("^"+yo),PSEUDO:new RegExp("^"+bo),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ho+"*(even|odd|(([+-]|)(\\d*)n|)"+ho+"*(?:([+-]|)"+ho+"*(\\d+)|))"+ho+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+ho+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ho+"*((?:-\\d)?\\d*)"+ho+"*\\)|)(?=[^-]|$)","i")},_o=/^(?:input|select|textarea|button)$/i,To=/^h\d$/i,Ro=/^[^{]+\{\s*\[native \w/,Ao=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Do=/[+~]/,Oo=/'|\\/g,Bo=new RegExp("\\\\([\\da-f]{1,6}"+ho+"?|("+ho+")|.)","ig"),Po=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{mo.apply(so=po.call(Zr.childNodes),Zr.childNodes),so[Zr.childNodes.length].nodeType}catch(fE){mo={apply:so.length?function(e,t){lo.apply(e,po.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var Lo=function(e,t,n,r){var o,i,a,u,c,s,f,l,d,m;if((t?t.ownerDocument||t:Zr)!==Pr&&Br(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Pr).nodeType)&&9!==u)return[];if(Ir&&!r){if(o=Ao.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&Ur(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return mo.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&Sr.getElementsByClassName)return mo.apply(n,t.getElementsByClassName(a)),n}if(Sr.qsa&&(!Mr||!Mr.test(e))){if(l=f=Qr,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(s=_r(e),(f=t.getAttribute("id"))?l=f.replace(Oo,"\\$&"):t.setAttribute("id",l),l="[id='"+l+"'] ",c=s.length;c--;)s[c]=l+Ho(s[c]);d=Do.test(e)&&zo(t.parentNode)||t,m=s.join(",")}if(m)try{return mo.apply(n,d.querySelectorAll(m)),n}catch(p){}finally{f||t.removeAttribute("id")}}}return Rr(e.replace(Co,"$1"),t,n,r)};function Io(){var e=[];return function t(n,r){return e.push(n+" ")>Nr.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function Mo(e){return e[Qr]=!0,e}function Fo(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||uo)-(~e.sourceIndex||uo);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function Uo(e){return Mo(function(t){return t=+t,Mo(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function zo(e){return e&&typeof e.getElementsByTagName!==ao&&e}function jo(){}function Ho(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Vo(e,t,n){var r=t.dir,o=n&&"parentNode"===r,i=to++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,a){var u,c,s=[eo,i];if(a){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||o){if((u=(c=t[Qr]||(t[Qr]={}))[r])&&u[0]===eo&&u[1]===i)return s[2]=u[2];if(c[r]=s,s[2]=e(t,n,a))return!0}}}function qo(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function $o(e,t,n,r,o){for(var i,a=[],u=0,c=e.length,s=null!=t;u<c;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),s&&t.push(u)));return a}function Wo(e,t,n,r,o,i){return r&&!r[Qr]&&(r=Wo(r)),o&&!o[Qr]&&(o=Wo(o,i)),Mo(function(i,a,u,c){var s,f,l,d=[],m=[],p=a.length,g=i||function(e,t,n){for(var r=0,o=t.length;r<o;r++)Lo(e,t[r],n);return n}(t||"*",u.nodeType?[u]:u,[]),h=!e||!i&&t?g:$o(g,d,e,u,c),v=n?o||(i?e:p||r)?[]:a:h;if(n&&n(h,v,u,c),r)for(s=$o(v,m),r(s,[],u,c),f=s.length;f--;)(l=s[f])&&(v[m[f]]=!(h[m[f]]=l));if(i){if(o||e){if(o){for(s=[],f=v.length;f--;)(l=v[f])&&s.push(h[f]=l);o(null,v=[],s,c)}for(f=v.length;f--;)(l=v[f])&&(s=o?go.call(i,l):d[f])>-1&&(i[s]=!(a[s]=l))}}else v=$o(v===a?v.splice(p,v.length):v),o?o(null,a,v,c):mo.apply(a,v)})}function Ko(e){for(var t,n,r,o=e.length,i=Nr.relative[e[0].type],a=i||Nr.relative[" "],u=i?1:0,c=Vo(function(e){return e===t},a,!0),s=Vo(function(e){return go.call(t,e)>-1},a,!0),f=[function(e,n,r){return!i&&(r||n!==Ar)||((t=n).nodeType?c(e,n,r):s(e,n,r))}];u<o;u++)if(n=Nr.relative[e[u].type])f=[Vo(qo(f),n)];else{if((n=Nr.filter[e[u].type].apply(null,e[u].matches))[Qr]){for(r=++u;r<o&&!Nr.relative[e[r].type];r++);return Wo(u>1&&qo(f),u>1&&Ho(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(Co,"$1"),n,u<r&&Ko(e.slice(u,r)),r<o&&Ko(e=e.slice(r)),r<o&&Ho(e))}f.push(n)}return qo(f)}Sr=Lo.support={},kr=Lo.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Br=Lo.setDocument=function(e){var t,n=e?e.ownerDocument||e:Zr,r=n.defaultView;return n!==Pr&&9===n.nodeType&&n.documentElement?(Pr=n,Lr=n.documentElement,Ir=!kr(n),r&&r!==function(e){try{return e.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",function(){Br()},!1):r.attachEvent&&r.attachEvent("onunload",function(){Br()})),Sr.attributes=!0,Sr.getElementsByTagName=!0,Sr.getElementsByClassName=Ro.test(n.getElementsByClassName),Sr.getById=!0,Nr.find.ID=function(e,t){if(typeof t.getElementById!==ao&&Ir){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},Nr.filter.ID=function(e){var t=e.replace(Bo,Po);return function(e){return e.getAttribute("id")===t}},Nr.find.TAG=Sr.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==ao)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Nr.find.CLASS=Sr.getElementsByClassName&&function(e,t){if(Ir)return t.getElementsByClassName(e)},Fr=[],Mr=[],Sr.disconnectedMatch=!0,Mr=Mr.length&&new RegExp(Mr.join("|")),Fr=Fr.length&&new RegExp(Fr.join("|")),t=Ro.test(Lr.compareDocumentPosition),Ur=t||Ro.test(Lr.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},io=t?function(e,t){if(e===t)return Or=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!Sr.sortDetached&&t.compareDocumentPosition(e)===r?e===n||e.ownerDocument===Zr&&Ur(Zr,e)?-1:t===n||t.ownerDocument===Zr&&Ur(Zr,t)?1:Dr?go.call(Dr,e)-go.call(Dr,t):0:4&r?-1:1)}:function(e,t){if(e===t)return Or=!0,0;var r,o=0,i=e.parentNode,a=t.parentNode,u=[e],c=[t];if(!i||!a)return e===n?-1:t===n?1:i?-1:a?1:Dr?go.call(Dr,e)-go.call(Dr,t):0;if(i===a)return Fo(e,t);for(r=e;r=r.parentNode;)u.unshift(r);for(r=t;r=r.parentNode;)c.unshift(r);for(;u[o]===c[o];)o++;return o?Fo(u[o],c[o]):u[o]===Zr?-1:c[o]===Zr?1:0},n):Pr},Lo.matches=function(e,t){return Lo(e,null,null,t)},Lo.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Pr&&Br(e),t=t.replace(So,"='$1']"),Sr.matchesSelector&&Ir&&(!Fr||!Fr.test(t))&&(!Mr||!Mr.test(t)))try{var n=(void 0).call(e,t);if(n||Sr.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(fE){}return Lo(t,Pr,null,[e]).length>0},Lo.contains=function(e,t){return(e.ownerDocument||e)!==Pr&&Br(e),Ur(e,t)},Lo.attr=function(e,t){(e.ownerDocument||e)!==Pr&&Br(e);var n=Nr.attrHandle[t.toLowerCase()],r=n&&co.call(Nr.attrHandle,t.toLowerCase())?n(e,t,!Ir):void 0;return void 0!==r?r:Sr.attributes||!Ir?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},Lo.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},Lo.uniqueSort=function(e){var t,n=[],r=0,o=0;if(Or=!Sr.detectDuplicates,Dr=!Sr.sortStable&&e.slice(0),e.sort(io),Or){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return Dr=null,e},Er=Lo.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=Er(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=Er(t);return n},(Nr=Lo.selectors={cacheLength:50,createPseudo:Mo,match:ko,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Bo,Po),e[3]=(e[3]||e[4]||e[5]||"").replace(Bo,Po),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Lo.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Lo.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ko.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&No.test(n)&&(t=_r(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Bo,Po).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=no[e+" "];return t||(t=new RegExp("(^|"+ho+")"+e+"("+ho+"|$)"))&&no(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==ao&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var o=Lo.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),u="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,c){var s,f,l,d,m,p,g=i!==a?"nextSibling":"previousSibling",h=t.parentNode,v=u&&t.nodeName.toLowerCase(),y=!c&&!u;if(h){if(i){for(;g;){for(l=t;l=l[g];)if(u?l.nodeName.toLowerCase()===v:1===l.nodeType)return!1;p=g="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?h.firstChild:h.lastChild],a&&y){for(m=(s=(f=h[Qr]||(h[Qr]={}))[e]||[])[0]===eo&&s[1],d=s[0]===eo&&s[2],l=m&&h.childNodes[m];l=++m&&l&&l[g]||(d=m=0)||p.pop();)if(1===l.nodeType&&++d&&l===t){f[e]=[eo,m,d];break}}else if(y&&(s=(t[Qr]||(t[Qr]={}))[e])&&s[0]===eo)d=s[1];else for(;(l=++m&&l&&l[g]||(d=m=0)||p.pop())&&((u?l.nodeName.toLowerCase()!==v:1!==l.nodeType)||!++d||(y&&((l[Qr]||(l[Qr]={}))[e]=[eo,d]),l!==t)););return(d-=o)===r||d%r==0&&d/r>=0}}},PSEUDO:function(e,t){var n,r=Nr.pseudos[e]||Nr.setFilters[e.toLowerCase()]||Lo.error("unsupported pseudo: "+e);return r[Qr]?r(t):r.length>1?(n=[e,e,"",t],Nr.setFilters.hasOwnProperty(e.toLowerCase())?Mo(function(e,n){for(var o,i=r(e,t),a=i.length;a--;)e[o=go.call(e,i[a])]=!(n[o]=i[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:Mo(function(e){var t=[],n=[],r=Tr(e.replace(Co,"$1"));return r[Qr]?Mo(function(e,t,n,o){for(var i,a=r(e,null,o,[]),u=e.length;u--;)(i=a[u])&&(e[u]=!(t[u]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),!n.pop()}}),has:Mo(function(e){return function(t){return Lo(e,t).length>0}}),contains:Mo(function(e){return e=e.replace(Bo,Po),function(t){return(t.textContent||t.innerText||Er(t)).indexOf(e)>-1}}),lang:Mo(function(e){return Eo.test(e||"")||Lo.error("unsupported lang: "+e),e=e.replace(Bo,Po).toLowerCase(),function(t){var n;do{if(n=Ir?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.window.location&&e.window.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===Lr},focus:function(e){return e===Pr.activeElement&&(!Pr.hasFocus||Pr.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!Nr.pseudos.empty(e)},header:function(e){return To.test(e.nodeName)},input:function(e){return _o.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:Uo(function(){return[0]}),last:Uo(function(e,t){return[t-1]}),eq:Uo(function(e,t,n){return[n<0?n+t:n]}),even:Uo(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:Uo(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:Uo(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:Uo(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=Nr.pseudos.eq,z(["radio","checkbox","file","password","image"],function(e){var t;Nr.pseudos[e]=(t=e,function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t})}),z(["submit","reset"],function(e){var t;Nr.pseudos[e]=(t=e,function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t})}),jo.prototype=Nr.filters=Nr.pseudos,Nr.setFilters=new jo,_r=Lo.tokenize=function(e,t){var n,r,o,i,a,u,c,s=ro[e+" "];if(s)return t?0:s.slice(0);for(a=e,u=[],c=Nr.preFilter;a;){for(i in n&&!(r=wo.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=xo.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Co," ")}),a=a.slice(n.length)),Nr.filter)Nr.filter.hasOwnProperty(i)&&(!(r=ko[i].exec(a))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length)));if(!n)break}return t?a.length:a?Lo.error(e):ro(e,u).slice(0)},Tr=Lo.compile=function(e,t){var n,r=[],o=[],i=oo[e+" "];if(!i){for(t||(t=_r(e)),n=t.length;n--;)(i=Ko(t[n]))[Qr]?r.push(i):o.push(i);(i=oo(e,function(e,t){var n=t.length>0,r=e.length>0,o=function(o,i,a,u,c){var s,f,l,d=0,m="0",p=o&&[],g=[],h=Ar,v=o||r&&Nr.find.TAG("*",c),y=eo+=null==h?1:Math.random()||.1,b=v.length;for(c&&(Ar=i!==Pr&&i);m!==b&&null!=(s=v[m]);m++){if(r&&s){for(f=0;l=e[f++];)if(l(s,i,a)){u.push(s);break}c&&(eo=y)}n&&((s=!l&&s)&&d--,o&&p.push(s))}if(d+=m,n&&m!==d){for(f=0;l=t[f++];)l(p,g,i,a);if(o){if(d>0)for(;m--;)p[m]||g[m]||(g[m]=fo.call(u));g=$o(g)}mo.apply(u,g),c&&!o&&g.length>0&&d+t.length>1&&Lo.uniqueSort(u)}return c&&(eo=y,Ar=h),p};return n?Mo(o):o}(o,r))).selector=e}return i},Rr=Lo.select=function(e,t,n,r){var o,i,a,u,c,s="function"==typeof e&&e,f=!r&&_r(e=s.selector||e);if(n=n||[],1===f.length){if((i=f[0]=f[0].slice(0)).length>2&&"ID"===(a=i[0]).type&&Sr.getById&&9===t.nodeType&&Ir&&Nr.relative[i[1].type]){if(!(t=(Nr.find.ID(a.matches[0].replace(Bo,Po),t)||[])[0]))return n;s&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=ko.needsContext.test(e)?0:i.length;o--&&(a=i[o],!Nr.relative[u=a.type]);)if((c=Nr.find[u])&&(r=c(a.matches[0].replace(Bo,Po),Do.test(i[0].type)&&zo(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&Ho(i)))return mo.apply(n,r),n;break}}return(s||Tr(e,f))(r,t,!Ir,n,Do.test(e)&&zo(t.parentNode)||t),n},Sr.sortStable=Qr.split("").sort(io).join("")===Qr,Sr.detectDuplicates=!!Or,Br(),Sr.sortDetached=!0;var Xo=e.document,Yo=Array.prototype.push,Go=Array.prototype.slice,Jo=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Qo=Jr.Event,Zo=ut.makeMap("children,contents,next,prev"),ei=function(e){return void 0!==e},ti=function(e){return"string"==typeof e},ni=function(e,t){var n,r=(t=t||Xo).createElement("div"),o=t.createDocumentFragment();for(r.innerHTML=e;n=r.firstChild;)o.appendChild(n);return o},ri=function(e,t,n,r){var o;if(ti(t))t=ni(t,vi(e[0]));else if(t.length&&!t.nodeType){if(t=wi.makeArray(t),r)for(o=t.length-1;o>=0;o--)ri(e,t[o],n,r);else for(o=0;o<t.length;o++)ri(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},oi=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},ii=function(e,t,n){var r,o;return t=wi(t)[0],e.each(function(){n&&r===this.parentNode?o.appendChild(this):(r=this.parentNode,o=t.cloneNode(!1),this.parentNode.insertBefore(o,this),o.appendChild(this))}),e},ai=ut.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),ui=ut.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),ci={for:"htmlFor",class:"className",readonly:"readOnly"},si={float:"cssFloat"},fi={},li={},di=function(e,t){return new wi.fn.init(e,t)},mi=/^\s*|\s*$/g,pi=function(e){return null==e?"":(""+e).replace(mi,"")},gi=function(e,t){var n,r,o,i;if(e)if(void 0===(n=e.length)){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},hi=function(e,t){var n=[];return gi(e,function(e,r){t(r,e)&&n.push(r)}),n},vi=function(e){return e?9===e.nodeType?e:e.ownerDocument:Xo};di.fn=di.prototype={constructor:di,selector:"",context:null,length:0,init:function(t,n){var r,o;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if(n&&n.nodeType)this.context=n;else{if(n)return wi(t).attr(n);this.context=n=e.document}if(ti(t)){if(this.selector=t,!(r="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:Jo.exec(t)))return wi(n).find(t);if(r[1])for(o=ni(t,vi(n)).firstChild;o;)Yo.call(this,o),o=o.nextSibling;else{if(!(o=vi(n).getElementById(r[2])))return this;if(o.id!==r[2])return this.find(t);this.length=1,this[0]=o}}else this.add(t,!1);return this},toArray:function(){return ut.toArray(this)},add:function(e,t){var n,r;if(ti(e))return this.add(wi(e));if(!1!==t)for(n=wi.unique(this.toArray().concat(wi.makeArray(e))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else Yo.apply(this,wi.makeArray(e));return this},attr:function(e,t){var n,r=this;if("object"==typeof e)gi(e,function(e,t){r.attr(e,t)});else{if(!ei(t)){if(r[0]&&1===r[0].nodeType){if((n=fi[e])&&n.get)return n.get(r[0],e);if(ui[e])return r.prop(e)?e:void 0;null===(t=r[0].getAttribute(e,2))&&(t=void 0)}return t}this.each(function(){var n;if(1===this.nodeType){if((n=fi[e])&&n.set)return void n.set(this,t);null===t?this.removeAttribute(e,2):this.setAttribute(e,t,2)}})}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=ci[e]||e))gi(e,function(e,t){n.prop(e,t)});else{if(!ei(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(e,t){var n,r,o=this,i=function(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})},a=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})};if("object"==typeof e)gi(e,function(e,t){o.css(e,t)});else if(ei(t))e=i(e),"number"!=typeof t||ai[e]||(t=t.toString()+"px"),o.each(function(){var n=this.style;if((r=li[e])&&r.set)r.set(this,t);else{try{this.style[si[e]||e]=t}catch(o){}null!==t&&""!==t||(n.removeProperty?n.removeProperty(a(e)):n.removeAttribute(e))}});else{if(n=o[0],(r=li[e])&&r.get)return r.get(n);if(!n.ownerDocument.defaultView)return n.currentStyle?n.currentStyle[i(e)]:"";try{return n.ownerDocument.defaultView.getComputedStyle(n,null).getPropertyValue(a(e))}catch(u){return}}return o},remove:function(){for(var e,t=this.length;t--;)e=this[t],Qo.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t;if(ei(e)){t=this.length;try{for(;t--;)this[t].innerHTML=e}catch(n){wi(this[t]).empty().append(e)}return this}return this[0]?this[0].innerHTML:""},text:function(e){var t;if(ei(e)){for(t=this.length;t--;)"innerText"in this[t]?this[t].innerText=e:this[0].textContent=e;return this}return this[0]?this[0].innerText||this[0].textContent:""},append:function(){return ri(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return ri(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?ri(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?ri(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return wi(e).append(this),this},prependTo:function(e){return wi(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return ii(this,e)},wrapAll:function(e){return ii(this,e,!0)},wrapInner:function(e){return this.each(function(){wi(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){wi(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),wi(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return"string"!=typeof e?n:(-1!==e.indexOf(" ")?gi(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(n,r){var o=oi(r,e);if(o!==t){var i=r.className;o?r.className=pi((" "+i+" ").replace(" "+e+" "," ")):r.className+=i?" "+e:e}}),n)},hasClass:function(e){return oi(this[0],e)},each:function(e){return gi(this,e)},on:function(e,t){return this.each(function(){Qo.bind(this,e,t)})},off:function(e,t){return this.each(function(){Qo.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?Qo.fire(this,e.type,e):Qo.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new wi(Go.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)wi.find(e,this[t],r);return wi(r)},filter:function(e){return wi("function"==typeof e?hi(this.toArray(),function(t,n){return e(n,t)}):wi.filter(e,this.toArray()))},closest:function(e){var t=[];return e instanceof wi&&(e=e[0]),this.each(function(n,r){for(;r;){if("string"==typeof e&&wi(r).is(e)){t.push(r);break}if(r===e){t.push(r);break}r=r.parentNode}}),wi(t)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Yo,sort:Array.prototype.sort,splice:Array.prototype.splice},ut.extend(di,{extend:ut.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:ut.toArray(e);var t},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:ut.isArray,each:gi,trim:pi,grep:hi,find:Lo,expr:Lo.selectors,unique:Lo.uniqueSort,text:Lo.getText,contains:Lo.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?wi.find.matchesSelector(t[0],e)?[t[0]]:[]:wi.find.matches(e,t)}});var yi=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof wi&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&wi(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},bi=function(e,t,n,r){var o=[];for(r instanceof wi&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(void 0!==r){if(e===r)break;if("string"==typeof r&&wi(e).is(r))break}o.push(e)}return o},Ci=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};gi({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return yi(e,"parentNode")},next:function(e){return Ci(e,"nextSibling",1)},prev:function(e){return Ci(e,"previousSibling",1)},children:function(e){return bi(e.firstChild,"nextSibling",1)},contents:function(e){return ut.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){di.fn[e]=function(n){var r=[];this.each(function(){var e=t.call(r,this,n,r);e&&(wi.isArray(e)?r.push.apply(r,e):r.push(e))}),this.length>1&&(Zo[e]||(r=wi.unique(r)),0===e.indexOf("parents")&&(r=r.reverse()));var o=wi(r);return n?o.filter(n):o}}),gi({parentsUntil:function(e,t){return yi(e,"parentNode",t)},nextUntil:function(e,t){return bi(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return bi(e,"previousSibling",1,t).slice(1)}},function(e,t){di.fn[e]=function(n,r){var o=[];this.each(function(){var e=t.call(o,this,n,o);e&&(wi.isArray(e)?o.push.apply(o,e):o.push(e))}),this.length>1&&(o=wi.unique(o),0!==e.indexOf("parents")&&"prevUntil"!==e||(o=o.reverse()));var i=wi(o);return r?i.filter(r):i}}),di.fn.is=function(e){return!!e&&this.filter(e).length>0},di.fn.init.prototype=di.fn,di.overrideDefaults=function(e){var t,n=function(r,o){return t=t||e(),0===arguments.length&&(r=t.element),o||(o=t.context),new n.fn.init(r,o)};return wi.extend(n,this),n},di.attrHooks=fi,di.cssHooks=li;var wi=di,xi=function(){function e(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}return e.prototype.current=function(){return this.node},e.prototype.next=function(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node},e.prototype.prev=function(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node},e.prototype.prev2=function(e){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",e),this.node},e.prototype.findSibling=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==this.rootNode){if(o=e[n])return o;for(i=e.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},e.prototype.findPreviousNode=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],this.rootNode&&o===this.rootNode)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==this.rootNode)return i}},e}(),Si={},Ni={exports:Si};!function(e,n,r,o){!function(o){if("object"==typeof n&&void 0!==r)r.exports=o();else if("function"==typeof e&&e.amd)e([],o);else{("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).EphoxContactWrapper=o()}}(function(){return function(){return function e(t,n,r){function i(u,c){if(!n[u]){if(!t[u]){var s="function"==typeof o&&o;if(!c&&s)return s(u,!0);if(a)return a(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[u]={exports:{}};t[u][0].call(l.exports,function(e){return i(t[u][1][e]||e)},l,l.exports,e,t,n,r)}return n[u].exports}for(var a="function"==typeof o&&o,u=0;u<r.length;u++)i(r[u]);return i}}()({1:[function(e,t,n){var r,o,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(fE){try{return r.call(null,e,0)}catch(fE){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(fE){r=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(fE){o=u}}();var s,f=[],l=!1,d=-1;function m(){l&&s&&(l=!1,s.length?f=s.concat(f):d=-1,f.length&&p())}function p(){if(!l){var e=c(m);l=!0;for(var t=f.length;t;){for(s=f,f=[];++d<t;)s&&s[d].run();d=-1,t=f.length}s=null,l=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(fE){try{return o.call(null,e)}catch(fE){return o.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function h(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];f.push(new g(e,t)),1!==f.length||l||c(p)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(e,t,n){(function(e){!function(n){var r=setTimeout;function o(){}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function a(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,i._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(fE){return void c(t.promise,fE)}u(t.promise,r)}else(1===e._state?u:c)(t.promise,e._value)})):e._deferreds.push(t)}function u(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof i)return e._state=3,e._value=t,void s(e);if("function"==typeof n)return void l((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,s(e)}catch(fE){c(e,fE)}var r,o}function c(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)a(e,e._deferreds[t]);e._deferreds=null}function f(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e(function(e){n||(n=!0,u(t,e))},function(e){n||(n=!0,c(t,e))})}catch(r){if(n)return;n=!0,c(t,r)}}i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(o);return a(this,new f(e,t,n)),n},i.all=function(e){var t=Array.prototype.slice.call(e);return new i(function(e,n){if(0===t.length)return e([]);var r=t.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,function(e){o(i,e)},n)}t[i]=a,0==--r&&e(t)}catch(c){n(c)}}for(var i=0;i<t.length;i++)o(i,t[i])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(e){return new i(function(t,n){n(e)})},i.race=function(e){return new i(function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)})},i._immediateFn="function"==typeof e?function(t){e(t)}:function(e){r(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},void 0!==t&&t.exports?t.exports=i:n.Promise||(n.Promise=i)}(this)}).call(this,e("timers").setImmediate)},{timers:3}],3:[function(e,t,n){(function(t,r){var o=e("process/browser.js").nextTick,i=Function.prototype.apply,a=Array.prototype.slice,u={},c=0;function s(e,t){this._id=e,this._clearFn=t}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n.setImmediate="function"==typeof t?t:function(e){var t=c++,r=!(arguments.length<2)&&a.call(arguments,1);return u[t]=!0,o(function(){u[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))}),t},n.clearImmediate="function"==typeof r?r:function(e){delete u[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(e,t,n){var r=e("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();t.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)})}(void 0,Si,Ni,void 0);var Ei,ki=Ni.exports.boltExport,_i=function(t){var n=w.none(),r=[],o=function(e){i()?u(e):r.push(e)},i=function(){return n.isSome()},a=function(e){z(e,u)},u=function(t){n.each(function(n){e.setTimeout(function(){t(n)},0)})};return t(function(e){i()||(n=w.some(e),a(r),r=[])}),{get:o,map:function(e){return _i(function(t){o(function(n){t(e(n))})})},isReady:i}},Ti={nu:_i,pure:function(e){return _i(function(t){t(e)})}},Ri=function(t){e.setTimeout(function(){throw t},0)},Ai=function(e){var t=function(t){e().then(t,Ri)};return{map:function(t){return Ai(function(){return e().then(t)})},bind:function(t){return Ai(function(){return e().then(function(e){return t(e).toPromise()})})},anonBind:function(t){return Ai(function(){return e().then(function(){return t.toPromise()})})},toLazy:function(){return Ti.nu(t)},toCached:function(){var t=null;return Ai(function(){return null===t&&(t=e()),t})},toPromise:e,get:t}},Di={nu:function(e){return Ai(function(){return new ki(e)})},pure:function(e){return Ai(function(){return ki.resolve(e)})}},Oi=function(e,t){return t(function(t){var n=[],r=0;0===e.length?t([]):z(e,function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=e.length&&t(n)}}(i))})})},Bi=function(e){return Oi(e,Di.nu)},Pi=function(e){return{is:function(t){return e===t},isValue:v,isError:h,getOr:l(e),getOrThunk:l(e),getOrDie:l(e),or:function(t){return Pi(e)},orThunk:function(t){return Pi(e)},fold:function(t,n){return n(e)},map:function(t){return Pi(t(e))},mapError:function(t){return Pi(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOption:function(){return w.some(e)}}},Li=function(e){return{is:h,isValue:h,isError:v,getOr:d,getOrThunk:function(e){return e()},getOrDie:function(){return g(String(e))()},or:function(e){return e},orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return Li(e)},mapError:function(t){return Li(t(e))},each:s,bind:function(t){return Li(e)},exists:h,forall:v,toOption:w.none}},Ii={value:Pi,error:Li,fromOption:function(e,t){return e.fold(function(){return Li(t)},Pi)}},Mi=function(t){if(!_(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var n=[],r={};return z(t,function(o,i){var a=te(o);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],c=o[u];if(void 0!==r[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!_(c))throw new Error("case arguments must be an array");n.push(u),r[u]=function(){var r=arguments.length;if(r!==c.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+c.length+" ("+c+"), got "+r);for(var o=new Array(r),a=0;a<o.length;a++)o[a]=arguments[a];return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);return arguments[i].apply(null,o)},match:function(e){var t=te(e);if(n.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+n.join(",")+"\nActual: "+t.join(","));if(!Y(n,function(e){return M(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+n.join(", "));return e[u].apply(null,o)},log:function(t){e.console.log(t,{constructors:n,constructor:u,params:o})}}}}),r},Fi=(Mi([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(e){return e.fold(d,d)}),Ui=window.Promise?window.Promise:function(){function t(e,t){return function(){e.apply(t,arguments)}}var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(e,t(a,this),t(u,this))},o=r.immediateFn||"function"==typeof e.setImmediate&&e.setImmediate||function(t){e.setTimeout(t,1)};function i(e){var t=this;null!==this._state?o(function(){var n=t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(fE){return void e.reject(fE)}e.resolve(r)}else(t._state?e.resolve:e.reject)(t._value)}):this._deferreds.push(e)}function a(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void f(t(n,e),t(a,this),t(u,this))}this._state=!0,this._value=e,c.call(this)}catch(fE){u.call(this,fE)}}function u(e){this._state=!1,this._value=e,c.call(this)}function c(){for(var e=0,t=this._deferreds.length;e<t;e++)i.call(this,this._deferreds[e]);this._deferreds=null}function s(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function f(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}return r.prototype.catch=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var n=this;return new r(function(r,o){i.call(n,new s(e,t,r,o))})},r.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&n(arguments[0])?arguments[0]:arguments);return new r(function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,function(e){o(i,e)},n)}e[i]=a,0==--r&&t(e)}catch(c){n(c)}}for(var i=0;i<e.length;i++)o(i,e[i])})},r.resolve=function(e){return e&&"object"==typeof e&&e.constructor===r?e:new r(function(t){t(e)})},r.reject=function(e){return new r(function(t,n){n(e)})},r.race=function(e){return new r(function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)})},r}(),zi=function(t,n){return"number"!=typeof n&&(n=0),e.setTimeout(t,n)},ji=function(t,n){return"number"!=typeof n&&(n=1),e.setInterval(t,n)},Hi=function(t,n){var r,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];e.clearTimeout(r),r=zi(function(){t.apply(this,o)},n)};return o.stop=function(){e.clearTimeout(r)},o},Vi={requestAnimationFrame:function(t,n){Ei?Ei.then(t):Ei=new Ui(function(t){n||(n=e.document.body),function(t,n){var r,o=e.window.requestAnimationFrame,i=["ms","moz","webkit"];for(r=0;r<i.length&&!o;r++)o=e.window[i[r]+"RequestAnimationFrame"];o||(o=function(t){e.window.setTimeout(t,0)}),o(t,n)}(t,n)}).then(t)},setTimeout:zi,setInterval:ji,setEditorTimeout:function(e,t,n){return zi(function(){e.removed||t()},n)},setEditorInterval:function(t,n,r){var o=ji(function(){t.removed?e.clearInterval(o):n()},r);return o},debounce:Hi,throttle:Hi,clearInterval:function(t){return e.clearInterval(t)},clearTimeout:function(t){return e.clearTimeout(t)}};function qi(t,n){void 0===n&&(n={});var r=0,o={},i=st.fromDom(t),a=Nt(i),u=n.maxLoadTime||5e3,c=function(e){Ht(Mt(i),e)},s=function(i,s,f){var l,d,m,p=function(e){m.status=e,m.passed=[],m.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},g=function(){for(var e=m.passed,t=e.length;t--;)e[t]();p(2)},h=function(){for(var e=m.failed,t=e.length;t--;)e[t]();p(3)},v=function(e,t){e()||((new Date).getTime()-w<u?Vi.setTimeout(t):h())},y=function(){v(function(){for(var e,n,r=t.styleSheets,o=r.length;o--;)if((n=(e=r[o]).ownerNode?e.ownerNode:e.owningElement)&&n.id===l.id)return g(),!0},y)},b=function(){v(function(){try{var e=d.sheet.cssRules;return g(),!!e}catch(t){}},b)};if(i=ut._addCacheSuffix(i),o[i]?m=o[i]:(m={passed:[],failed:[]},o[i]=m),s&&m.passed.push(s),f&&m.failed.push(f),1!==m.status)if(2!==m.status)if(3!==m.status){m.status=1,(l=a.dom().createElement("link")).rel="stylesheet",l.type="text/css",l.id="u"+r++,l.async=!1,l.defer=!1;var C,w=(new Date).getTime();if(n.contentCssCors&&(l.crossOrigin="anonymous"),n.referrerPolicy&&Sn(st.fromDom(l),"referrerpolicy",n.referrerPolicy),"onload"in l&&!((C=e.navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(C[1],10)<536))l.onload=y,l.onerror=h;else{if(e.navigator.userAgent.indexOf("Firefox")>0)return(d=a.dom().createElement("style")).textContent='@import "'+i+'"',b(),void c(st.fromDom(d));y()}c(st.fromDom(l)),l.href=i}else h();else g()},d=function(e){return Di.nu(function(t){s(e,f(t,l(Ii.value(e))),f(t,l(Ii.error(e))))})};return{load:s,loadAll:function(e,t,n){Bi(U(e,d)).get(function(e){var r=H(e,function(e){return e.isValue()});r.fail.length>0?n(r.fail.map(Fi)):t(r.pass.map(Fi))})},_setReferrerPolicy:function(e){n.referrerPolicy=e}}}var $i=function(){var e=new WeakMap;return{forElement:function(t,n){var r=It(t).dom();return w.from(e.get(r)).getOrThunk(function(){var t=qi(r,n);return e.set(r,t),t})}}}(),Wi=ut.each,Ki=ut.grep,Xi=nt.ie,Yi=/^([a-z0-9],?)+$/i,Gi=function(e,t,n){var r=t.keep_values,o={set:function(e,r,o){t.url_converter&&(r=t.url_converter.call(t.url_converter_scope||n(),r,o,e[0])),e.attr("data-mce-"+o,r).attr(o,r)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}},i={style:{set:function(t,n){null===n||"object"!=typeof n?(r&&t.attr("data-mce-style",n),null!==n&&"string"==typeof n?(t.removeAttr("style"),t.css(e.parse(n))):t.attr("style",n)):t.css(n)},get:function(t){var n=t.attr("data-mce-style")||t.attr("style");return n=e.serialize(e.parse(n),t[0].nodeName)}}};return r&&(i.href=i.src=o),i},Ji=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r)},Qi=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o};function Zi(t,n){var r=this;void 0===n&&(n={});var o={},i=e.window,a={},u=0,c=$i.forElement(st.fromDom(t),{contentCssCors:n.contentCssCors,referrerPolicy:n.referrerPolicy}),s=[],f=n.schema?n.schema:xr({}),l=jr({url_converter:n.url_converter,url_converter_scope:n.url_converter_scope},n.schema),d=n.ownEvents?new Jr:Jr.Event,m=f.getBlockElements(),p=wi.overrideDefaults(function(){return{context:t,element:V.getRoot()}}),g=function(e){return e&&t&&E(e)?t.getElementById(e):e},h=function(e){return p("string"==typeof e?g(e):e)},v=function(e,t,n){var r,o,i=h(e);return i.length&&(o=(r=q[t])&&r.get?r.get(i,t):i.attr(t)),void 0===o&&(o=n||""),o},y=function(e){var t=g(e);return t?t.attributes:[]},b=function(e,t,r){""===r&&(r=null);var o=h(e),i=o.attr(t);if(o.length){var a=q[t];a&&a.set?a.set(o,r,t):o.attr(t,r),i!==r&&n.onSetAttrib&&n.onSetAttrib({attrElm:o,attrName:t,attrValue:r})}},C=function(){return n.root_element||t.body},w=function(e,n){return Ln(t.body,g(e),n)},x=function(e,t,n){var r=h(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=nt.browser.isIE()?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:void 0)},S=function(e){var t,n;return e=g(e),t=x(e,"width"),n=x(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},N=function(e,t){var n;if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(Yi.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;n>=0;n--)if(r[n]===o)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return Lo(t,i[0].ownerDocument||i[0],null,i).length>0},k=function(e,t,n,r){var o,i=[],a=g(e);for(r=void 0===r,n=n||("BODY"!==C().nodeName?C().parentNode:null),ut.is(t,"string")&&(o=t,t="*"===t?function(e){return 1===e.nodeType}:function(e){return N(e,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},_=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return N(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},T=function(e,t,n){var o,i="string"==typeof e?g(e):e;if(!i)return!1;if(ut.isArray(i)&&(i.length||0===i.length))return o=[],Wi(i,function(e,r){e&&("string"==typeof e&&(e=g(e)),o.push(t.call(n,e,r)))}),o;var a=n||r;return t.call(a,i)},R=function(e,t){h(e).each(function(e,n){Wi(t,function(e,t){b(n,t,e)})})},A=function(e,t){var n=h(e);Xi?n.each(function(e,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+t,n.removeChild(n.firstChild)}catch(r){wi("<div></div>").html("<br>"+t).contents().slice(1).appendTo(n)}return t}}):n.html(t)},D=function(e,n,r,o,i){return T(e,function(e){var a="string"==typeof n?t.createElement(n):n;return R(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&A(a,o)),i?a:e.appendChild(a)})},O=function(e,n,r){return D(t.createElement(e),e,n,r,!0)},B=lr.decode,P=lr.encodeAllRaw,L=function(e,t){var n=h(e);return t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():n.remove(),n.length>1?n.toArray():n[0]},I=function(e,t,n){h(e).toggleClass(t,n).each(function(){""===this.className&&wi(this).attr("class",null)})},M=function(e,t,n){return T(t,function(t){return ut.is(t,"array")&&(e=e.cloneNode(!0)),n&&Wi(Ki(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},F=function(e){if(an(e)){var t="a"===e.nodeName.toLowerCase()&&!v(e,"href")&&v(e,"id");if(v(e,"name")||v(e,"data-mce-bookmark")||t)return!0}return!1},U=function(){return t.createRange()},z=function(e,r,o,a){if(ut.isArray(e)){for(var u=e.length,c=[];u--;)c[u]=z(e[u],r,o,a);return c}return!n.collect||e!==t&&e!==i||s.push([e,r,o,a]),d.bind(e,r,o,a||V)},j=function(e,n,r){var o;if(ut.isArray(e)){o=e.length;for(var a=[];o--;)a[o]=j(e[o],n,r);return a}if(s.length>0&&(e===t||e===i))for(o=s.length;o--;){var u=s[o];e!==u[0]||n&&n!==u[1]||r&&r!==u[2]||d.unbind(u[0],u[1],u[2])}return d.unbind(e,n,r)},H=function(e){if(e&&an(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},V={doc:t,settings:n,win:i,files:a,stdMode:!0,boxModel:!0,styleSheetLoader:c,boundEvents:s,styles:l,schema:f,events:d,isBlock:function(e){if("string"==typeof e)return!!m[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!m[e.nodeName])}return!1},$:p,$$:h,root:null,clone:function(e,n){if(!Xi||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return Wi(y(e),function(t){b(r,t.nodeName,v(e,t.nodeName))}),r},getRoot:C,getViewPort:function(e){var t=nn(e);return{x:t.x,y:t.y,w:t.width,h:t.height}},getRect:function(e){e=g(e);var t=w(e),n=S(e);return{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:S,getParent:function(e,t,n){var r=k(e,t,n,!1);return r&&r.length>0?r[0]:null},getParents:k,get:g,getNext:function(e,t){return _(e,t,"nextSibling")},getPrev:function(e,t){return _(e,t,"previousSibling")},select:function(e,r){return Lo(e,g(r)||n.root_element||t,[])},is:N,add:D,create:O,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)t.hasOwnProperty(r)&&null!==t[r]&&void 0!==t[r]&&(o+=" "+r+'="'+P(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:L,setStyle:function(e,t,r){var o=E(t)?h(e).css(t,r):h(e).css(t);n.update_styles&&Ji(l,o)},getStyle:x,setStyles:function(e,t){var r=h(e).css(t);n.update_styles&&Ji(l,r)},removeAllAttribs:function(e){return T(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:b,setAttribs:R,getAttrib:v,getPos:w,parseStyle:function(e){return l.parse(e)},serializeStyle:function(e,t){return l.serialize(e,t)},addStyle:function(n){var r,i;if(V!==Zi.DOM&&t===e.document){if(o[n])return;o[n]=!0}(i=t.getElementById("mceDefaultStyles"))||((i=t.createElement("style")).id="mceDefaultStyles",i.type="text/css",(r=t.getElementsByTagName("head")[0]).firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=n:i.appendChild(t.createTextNode(n))},loadCSS:function(r){if(V===Zi.DOM||t!==e.document){r||(r="");var o=t.getElementsByTagName("head")[0];Wi(r.split(","),function(e){if(e=ut._addCacheSuffix(e),!a[e]){a[e]=!0;var t=O("link",we(we({rel:"stylesheet",type:"text/css",href:e},n.contentCssCors?{crossOrigin:"anonymous"}:{}),n.referrerPolicy?{referrerPolicy:n.referrerPolicy}:{}));o.appendChild(t)}})}else Zi.DOM.loadCSS(r)},addClass:function(e,t){h(e).addClass(t)},removeClass:function(e,t){I(e,t,!1)},hasClass:function(e,t){return h(e).hasClass(t)},toggleClass:I,show:function(e){h(e).show()},hide:function(e){h(e).hide()},isHidden:function(e){return"none"===h(e).css("display")},uniqueId:function(e){return(e||"mce_")+u++},setHTML:A,getOuterHTML:function(e){var t="string"==typeof e?g(e):e;return an(t)?t.outerHTML:wi("<div></div>").append(wi(t).clone()).html()},setOuterHTML:function(e,t){h(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}L(wi(this).html(t),!0)})},decode:B,encode:P,insertAfter:function(e,t){var n=g(t);return T(e,function(e){var t=n.parentNode,r=n.nextSibling;return r?t.insertBefore(e,r):t.appendChild(e),e})},replace:M,rename:function(e,t){var n;return e.nodeName!==t.toUpperCase()&&(n=O(t),Wi(y(e),function(t){b(n,t.nodeName,v(e,t.nodeName))}),M(n,e,!0)),n||e},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return l.toHex(ut.trim(e))},run:T,getAttribs:y,isEmpty:function(e,t){var n,r,o=0;if(F(e))return!1;if(e=e.firstChild){var i=new xi(e,e.parentNode),a=f?f.getWhiteSpaceElements():{};t=t||(f?f.getNonEmptyElements():null);do{if(n=e.nodeType,an(e)){var u=e.getAttribute("data-mce-bogus");if(u){e=i.next("all"===u);continue}if(r=e.nodeName.toLowerCase(),t&&t[r]){if("br"===r){o++,e=i.next();continue}return!1}if(F(e))return!1}if(8===n)return!1;if(3===n&&!Yn(e.nodeValue))return!1;if(3===n&&e.parentNode&&a[e.parentNode.nodeName]&&Yn(e.nodeValue))return!1;e=i.next()}while(e)}return o<=1},createRng:U,nodeIndex:Qi,split:function(e,t,n){var r,o,i,a=U();if(e&&t)return a.setStart(e.parentNode,Qi(e)),a.setEnd(t.parentNode,Qi(t)),r=a.extractContents(),(a=U()).setStart(t.parentNode,Qi(t)+1),a.setEnd(e.parentNode,Qi(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(Jn(V,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(Jn(V,o),e),L(e),n||t},bind:z,unbind:j,fire:function(e,t,n){return d.fire(e,t,n)},getContentEditable:H,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=H(e));e=e.parentNode);return n},destroy:function(){if(s.length>0)for(var e=s.length;e--;){var t=s[e];d.unbind(t[0],t[1],t[2])}Lo.setDocument&&Lo.setDocument()},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}},q=Gi(l,n,function(){return V});return V}!function(t){t.DOM=t(e.document),t.nodeIndex=Qi}(Zi||(Zi={}));var ea=Zi,ta=ea.DOM,na=ut.each,ra=ut.grep,oa=function(){function t(e){void 0===e&&(e={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=e}return t.prototype._setReferrerPolicy=function(e){this.settings.referrerPolicy=e},t.prototype.loadScript=function(t,n,r){var o,i=ta,a=i.uniqueId();(o=e.document.createElement("script")).id=a,o.type="text/javascript",o.src=ut._addCacheSuffix(t),this.settings.referrerPolicy&&i.setAttrib(o,"referrerpolicy",this.settings.referrerPolicy),o.onload=function(){i.remove(a),o&&(o.onreadystatechange=o.onload=o=null),n()},o.onerror=function(){D(r)?r():void 0!==e.console&&e.console.log&&e.console.log("Failed to load script: "+t)},(e.document.getElementsByTagName("head")[0]||e.document.body).appendChild(o)},t.prototype.isDone=function(e){return 2===this.states[e]},t.prototype.markDone=function(e){this.states[e]=2},t.prototype.add=function(e,t,n,r){void 0===this.states[e]&&(this.queue.push(e),this.states[e]=0),t&&(this.scriptLoadedCallbacks[e]||(this.scriptLoadedCallbacks[e]=[]),this.scriptLoadedCallbacks[e].push({success:t,failure:r,scope:n||this}))},t.prototype.load=function(e,t,n,r){return this.add(e,t,n,r)},t.prototype.remove=function(e){delete this.states[e],delete this.scriptLoadedCallbacks[e]},t.prototype.loadQueue=function(e,t,n){this.loadScripts(this.queue,e,t,n)},t.prototype.loadScripts=function(e,t,n,r){var o=this,i=[],a=function(e,t){na(o.scriptLoadedCallbacks[t],function(t){D(t[e])&&t[e].call(t.scope)}),o.scriptLoadedCallbacks[t]=void 0};o.queueLoadedCallbacks.push({success:t,failure:r,scope:n||this});var u=function(){var t=ra(e);if(e.length=0,na(t,function(e){2!==o.states[e]?3!==o.states[e]?1!==o.states[e]&&(o.states[e]=1,o.loading++,o.loadScript(e,function(){o.states[e]=2,o.loading--,a("success",e),u()},function(){o.states[e]=3,o.loading--,i.push(e),a("failure",e),u()})):a("failure",e):a("success",e)}),!o.loading){var n=o.queueLoadedCallbacks.slice(0);o.queueLoadedCallbacks.length=0,na(n,function(e){0===i.length?D(e.success)&&e.success.call(e.scope):D(e.failure)&&e.failure.call(e.scope,i)})}};u()},t.ScriptLoader=new t,t}(),ia=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},aa={},ua=ia("en"),ca=function(){return le(aa,ua.get())},sa={getData:function(){return oe(aa,function(e){return we({},e)})},setCode:function(e){e&&ua.set(e)},getCode:function(){return ua.get()},add:function(e,t){var n=aa[e];n||(aa[e]=n={}),re(t,function(e,t){n[t.toLowerCase()]=e})},translate:function(e){var t,n=ca().getOr({}),r=function(e){return D(e)?Object.prototype.toString.call(e):o(e)?"":""+e},o=function(e){return""===e||null==e},i=function(e){var t=r(e);return le(n,t.toLowerCase()).map(r).getOr(t)},a=function(e){return e.replace(/{context:\w+}$/,"")},u=function(e){return e};if(o(e))return u("");if(k(t=e)&&de(t,"raw"))return u(r(e.raw));if(function(e){return _(e)&&e.length>1}(e)){var c=e.slice(1);return u(a(i(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return de(c,t)?r(c[t]):e})))}return u(a(i(e)))},isRtl:function(){return ca().bind(function(e){return le(e,"_dir")}).exists(function(e){return"rtl"===e})},hasCode:function(e){return de(aa,e)}};function fa(){var e=this,t=[],n={},r={},o=[],i=function(e,t){var n=V(o,function(n){return n.name===e&&n.state===t});z(n,function(e){return e.callback()})},a=function(e){var t;return r[e]&&(t=r[e].dependencies),t||[]},u=function(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},c=function(e,t,o,s,f){if(!n[e]){var l="string"==typeof t?t:t.prefix+t.resource+t.suffix;0!==l.indexOf("/")&&-1===l.indexOf("://")&&(l=fa.baseURL+"/"+l),n[e]=l.substring(0,l.lastIndexOf("/"));var d=function(){i(e,"loaded"),function(e,t,n,r){var o=a(e);z(o,function(e){var n=u(t,e);c(n.resource,n,void 0,void 0)}),n&&(r?n.call(r):n.call(oa))}(e,t,o,s)};r[e]?d():oa.ScriptLoader.add(l,d,s,f)}},s=function(e,t,i){void 0===i&&(i="added"),de(r,e)&&"added"===i?t():de(n,e)&&"loaded"===i?t():o.push({name:e,state:i,callback:t})};return{items:t,urls:n,lookup:r,_listeners:o,get:function(e){if(r[e])return r[e].instance},dependencies:a,requireLangPack:function(e,t){!1!==fa.languageLoad&&s(e,function(){var r=sa.getCode();!r||t&&-1===(","+(t||"")+",").indexOf(","+r+",")||oa.ScriptLoader.add(n[e]+"/langs/"+r+".js")},"loaded")},add:function(e,n,o){var a=n;return t.push(a),r[e]={instance:a,dependencies:o},i(e,"added"),a},remove:function(e){delete n[e],delete r[e]},createUrl:u,addComponents:function(t,n){var r=e.urls[t];z(n,function(e){oa.ScriptLoader.add(r+"/"+e)})},load:c,waitFor:s}}!function(e){e.PluginManager=e(),e.ThemeManager=e()}(fa||(fa={}));var la=fa,da=function(t,n){var r=null;return{cancel:function(){null!==r&&(e.clearTimeout(r),r=null)},throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null===r&&(r=e.setTimeout(function(){t.apply(null,o),r=null},n))}}},ma=function(t,n){var r=null;return{cancel:function(){null!==r&&(e.clearTimeout(r),r=null)},throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null!==r&&e.clearTimeout(r),r=e.setTimeout(function(){t.apply(null,o),r=null},n)}}},pa=function(e,t){var n=En(e,t);return void 0===n||""===n?[]:n.split(" ")},ga=function(e){return void 0!==e.dom().classList},ha=function(e,t){return function(e,t,n){var r=pa(e,t).concat([n]);return Sn(e,t,r.join(" ")),!0}(e,"class",t)},va=function(e,t){return function(e,t,n){var r=V(pa(e,t),function(e){return e!==n});return r.length>0?Sn(e,t,r.join(" ")):kn(e,t),!1}(e,"class",t)},ya=function(e,t){ga(e)?e.dom().classList.add(t):ha(e,t)},ba=function(e){0===(ga(e)?e.dom().classList:function(e){return pa(e,"class")}(e)).length&&kn(e,"class")},Ca=function(e,t){return ga(e)&&e.dom().classList.contains(t)},wa=function(e,t){var n=[];return z(Dt(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(wa(e,t))}),n},xa=function(t,n){return function(t,n){var r=void 0===n?e.document:n.dom();return bt(r)?[]:U(r.querySelectorAll(t),st.fromDom)}(n,t)};function Sa(e,t,n,r,o){return e(n,r)?w.some(n):D(o)&&o(n)?w.none():t(n,r,o)}var Na=function(e,t,n){for(var r=e.dom(),o=D(n)?n:l(!1);r.parentNode;){r=r.parentNode;var i=st.fromDom(r);if(t(i))return w.some(i);if(o(i))break}return w.none()},Ea=function(e,t,n){return Sa(function(e,t){return t(e)},Na,e,t,n)},ka=function(e,t,n){return Na(e,function(e){return yt(e,t)},n)},_a=function(t,n){return function(t,n){var r=void 0===n?e.document:n.dom();return bt(r)?w.none():w.from(r.querySelector(t)).map(st.fromDom)}(n,t)},Ta=function(e,t,n){return Sa(function(e,t){return yt(e,t)},ka,e,t,n)},Ra=l("mce-annotation"),Aa=l("data-mce-annotation"),Da=l("data-mce-annotation-uid"),Oa=function(e,t){var n=e.selection.getRng(),r=st.fromDom(n.startContainer),o=st.fromDom(e.getBody()),i=t.fold(function(){return"."+Ra()},function(e){return"["+Aa()+'="'+e+'"]'}),a=Ot(r,n.startOffset).getOr(r),u=Ta(a,i,function(e){return Ct(e,o)}),c=function(e,t){return n=t,(r=e.dom())&&r.hasAttribute&&r.hasAttribute(n)?w.some(En(e,t)):w.none();var n,r};return u.bind(function(t){return c(t,""+Da()).bind(function(n){return c(t,""+Aa()).map(function(t){var r=Ba(e,n);return{uid:n,name:t,elements:r}})})})},Ba=function(e,t){var n=st.fromDom(e.getBody());return xa(n,"["+Da()+'="'+t+'"]')},Pa=function(e,t){var n=ia({}),r=function(e,t){o(e,function(e){return t(e),e})},o=function(e,t){var r=n.get(),o=t(r.hasOwnProperty(e)?r[e]:{listeners:[],previous:ia(w.none())});r[e]=o,n.set(r)},i=ma(function(){var t,i,a,u=n.get(),c=(t=te(u),(a=B.call(t,0)).sort(i),a);z(c,function(t){o(t,function(n){var o=n.previous.get();return Oa(e,w.some(t)).fold(function(){o.isSome()&&(!function(e){r(e,function(t){z(t.listeners,function(t){return t(!1,e)})})}(t),n.previous.set(w.none()))},function(e){var t=e.uid,i=e.name,a=e.elements;o.is(t)||(!function(e,t,n){r(e,function(r){z(r.listeners,function(r){return r(!0,e,{uid:t,nodes:U(n,function(e){return e.dom()})})})})}(i,t,a),n.previous.set(w.some(t)))}),{previous:n.previous,listeners:n.listeners}})})},30);e.on("remove",function(){i.cancel()}),e.on("NodeChange",function(){i.throttle()});return{addListener:function(e,t){o(e,function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}})}}},La=function(e,t){e.on("init",function(){e.serializer.addNodeFilter("span",function(e){z(e,function(e){(function(e){return w.from(e.attr(Aa())).bind(t.lookup)})(e).each(function(t){!1===t.persistent&&e.unwrap()})})})})},Ia=0,Ma=function(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++Ia+String(t)},Fa=function(t,n){var r,o,i=St(t).dom(),a=st.fromDom(i.createDocumentFragment()),u=(r=n,(o=(i||e.document).createElement("div")).innerHTML=r,Dt(st.fromDom(o)));Vt(a,u),qt(t),Ht(t,a)},Ua=function(e,t){return st.fromDom(e.dom().cloneNode(t))},za=function(e){return Ua(e,!1)},ja=function(e){return Ua(e,!0)},Ha=function(e,t,n){void 0===n&&(n=h);var r=new xi(e,t),o=function(e){var t;do{t=r[e]()}while(t&&!pn(t)&&!n(t));return w.from(t).filter(pn)};return{current:function(){return w.from(r.current()).filter(pn)},next:function(){return o("next")},prev:function(){return o("prev")},prev2:function(){return o("prev2")}}},Va=function(e,t){var n=t||function(t){return e.isBlock(t)||yn(t)||Cn(t)},r=function(e,t,n,o){if(pn(e)){var i=o(e,t,e.data);if(-1!==i)return w.some({container:e,offset:i})}return n().bind(function(e){return r(e.container,e.offset,n,o)})};return{backwards:function(e,t,o,i){var a=Ha(e,i,n);return r(e,t,function(){return a.prev().map(function(e){return{container:e,offset:e.length}})},o).getOrNull()},forwards:function(e,t,o,i){var a=Ha(e,i,n);return r(e,t,function(){return a.next().map(function(e){return{container:e,offset:0}})},o).getOrNull()}}},qa="\ufeff",$a=function(e){return"\ufeff"===e},Wa=function(e){return e.replace(/\uFEFF/g,"")},Ka=an,Xa=pn,Ya=function(e){return Xa(e)&&(e=e.parentNode),Ka(e)&&e.hasAttribute("data-mce-caret")},Ga=function(e){return Xa(e)&&$a(e.data)},Ja=function(e){return Ya(e)||Ga(e)},Qa=function(e){return e.firstChild!==e.lastChild||!yn(e.firstChild)},Za=function(e){var t=e.container();return!(!e||!pn(t))&&(t.data.charAt(e.offset())===qa||e.isAtStart()&&Ga(t.previousSibling))},eu=function(e){var t=e.container();return!(!e||!pn(t))&&(t.data.charAt(e.offset()-1)===qa||e.isAtEnd()&&Ga(t.nextSibling))},tu=function(t,n,r){var o,i=n.ownerDocument.createElement(t);i.setAttribute("data-mce-caret",r?"before":"after"),i.setAttribute("data-mce-bogus","all"),i.appendChild(((o=e.document.createElement("br")).setAttribute("data-mce-bogus","1"),o));var a=n.parentNode;return r?a.insertBefore(i,n):n.nextSibling?a.insertBefore(i,n.nextSibling):a.appendChild(i),i},nu=function(e){return Xa(e)&&e.data[0]===qa},ru=function(e){return Xa(e)&&e.data[e.data.length-1]===qa},ou=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],fn(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n},iu=function(e,t,n){return e.isSome()&&t.isSome()?w.some(n(e.getOrDie(),t.getOrDie())):w.none()},au=Math.round,uu=function(e){return e?{left:au(e.left),top:au(e.top),bottom:au(e.bottom),right:au(e.right),width:au(e.width),height:au(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},cu=function(e,t){return e=uu(e),t?e.right=e.left:(e.left=e.left+e.width,e.right=e.left),e.width=0,e},su=function(e,t,n){return e>=0&&e<=Math.min(t.height,n.height)/2},fu=function(e,t){return e.bottom-e.height/2<t.top||!(e.top>t.bottom)&&su(t.top-e.bottom,e,t)},lu=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&su(t.bottom-e.top,e,t)},du=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},mu=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},pu=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},gu=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿-⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),hu=function(e){return"string"==typeof e&&e.charCodeAt(0)>=768&&gu.test(e)},vu=bn,yu=Cn,bu=yn,Cu=pn,wu=un(["script","style","textarea"]),xu=un(["img","input","textarea","hr","iframe","video","audio","object"]),Su=un(["table"]),Nu=Ja,Eu=function(e){return!Nu(e)&&(Cu(e)?!wu(e.parentNode):xu(e)||bu(e)||Su(e)||ku(e))},ku=function(e){return!1===function(e){return an(e)&&"true"===e.getAttribute("unselectable")}(e)&&yu(e)},_u=function(e,t){return Eu(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(ku(e))return!1;if(vu(e))return!0}return!0}(e,t)},Tu=an,Ru=Eu,Au=cn("display","block table"),Du=cn("float","left right"),Ou=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){for(var n=0;n<e.length;n++)if(!e[n](t))return!1;return!0}}(Tu,Ru,p(Du)),Bu=p(cn("white-space","pre pre-line pre-wrap")),Pu=pn,Lu=yn,Iu=ea.nodeIndex,Mu=pu,Fu=function(e){return"createRange"in e?e.createRange():ea.DOM.createRng()},Uu=function(e){return e&&/[\r\n\t ]/.test(e)},zu=function(e){return!!e.setStart&&!!e.setEnd},ju=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(Uu(e.toString())&&Bu(n.parentNode)&&pn(n)&&(t=n.data,Uu(t[r-1])||Uu(t[r+1])))},Hu=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},Vu=function(e){var t,n=e.getClientRects();return t=n.length>0?uu(n[0]):uu(e.getBoundingClientRect()),!zu(e)&&Lu(e)&&Hu(t)?function(e){var t=e.ownerDocument,n=Fu(t),r=t.createTextNode(" "),o=e.parentNode;o.insertBefore(r,e),n.setStart(r,0),n.setEnd(r,1);var i=uu(n.getBoundingClientRect());return o.removeChild(r),i}(e):Hu(t)&&zu(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&pn(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),Vu(i)}return null}(e):t},qu=function(e,t){var n=cu(e,t);return n.width=1,n.right=n.left+1,n},$u=function(e){var t,n,r=[],o=function(e){var t,n;0!==e.height&&(r.length>0&&(t=e,n=r[r.length-1],t.left===n.left&&t.top===n.top&&t.bottom===n.bottom&&t.right===n.right)||r.push(e))},i=function(e,t){var n=Fu(e.ownerDocument);if(t<e.data.length){if(hu(e.data[t]))return r;if(hu(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!ju(n)))return o(qu(Vu(n),!1)),r}t>0&&(n.setStart(e,t-1),n.setEnd(e,t),ju(n)||o(qu(Vu(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),ju(n)||o(qu(Vu(n),!0)))};if(Pu(e.container()))return i(e.container(),e.offset()),r;if(Tu(e.container()))if(e.isAtEnd())n=Mu(e.container(),e.offset()),Pu(n)&&i(n,n.data.length),Ou(n)&&!Lu(n)&&o(qu(Vu(n),!1));else{if(n=Mu(e.container(),e.offset()),Pu(n)&&i(n,0),Ou(n)&&e.isAtEnd())return o(qu(Vu(n),!1)),r;t=Mu(e.container(),e.offset()-1),Ou(t)&&!Lu(t)&&(Au(t)||Au(n)||!Ou(n))&&o(qu(Vu(t),!1)),Ou(n)&&o(qu(Vu(n),!0))}return r};function Wu(e,t,n){var r=function(){return n||(n=$u(Wu(e,t))),n};return{container:l(e),offset:l(t),toRange:function(){var n=Fu(e.ownerDocument);return n.setStart(e,t),n.setEnd(e,t),n},getClientRects:r,isVisible:function(){return r().length>0},isAtStart:function(){return Pu(e),0===t},isAtEnd:function(){return Pu(e)?t>=e.data.length:t>=e.childNodes.length},isEqual:function(n){return n&&e===n.container()&&t===n.offset()},getNode:function(n){return Mu(e,n?t-1:t)}}}!function(e){e.fromRangeStart=function(t){return e(t.startContainer,t.startOffset)},e.fromRangeEnd=function(t){return e(t.endContainer,t.endOffset)},e.after=function(t){return e(t.parentNode,Iu(t)+1)},e.before=function(t){return e(t.parentNode,Iu(t))},e.isAbove=function(e,t){return iu(Q(t.getClientRects()),Z(e.getClientRects()),fu).getOr(!1)},e.isBelow=function(e,t){return iu(Z(t.getClientRects()),Q(e.getClientRects()),lu).getOr(!1)},e.isAtStart=function(e){return!!e&&e.isAtStart()},e.isAtEnd=function(e){return!!e&&e.isAtEnd()},e.isTextPosition=function(e){return!!e&&pn(e.container())},e.isElementPosition=function(t){return!1===e.isTextPosition(t)}}(Wu||(Wu={}));var Ku,Xu=Wu,Yu=function(e,t){pn(t)&&0===t.data.length&&e.remove(t)},Gu=function(e,t,n){vn(n)?function(e,t,n){var r=w.from(n.firstChild),o=w.from(n.lastChild);t.insertNode(n),r.each(function(t){return Yu(e,t.previousSibling)}),o.each(function(t){return Yu(e,t.nextSibling)})}(e,t,n):function(e,t,n){t.insertNode(n),Yu(e,n.previousSibling),Yu(e,n.nextSibling)}(e,t,n)},Ju=pn,Qu=fn,Zu=ea.nodeIndex,ec=function(e){var t=e.parentNode;return Qu(t)?ec(t):t},tc=function(e){return e?ye(e.childNodes,function(e,t){return Qu(t)&&"BR"!==t.nodeName?e=e.concat(tc(t)):e.push(t),e},[]):[]},nc=function(e){return function(t){return e===t}},rc=function(e){return(Ju(e)?"text()":e.nodeName.toLowerCase())+"["+function(e){var t,n;t=tc(ec(e)),n=be(t,nc(e),e),t=t.slice(0,n+1);var r=ye(t,function(e,n,r){return Ju(n)&&Ju(t[r-1])&&e++,e},0);return t=he(t,un([e.nodeName])),(n=be(t,nc(e),e))-r}(e)+"]"},oc=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),Ju(n)?o=function(e,t){for(;(e=e.previousSibling)&&Ju(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(rc(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=he(a,p(fn)),(u=u.concat(ge(a,function(e){return rc(e)}))).reverse().join("/")+","+o},ic=function(e,t){var n;if(!t)return null;var r=t.split(","),o=r[0].split("/");n=r.length>1?r[1]:"before";var i=ye(o,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),n=e,r=t[1],o=parseInt(t[2],10),i=tc(n),i=he(i,function(e,t){return!Ju(e)||!Ju(i[t-1])}),(i=he(i,un([r])))[o]):null;var n,r,o,i},e);return i?Ju(i)?function(e,t){for(var n,r=e,o=0;Ju(r);){if(n=r.data.length,t>=o&&t<=o+n){e=r,t-=o;break}if(!Ju(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return Ju(e)&&t>e.data.length&&(t=e.data.length),Xu(e,t)}(i,parseInt(n,10)):(n="after"===n?Zu(i)+1:Zu(i),Xu(i.parentNode,n)):null},ac=Cn,uc=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],c=[],s=0,f=e.getRoot();for(pn(a)?c.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&pn(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(s=1,u=Math.max(0,i.length-1)),c.push(e.nodeIndex(i[u],n)+s));a&&a!==f;a=a.parentNode)c.push(e.nodeIndex(a,n));return c},cc=function(e,t,n){var r=0;return ut.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},sc=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],an(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r))},fc=function(e){return sc(e,!0),sc(e,!1),e},lc=function(e,t){var n;if(an(e)&&(e=pu(e,t),ac(e)))return e;if(Ja(e)){if(pn(e)&&Ya(e)&&(e=e.parentNode),n=e.previousSibling,ac(n))return n;if(n=e.nextSibling,ac(n))return n}},dc=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(ac(r)||"IMG"===o)return{name:o,index:cc(n.dom,o,r)};var a=function(e){return lc(e.startContainer,e.startOffset)||lc(e.endContainer,e.endOffset)}(i);return a?{name:o=a.tagName,index:cc(n.dom,o,a)}:function(e,t,n,r){var o=t.dom,i={};return i.start=uc(o,e,n,r,!0),t.isCollapsed()||(i.end=uc(o,e,n,r,!1)),i}(e,n,t,i)},mc=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,""):e.create("span",r)},pc=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:cc(n,u,a)};var c=fc(r.cloneRange());if(!i){c.collapse(!1);var s=mc(n,o+"_end",t);Gu(n,c,s)}(r=fc(r)).collapse(!0);var f=mc(n,o+"_start",t);return Gu(n,r,f),e.moveToBookmark({id:o,keep:!0}),{id:o}},gc=function(e,t,n){return 2===t?dc(Wa,n,e):3===t?function(e){var t=e.getRng();return{start:oc(e.dom.getRoot(),Xu.fromRangeStart(t)),end:oc(e.dom.getRoot(),Xu.fromRangeEnd(t))}}(e):t?function(e){return{rng:e.getRng()}}(e):pc(e,!1)},hc=m(dc,d,!0),vc=ea.DOM,yc=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n}return r},bc=function(e){return e.getParam("content_security_policy","")},Cc=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":!0===t?"p":t},wc=function(e){return e.getParam("forced_root_block_attrs",{})},xc=function(e){return e.getParam("automatic_uploads",!0,"boolean")},Sc=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},Nc=function(e){return e.getParam("icons","","string")},Ec=function(e){return e.getParam("images_upload_url","","string")},kc=function(e){return e.getParam("images_upload_base_path","","string")},_c=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},Tc=function(e){return e.getParam("images_upload_handler",null,"function")},Rc=function(e){return e.getParam("content_css_cors",!1,"boolean")},Ac=function(e){return e.getParam("referrer_policy","","string")},Dc=function(e){return e.getParam("language","en","string")},Oc=function(e){return e.getParam("indent_use_margin",!1)},Bc=function(e){return e.getParam("object_resizing")},Pc=function(e){return e.getParam("event_root")},Lc=function(e){return e.getParam("service_message")},Ic=function(e){return e.getParam("theme")},Mc=function(e){return e.getParam("validate")},Fc=function(e){return!1!==e.getParam("inline_boundaries")},Uc=function(e){return e.getParam("formats")},zc=function(e){return e.getParam("content_css_cors")},jc=function(e){return e.getParam("plugins")},Hc=an,Vc=pn,qc=function(e){var t=e.parentNode;t&&t.removeChild(e)},$c=function(e,t){0===t.length?qc(e):e.nodeValue=t},Wc=function(e){var t=Wa(e);return{count:e.length-t.length,text:t}},Kc=function(e,t){return Jc(e),t},Xc=function(e,t){var n,r,o,i=t.container(),a=(n=ee(i.childNodes),r=e,o=I(n,r),-1===o?w.none():w.some(o)).map(function(e){return e<t.offset()?Xu(i,t.offset()-1):t}).getOr(t);return Jc(e),a},Yc=function(e,t){return Vc(e)&&t.container()===e?function(e,t){var n=Wc(e.data.substr(0,t.offset())),r=Wc(e.data.substr(t.offset())),o=n.text+r.text;return o.length>0?($c(e,o),Xu(e,t.offset()-n.count)):t}(e,t):Kc(e,t)},Gc=function(e,t){return Xu.isTextPosition(t)?Yc(e,t):function(e,t){return t.container()===e.parentNode?Xc(e,t):Kc(e,t)}(e,t)},Jc=function(e){if(Hc(e)&&Ja(e)&&(Qa(e)?e.removeAttribute("data-mce-caret"):qc(e)),Vc(e)){var t=Wa(function(e){try{return e.nodeValue}catch(t){return""}}(e));$c(e,t)}},Qc=Ke().browser,Zc=Cn,es=function(e,t,n){var r,o,i,a,u,c=cu(t.getBoundingClientRect(),n);return"BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,i=e.scrollTop||r.scrollTop):(u=e.getBoundingClientRect(),o=e.scrollLeft-u.left,i=e.scrollTop-u.top),c.left+=o,c.right+=o,c.top+=i,c.bottom+=i,c.width=1,(a=t.offsetWidth-t.clientWidth)>0&&(n&&(a*=-1),c.left+=a,c.right+=a),c},ts=function(e,t,n,r){var o,i,a=ia(w.none()),u=Cc(e),c=u.length>0?u:"p",s=function(){!function(e){var t,n,r,o,i=xa(st.fromDom(e),"*[contentEditable=false]");for(r=0;r<i.length;r++)n=(t=i[r].dom()).previousSibling,ru(n)&&(1===(o=n.data).length?n.parentNode.removeChild(n):n.deleteData(o.length-1,1)),n=t.nextSibling,nu(n)&&(1===(o=n.data).length?n.parentNode.removeChild(n):n.deleteData(0,1))}(t),i&&(Jc(i),i=null),a.get().each(function(e){wi(e.caret).remove(),a.set(w.none())}),o&&(Vi.clearInterval(o),o=null)},f=function(){o=Vi.setInterval(function(){r()?wi("div.mce-visual-caret",t).toggleClass("mce-visual-caret-hidden"):wi("div.mce-visual-caret",t).addClass("mce-visual-caret-hidden")},500)};return{show:function(e,r){var o,u,l;if(s(),an(l=r)&&/^(TD|TH)$/i.test(l.tagName))return null;if(!n(r))return i=function(e,t){var n,r=e.ownerDocument.createTextNode(qa),o=e.parentNode;if(t){if(n=e.previousSibling,Xa(n)){if(Ja(n))return n;if(ru(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else{if(n=e.nextSibling,Xa(n)){if(Ja(n))return n;if(nu(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r}(r,e),u=r.ownerDocument.createRange(),Zc(i.nextSibling)?(u.setStart(i,0),u.setEnd(i,0)):(u.setStart(i,1),u.setEnd(i,1)),u;i=tu(c,r,e),o=es(t,r,e),wi(i).css("top",o.top);var d=wi('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(o).appendTo(t)[0];return a.set(w.some({caret:d,element:r,before:e})),a.get().each(function(t){e&&wi(t.caret).addClass("mce-visual-caret-before")}),f(),(u=r.ownerDocument.createRange()).setStart(i,0),u.setEnd(i,0),u},hide:s,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){a.get().each(function(e){var n=es(t,e.element,e.before);wi(e.caret).css(we({},n))})},destroy:function(){return Vi.clearInterval(o)}}},ns=function(){return Qc.isIE()||Qc.isEdge()||Qc.isFirefox()},rs=function(e){return Zc(e)||ln(e)&&ns()},os=Cn,is=cn("display","block table table-cell table-caption list-item"),as=Ja,us=Ya,cs=an,ss=Eu,fs=function(e){return e>0},ls=function(e){return e<0},ds=function(e,t){for(var n;n=e(t);)if(!us(n))return n;return null},ms=function(e,t,n,r,o){var i=new xi(e,r);if(ls(t)){if((os(e)||us(e))&&n(e=ds(i.prev,!0)))return e;for(;e=ds(i.prev,o);)if(n(e))return e}if(fs(t)){if((os(e)||us(e))&&n(e=ds(i.next,!0)))return e;for(;e=ds(i.next,o);)if(n(e))return e}return null},ps=function(e,t){for(;e&&e!==t;){if(is(e))return e;e=e.parentNode}return null},gs=function(e,t,n){return ps(e.container(),n)===ps(t.container(),n)},hs=function(e,t){if(!t)return null;var n=t.container(),r=t.offset();return cs(n)?n.childNodes[r+e]:null},vs=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},ys=function(e,t,n){return ps(t,e)===ps(n,e)},bs=function(e,t,n){var r,o;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],as(r)&&(r=r[o]),os(r)){if(ys(t,r,n))return r;break}if(ss(r))break;n=n.parentNode}return null},Cs=m(vs,!0),ws=m(vs,!1),xs=function(e,t,n){var r,o,i,a=m(bs,!0,t),u=m(bs,!1,t);o=n.startContainer;var c=n.startOffset;if(Ya(o)){if(cs(o)||(o=o.parentNode),"before"===(i=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,rs(r)))return Cs(r);if("after"===i&&(r=o.previousSibling,rs(r)))return ws(r)}if(!n.collapsed)return n;if(pn(o)){if(as(o)){if(1===e){if(r=u(o))return Cs(r);if(r=a(o))return ws(r)}if(-1===e){if(r=a(o))return ws(r);if(r=u(o))return Cs(r)}return n}if(ru(o)&&c>=o.data.length-1)return 1===e&&(r=u(o))?Cs(r):n;if(nu(o)&&c<=1)return-1===e&&(r=a(o))?ws(r):n;if(c===o.data.length)return(r=u(o))?Cs(r):n;if(0===c)return(r=a(o))?ws(r):n}return n},Ss=function(e,t){return w.from(hs(e?0:-1,t)).filter(os)},Ns=function(e,t,n){var r=xs(e,t,n);return-1===e?Wu.fromRangeStart(r):Wu.fromRangeEnd(r)},Es=function(e){return w.from(e.getNode()).map(st.fromDom)},ks=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},_s=function(e,t){var n=gs(e,t);return!(n||!yn(e.getNode()))||n};!function(e){e[e.Backwards=-1]="Backwards",e[e.Forwards=1]="Forwards"}(Ku||(Ku={}));var Ts,Rs=Cn,As=pn,Ds=an,Os=yn,Bs=Eu,Ps=function(e){return xu(e)||function(e){return!!ku(e)&&!0!==$(ee(e.getElementsByTagName("*")),function(e,t){return e||vu(t)},!1)}(e)},Ls=_u,Is=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},Ms=function(e,t){if(fs(e)){if(Bs(t.previousSibling)&&!As(t.previousSibling))return Xu.before(t);if(As(t))return Xu(t,0)}if(ls(e)){if(Bs(t.nextSibling)&&!As(t.nextSibling))return Xu.after(t);if(As(t))return Xu(t,t.data.length)}return ls(e)?Os(t)?Xu.before(t):Xu.after(t):Xu.before(t)},Fs=function(e,t,n){var r,o,i,a;if(!Ds(n)||!t)return null;if(t.isEqual(Xu.after(n))&&n.lastChild){if(a=Xu.after(n.lastChild),ls(e)&&Bs(n.lastChild)&&Ds(n.lastChild))return Os(n.lastChild)?Xu.before(n.lastChild):a}else a=t;var u=a.container(),c=a.offset();if(As(u)){if(ls(e)&&c>0)return Xu(u,--c);if(fs(e)&&c<u.length)return Xu(u,++c);r=u}else{if(ls(e)&&c>0&&(o=Is(u,c-1),Bs(o)))return!Ps(o)&&(i=ms(o,e,Ls,o))?As(i)?Xu(i,i.data.length):Xu.after(i):As(o)?Xu(o,o.data.length):Xu.before(o);if(fs(e)&&c<u.childNodes.length&&(o=Is(u,c),Bs(o)))return Os(o)?function(e,t){var n=t.nextSibling;return n&&Bs(n)?As(n)?Xu(n,0):Xu.before(n):Fs(Ku.Forwards,Xu.after(t),e)}(n,o):!Ps(o)&&(i=ms(o,e,Ls,o))?As(i)?Xu(i,0):Xu.before(i):As(o)?Xu(o,0):Xu.after(o);r=o||a.getNode()}if((fs(e)&&a.isAtEnd()||ls(e)&&a.isAtStart())&&(r=ms(r,e,l(!0),n,!0),Ls(r,n)))return Ms(e,r);o=ms(r,e,Ls,n);var s=Ce(V(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(u,n),Rs));return!s||o&&s.contains(o)?o?Ms(e,o):null:a=fs(e)?Xu.after(s):Xu.before(s)},Us=function(e){return{next:function(t){return Fs(Ku.Forwards,t,e)},prev:function(t){return Fs(Ku.Backwards,t,e)}}},zs=function(e){return Xu.isTextPosition(e)?0===e.offset():Eu(e.getNode())},js=function(e){if(Xu.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return Eu(e.getNode(!0))},Hs=function(e,t){return!Xu.isTextPosition(e)&&!Xu.isTextPosition(t)&&e.getNode()===t.getNode(!0)},Vs=function(e,t,n){return e?!Hs(t,n)&&(r=t,!(!Xu.isTextPosition(r)&&yn(r.getNode())))&&js(t)&&zs(n):!Hs(n,t)&&zs(t)&&js(n);var r},qs=function(e,t,n){var r=Us(t);return w.from(e?r.next(n):r.prev(n))},$s=function(e,t,n){return qs(e,t,n).bind(function(r){return gs(n,r,t)&&Vs(e,n,r)?qs(e,t,r):w.some(r)})},Ws=function(e,t,n,r){return $s(e,t,n).bind(function(n){return r(n)?Ws(e,t,n,r):w.some(n)})},Ks=function(e,t){var n,r=e?t.firstChild:t.lastChild;return pn(r)?w.some(Xu(r,e?0:r.data.length)):r?Eu(r)?w.some(e?Xu.before(r):yn(n=r)?Xu.before(n):Xu.after(n)):function(e,t,n){var r=e?Xu.before(n):Xu.after(n);return qs(e,t,r)}(e,t,r):w.none()},Xs=m(qs,!0),Ys=m(qs,!1),Gs=m(Ks,!0),Js=m(Ks,!1),Qs=function(e){return an(e)&&"_mce_caret"===e.id},Zs=function(e,t){for(;t&&t!==e;){if("_mce_caret"===t.id)return t;t=t.parentNode}return null},ef=function(e,t){return an(t)&&e.isBlock(t)&&!t.innerHTML&&!nt.ie&&(t.innerHTML='<br data-mce-bogus="1" />'),t},tf=function(e,t){return Js(e).fold(function(){return!1},function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})},nf=function(e,t,n){return!(!function(e){return!1===e.hasChildNodes()}(t)||!Zs(e,t))&&(function(e,t){var n=e.ownerDocument.createTextNode(qa);e.appendChild(n),t.setStart(n,0),t.setEnd(n,0)}(t,n),!0)},rf=function(e,t,n,r){var o,i,a,u,c=n[t?"start":"end"],s=e.getRoot();if(c){for(a=c[0],i=s,o=c.length-1;o>=1;o--){if(u=i.childNodes,nf(s,i,r))return!0;if(c[o]>u.length-1)return!!nf(s,i,r)||tf(i,r);i=u[c[o]]}3===i.nodeType&&(a=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(c[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},of=function(e){return pn(e)&&e.data.length>0},af=function(e,t,n){var r,o,i,a,u,c,s=e.get(n.id+"_"+t),f=n.keep;if(s){if(r=s.parentNode,"start"===t?(f?s.hasChildNodes()?(r=s.firstChild,o=1):of(s.nextSibling)?(r=s.nextSibling,o=0):of(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=e.nodeIndex(s)+1):o=e.nodeIndex(s),u=r,c=o):(f?s.hasChildNodes()?(r=s.firstChild,o=1):of(s.previousSibling)?(r=s.previousSibling,o=s.previousSibling.data.length):(r=s.parentNode,o=e.nodeIndex(s)):o=e.nodeIndex(s),u=r,c=o),!f){for(a=s.previousSibling,i=s.nextSibling,ut.each(ut.grep(s.childNodes),function(e){pn(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});s=e.get(n.id+"_"+t);)e.remove(s,!0);a&&i&&a.nodeType===i.nodeType&&pn(a)&&!nt.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,c=o)}return w.some(Xu(u,c))}return w.none()},uf=function(e,t){var n=e.dom;if(t){if(function(e){return ut.isArray(e.start)}(t))return function(e,t){var n=e.createRng();return rf(e,!0,t,n)&&rf(e,!1,t,n)?w.some(n):w.none()}(n,t);if(function(e){return"string"==typeof e.start}(t))return w.some(function(e,t){var n,r=e.createRng();return n=ic(e.getRoot(),t.start),r.setStart(n.container(),n.offset()),n=ic(e.getRoot(),t.end),r.setEnd(n.container(),n.offset()),r}(n,t));if(function(e){return e.hasOwnProperty("id")}(t))return function(e,t){var n=af(e,"start",t),r=af(e,"end",t);return iu(n,r.or(n),function(t,n){var r=e.createRng();return r.setStart(ef(e,t.container()),t.offset()),r.setEnd(ef(e,n.container()),n.offset()),r})}(n,t);if(function(e){return e.hasOwnProperty("name")}(t))return function(e,t){return w.from(e.select(t.name)[t.index]).map(function(t){var n=e.createRng();return n.selectNode(t),n})}(n,t);if(function(e){return e.hasOwnProperty("rng")}(t))return w.some(t.rng)}return w.none()},cf=function(e,t,n){return gc(e,t,n)},sf=function(e,t){uf(e,t).each(function(t){e.setRng(t)})},ff=function(e){return an(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},lf=(Ts=" ",function(e){return Ts===e}),df=function(e){return""!==e&&-1!==" \f\n\r\t\v".indexOf(e)},mf=function(e){return!df(e)&&!lf(e)},pf=function(e){return!!e.nodeType},gf=function(e,t,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!function(e){return e&&/^(IMG)$/.test(e.nodeName)}(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?(u=i[a],r=new xi(u,e.getParent(u,e.isBlock))):(u=i[i.length-1],(r=new xi(u,e.getParent(u,e.isBlock))).next(!0)),o=r.current();o;o=r.next())if(3===o.nodeType&&!bf(o))return n.setStart(o,0),void t.setRng(n)},hf=function(e,t,n){if(e){var r=t?"nextSibling":"previousSibling";for(e=n?e:e[r];e;e=e[r])if(1===e.nodeType||!bf(e))return e}},vf=function(e,t){return pf(t)&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},yf=function(e,t,n){return e.schema.isValidChild(t,n)},bf=function(e){return e&&pn(e)&&/^([\t \r\n]+|)$/.test(e.nodeValue)},Cf=function(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e},wf=function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},xf=function(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},Sf=function(e,t,n){return xf(e,e.getStyle(t,n),n)},Nf=function(e,t){var n;return e.getParent(t,function(t){return(n=e.getStyle(t,"text-decoration"))&&"none"!==n}),n},Ef=function(e,t,n){return e.getParents(t,n,e.getRoot())},kf=function(e,t,n){var r=["inline","block","selector","attributes","styles","classes"],o=function(e){return se(e,function(e,t){return F(r,function(e){return e===t})})};return F(e.formatter.get(t),function(t){var r=o(t);return F(e.formatter.get(n),function(e){var t,n,i,a=o(e);return t=r,n=a,void 0===i&&(i=c),u(i).eq(t,n)})})},_f=ff,Tf=Ef,Rf=bf,Af=vf,Df=function(e,t){for(var n=t;n;){if(an(n)&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},Of=function(e,t,n,r){for(var o=t.data,i=n;e?i>=0:i<o.length;e?i--:i++)if(r(o.charAt(i)))return e?i+1:i;return-1},Bf=function(e,t,n){return Of(e,t,n,function(e){return lf(e)||df(e)})},Pf=function(e,t,n){return Of(e,t,n,mf)},Lf=function(e,t,n,r,o,i){var a,u=e.getParent(n,e.isBlock)||t,c=function(t,n,r){var i=Va(e),c=o?i.backwards:i.forwards;return w.from(c(t,n,function(e,t){return _f(e.parentNode)?-1:(a=e,r(o,e,t))},u))};return c(n,r,Bf).bind(function(e){return i?c(e.container,e.offset+(o?-1:0),Pf):w.some(e)}).orThunk(function(){return a?w.some({container:a,offset:o?0:a.length}):w.none()})},If=function(e,t,n,r,o){pn(r)&&0===r.nodeValue.length&&r[o]&&(r=r[o]);for(var i=Tf(e,r),a=0;a<i.length;a++)for(var u=0;u<t.length;u++){var c=t[u];if(!("collapsed"in c&&c.collapsed!==n.collapsed)&&e.is(i[a],c.selector))return i[a]}return r},Mf=function(e,t,n,r){var o,i=e.dom,a=i.getRoot();if(t[0].wrapper||(o=i.getParent(n,t[0].block,a)),!o){var u=i.getParent(n,"LI,TD,TH");o=i.getParent(pn(n)?n.parentNode:n,function(t){return t!==a&&Af(e,t)},u)}if(o&&t[0].wrapper&&(o=Tf(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!wf(o,"br")););return o||n},Ff=function(e,t,n,r,o,i,a){var u,c,s;u=c=a?n:o;var f,l=a?"previousSibling":"nextSibling",d=e.getRoot();if(pn(u)&&!Rf(u)&&(a?r>0:i<u.nodeValue.length))return u;for(;;){if(!t[0].block_expand&&e.isBlock(c))return c;for(s=c[l];s;s=s[l])if(!_f(s)&&!Rf(s)&&("BR"!==(f=s).nodeName||!f.getAttribute("data-mce-bogus")||f.nextSibling))return c;if(c===d||c.parentNode===d){u=c;break}c=c.parentNode}return u},Uf=function(e,t,n,r){void 0===r&&(r=!1);var o=t.startContainer,i=t.startOffset,a=t.endContainer,u=t.endOffset,c=e.dom;(an(o)&&o.hasChildNodes()&&(o=pu(o,i),pn(o)&&(i=0)),an(a)&&a.hasChildNodes()&&(a=pu(a,t.collapsed?u:u-1),pn(a)&&(u=a.nodeValue.length)),o=Df(c,o),a=Df(c,a),(_f(o.parentNode)||_f(o))&&(o=_f(o)?o:o.parentNode,o=t.collapsed?o.previousSibling||o:o.nextSibling||o,pn(o)&&(i=t.collapsed?o.length:0)),(_f(a.parentNode)||_f(a))&&(a=_f(a)?a:a.parentNode,a=t.collapsed?a.nextSibling||a:a.previousSibling||a,pn(a)&&(u=t.collapsed?0:a.length)),t.collapsed)&&(Lf(c,e.getBody(),o,i,!0,r).each(function(e){var t=e.container,n=e.offset;o=t,i=n}),Lf(c,e.getBody(),a,u,!1,r).each(function(e){var t=e.container,n=e.offset;a=t,u=n}));return(n[0].inline||n[0].block_expand)&&(n[0].inline&&pn(o)&&0!==i||(o=Ff(c,n,o,i,a,u,!0)),n[0].inline&&pn(a)&&u!==a.nodeValue.length||(a=Ff(c,n,o,i,a,u,!1))),n[0].selector&&!1!==n[0].expand&&!n[0].inline&&(o=If(c,n,t,o,"previousSibling"),a=If(c,n,t,a,"nextSibling")),(n[0].block||n[0].selector)&&(o=Mf(e,n,o,"previousSibling"),a=Mf(e,n,a,"nextSibling"),n[0].block&&(c.isBlock(o)||(o=Ff(c,n,o,i,a,u,!0)),c.isBlock(a)||(a=Ff(c,n,o,i,a,u,!1)))),an(o)&&(i=c.nodeIndex(o),o=o.parentNode),an(a)&&(u=c.nodeIndex(a)+1,a=a.parentNode),{startContainer:o,startOffset:i,endContainer:a,endOffset:u}},zf=function(e,t){var n=e.childNodes;return t>=n.length?t=n.length-1:t<0&&(t=0),n[t]||e},jf=function(e,t,n){var r=t.startContainer,o=t.startOffset,i=t.endContainer,a=t.endOffset,u=function(e){var t;return 3===(t=e[0]).nodeType&&t===r&&o>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===a&&e.length>0&&t===i&&3===t.nodeType&&e.splice(e.length-1,1),e},c=function(e,t,n){for(var r=[];e&&e!==n;e=e[t])r.push(e);return r},s=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},f=function(e,t,r){for(var o=r?"nextSibling":"previousSibling",i=e,a=i.parentNode;i&&i!==t;i=a){a=i.parentNode;var s=c(i===e?i:i[o],o);s.length&&(r||s.reverse(),n(u(s)))}};if(1===r.nodeType&&r.hasChildNodes()&&(r=zf(r,o)),1===i.nodeType&&i.hasChildNodes()&&(i=zf(i,a-1)),r===i)return n(u([r]));for(var l=e.findCommonAncestor(r,i),d=r;d;d=d.parentNode){if(d===i)return f(r,l,!0);if(d===l)break}for(d=i;d;d=d.parentNode){if(d===r)return f(i,l);if(d===l)break}var m=s(r,l)||r,p=s(i,l)||i;f(r,m,!0);var g=c(m===r?m:m.nextSibling,"nextSibling",p===i?p.nextSibling:p);g.length&&n(u(g)),f(i,p)},Hf=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},Vf=function(e){return V(function(e){return X(e,function(e){var t=mu(e);return t?[st.fromDom(t)]:[]})}(e),Wn)},qf=function(e,t){var n=xa(t,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:Vf(e)},$f=function(e){return qf(Hf(e.selection.getSel()),st.fromDom(e.getBody()))},Wf=function(e){return Bt(e).fold(l([e]),function(t){return[e].concat(Wf(t))})},Kf=function(e){return Pt(e).fold(l([e]),function(t){return"br"===ft(t)?_t(t).map(function(t){return[e].concat(Kf(t))}).getOr([]):[e].concat(Kf(t))})},Xf=function(e,t){return iu(function(e){var t=e.startContainer,n=e.startOffset;return pn(t)?0===n?w.some(st.fromDom(t)):w.none():w.from(t.childNodes[n]).map(st.fromDom)}(t),function(e){var t=e.endContainer,n=e.endOffset;return pn(t)?n===t.data.length?w.some(st.fromDom(t)):w.none():w.from(t.childNodes[n-1]).map(st.fromDom)}(t),function(t,n){var r=W(Wf(e),m(Ct,t)),o=W(Kf(e),m(Ct,n));return r.isSome()&&o.isSome()}).getOr(!1)},Yf=function(e,t,n,r){var o=n,i=new xi(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==ut.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},Gf=function(e){var t=e.selection.getSel();return t&&t.rangeCount>0},Jf=function(e,t){var n=$f(e);n.length>0?z(n,function(n){var r=n.dom(),o=e.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),t(o,!0)}):t(e.selection.getRng(),!1)},Qf=function(e,t,n){var r=pc(e,t);n(r),e.moveToBookmark(r)};var Zf=function(e,t){var n=function(t){return e(t)?w.from(t.dom().nodeValue):w.none()};return{get:function(r){if(!e(r))throw new Error("Can only get "+t+" value of a "+t+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom().nodeValue=r}}}(pt,"text"),el=function(e){return Zf.get(e)},tl=function(e,t,n,r){return kt(t).fold(function(){return"skipping"},function(o){return"br"===r||function(e){return pt(e)&&"\ufeff"===el(e)}(t)?"valid":function(e){return mt(e)&&Ca(e,Ra())}(t)?"existing":Qs(t)?"caret":yf(e,n,r)&&yf(e,ft(o),n)?"valid":"invalid-child"})},nl=function(e,t,n,r){var o=t.uid,i=void 0===o?Ma("mce-annotation"):o,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["uid"]),u=st.fromTag("span",e);ya(u,Ra()),Sn(u,""+Da(),i),Sn(u,""+Aa(),n);var c=r(i,a),s=c.attributes,f=void 0===s?{}:s,l=c.classes,d=void 0===l?[]:l;return Nn(u,f),function(e,t){z(t,function(t){ya(e,t)})}(u,d),u},rl=function(e,t,n,r,o){var i=[],a=nl(e.getDoc(),o,n,r),u=ia(w.none()),c=function(){u.set(w.none())},s=function(e){z(e,f)},f=function(t){var n,r;switch(tl(e,t,"span",ft(t))){case"invalid-child":c();var o=Dt(t);s(o),c();break;case"valid":var u=r.get().getOrThunk(function(){var e=za(a);return i.push(e),r.set(w.some(e)),e});Ut(n=t,r=u),Ht(r,n)}};return jf(e.dom,t,function(e){c(),function(e){var t=U(e,st.fromDom);s(t)}(e)}),i},ol=function(e,t,n,r){e.undoManager.transact(function(){var o=e.selection,i=o.getRng(),a=$f(e).length>0;if(i.collapsed&&!a&&function(e,t){var n=Uf(e,t,[{inline:!0}]);t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t)}(e,i),o.getRng().collapsed&&!a){var u=nl(e.getDoc(),r,t,n.decorate);Fa(u," "),o.getRng().insertNode(u.dom()),o.select(u.dom())}else Qf(o,!1,function(){Jf(e,function(o){rl(e,o,t,n.decorate,r)})})})},il=function(e){var t,n=(t={},{register:function(e,n){t[e]={name:e,settings:n}},lookup:function(e){return t.hasOwnProperty(e)?w.from(t[e]).map(function(e){return e.settings}):w.none()}});La(e,n);var r=Pa(e);return{register:function(e,t){n.register(e,t)},annotate:function(t,r){n.lookup(t).each(function(n){ol(e,t,n,r)})},annotationChanged:function(e,t){r.addListener(e,t)},remove:function(t){Oa(e,w.some(t)).each(function(e){var t=e.elements;z(t,Wt)})},getAll:function(t){var n=function(e,t){var n=st.fromDom(e.getBody()),r=xa(n,"["+Aa()+'="'+t+'"]'),o={};return z(r,function(e){var t=En(e,Da()),n=o.hasOwnProperty(t)?o[t]:[];o[t]=n.concat([e])}),o}(e,t);return oe(n,function(e){return U(e,function(e){return e.dom()})})}}},al={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},ul=function(e,t,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(e[r])return e[r];if(e!==t){var i=e[o];if(i)return i;for(var a=e.parent;a&&a!==t;a=a.parent)if(i=a[o])return i}},cl=function(e){if(!Yn(e.value))return!1;var t=e.parent;return!t||"span"===t.name&&!t.attr("style")||!/^[ ]+$/.test(e.value)},sl=function(e){var t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t},fl=function(){function e(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}return e.create=function(t,n){var r=new e(t,al[t]||1);return n&&re(n,function(e,t){r.attr(t,e)}),r},e.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},e.prototype.attr=function(e,t){var n,r=this;if("string"!=typeof e)return null!=e&&re(e,function(e,t){r.attr(t,e)}),r;if(n=r.attributes){if(void 0!==t){if(null===t){if(e in n.map){delete n.map[e];for(var o=n.length;o--;)if(n[o].name===e)return n.splice(o,1),r}return r}if(e in n.map){for(o=n.length;o--;)if(n[o].name===e){n[o].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,r}return n.map[e]}},e.prototype.clone=function(){var t,n=new e(this.name,this.type);if(t=this.attributes){var r=[];r.map={};for(var o=0,i=t.length;o<i;o++){var a=t[o];"id"!==a.name&&(r[r.length]={name:a.name,value:a.value},r.map[a.name]=a.value)}n.attributes=r}return n.value=this.value,n.shortEnded=this.shortEnded,n},e.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},e.prototype.unwrap=function(){for(var e=this.firstChild;e;){var t=e.next;this.insert(e,this,!0),e=t}this.remove()},e.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t,t&&(t.prev=null)):n.next=t,e.lastChild===this?(e.lastChild=n,n&&(n.next=null)):t.prev=n,this.parent=this.next=this.prev=null),this},e.prototype.append=function(e){e.parent&&e.remove();var t=this.lastChild;return t?(t.next=e,e.prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},e.prototype.insert=function(e,t,n){e.parent&&e.remove();var r=t.parent||this;return n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},e.prototype.getAll=function(e){for(var t=[],n=this.firstChild;n;n=ul(n,this))n.name===e&&t.push(n);return t},e.prototype.empty=function(){if(this.firstChild){for(var e=[],t=this.firstChild;t;t=ul(t,this))e.push(t);for(var n=e.length;n--;){(t=e[n]).parent=t.firstChild=t.lastChild=t.next=t.prev=null}}return this.firstChild=this.lastChild=null,this},e.prototype.isEmpty=function(e,t,n){void 0===t&&(t={});var r=this.firstChild;if(sl(this))return!1;if(r)do{if(1===r.type){if(r.attr("data-mce-bogus"))continue;if(e[r.name])return!1;if(sl(r))return!1}if(8===r.type)return!1;if(3===r.type&&!cl(r))return!1;if(3===r.type&&r.parent&&t[r.parent.name]&&Yn(r.value))return!1;if(n&&n(r))return!1}while(r=ul(r,this));return!0},e.prototype.walk=function(e){return ul(this,null,e)},e}(),ll=ut.makeMap,dl=function(e){var t=[],n=(e=e||{}).indent,r=ll(e.indent_before||""),o=ll(e.indent_after||""),i=lr.getEncodeFunc(e.entity_encoding||"raw",e.entities),a="html"===e.element_format;return{start:function(e,u,c){var s,f,l,d;if(n&&r[e]&&t.length>0&&(d=t[t.length-1]).length>0&&"\n"!==d&&t.push("\n"),t.push("<",e),u)for(s=0,f=u.length;s<f;s++)l=u[s],t.push(" ",l.name,'="',i(l.value,!0),'"');t[t.length]=!c||a?">":" />",c&&n&&o[e]&&t.length>0&&(d=t[t.length-1]).length>0&&"\n"!==d&&t.push("\n")},end:function(e){var r;t.push("</",e,">"),n&&o[e]&&t.length>0&&(r=t[t.length-1]).length>0&&"\n"!==r&&t.push("\n")},text:function(e,n){e.length>0&&(t[t.length]=n?e:i(e))},cdata:function(e){t.push("<![CDATA[",e,"]]>")},comment:function(e){t.push("\x3c!--",e,"--\x3e")},pi:function(e,r){r?t.push("<?",e," ",i(r),"?>"):t.push("<?",e,"?>"),n&&t.push("\n")},doctype:function(e){t.push("<!DOCTYPE",e,">",n?"\n":"")},reset:function(){t.length=0},getContent:function(){return t.join("").replace(/\n$/,"")}}},ml=function(e,t){void 0===t&&(t=xr());var n=dl(e);(e=e||{}).validate=!("validate"in e)||e.validate;return{serialize:function(r){var o=e.validate,i={3:function(e){n.text(e.value,e.raw)},8:function(e){n.comment(e.value)},7:function(e){n.pi(e.name,e.value)},10:function(e){n.doctype(e.value)},4:function(e){n.cdata(e.value)},11:function(e){if(e=e.firstChild)do{a(e)}while(e=e.next)}};n.reset();var a=function(e){var r,u,c,s,f,l,d,m,p,g=i[e.type];if(g)g(e);else{if(r=e.name,u=e.shortEnded,c=e.attributes,o&&c&&c.length>1&&((l=[]).map={},p=t.getElementRule(e.name))){for(d=0,m=p.attributesOrder.length;d<m;d++)(s=p.attributesOrder[d])in c.map&&(f=c.map[s],l.map[s]=f,l.push({name:s,value:f}));for(d=0,m=c.length;d<m;d++)(s=c[d].name)in l.map||(f=c.map[s],l.map[s]=f,l.push({name:s,value:f}));c=l}if(n.start(e.name,c,u),!u){if(e=e.firstChild)do{a(e)}while(e=e.next);n.end(r)}}};return 1!==r.type||e.inner?i[11](r):a(r),n.getContent()}}},pl=function(e){for(var t,n=/data:[^;]+;base64,([a-z0-9\+\/=]+)/gi,r=[],o={},i=Ma("img"),a=0,u=0;t=n.exec(e);){var c=t[0],s=i+"_"+u++;o[s]=c,a<t.index&&r.push(e.substr(a,t.index-a)),r.push(s),a=t.index+c.length}return 0===a?{prefix:i,uris:o,html:e}:(a<e.length&&r.push(e.substr(a)),{prefix:i,uris:o,html:r.join("")})},gl=function(e,t){return e.replace(new RegExp(t.prefix+"_[0-9]+","g"),function(e){return le(t.uris,e).getOr(e)})},hl=function(e){return 0===e.indexOf("data-")||0===e.indexOf("aria-")},vl=function(e,t){return!e.allow_html_data_urls&&(/^data:image\//i.test(t)?!1===e.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(t):/^data:/i.test(t))},yl=function(e,t,n){var r,o,i=1,a=e.getShortEndedElements(),u=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;for(u.lastIndex=r=n;o=u.exec(t);){if(r=u.lastIndex,"/"===o[1])i--;else if(!o[1]){if(o[2]in a)continue;i++}if(0===i)break}return r},bl=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf("[if ",n)&&function(e,t){return/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(e.substr(t))}(r,n)){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/;a.lastIndex=n;var u=a.exec(e);return u?u.index+u[0].length:r.length},Cl=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function wl(e,t){void 0===t&&(t=xr());var n=function(){};!1!==(e=e||{}).fix_self_closing&&(e.fix_self_closing=!0);var r=e.comment?e.comment:n,o=e.cdata?e.cdata:n,i=e.text?e.text:n,a=e.start?e.start:n,u=e.end?e.end:n,c=e.pi?e.pi:n,s=e.doctype?e.doctype:n,f=function(n,f){void 0===f&&(f="html");for(var l,d,m,p,g,h,v,y,b,C,w,x,S,N,E,k,_,T,R,A=n.html,D=0,O=[],B=0,P=lr.decode,L=ut.makeMap("src,href,data,background,formaction,poster,xlink:href"),I=/((java|vb)script|mhtml):/i,M="html"===f?0:1,F=function(e){var t,n;for(t=O.length;t--&&O[t].name!==e;);if(t>=0){for(n=O.length-1;n>=t;n--)(e=O[n]).valid&&u(e.name);O.length=t}},U=function(e,t){return i(gl(e,n),t)},z=function(t){""!==t&&(">"===t.charAt(0)&&(t=" "+t),e.allow_conditional_comments||"[if"!==t.substr(0,3).toLowerCase()||(t=" "+t),r(gl(t,n)))},j=function(e,t){var n=e||"",r=!Pe(n,"--"),o=bl(A,r,t);return e=A.substr(t,o-t),z(r?n+e:e),o+1},H=function(t,r,o,i,a){var u,c;if(o=function(e){return le(n.uris,e).getOr(e)}((r=r.toLowerCase())in K?r:P(o||i||a||"")),X&&!y&&!1===hl(r)){if(!(u=N[r])&&E){for(c=E.length;c--&&!(u=E[c]).pattern.test(r););-1===c&&(u=null)}if(!u)return;if(u.validValues&&!(o in u.validValues))return}if(L[r]&&!e.allow_script_urls){var s=o.replace(/[\s\u0000-\u001F]+/g,"");try{s=decodeURIComponent(s)}catch(f){s=unescape(s)}if(I.test(s))return;if(vl(e,s))return}y&&(r in L||0===r.indexOf("on"))||(p.map[r]=o,p.push({name:r,value:o}))},V=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),q=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,$=t.getShortEndedElements(),W=e.self_closing_elements||t.getSelfClosingElements(),K=t.getBoolAttrs(),X=e.validate,Y=e.remove_internals,G=e.fix_self_closing,J=t.getSpecialElements(),Q=A+">";l=V.exec(Q);){var Z=l[0];if(D<l.index&&U(P(A.substr(D,l.index-D))),d=l[7])":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),F(d);else if(d=l[8]){if(l.index+Z.length>A.length){U(P(A.substr(l.index))),D=l.index+Z.length;continue}":"===(d=d.toLowerCase()).charAt(0)&&(d=d.substr(1)),b=d in $,G&&W[d]&&O.length>0&&O[O.length-1].name===d&&F(d);var ee=Cl(q,l[9]);if(null!==ee){if("all"===ee){D=yl(t,A,V.lastIndex),V.lastIndex=D;continue}w=!1}if(!X||(C=t.getElementRule(d))){if(w=!0,X&&(N=C.attributes,E=C.attributePatterns),(S=l[9])?((y=-1!==S.indexOf("data-mce-type"))&&Y&&(w=!1),(p=[]).map={},S.replace(q,H)):(p=[]).map={},X&&!y){if(k=C.attributesRequired,_=C.attributesDefault,T=C.attributesForced,C.removeEmptyAttrs&&!p.length&&(w=!1),T)for(g=T.length;g--;)v=(x=T[g]).name,"{$uid}"===(R=x.value)&&(R="mce_"+B++),p.map[v]=R,p.push({name:v,value:R});if(_)for(g=_.length;g--;)(v=(x=_[g]).name)in p.map||("{$uid}"===(R=x.value)&&(R="mce_"+B++),p.map[v]=R,p.push({name:v,value:R}));if(k){for(g=k.length;g--&&!(k[g]in p.map););-1===g&&(w=!1)}if(x=p.map["data-mce-bogus"]){if("all"===x){D=yl(t,A,V.lastIndex),V.lastIndex=D;continue}w=!1}}w&&a(d,p,b)}else w=!1;if(m=J[d]){m.lastIndex=D=l.index+Z.length,(l=m.exec(A))?(w&&(h=A.substr(D,l.index-D)),D=l.index+l[0].length):(h=A.substr(D),D=A.length),w&&(h.length>0&&U(h,!0),u(d)),V.lastIndex=D;continue}b||(S&&S.indexOf("/")===S.length-1?w&&u(d):O.push({name:d,valid:w}))}else if(d=l[1])z(d);else if(d=l[2]){if(!(1===M||e.preserve_cdata||O.length>0&&t.isValidChild(O[O.length-1].name,"#cdata"))){D=j("",l.index+2),V.lastIndex=D;continue}o(d)}else if(d=l[3])s(d);else{if((d=l[4])||"<!"===Z){D=j(d,l.index+Z.length),V.lastIndex=D;continue}if(d=l[5]){if(1!==M){D=j("?",l.index+2),V.lastIndex=D;continue}c(d,l[6])}}D=l.index+Z.length}for(D<A.length&&U(P(A.substr(D))),g=O.length-1;g>=0;g--)(d=O[g]).valid&&u(d.name)};return{parse:function(e,t){void 0===t&&(t="html"),f(pl(e),t)}}}!function(e){e.findEndTag=yl}(wl||(wl={}));var xl,Sl,Nl,El=wl,kl=function(e,t){var n,r,o,i,a=t,u=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,c=e.schema;a=function(e,t){var n=new RegExp(["\\s?("+e.join("|")+')="[^"]+"'].join("|"),"gi");return t.replace(n,"")}(e.getTempAttrs(),a);for(var s=c.getShortEndedElements();i=u.exec(a);)r=u.lastIndex,o=i[0].length,n=s[i[1]]?r:El.findEndTag(c,a,r),a=a.substring(0,r-o)+a.substring(n),u.lastIndex=r-o;return Wa(a)},_l=kl,Tl=function(e,t,n,r){var o;if(t.format=n,t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)o=ut.trim(_l(e.serializer,r.innerHTML));else if("text"===t.format)o=Wa(r.innerText||r.textContent);else{if("tree"===t.format)return e.serializer.serialize(r,t);o=function(e,t){var n=Cc(e),r=new RegExp("^(<"+n+"[^>]*>( | |\\s| |<br \\/>|)<\\/"+n+">[\r\n]*|<br \\/>[\r\n]*)$");return t.replace(r,"")}(e,e.serializer.serialize(r,t))}return"text"===t.format||Kn(st.fromDom(r))?t.content=o:t.content=ut.trim(o),t.no_events||e.fire("GetContent",t),t.content},Rl=ut.each,Al=function(e){this.compare=function(t,n){if(t.nodeName!==n.nodeName)return!1;var r=function(t){var n={};return Rl(e.getAttribs(t),function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=e.getAttrib(t,o))}),n},o=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!!o(r(t),r(n))&&(!!o(e.parseStyle(e.getAttrib(t,"style")),e.parseStyle(e.getAttrib(n,"style")))&&(!ff(t)&&!ff(n)))}},Dl=function(e,t,n){return w.from(n.container()).filter(pn).exists(function(r){var o=e?0:-1;return t(r.data.charAt(n.offset()+o))})},Ol=m(Dl,!0,df),Bl=m(Dl,!1,df),Pl=function(e){var t=e.container();return pn(t)&&0===t.data.length},Ll=function(e,t){return function(n){return w.from(hs(e?0:-1,n)).filter(t).isSome()}},Il=function(e){return"IMG"===e.nodeName&&"block"===Tn(st.fromDom(e),"display")},Ml=function(e){return Cn(e)&&!function(e){return an(e)&&"all"===e.getAttribute("data-mce-bogus")}(e)},Fl=Ll(!0,Il),Ul=Ll(!1,Il),zl=Ll(!0,ln),jl=Ll(!1,ln),Hl=Ll(!0,Ml),Vl=Ll(!1,Ml),ql=function(e,t){var n,r,o,i=st.fromDom(e),a=st.fromDom(t);return n=a,r="pre,code",o=m(Ct,i),ka(n,r,o).isSome()},$l=function(e,t){return Eu(t)&&!1===function(e,t){return pn(t)&&Yn(t.data)&&!1===ql(e,t)}(e,t)||function(e){return an(e)&&"A"===e.nodeName&&e.hasAttribute("name")}(t)||Wl(t)},Wl=sn("data-mce-bookmark"),Kl=sn("data-mce-bogus"),Xl=(xl="data-mce-bogus",Sl="all",function(e){return an(e)&&e.getAttribute(xl)===Sl}),Yl=function(e,t){return void 0===t&&(t=!0),function(e,t){var n,r=0;if($l(e,e))return!1;if(!(n=e.firstChild))return!0;var o=new xi(n,e);do{if(t){if(Xl(n)){n=o.next(!0);continue}if(Kl(n)){n=o.next();continue}}if(yn(n))r++,n=o.next();else{if($l(e,n))return!1;n=o.next()}}while(n);return r<=1}(e.dom(),t)},Gl=function(e){var t=xa(e,"br"),n=V(function(e){for(var t=[],n=e.dom();n;)t.push(st.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),zn);t.length===n.length&&z(n,$t)},Jl=function(e){qt(e),Ht(e,st.fromHtml('<br data-mce-bogus="1">'))},Ql=function(e){Pt(e).each(function(t){_t(t).each(function(n){Fn(e)&&zn(t)&&Fn(n)&&$t(t)})})},Zl=function(e,t,n){return xt(t,e)?function(e,t){for(var n=D(t)?t:h,r=e.dom(),o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=st.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Ct(e,t)}).slice(0,-1):[]},ed=function(e,t){return Zl(e,t,l(!1))},td=function(e,t){return[e].concat(ed(e,t))},nd=function(e,t,n){if(0!==n){var r=e.data.slice(t,t+n),o=t+n>=e.data.length,i=0===t;e.replaceData(t,n,function(e,t,n){return $(e,function(r,o){return df(o)||lf(o)?r.previousCharIsSpace||""===r.str&&t||r.str.length===e.length-1&&n?{previousCharIsSpace:!1,str:r.str+" "}:{previousCharIsSpace:!0,str:r.str+" "}:{previousCharIsSpace:!1,str:r.str+o}},{previousCharIsSpace:!1,str:""}).str}(r,i,o))}},rd=function(e,t){var n=e.data.slice(t),r=n.length-Me(n).length;return nd(e,t,r)},od=function(e,t){return function(e,t){var n=e.container(),r=e.offset();return!1===Xu.isTextPosition(e)&&n===t.parentNode&&r>Xu.before(t).offset()}(t,e)?Xu(t.container(),t.offset()-1):t},id=function(e){return Eu(e.previousSibling)?w.some((t=e.previousSibling,pn(t)?Xu(t,t.data.length):Xu.after(t))):e.previousSibling?Js(e.previousSibling):w.none();var t},ad=function(e){return Eu(e.nextSibling)?w.some((t=e.nextSibling,pn(t)?Xu(t,0):Xu.before(t))):e.nextSibling?Gs(e.nextSibling):w.none();var t},ud=function(e,t){return id(t).orThunk(function(){return ad(t)}).orThunk(function(){return function(e,t){var n=Xu.before(t.previousSibling?t.previousSibling:t.parentNode);return Ys(e,n).fold(function(){return Xs(e,Xu.after(t))},w.some)}(e,t)})},cd=function(e,t){return ad(t).orThunk(function(){return id(t)}).orThunk(function(){return function(e,t){return Xs(e,Xu.after(t)).fold(function(){return Ys(e,Xu.before(t))},w.some)}(e,t)})},sd=function(e,t,n){return function(e,t,n){return e?cd(t,n):ud(t,n)}(e,t,n).map(m(od,n))},fd=function(e,t,n){n.fold(function(){e.focus()},function(n){e.selection.setRng(n.toRange(),t)})},ld=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(ft(t))},dd=function(e){if(Yl(e)){var t=st.fromHtml('<br data-mce-bogus="1">');return qt(e),Ht(e,t),w.some(Xu.before(t.dom()))}return w.none()},md=function(e,t,n){var r,o,i,a,u=_t(e).filter(pt),c=Tt(e).filter(pt);return $t(e),(r=u,o=c,i=t,a=function(e,t,r){var o=e.dom(),i=t.dom(),a=o.data.length;return function(e,t,n){var r=Fe(e.data).length;e.appendData(t.data),$t(st.fromDom(t)),n&&rd(e,r)}(o,i,n),r.container()===i?Xu(o,a):r},r.isSome()&&o.isSome()&&i.isSome()?w.some(a(r.getOrDie(),o.getOrDie(),i.getOrDie())):w.none()).orThunk(function(){return n&&(u.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Fe(r).length,nd(t,n-o,o);var t,n,r,o}),c.each(function(e){return rd(e.dom(),0)})),t})},pd=function(e,t,n,r){void 0===r&&(r=!0);var o,i=sd(t,e.getBody(),n.dom()),a=Na(n,m(ld,e),(o=e.getBody(),function(e){return e.dom()===o})),u=md(n,i,function(e,t){return de(e.schema.getTextInlineElements(),ft(t))}(e,n));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):a.bind(dd).fold(function(){r&&fd(e,t,u)},function(n){r&&fd(e,t,w.some(n))})},gd=function(e,t){return{start:e,end:t}},hd=Mi([{removeTable:["element"]},{emptyCells:["cells"]},{deleteCellSelection:["rng","cell"]}]),vd=function(e,t){return Ta(st.fromDom(e),"td,th",t)},yd=function(e,t){return ka(e,"table",t)},bd=function(e){return!Ct(e.start,e.end)},Cd=function(e,t){return yd(e.start,t).bind(function(n){return yd(e.end,t).bind(function(e){return t=Ct(n,e),r=n,t?w.some(r):w.none();var t,r})})},wd=function(e){return xa(e,"td,th")},xd=function(e,t){var n=vd(t.startContainer,e),r=vd(t.endContainer,e);return t.collapsed?w.none():iu(n,r,gd).fold(function(){return n.fold(function(){return r.bind(function(t){return yd(t,e).bind(function(e){return Q(wd(e)).map(function(e){return gd(e,t)})})})},function(t){return yd(t,e).bind(function(e){return Z(wd(e)).map(function(e){return gd(t,e)})})})},function(t){return Sd(e,t)?w.none():function(e,t){return yd(e.start,t).bind(function(t){return Z(wd(t)).map(function(t){return gd(e.start,t)})})}(t,e)})},Sd=function(e,t){return Cd(t,e).isSome()},Nd=function(e,t,n){return e.filter(function(e){return bd(e)&&Sd(n,e)}).orThunk(function(){return xd(n,t)}).bind(function(e){return function(e,t){return Cd(e,t).map(function(t){return function(e,t,n){return{rng:e,table:t,cells:n}}(e,t,wd(t))})}(e,n)})},Ed=function(e,t){return K(e,function(e){return Ct(e,t)})},kd=function(e,t,n){return e.filter(function(e){return function(e,t){return!bd(e)&&Cd(e,t).exists(function(e){var t=e.dom().rows;return 1===t.length&&1===t[0].cells.length})}(e,n)&&Xf(e.start,t)}).map(function(e){return e.start})},_d=function(e){return function(e){return iu(Ed(e.cells,e.rng.start),Ed(e.cells,e.rng.end),function(t,n){return e.cells.slice(t,n+1)})}(e).map(function(t){var n=e.cells;return t.length===n.length?hd.removeTable(e.table):hd.emptyCells(t)})},Td=function(e,t){var n=function(e){return function(t){return Ct(e,t)}}(e),r=function(e,t){var n=vd(e.startContainer,t),r=vd(e.endContainer,t);return iu(n,r,gd)}(t,n);return kd(r,t,n).map(function(e){return hd.deleteCellSelection(t,e)}).orThunk(function(){return Nd(r,t,n).bind(_d)})},Rd=function(e){var t;return(8===lt(t=e)||"#comment"===ft(t)?_t(e):Pt(e)).bind(Rd).orThunk(function(){return w.some(e)})},Ad=function(e,t){return z(t,Jl),e.selection.setCursorLocation(t[0].dom(),0),!0},Dd=function(e,t,n){t.deleteContents();var r,o=Rd(n).getOr(n),i=st.fromDom(e.dom.getParent(o.dom(),e.dom.isBlock));if(Yl(i)&&(Jl(i),e.selection.setCursorLocation(i.dom(),0)),!Ct(n,i)){var a=kt(i).is(n)?[]:kt(r=i).map(Dt).map(function(e){return V(e,function(e){return!Ct(r,e)})}).getOr([]);z(a.concat(Dt(n)),function(e){Ct(e,i)||xt(e,i)||$t(e)})}return!0},Od=function(e,t){return pd(e,!1,t),!0},Bd=function(e,t,n,r){return Ld(t,r).fold(function(){return function(e,t,n){return Td(t,n).map(function(t){return t.fold(m(Od,e),m(Ad,e),m(Dd,e))})}(e,t,n)},function(t){return function(e,t){return Id(e,t)}(e,t)}).getOr(!1)},Pd=function(e,t){return W(td(t,e),Wn)},Ld=function(e,t){return W(td(t,e),function(e){return"caption"===ft(e)})},Id=function(e,t){return Jl(t),e.selection.setCursorLocation(t.dom(),0),w.some(!0)},Md=function(e,t,n,r,o){return $s(n,e.getBody(),o).bind(function(i){return function(e,t,n,r){return Gs(e.dom()).bind(function(o){return Js(e.dom()).map(function(e){return t?n.isEqual(o)&&r.isEqual(e):n.isEqual(e)&&r.isEqual(o)})}).getOr(!0)}(r,n,o,i)?function(e,t){return Id(e,t)}(e,r):function(e,t,n){return Ld(e,st.fromDom(n.getNode())).map(function(e){return!1===Ct(e,t)})}(t,r,i)}).or(w.some(!0))},Fd=function(e,t,n,r){var o=Xu.fromRangeStart(e.selection.getRng());return Pd(n,r).bind(function(r){return Yl(r)?Id(e,r):function(e,t,n,r,o){return $s(n,e.getBody(),o).bind(function(e){return Pd(t,st.fromDom(e.getNode())).map(function(e){return!1===Ct(e,r)})})}(e,n,t,r,o)}).getOr(!1)},Ud=function(e,t){return e?zl(t):jl(t)},zd=function(e,t,n){var r=st.fromDom(e.getBody());return Ld(r,n).fold(function(){return Fd(e,t,r,n)||function(e,t){var n=Xu.fromRangeStart(e.selection.getRng());return Ud(t,n)||qs(t,e.getBody(),n).map(function(e){return Ud(t,e)}).getOr(!1)}(e,t)},function(n){return function(e,t,n,r){var o=Xu.fromRangeStart(e.selection.getRng());return Yl(r)?Id(e,r):Md(e,n,t,r,o)}(e,t,r,n).getOr(!1)})},jd=function(e,t){var n=st.fromDom(e.selection.getStart(!0)),r=$f(e);return e.selection.isCollapsed()&&0===r.length?zd(e,t,n):function(e,t){var n=st.fromDom(e.getBody()),r=e.selection.getRng(),o=$f(e);return 0!==o.length?Ad(e,o):Bd(e,n,r,t)}(e,n)},Hd=function(t){var n=Xu.fromRangeStart(t),r=Xu.fromRangeEnd(t),o=t.commonAncestorContainer;return qs(!1,o,r).map(function(i){return!gs(n,r,o)&&gs(n,i,o)?function(t,n,r,o){var i=e.document.createRange();return i.setStart(t,n),i.setEnd(r,o),i}(n.container(),n.offset(),i.container(),i.offset()):t}).getOr(t)},Vd=function(e){return e.collapsed?e:Hd(e)},qd=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&function(e){return" "===e.data||yn(e)}(e.firstChild)},$d=function(e){return e.length>0&&(!(t=e[e.length-1]).firstChild||qd(t))?e.slice(0,-1):e;var t},Wd=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},Kd=function(e,t){var n=Xu.after(e),r=Us(t).prev(n);return r?r.toRange():null},Xd=function(e,t,n){var r=e.parentNode;return ut.each(t,function(t){r.insertBefore(t,e)}),function(e,t){var n=Xu.before(e),r=Us(t).next(n);return r?r.toRange():null}(e,n)},Yd=function(e,t,n,r){var o,i=function(e,t,n){var r=t.serialize(n);return function(e){var t=e.firstChild,n=e.lastChild;return t&&"META"===t.nodeName&&t.parentNode.removeChild(t),n&&"mce_marker"===n.id&&n.parentNode.removeChild(n),e}(e.createFragment(r))}(t,e,r),a=Wd(t,n.startContainer),u=$d((o=i.firstChild,ut.grep(o.childNodes,function(e){return"LI"===e.nodeName}))),c=t.getRoot(),s=function(e){var r=Xu.fromRangeStart(n),o=Us(t.getRoot()),i=1===e?o.prev(r):o.next(r);return!i||Wd(t,i.getNode())!==a};return s(1)?Xd(a,u,c):s(2)?function(e,t,n,r){return r.insertAfter(t.reverse(),e),Kd(t[0],n)}(a,u,c,t):function(e,t,n,r){var o=function(e,t){var n=t.cloneRange(),r=t.cloneRange();return n.setStartBefore(e),r.setEndAfter(e),[n.cloneContents(),r.cloneContents()]}(e,r),i=e.parentNode;return i.insertBefore(o[0],e),ut.each(t,function(t){i.insertBefore(t,e)}),i.insertBefore(o[1],e),i.removeChild(e),Kd(t[t.length-1],n)}(a,u,c,n)},Gd=un(["td","th"]),Jd=function(e,t){var n=e.selection.getRng(),r=n.startContainer,o=n.startOffset;n.collapsed&&function(e,t){return pn(e)&&" "===e.nodeValue[t-1]}(r,o)&&pn(r)&&(r.insertData(o-1," "),r.deleteData(o,1),n.setStart(r,o),n.setEnd(r,o),e.selection.setRng(n)),e.selection.setContent(t)},Qd=function(e){var t=e.dom,n=Vd(e.selection.getRng());e.selection.setRng(n);var r=t.getParent(n.startContainer,Gd);!function(e,t,n){return null!==n&&n===e.getParent(t.endContainer,Gd)&&Xf(st.fromDom(n),t)}(t,n,r)?e.getDoc().execCommand("Delete",!1,null):Dd(e,n,st.fromDom(r))},Zd=function(e,t,n){var r,o,i,a,u,c,s=e.selection,f=e.dom;/^ | $/.test(t)&&(t=function(e,t){var n=e.startContainer,r=e.startOffset,o=function(e){return n[e]&&3===n[e].nodeType};return pn(n)&&(r>0?t=t.replace(/^ /," "):o("previousSibling")||(t=t.replace(/^ /," ")),r<n.length?t=t.replace(/ (<br>|)$/," "):o("nextSibling")||(t=t.replace(/( | )(<br>|)$/," "))),t}(s.getRng(),t));var l=e.parser,d=n.merge,m=ml({validate:Mc(e)},e.schema),p='<span id="mce_marker" data-mce-type="bookmark">​</span>';if(i={content:t,format:"html",selection:!0,paste:n.paste},(i=e.fire("BeforeSetContent",i)).isDefaultPrevented())e.fire("SetContent",{content:i.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=i.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,p);var g=(u=s.getRng()).startContainer||(u.parentElement?u.parentElement():null),h=e.getBody();g===h&&s.isCollapsed()&&f.isBlock(h.firstChild)&&function(e,t){return t&&!e.schema.getShortEndedElements()[t.nodeName]}(e,h.firstChild)&&f.isEmpty(h.firstChild)&&((u=f.createRng()).setStart(h.firstChild,0),u.setEnd(h.firstChild,0),s.setRng(u)),s.isCollapsed()||(Qd(e),t=function(e,t){var n=e.startContainer,r=e.startOffset;return pn(n)&&e.collapsed&&(" "===n.data[r]?(n.deleteData(r,1),/[\u00a0| ]$/.test(t)||(t+=" ")):" "===n.data[r-1]&&(n.deleteData(r-1,1),/[\u00a0| ]$/.test(t)||(t=" "+t))),t}(e.selection.getRng(),t));var v,y={context:(r=s.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},b=l.parse(t,y);if(!0===n.paste&&function(e,t){var n=t.firstChild,r=t.lastChild;return n&&"meta"===n.name&&(n=n.next),r&&"mce_marker"===r.attr("id")&&(r=r.prev),function(e,t){var n=e.getNonEmptyElements();return t&&(t.isEmpty(n)||function(e,t){return e.getBlockElements()[t.name]&&function(e){return e.firstChild&&e.firstChild===e.lastChild}(t)&&function(e){return"br"===e.name||" "===e.value}(t.firstChild)}(e,t))}(e,r)&&(r=r.prev),!(!n||n!==r||"ul"!==n.name&&"ol"!==n.name)}(e.schema,b)&&function(e,t){return!!Wd(e,t)}(f,r))return u=Yd(m,f,e.selection.getRng(),b),e.selection.setRng(u),void e.fire("SetContent",i);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(b),"mce_marker"===(c=b.lastChild).attr("id"))for(a=c,c=c.prev;c;c=c.walk(!0))if(3===c.type||!f.isBlock(c.name)){e.schema.isValidChild(c.parent.name,"span")&&c.parent.insert(a,c,"br"===c.name);break}if(e._selectionOverrides.showBlockCaretContainer(r),y.invalid){for(Jd(e,p),r=s.getNode(),o=e.getBody(),9===r.nodeType?r=c=o:c=r;c!==o;)r=c,c=c.parentNode;t=r===o?o.innerHTML:f.getOuterHTML(r),t=m.serialize(l.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return m.serialize(b)}))),r===o?f.setHTML(o,t):f.setOuterHTML(r,t)}else!function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):Jd(e,t)}}(e,t=m.serialize(b),r);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new Al(r);ut.each(r.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}}(e,d),function(e,t){var n,r,o=e.dom,i=e.selection;if(t){e.selection.scrollIntoView(t);var a=function(t){for(var n=e.getBody();t&&t!==n;t=t.parentNode)if("false"===e.dom.getContentEditable(t))return t;return null}(t);if(a)return o.remove(t),void i.select(a);var u=o.createRng(),c=t.previousSibling;c&&3===c.nodeType?(u.setStart(c,c.nodeValue.length),nt.ie||(r=t.nextSibling)&&3===r.nodeType&&(c.appendData(r.data),r.parentNode.removeChild(r))):(u.setStartBefore(t),u.setEndBefore(t));var s=o.getParent(t,o.isBlock);o.remove(t),s&&o.isEmpty(s)&&(e.$(s).empty(),u.setStart(s,0),u.setEnd(s,0),Gd(s)||function(e){return!!e.getAttribute("data-mce-fragment")}(s)||!(n=function(t){var n=Xu.fromRangeStart(t);if(n=Us(e.getBody()).next(n))return n.toRange()}(u))?o.add(s,o.create("br",{"data-mce-bogus":"1"})):(u=n,o.remove(s))),i.setRng(u)}}(e,f.get("mce_marker")),v=e.getBody(),ut.each(v.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),function(e,t){w.from(e.getParent(t,"td,th")).map(st.fromDom).each(Ql)}(e.dom,e.selection.getStart()),e.fire("SetContent",i),e.addVisual()}},em=function(e){return e.dom().focus()},tm=function(e){var t=It(e).dom();return e.dom()===t.activeElement},nm=function(t){return void 0===t&&(t=st.fromDom(e.document)),w.from(t.dom().activeElement).map(st.fromDom)},rm=function(e,t,n,r){return{start:l(e),soffset:l(t),finish:l(n),foffset:l(r)}},om=Mi([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),im=(om.before,om.on,om.after,function(e){return e.fold(d,d,d)}),am=Mi([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),um={domRange:am.domRange,relative:am.relative,exact:am.exact,exactFromRange:function(e){return am.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){var t=function(e){return e.match({domRange:function(e){return st.fromDom(e.startContainer)},relative:function(e,t){return im(e)},exact:function(e,t,n,r){return e}})}(e);return Et(t)},range:rm},cm=Ke().browser,sm=function(e,t){var n=pt(t)?el(t).length:Dt(t).length+1;return e>n?n:e<0?0:e},fm=function(e){return um.range(e.start(),sm(e.soffset(),e.start()),e.finish(),sm(e.foffset(),e.finish()))},lm=function(e,t){return!on(t.dom())&&(xt(e,t)||Ct(e,t))},dm=function(e){return function(t){return lm(e,t.start())&&lm(e,t.finish())}},mm=function(e){return!0===e.inline||cm.isIE()},pm=function(e){return um.range(st.fromDom(e.startContainer),e.startOffset,st.fromDom(e.endContainer),e.endOffset)},gm=function(e){return function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?w.from(t.getRangeAt(0)):w.none()).map(pm)}(Et(e).dom()).filter(dm(e))},hm=function(t){var n=e.document.createRange();try{return n.setStart(t.start().dom(),t.soffset()),n.setEnd(t.finish().dom(),t.foffset()),w.some(n)}catch(r){return w.none()}},vm=function(e){var t=mm(e)?gm(st.fromDom(e.getBody())):w.none();e.bookmark=t.isSome()?t:e.bookmark},ym=function(e){return(e.bookmark?e.bookmark:w.none()).bind(function(t){return n=st.fromDom(e.getBody()),r=t,w.from(r).filter(dm(n)).map(fm);var n,r}).bind(hm)},bm={isEditorUIElement:function(e){var t=e.className.toString();return-1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},Cm=function(e,t){Ke().browser.isIE()?function(e){e.on("focusout",function(){vm(e)})}(e):function(e,t){e.on("mouseup touchend",function(e){t.throttle()})}(e,t),e.on("keyup NodeChange",function(t){(function(e){return"nodechange"===e.type&&e.selectionChange})(t)||vm(e)})},wm=function(t){var n=da(function(){vm(t)},0);t.on("init",function(){t.inline&&function(t,n){var r=function(){n.throttle()};ea.DOM.bind(e.document,"mouseup",r),t.on("remove",function(){ea.DOM.unbind(e.document,"mouseup",r)})}(t,n),Cm(t,n)}),t.on("remove",function(){n.cancel()})},xm=ea.DOM,Sm=function(e,t){var n=function(e){return e.getParam("custom_ui_selector","","string")}(e);return null!==xm.getParent(t,function(t){return function(e){return bm.isEditorUIElement(e)}(t)||!!n&&e.dom.is(t,n)})},Nm=function(t,n){var r=n.editor;wm(r),r.on("focusin",function(){var e=t.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),t.setActive(this),t.focusedEditor=this,this.fire("focus",{blurredEditor:e}),this.focus(!0))}),r.on("focusout",function(){var n=this;Vi.setEditorTimeout(n,function(){var r=t.focusedEditor;Sm(n,function(){try{return e.document.activeElement}catch(t){return e.document.body}}())||r!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null)})}),Nl||(Nl=function(n){var r=t.activeEditor,o=n.target;r&&o.ownerDocument===e.document&&(o===e.document.body||Sm(r,o)||t.focusedEditor!==r||(r.fire("blur",{focusedEditor:null}),t.focusedEditor=null))},xm.bind(e.document,"focusin",Nl))},Em=function(t,n){t.focusedEditor===n.editor&&(t.focusedEditor=null),t.activeEditor||(xm.unbind(e.document,"focusin",Nl),Nl=null)},km=function(e,t){return function(e){return e.collapsed?w.from(pu(e.startContainer,e.startOffset)).map(st.fromDom):w.none()}(t).bind(function(t){return $n(t)?w.some(t):!1===xt(e,t)?w.some(e):w.none()})},_m=function(e,t){km(st.fromDom(e.getBody()),t).bind(function(e){return Gs(e.dom())}).fold(function(){e.selection.normalize()},function(t){return e.selection.setRng(t.toRange())})},Tm=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},Rm=function(e){return tm(e)||(t=e,nm(It(t)).filter(function(e){return t.dom().contains(e.dom())})).isSome();var t},Am=function(e){return e.inline?function(e){var t=e.getBody();return t&&Rm(st.fromDom(t))}(e):function(e){return e.iframeElement&&tm(st.fromDom(e.iframeElement))}(e)},Dm=function(e){return Am(e)||function(e){return nm().filter(function(t){return n=t.dom(),!(void 0!==(r=n.classList)&&(r.contains("tox-edit-area")||r.contains("tox-edit-area__iframe")||r.contains("mce-content-body")))&&Sm(e,t.dom());var n,r}).isSome()}(e)},Om=function(e){return e.editorManager.setActive(e)},Bm=function(e,t){e.removed||(t?Om(e):function(e){var t=e.selection,n=e.getBody(),r=t.getRng();e.quirks.refreshContentEditable(),void 0!==e.bookmark&&!1===Am(e)&&ym(e).each(function(t){e.selection.setRng(t),r=t});var o=function(e,t){return e.dom.getParent(t,function(t){return"true"===e.dom.getContentEditable(t)})}(e,t.getNode());if(e.$.contains(n,o))return Tm(o),_m(e,r),void Om(e);e.inline||(nt.opera||Tm(n),e.getWin().focus()),(nt.gecko||e.inline)&&(Tm(n),_m(e,r)),Om(e)}(e))},Pm=function(e,t){t(e),e.firstChild&&Pm(e.firstChild,t),e.next&&Pm(e.next,t)},Lm=function(e,t,n){var r=function(e,t,n){var r={},o={},i=[];for(var a in n.firstChild&&Pm(n.firstChild,function(n){z(e,function(e){e.name===n.name&&(r[e.name]?r[e.name].nodes.push(n):r[e.name]={filter:e,nodes:[n]})}),z(t,function(e){"string"==typeof n.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(n):o[e.name]={filter:e,nodes:[n]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var u in o)o.hasOwnProperty(u)&&i.push(o[u]);return i}(e,t,n);z(r,function(e){z(e.filter.callbacks,function(t){t(e.nodes,e.filter.name,{})})})},Im=function(e){return e instanceof fl},Mm=function(e,t){e.dom.setHTML(e.getBody(),t),function(e){Am(e)&&Gs(e.getBody()).each(function(t){var n=t.getNode(),r=ln(n)?Gs(n).getOr(t):t;e.selection.setRng(r.toRange())})}(e)},Fm=function(e,t,n){return n.format=n.format?n.format:"html",n.set=!0,n.content=Im(t)?"":t,Im(t)||n.no_events||(e.fire("BeforeSetContent",n),t=n.content),w.from(e.getBody()).fold(l(t),function(r){return Im(t)?function(e,t,n,r){Lm(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=ml({validate:e.validate},e.schema).serialize(n);return r.content=Kn(st.fromDom(t))?o:ut.trim(o),Mm(e,r.content),r.no_events||e.fire("SetContent",r),n}(e,r,t,n):function(e,t,n,r){var o,i;return 0===n.length||/^\s+$/.test(n)?(i='<br data-mce-bogus="1">',"TABLE"===t.nodeName?n="<tr><td>"+i+"</td></tr>":/^(UL|OL)$/.test(t.nodeName)&&(n="<li>"+i+"</li>"),(o=Cc(e))&&e.schema.isValidChild(t.nodeName.toLowerCase(),o.toLowerCase())?(n=i,n=e.dom.createHTML(o,wc(e),n)):n||(n='<br data-mce-bogus="1">'),Mm(e,n),e.fire("SetContent",r)):("raw"!==r.format&&(n=ml({validate:e.validate},e.schema).serialize(e.parser.parse(n,{isRootContent:!0,insert:!0}))),r.content=Kn(st.fromDom(t))?n:ut.trim(n),Mm(e,r.content),r.no_events||e.fire("SetContent",r)),r.content}(e,r,t,n)})},Um=function(e,t){return e.splitText(t)},zm=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&pn(t)?n>0&&n<t.nodeValue.length&&(t=(r=Um(t,n)).previousSibling,o>n?(t=r=Um(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(pn(t)&&n>0&&n<t.nodeValue.length&&(t=Um(t,n),n=0),pn(r)&&o>0&&o<r.nodeValue.length&&(o=(r=Um(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},jm=wf,Hm=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&e.dom.is(t,r[o].selector))return!0;return!1},Vm=function(e,t,n,r){var o=e.dom.getRoot();return t!==o&&(t=e.dom.getParent(t,function(t){return!!Hm(e,t,n)||(t.parentNode===o||!!Wm(e,t,n,r,!0))}),Wm(e,t,n,r))},qm=function(e,t,n){return!!jm(t,n.inline)||(!!jm(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0))},$m=function(e,t,n,r,o,i){var a,u,c,s=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(s)if(void 0===s.length){for(a in s)if(s.hasOwnProperty(a)){if(u="attributes"===r?e.getAttrib(t,a):Sf(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!jm(u,xf(e,Cf(s[a],i),a)))return}}else for(c=0;c<s.length;c++)if("attributes"===r?e.getAttrib(t,s[c]):Sf(e,t,s[c]))return n;return n},Wm=function(e,t,n,r,o){var i,a,u,c,s=e.formatter.get(n),f=e.dom;if(s&&t)for(a=0;a<s.length;a++)if(i=s[a],qm(e.dom,t,i)&&$m(f,t,i,"attributes",o,r)&&$m(f,t,i,"styles",o,r)){if(c=i.classes)for(u=0;u<c.length;u++)if(!e.dom.hasClass(t,c[u]))return;return i}},Km=function(e,t,n,r){if(r)return Vm(e,r,t,n);if(r=e.selection.getNode(),Vm(e,r,t,n))return!0;var o=e.selection.getStart();return!(o===r||!Vm(e,o,t,n))},Xm=function(e,t,n){var r=[],o={},i=e.selection.getStart();return e.dom.getParent(i,function(i){for(var a=0;a<t.length;a++){var u=t[a];!o[u]&&Wm(e,i,u,n)&&(o[u]=!0,r.push(u))}},e.dom.getRoot()),r},Ym=function(e,t){var n,r,o,i,a,u=e.formatter.get(t),c=e.dom;if(u)for(n=e.selection.getStart(),r=Ef(c,n),i=u.length-1;i>=0;i--){if(!(a=u[i].selector)||u[i].defaultBlock)return!0;for(o=r.length-1;o>=0;o--)if(c.is(r[o],a))return!0}return!1},Gm=function(e,t,n){return $(n,function(n,r){var o=function(e,t){return F(e.formatter.get(t),function(e){var t=function(e){return e.length>1&&"%"===e.charAt(0)};return F(["styles","attributes"],function(n){return le(e,n).exists(function(e){var n=_(e)?e:fe(e);return F(n,t)})})})}(e,r);return e.formatter.matchNode(t,r,{},o)?n.concat([r]):n},[])},Jm=function(e){return function(e){for(var t=[];e;){if(3===e.nodeType&&"\ufeff"!==e.nodeValue||e.childNodes.length>1)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length>0},Qm=function(e){if(e){var t=new xi(e,e);for(e=t.current();e;e=t.next())if(pn(e))return e}return null},Zm=function(e){var t=st.fromTag("span");return Nn(t,{id:"_mce_caret","data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&Ht(t,st.fromText("\ufeff")),t},ep=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(Jm(t))pd(e,!1,st.fromDom(t),n);else{var i=o.getRng(),a=r.getParent(t,r.isBlock),u=i.startContainer,c=i.startOffset,s=i.endContainer,f=i.endOffset,l=function(e){var t=Qm(e);return t&&"\ufeff"===t.nodeValue.charAt(0)&&t.deleteData(0,1),t}(t);r.remove(t,!0),u===l&&c>0&&i.setStart(l,c-1),s===l&&f>0&&i.setEnd(l,f-1),a&&r.isEmpty(a)&&Jl(st.fromDom(a)),o.setRng(i)}},tp=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)ep(e,t,n);else if(!(t=Zs(e.getBody(),o.getStart())))for(;t=r.get("_mce_caret");)ep(e,t,!1)},np=function(e,t){return e.appendChild(t),t},rp=function(e,t){var n=q(e,function(e,t){return np(e,t.cloneNode(!1))},t);return np(n,n.ownerDocument.createTextNode("\ufeff"))},op=function(e,t,n,r){var o,i,a,u=e.dom,c=e.selection,s=[],f=c.getRng(),l=f.startContainer,d=f.startOffset;for(i=l,3===l.nodeType&&(d!==l.nodeValue.length&&(o=!0),i=i.parentNode);i;){if(Wm(e,i,t,n,r)){a=i;break}i.nextSibling&&(o=!0),s.push(i),i=i.parentNode}if(a)if(o){var p=c.getBookmark();f.collapse(!0);var g=Uf(e,f,e.formatter.get(t),!0);g=zm(g),e.formatter.remove(t,n,g,r),c.moveToBookmark(p)}else{var h=Zs(e.getBody(),a),v=Zm(!1).dom();!function(e,t,n){var r=e.dom,o=r.getParent(n,m(vf,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Gl(st.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))}(e,v,null!==h?h:a);var y=function(e,t,n,r,o,i){var a=e.formatter,u=e.dom,c=V(te(a.get()),function(e){return e!==r&&!Be(e,"removeformat")}),s=Gm(e,n,c);if(V(s,function(t){return!kf(e,t,r)}).length>0){var f=n.cloneNode(!1);return u.add(t,f),a.remove(r,o,f,i),u.remove(f),w.some(f)}return w.none()}(e,v,a,t,n,r),b=rp(s.concat(y.toArray()),v);ep(e,h,!1),c.setCursorLocation(b,1),u.isEmpty(a)&&u.remove(a)}},ip=function(e){e.on("mouseup keydown",function(t){!function(e,t){var n=e.selection,r=e.getBody();tp(e,null,!1),8!==t&&46!==t||!n.isCollapsed()||"\ufeff"!==n.getStart().innerHTML||tp(e,Zs(r,n.getStart())),37!==t&&39!==t||tp(e,Zs(r,n.getStart()))}(e,t.keyCode)})},ap=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(ft(t))&&!Qs(t.dom())&&!fn(t.dom())},up={},cp=he,sp=pe;!function(e,t){up[e]||(up[e]=[]),up[e].push(t)}("pre",function(e){var t,n=e.selection.getRng(),r=un(["pre"]);n.collapsed||(t=e.selection.getSelectedBlocks(),sp(cp(cp(t,r),function(e){return r(e.previousSibling)&&-1!==ve(t,e.previousSibling)}),function(e){var t,n;t=e.previousSibling,wi(n=e).remove(),wi(t).append("<br><br>").append(n.childNodes)}))});var fp,lp,dp=ut.each,mp=function(e){return an(e)&&!ff(e)&&!Qs(e)&&!fn(e)},pp=function(e,t){var n;for(n=e;n;n=n[t]){if(pn(n)&&0!==n.nodeValue.length)return e;if(an(n)&&!ff(n))return n}return e},gp=function(e,t,n){var r,o,i=new Al(e);if(t&&n&&(t=pp(t,"previousSibling"),n=pp(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)o=r,r=r.nextSibling,t.appendChild(o);return e.remove(n),ut.each(ut.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},hp=function(e,t,n,r){if(r&&!1!==t.merge_siblings){var o=gp(e,hf(r),r);gp(e,o,hf(o,!0))}},vp=function(e,t,n){dp(e.childNodes,function(e){mp(e)&&(t(e)&&n(e),e.hasChildNodes()&&vp(e,t,n))})},yp=function(e,t){return function(n){return!(!n||!Sf(e,n,t))}},bp=function(e,t,n){return function(r){e.setStyle(r,t,n),""===r.getAttribute("style")&&r.removeAttribute("style"),function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)}(e,r)}},Cp=Mi([{keep:[]},{rename:["name"]},{removed:[]}]),wp=/^(src|href|style)$/,xp=ut.each,Sp=wf,Np=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},Ep=function(e,t,n){var r,o;if(r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],an(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[o>i?i:o]}return pn(r)&&n&&o>=r.nodeValue.length&&(r=new xi(r,e.getBody()).next()||r),pn(r)&&!n&&0===o&&(r=new xi(r,e.getBody()).prev()||r),r},kp=function(e,t){var n=t?"firstChild":"lastChild";if(function(e){return/^(TR|TH|TD)$/.test(e.nodeName)}(e)&&e[n]){var r=e[n];return"TR"===e.nodeName&&r[n]||r}return e},_p=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Tp=function(e,t,n,r,o){var i=st.fromDom(t),a=st.fromDom(e.create(r,o)),u=n?At(i):Rt(i);return Vt(a,u),n?(Ut(i,a),jt(a,i)):(zt(i,a),Ht(a,i)),a.dom()},Rp=function(e,t,n,r){return!(t=hf(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},Ap=function(e,t,n,r,o){var i,a=e.dom;if(!function(e,t,n){return!!Sp(t,n.inline)||!!Sp(t,n.block)||(n.selector?an(t)&&e.is(t,n.selector):void 0)}(a,r,t)&&!function(e,t){return t.links&&"A"===e.nodeName}(r,t))return Cp.keep();var u=r;if(t.inline&&"all"===t.remove&&_(t.preserve_attributes)){var c=V(a.getAttribs(u),function(e){return M(t.preserve_attributes,e.name.toLowerCase())});if(a.removeAllAttribs(u),z(c,function(e){return a.setAttrib(u,e.name,e.value)}),c.length>0)return Cp.rename("span")}if("all"!==t.remove){xp(t.styles,function(e,r){e=xf(a,Cf(e,n),r),"number"==typeof r&&(r=e,o=null),(t.remove_similar||!o||Sp(Sf(a,o,r),e))&&a.setStyle(u,r,""),i=!0}),i&&""===a.getAttrib(u,"style")&&(u.removeAttribute("style"),u.removeAttribute("data-mce-style")),xp(t.attributes,function(e,r){var i;if(e=Cf(e,n),"number"==typeof r&&(r=e,o=null),t.remove_similar||!o||Sp(a.getAttrib(o,r),e)){if("class"===r&&(e=a.getAttrib(u,r))&&(i="",z(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(i+=(i?" ":"")+e)}),i))return void a.setAttrib(u,r,i);"class"===r&&u.removeAttribute("className"),wp.test(r)&&u.removeAttribute("data-mce-"+r),u.removeAttribute(r)}}),xp(t.classes,function(e){e=Cf(e,n),o&&!a.hasClass(o,e)||a.removeClass(u,e)});for(var s=a.getAttribs(u),f=0;f<s.length;f++){var l=s[f].nodeName;if(0!==l.indexOf("_")&&0!==l.indexOf("data-"))return Cp.keep()}}return"none"!==t.remove?(function(e,t,n){var r,o=t.parentNode,i=e.dom,a=Cc(e);n.block&&(a?o===i.getRoot()&&(n.list_block&&Sp(t,n.list_block)||z(ee(t.childNodes),function(t){yf(e,a,t.nodeName.toLowerCase())?r?r.appendChild(t):(r=_p(i,t,a),i.setAttribs(r,e.settings.forced_root_block_attrs)):r=0})):i.isBlock(t)&&!i.isBlock(o)&&(Rp(i,t,!1)||Rp(i,t.firstChild,!0,!0)||t.insertBefore(i.create("br"),t.firstChild),Rp(i,t,!0)||Rp(i,t.lastChild,!1,!0)||t.appendChild(i.create("br")))),n.selector&&n.inline&&!Sp(n.inline,t)||i.remove(t,!0)}(e,u,t),Cp.removed()):Cp.keep()},Dp=function(e,t,n,r,o){return Ap(e,t,n,r,o).fold(h,function(t){return e.dom.rename(r,t),!0},v)},Op=function(e,t,n,r){return Ap(e,t,n,r,r).fold(l(r),function(t){return e.dom.createFragment().appendChild(r),e.dom.rename(r,t)},l(null))},Bp=function(e,t,n,r,o){var i=e.formatter.get(t),a=i[0],u=!0,c=e.dom,s=e.selection,f=function(r){var u=function(e,t,n,r,o){var i;return z(Ef(e.dom,t.parentNode).reverse(),function(t){if(!i&&"_start"!==t.id&&"_end"!==t.id){var a=Wm(e,t,n,r,o);a&&!1!==a.split&&(i=t)}}),i}(e,r,t,n,o);return function(e,t,n,r,o,i,a,u){var c,s,f,l=e.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){c=l.clone(m,!1);for(var p=0;p<t.length&&null!==(c=Op(e,t[p],u,c));p++);c&&(s&&c.appendChild(s),f||(f=c),s=c)}!i||a.mixed&&l.isBlock(n)||(r=l.split(n,r)),s&&(o.parentNode.insertBefore(s,o),f.appendChild(o),a.inline&&hp(l,a,0,s))}return r}(e,i,u,r,r,!0,a,n)},l=function(t){var r,o;an(t)&&c.getContentEditable(t)&&(r=u,u="true"===c.getContentEditable(t),o=!0);var s=ee(t.childNodes);if(u&&!o)for(var f=0;f<i.length&&!Dp(e,i[f],n,t,t);f++);if(a.deep&&s.length){for(f=0;f<s.length;f++)l(s[f]);o&&(u=r)}},d=function(e){var t=c.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return function(e){return ff(e)&&an(e)&&("_start"===e.id||"_end"===e.id)}(n)&&(n=n[e?"firstChild":"lastChild"]),pn(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),c.remove(t,!0),n},m=function(t){var n,r,o=Uf(e,t,i,!0);if(a.split){if(o=zm(o),(n=Ep(e,o,!0))!==(r=Ep(e,o))){if(n=kp(n,!0),r=kp(r,!1),Np(c,n,r)){var u=w.from(n.firstChild).getOr(n);return f(Tp(c,u,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void d(!0)}if(Np(c,r,n)){u=w.from(r.lastChild).getOr(r);return f(Tp(c,u,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void d(!1)}n=_p(c,n,"span",{id:"_start","data-mce-type":"bookmark"}),r=_p(c,r,"span",{id:"_end","data-mce-type":"bookmark"});var s=c.createRng();s.setStartAfter(n),s.setEndBefore(r),jf(c,s,function(e){z(e,function(e){ff(e)||ff(e.parentNode)||f(e)})}),f(n),f(r),n=d(!0),r=d()}else n=r=f(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=c.nodeIndex(n),o.endContainer=r.parentNode?r.parentNode:r,o.endOffset=c.nodeIndex(r)+1}jf(c,o,function(t){z(t,function(t){l(t);z(["underline","line-through","overline"],function(n){an(t)&&e.dom.getStyle(t,"text-decoration")===n&&t.parentNode&&Nf(c,t.parentNode)===n&&Dp(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,t)})})})};if(r)if(pf(r)){var p=c.createRng();p.setStartBefore(r),p.setEndAfter(r),m(p)}else m(r);else if("false"!==c.getContentEditable(s.getNode()))s.isCollapsed()&&a.inline&&!$f(e).length?op(e,t,n,o):(Qf(s,!0,function(){Jf(e,m)}),a.inline&&Km(e,t,n,s.getStart())&&gf(c,s,s.getRng()),e.nodeChanged());else{r=s.getNode();for(var g=0;g<i.length&&(!i[g].ceFalseOverride||!Dp(e,i[g],n,r,r));g++);}},Pp=ut.each,Lp=function(e,t,n,r){Pp(t,function(t){Pp(e.dom.select(t.inline,r),function(r){mp(r)&&Dp(e,t,n,r,t.exact?r:null)}),function(e,t,n){if(t.clear_child_styles){var r=t.links?"*:not(a)":"*";dp(e.select(r,n),function(n){mp(n)&&dp(t.styles,function(t,r){e.setStyle(n,r,"")})})}}(e.dom,t,r)})},Ip=ut.each,Mp=function(e,t,n,r){var o,i=e.formatter.get(t),a=i[0],u=!r&&e.selection.isCollapsed(),c=e.dom,s=e.selection,f=function(e,t){if(t=t||a,e){if(t.onformat&&t.onformat(e,t,n,r),Ip(t.styles,function(t,r){c.setStyle(e,r,Cf(t,n))}),t.styles){var o=c.getAttrib(e,"style");o&&c.setAttrib(e,"data-mce-style",o)}Ip(t.attributes,function(t,r){c.setAttrib(e,r,Cf(t,n))}),Ip(t.classes,function(t){t=Cf(t,n),c.hasClass(e,t)||c.addClass(e,t)})}},l=function(e,t){var n=!1;return!!a.selector&&(Ip(e,function(e){if(!("collapsed"in e&&e.collapsed!==u))return c.is(t,e.selector)&&!Qs(t)?(f(t,e),n=!0,!1):void 0}),n)},d=function(r,o,u,c){var s=[],d=!0,m=a.inline||a.block,p=r.create(m);f(p),jf(r,o,function(o){var u,g=function(o){var h=!1,v=d,y=o.nodeName.toLowerCase(),b=o.parentNode.nodeName.toLowerCase();if(an(o)&&r.getContentEditable(o)&&(v=d,d="true"===r.getContentEditable(o),h=!0),wf(y,"br"))return u=0,void(a.block&&r.remove(o));if(a.wrapper&&Wm(e,o,t,n))u=0;else{if(d&&!h&&a.block&&!a.wrapper&&vf(e,y)&&yf(e,b,m))return o=r.rename(o,m),f(o),s.push(o),void(u=0);if(a.selector){var C=l(i,o);if(!a.inline||C)return void(u=0)}!d||h||!yf(e,m,y)||!yf(e,b,m)||!c&&3===o.nodeType&&1===o.nodeValue.length&&65279===o.nodeValue.charCodeAt(0)||Qs(o)||a.inline&&r.isBlock(o)?(u=0,Ip(ut.grep(o.childNodes),g),h&&(d=v),u=0):(u||(u=r.clone(p,!1),o.parentNode.insertBefore(u,o),s.push(u)),u.appendChild(o))}};Ip(o,g)}),!0===a.links&&Ip(s,function(e){var t=function(e){"A"===e.nodeName&&f(e,a),Ip(ut.grep(e.childNodes),t)};t(e)}),Ip(s,function(o){var u=function(e){var t=!1;return Ip(e.childNodes,function(e){if(function(e){return e&&1===e.nodeType&&!ff(e)&&!Qs(e)&&!fn(e)}(e))return t=e,!1}),t},c=function(e){var t=0;return Ip(e.childNodes,function(e){(function(e){return e&&pn(e)&&0===e.length})(e)||ff(e)||t++}),t}(o);!(s.length>1)&&r.isBlock(o)||0!==c?(a.inline||a.wrapper)&&(a.exact||1!==c||(o=function(e){var t,n=u(e);return n&&!ff(n)&&qm(r,n,a)&&(t=r.clone(n,!1),f(t),r.replace(t,e,!0),r.remove(n,!0)),t||e}(o)),Lp(e,i,n,o),function(e,t,n,r,o){Wm(e,o.parentNode,n,r)&&Dp(e,t,r,o)||t.merge_with_parents&&e.dom.getParent(o.parentNode,function(i){if(Wm(e,i,n,r))return Dp(e,t,r,o),!0})}(e,a,t,n,o),function(e,t,n,r){t.styles&&t.styles.backgroundColor&&vp(r,yp(e,"fontSize"),bp(e,"backgroundColor",Cf(t.styles.backgroundColor,n)))}(r,a,n,o),function(e,t,n,r){var o=function(t){if(1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType){var n=Nf(e,t.parentNode);e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null)}};t.styles&&(t.styles.color||t.styles.textDecoration)&&(ut.walk(r,o,"childNodes"),o(r))}(r,a,0,o),function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(vp(r,yp(e,"fontSize"),bp(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))}(r,a,0,o),hp(r,a,0,o)):r.remove(o,!0)})};if("false"!==c.getContentEditable(s.getNode())){if(a){if(r)pf(r)?l(i,r)||((o=c.createRng()).setStartBefore(r),o.setEndAfter(r),d(c,Uf(e,o,i),0,!0)):d(c,r,0,!0);else if(u&&a.inline&&!$f(e).length)!function(e,t,n){var r,o,i=e.selection,a=i.getRng(),u=a.startOffset,c=a.startContainer.nodeValue;(r=Zs(e.getBody(),i.getStart()))&&(o=Qm(r));var s,f,l=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(c&&u>0&&u<c.length&&l.test(c.charAt(u))&&l.test(c.charAt(u-1))){var d=i.getBookmark();a.collapse(!0);var m=Uf(e,a,e.formatter.get(t));m=zm(m),e.formatter.apply(t,n,m),i.moveToBookmark(d)}else r&&"\ufeff"===o.nodeValue?e.formatter.apply(t,n,r):(s=e.getDoc(),f=Zm(!0).dom(),o=(r=s.importNode(f,!0)).firstChild,a.insertNode(r),u=1,e.formatter.apply(t,n,r)),i.setCursorLocation(o,u)}(e,t,n);else{var m=s.getNode();e.settings.forced_root_block||!i[0].defaultBlock||c.getParent(m,c.isBlock)||Mp(e,i[0].defaultBlock),s.setRng(Vd(s.getRng())),Qf(s,!0,function(t){Jf(e,function(t,n){var r=n?t:Uf(e,t,i);d(c,r)})}),gf(c,s,s.getRng()),e.nodeChanged()}!function(e,t){sp(up[e],function(e){e(t)})}(t,e)}}else{r=s.getNode();for(var p=0,g=i.length;p<g;p++)if(i[p].ceFalseOverride&&c.is(r,i[p].selector))return void f(r,i[p])}},Fp=function(e,t){return U(t,function(t){var n=e.fire("GetSelectionRange",{range:t});return n.range!==t?n.range:t})},Up=function(t,n){var r=(n||e.document).createDocumentFragment();return z(t,function(e){r.appendChild(e.dom())}),st.fromDom(r)},zp=function(e,t,n){return{element:l(e),width:l(t),rows:l(n)}},jp=function(e,t){return{element:l(e),cells:l(t)}},Hp=function(e,t){return{x:l(e),y:l(t)}},Vp=function(e,t){var n=parseInt(En(e,t),10);return isNaN(n)?1:n},qp=function(e,t,n){var r=e.rows();return!!(r[n]?r[n].cells():[])[t]},$p=function(e){return $(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},Wp=function(e,t){for(var n=e.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Ct(o[i],t))return w.some(Hp(i,r));return w.none()},Kp=function(e,t,n,r,o){for(var i=[],a=e.rows(),u=n;u<=o;u++){var c=a[u].cells(),s=t<r?c.slice(t,r+1):c.slice(r,t+1);i.push(jp(a[u].element(),s))}return i},Xp=function(e){var t=zp(za(e),0,[]);return z(xa(e,"tr"),function(e,n){z(xa(e,"td,th"),function(r,o){!function(e,t,n,r,o){for(var i=Vp(o,"rowspan"),a=Vp(o,"colspan"),u=e.rows(),c=n;c<n+i;c++){u[c]||(u[c]=jp(ja(r),[]));for(var s=t;s<t+a;s++)u[c].cells()[s]=c===n&&s===t?o:za(o)}}(t,function(e,t,n){for(;qp(e,t,n);)t++;return t}(t,o,n),n,e,r)})}),zp(t.element(),$p(t.rows()),t.rows())},Yp=function(e){return function(e,t){var n=za(e.element()),r=st.fromTag("tbody");return Vt(r,t),Ht(n,r),n}(e,function(e){return U(e.rows(),function(e){var t=U(e.cells(),function(e){var t=ja(e);return kn(t,"colspan"),kn(t,"rowspan"),t}),n=za(e.element());return Vt(n,t),n})}(e))},Gp=function(e,t,n){return Wp(e,t).bind(function(t){return Wp(e,n).map(function(n){return function(e,t,n){var r=t.x(),o=t.y(),i=n.x(),a=n.y(),u=o<a?Kp(e,r,o,i,a):Kp(e,r,a,i,o);return zp(e.element(),$p(u),u)}(e,t,n)})})},Jp=function(e,t){return W(e,function(e){return"li"===ft(e)&&Xf(e,t)}).fold(l([]),function(t){return function(e){return W(e,function(e){return"ul"===ft(e)||"ol"===ft(e)})}(e).map(function(e){var t=st.fromTag(ft(e)),n=se(Dn(e),function(e,t){return Pe(t,"list-style")});return _n(t,n),[st.fromTag("li"),t]}).getOr([])})},Qp=function(e,t){var n=st.fromDom(t.commonAncestorContainer),r=td(n,e),o=V(r,function(e){return Un(e)||Mn(e)}),i=Jp(r,t),a=o.concat(i.length?i:function(e){return Vn(e)?kt(e).filter(Hn).fold(l([]),function(t){return[e,t]}):Hn(e)?[e]:[]}(n));return U(a,za)},Zp=function(){return Up([])},eg=function(e,t){return n=st.fromDom(t.cloneContents()),r=Qp(e,t),o=$(r,function(e,t){return Ht(t,e),t},n),r.length>0?Up([o]):o;var n,r,o},tg=function(e,t){return(n=e,r=t[0],ka(r,"table",m(Ct,n))).bind(function(e){var n=t[0],r=t[t.length-1],o=Xp(e);return Gp(o,n,r).map(function(e){return Up([Yp(e)])})}).getOrThunk(Zp);var n,r},ng=function(e,t){var n=qf(t,e);return n.length>0?tg(e,n):function(e,t){return t.length>0&&t[0].collapsed?Zp():eg(e,t[0])}(e,t)},rg=function(e,t){return t>=0&&t<e.length&&df(e.charAt(t))},og=function(e){var t=Wa(e.innerText);return nt.browser.isIE()?function(e){return e.replace(/^[ \f\n\r\t\v]+/,"")}(t):t},ig=function(e,t,n){if(void 0===n&&(n={}),n.get=!0,n.format=t,n.selection=!0,(n=e.fire("BeforeGetContent",n)).isDefaultPrevented())return e.fire("GetContent",n),n.content;if("text"===n.format)return function(e){return w.from(e.selection.getRng()).map(function(t){var n=e.dom.add(e.getBody(),"div",{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},t.cloneContents()),r=og(n),o=Wa(n.textContent);if(e.dom.remove(n),rg(o,0)||rg(o,o.length-1)){var i=e.dom.getParent(t.commonAncestorContainer,e.dom.isBlock),a=og(i),u=a.indexOf(r);return-1!==u?(rg(a,u-1)?" ":"")+r+(rg(a,u+r.length)?" ":""):r}return r}).getOr("")}(e);n.getInner=!0;var r=function(e,t){var n=e.selection.getRng(),r=e.dom.create("body"),o=e.selection.getSel(),i=Fp(e,Hf(o)),a=t.contextual?ng(st.fromDom(e.getBody()),i).dom():n.cloneContents();return a&&r.appendChild(a),e.selection.serializer.serialize(r,t)}(e,n);return"tree"===n.format?r:(n.content=e.selection.isCollapsed()?"":r,e.fire("GetContent",n),n.content)},ag=function(e){return an(e)?e.outerHTML:pn(e)?lr.encodeRaw(e.data,!1):gn(e)?"\x3c!--"+e.data+"--\x3e":""},ug=function(t,n,r){var o=function(t){var n,r=e.document.createElement("div"),o=e.document.createDocumentFragment();for(t&&(r.innerHTML=t);n=r.firstChild;)o.appendChild(n);return o}(n);if(t.hasChildNodes()&&r<t.childNodes.length){var i=t.childNodes[r];i.parentNode.insertBefore(o,i)}else t.appendChild(o)},cg=function(e,t){var n,r,o,i,a,u,c,s,f,l=U(ee(t.childNodes),ag);return function(e,t){var n=0;z(e,function(e){0===e[0]?n++:1===e[0]?(ug(t,e[1],n),n++):2===e[0]&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(t,n)})}((r=e,o=(n=l).length+r.length+2,i=new Array(o),a=new Array(o),u=function(e,t,o,i,a){var c=s(e,t,o,i);if(null===c||c.start===t&&c.diag===t-i||c.end===e&&c.diag===e-o)for(var f=e,l=o;f<t||l<i;)f<t&&l<i&&n[f]===r[l]?(a.push([0,n[f]]),++f,++l):t-e>i-o?(a.push([2,n[f]]),++f):(a.push([1,r[l]]),++l);else{u(e,c.start,o,c.start-c.diag,a);for(var d=c.start;d<c.end;++d)a.push([0,n[d]]);u(c.end,t,c.end-c.diag,i,a)}},c=function(e,t,o,i){for(var a=e;a-t<i&&a<o&&n[a]===r[a-t];)++a;return function(e,t,n){return{start:e,end:t,diag:n}}(e,a,t)},s=function(e,t,o,u){var s=t-e,f=u-o;if(0===s||0===f)return null;var l,d,m,p,g,h=s-f,v=f+s,y=(v%2==0?v:v+1)/2;for(i[1+y]=e,a[1+y]=t+1,l=0;l<=y;++l){for(d=-l;d<=l;d+=2){for(m=d+y,d===-l||d!==l&&i[m-1]<i[m+1]?i[m]=i[m+1]:i[m]=i[m-1]+1,g=(p=i[m])-e+o-d;p<t&&g<u&&n[p]===r[g];)i[m]=++p,++g;if(h%2!=0&&h-l<=d&&d<=h+l&&a[m-h]<=i[m])return c(a[m-h],d+e-o,t,u)}for(d=h-l;d<=h+l;d+=2){for(m=d+y-h,d===h-l||d!==h+l&&a[m+1]<=a[m-1]?a[m]=a[m+1]-1:a[m]=a[m-1],g=(p=a[m]-1)-e+o-d;p>=e&&g>=o&&n[p]===r[g];)a[m]=p--,g--;if(h%2==0&&-l<=d&&d<=l&&a[m]<=i[m+h])return c(a[m],d+e-o,t,u)}}},f=[],u(0,n.length,0,r.length,f),f),t),t},sg=ia(w.none()),fg=function(e){var t,n=(t=e.getBody(),V(U(ee(t.childNodes),ag),function(e){return e.length>0})),r=X(n,function(t){var n=kl(e.serializer,t);return n.length>0?[n]:[]}),o=r.join("");return-1!==o.indexOf("</iframe>")?function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}}(r):function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}}(o)},lg=function(e,t,n){"fragmented"===t.type?cg(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},dg=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},mg=function(t){var n=st.fromTag("body",sg.get().getOrThunk(function(){var t=e.document.implementation.createHTMLDocument("undo");return sg.set(w.some(t)),t}));return Fa(n,dg(t)),z(xa(n,"*[data-mce-bogus]"),Wt),n.dom().innerHTML},pg=function(e,t){return!(!e||!t)&&(!!function(e,t){return dg(e)===dg(t)}(e,t)||function(e,t){return mg(e)===mg(t)}(e,t))},gg=function(e){return 0===e.get()},hg=function(e,t,n){gg(n)&&(e.typing=t)},vg=function(e,t){e.typing&&(hg(e,!1,t),e.add())},yg=function(e){return e instanceof fl},bg=function(e,t){Lm(e.serializer.getNodeFilters(),e.serializer.getAttributeFilters(),t)},Cg=function(e){return{undoManager:{beforeChange:function(t,n){return function(e,t,n){gg(t)&&n.set(w.some(hc(e.selection)))}(e,t,n)},addUndoLevel:function(t,n,r,o,i,a){return function(e,t,n,r,o,i,a){var u=fg(e);if(i=i||{},i=ut.extend(i,u),!1===gg(r)||e.removed)return null;var c=t.data[n.get()];if(e.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:a}).isDefaultPrevented())return null;if(c&&pg(c,i))return null;t.data[n.get()]&&o.get().each(function(e){t.data[n.get()].beforeBookmark=e});var s=function(e){return e.getParam("custom_undo_redo_levels",0,"number")}(e);if(s&&t.data.length>s){for(var f=0;f<t.data.length-1;f++)t.data[f]=t.data[f+1];t.data.length--,n.set(t.data.length)}i.bookmark=hc(e.selection),n.get()<t.data.length-1&&(t.data.length=n.get()+1),t.data.push(i),n.set(t.data.length-1);var l={level:i,lastLevel:c,originalEvent:a};return e.fire("AddUndo",l),n.get()>0&&(e.setDirty(!0),e.fire("change",l)),i}(e,t,n,r,o,i,a)},undo:function(t,n,r){return function(e,t,n,r){var o;return t.typing&&(t.add(),t.typing=!1,hg(t,!1,n)),r.get()>0&&(r.set(r.get()-1),o=t.data[r.get()],lg(e,o,!0),e.setDirty(!0),e.fire("Undo",{level:o})),o}(e,t,n,r)},redo:function(t,n){return function(e,t,n){var r;return t.get()<n.length-1&&(t.set(t.get()+1),r=n[t.get()],lg(e,r,!1),e.setDirty(!0),e.fire("Redo",{level:r})),r}(e,t,n)},clear:function(t,n){return function(e,t,n){t.data=[],n.set(0),t.typing=!1,e.fire("ClearUndos")}(e,t,n)},reset:function(e){return function(e){e.clear(),e.add()}(e)},hasUndo:function(t,n){return function(e,t,n){return n.get()>0||t.typing&&t.data[0]&&!pg(fg(e),t.data[0])}(e,t,n)},hasRedo:function(e,t){return function(e,t){return t.get()<e.data.length-1&&!e.typing}(e,t)},transact:function(e,t,n){return function(e,t,n){return vg(e,t),e.beforeChange(),e.ignore(n),e.add()}(e,t,n)},ignore:function(e,t){return function(e,t){try{e.set(e.get()+1),t()}finally{e.set(e.get()-1)}}(e,t)},extra:function(t,n,r,o){return function(e,t,n,r,o){if(t.transact(r)){var i=t.data[n.get()].bookmark,a=t.data[n.get()-1];lg(e,a,!0),t.transact(o)&&(t.data[n.get()-1].beforeBookmark=i)}}(e,t,n,r,o)}},formatter:{apply:function(t,n,r){return Mp(e,t,n,r)},remove:function(t,n,r,o){return Bp(e,t,n,r,o)},toggle:function(t,n,r){return function(e,t,n,r){var o=e.formatter.get(t);!Km(e,t,n,r)||"toggle"in o[0]&&!o[0].toggle?Mp(e,t,n,r):Bp(e,t,n,r)}(e,t,n,r)}},editor:{getContent:function(t,n){return function(e,t,n){return w.from(e.getBody()).fold(l("tree"===t.format?new fl("body",11):""),function(r){return Tl(e,t,n,r)})}(e,t,n)},setContent:function(t,n){return Fm(e,t,n)},insertContent:function(t,n){return Zd(e,t,n)}},selection:{getContent:function(t,n){return ig(e,t,n)}},raw:{getModel:function(){return w.none()}}}},wg=function(e){return de(e.plugins,"rtc")},xg=function(e){var t=e;return le(e.plugins,"rtc").fold(function(){return t.rtcInstance=Cg(e),w.none()},function(n){return w.some(n.setup().then(function(n){return t.rtcInstance=function(e,t){var n=function(e){return k(e)?e:{}},r=g("Unimplemented feature for rtc");return{undoManager:{beforeChange:s,addUndoLevel:r,undo:function(){return t.undo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},redo:function(){return t.redo(),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},clear:r,reset:r,hasUndo:function(){return t.hasUndo()},hasRedo:function(){return t.hasRedo()},transact:function(e,n,r){return t.transact(r),{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},ignore:r,extra:r},formatter:{apply:function(e,r,o){return t.applyFormat(e,n(r))},remove:function(e,r,o,i){return t.removeFormat(e,n(r))},toggle:function(e,r,o){return t.toggleFormat(e,n(r))}},editor:{getContent:function(n,r){if("html"===r||"tree"===r){var o=t.getContent(),i=ml({inner:!0});return bg(e,o),"tree"===r?o:i.serialize(o)}return Cg(e).editor.getContent(n,r)},setContent:function(n,r){var o=yg(n)?n:e.parser.parse(n,{isRootContent:!0,insert:!0});return t.setContent(o),n},insertContent:function(n,r){var o=yg(n)?n:e.parser.parse(n,{insert:!0});t.insertContent(o)}},selection:{getContent:function(n,r){if("html"===n||"tree"===n){var o=t.getSelectedContent(),i=ml({});return bg(e,o),"tree"===n?o:i.serialize(o)}return Cg(e).selection.getContent(n,r)}},raw:{getModel:function(){return w.some(t.getRawModel())}}}}(e,n),n.isRemote}))})},Sg=function(e){return e.rtcInstance?e.rtcInstance:Cg(e)},Ng=function(e){var t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")},Eg=function(e,t){return void 0===t&&(t={}),function(e,t,n){return Sg(e).editor.getContent(t,n)}(e,t,t.format?t.format:"html")},kg=function(e,t,n){return void 0===n&&(n={}),function(e,t,n){return Sg(e).editor.setContent(t,n)}(e,t,n)},_g=ea.DOM,Tg=function(e){return w.from(e).each(function(e){return e.destroy()})},Rg=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&_g.remove(o.nextSibling),function(e){e.fire("remove")}(e),e.editorManager.remove(e),!e.inline&&r&&function(e){_g.setStyle(e.id,"display",e.orgDisplay)}(e),function(e){e.fire("detach")}(e),_g.remove(e.getContainer()),Tg(t),Tg(n),e.destroy()}},Ag=function(e,t){var n=e.selection,r=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Tg(n),Tg(r)),function(e){var t=e.formElement;t&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,t._mceOldSubmit=null),_g.unbind(t,"submit reset",e.formEventDelegate))}(e),function(e){e.contentAreaContainer=e.formElement=e.container=e.editorContainer=null,e.bodyElement=e.contentDocument=e.contentWindow=null,e.iframeElement=e.targetElm=null,e.selection&&(e.selection=e.selection.win=e.selection.dom=e.selection.dom.doc=null)}(e),e.destroyed=!0):e.remove())},Dg=Object.prototype.hasOwnProperty,Og=(fp=function(e,t){return k(e)&&k(t)?Og(e,t):t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Dg.call(o,i)&&(n[i]=fp(n[i],o[i]))}return n}),Bg=Ke().deviceType,Pg=Bg.isTouch(),Lg=Bg.isPhone(),Ig=Bg.isTablet(),Mg=["lists","autolink","autosave"],Fg={table_grid:!1,object_resizing:!1,resize:!1},Ug=function(e){var t=_(e)?e.join(" "):e,n=U(E(t)?t.split(" "):[],Ie);return V(n,function(e){return e.length>0})},zg=function(e,t){var n=ce(t,function(t,n){return M(e,n)});return function(e,t){return{sections:l(e),settings:l(t)}}(n.t,n.f)},jg=function(e,t){return e.sections().hasOwnProperty(t)},Hg=function(e,t){return le(e,"toolbar_mode").orThunk(function(){return le(e,"toolbar_drawer").map(function(e){return!1===e?"wrap":e})}).getOr(t)},Vg=function(e,t){var n={resize:!1,toolbar_mode:Hg(e,"scrolling"),toolbar_sticky:!1};return we(we(we({},Fg),n),t?{menubar:!1}:{})},qg=function(e,t){var n=t.external_plugins?t.external_plugins:{};return e&&e.external_plugins?ut.extend({},e.external_plugins,n):n},$g=function(e,t,n,r){var o=Ug(n.forced_plugins),i=Ug(r.plugins),a=function(e,t){return jg(e,t)?e.sections()[t]:{}}(t,"mobile"),u=a.plugins?Ug(a.plugins):i,c=function(e,t){return[].concat(Ug(e)).concat(Ug(t))}(o,e&&function(e,t,n){var r=e.sections();return jg(e,t)&&r[t].theme===n}(t,"mobile","mobile")?V(u,m(M,Mg)):e&&jg(t,"mobile")?u:i);return ut.extend(r,{plugins:c.join(" ")})},Wg=function(e,t,n,r,o){var i=e?{mobile:Vg(o.mobile||{},t)}:{},a=zg(["mobile"],Og(i,o)),u=ut.extend(n,r,a.settings(),function(e,t){return e&&jg(t,"mobile")}(e,a)?function(e,t,n){void 0===n&&(n={});var r=e.sections(),o=r.hasOwnProperty(t)?r[t]:{};return ut.extend({},n,o)}(a,"mobile"):{},{validate:!0,external_plugins:qg(r,a.settings())});return $g(e,a,r,u)},Kg=function(e,t,n,r,o){var i=function(e,t,n,r,o){var i={id:t,theme:"silver",toolbar_mode:Hg(e,"floating"),plugins:"",document_base_url:n,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:o.convertURL,url_converter_scope:o};return we(we({},i),r?Fg:{})}(o,t,n,Pg,e);return Wg(Lg||Ig,Lg,i,r,o)},Xg=function(e,t,n){return w.from(t.settings[n]).filter(e)},Yg=function(e,t,n,r){var o,i=t in e.settings?e.settings[t]:n;return"hash"===r?function(e){var t={};return"string"==typeof e?z(e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(","),function(e){var n=e.split("=");n.length>1?t[ut.trim(n[0])]=ut.trim(n[1]):t[ut.trim(n[0])]=ut.trim(n[0])}):t=e,t}(i):"string"===r?Xg(E,e,t).getOr(n):"number"===r?Xg(O,e,t).getOr(n):"boolean"===r?Xg(R,e,t).getOr(n):"object"===r?Xg(k,e,t).getOr(n):"array"===r?Xg(_,e,t).getOr(n):"string[]"===r?Xg((o=E,function(e){return _(e)&&Y(e,o)}),e,t).getOr(n):"function"===r?Xg(D,e,t).getOr(n):i},Gg=(lp={},{add:function(e,t){lp[e]=t},get:function(e){return lp[e]?lp[e]:{icons:{}}},has:function(e){return de(lp,e)}}),Jg=function(e,t){return t.dom()[e]},Qg=function(e,t){return parseInt(Tn(t,e),10)},Zg=m(Jg,"clientWidth"),eh=m(Jg,"clientHeight"),th=m(Qg,"margin-top"),nh=m(Qg,"margin-left"),rh=function(e,t,n){var r,o=st.fromDom(e.getBody()),i=e.inline?o:(r=o,st.fromDom(r.dom().ownerDocument.documentElement)),a=function(e,t,n,r){var o=function(e){return e.dom().getBoundingClientRect()}(t);return{x:n-(e?o.left+t.dom().clientLeft+nh(t):0),y:r-(e?o.top+t.dom().clientTop+th(t):0)}}(e.inline,i,t,n);return function(e,t,n){var r=Zg(e),o=eh(e);return t>=0&&n>=0&&t<=r&&n<=o}(i,a.x,a.y)},oh=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,w.from(t).map(st.fromDom)).map(function(e){return xt(St(e),e)}).getOr(!1)};function ih(e){var t=[],n=function(){var t,n=e.theme;return n&&n.getNotificationManagerImpl?n.getNotificationManagerImpl():{open:t=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:t,reposition:t,getArgs:t}},r=function(){return w.from(t[0])},o=function(){t.length>0&&n().reposition(t)},i=function(e){K(t,function(t){return t===e}).each(function(e){t.splice(e,1)})},a=function(a){if(!e.removed&&oh(e))return W(t,function(e){return t=n().getArgs(e),r=a,!(t.type!==r.type||t.text!==r.text||t.progressBar||t.timeout||r.progressBar||r.timeout);var t,r}).getOrThunk(function(){e.editorManager.setActive(e);var u=n().open(a,function(){i(u),o(),r().fold(function(){return e.focus()},function(e){return em(st.fromDom(e.getEl()))})});return function(e){t.push(e)}(u),o(),u})};return function(e){e.on("SkinLoaded",function(){var t=Lc(e);t&&a({text:t,type:"warning",timeout:0})}),e.on("ResizeEditor ResizeWindow NodeChange",function(){Vi.requestAnimationFrame(o)}),e.on("remove",function(){z(t.slice(),function(e){n().close(e)})})}(e),{open:a,close:function(){r().each(function(e){n().close(e),i(e),o()})},getNotifications:function(){return t}}}var ah=la.PluginManager,uh=la.ThemeManager;var ch=function(e){var t=[],n=function(){var t,n=e.theme;return n&&n.getWindowManagerImpl?n.getWindowManagerImpl():{open:t=function(){throw new Error("Theme did not provide a WindowManager implementation.")},openUrl:t,alert:t,confirm:t,close:t,getParams:t,setParams:t}},r=function(e,t){return function(){return t?t.apply(e,arguments):void 0}},o=function(n){t.push(n),function(t){e.fire("OpenWindow",{dialog:t})}(n)},i=function(n){!function(t){e.fire("CloseWindow",{dialog:t})}(n),0===(t=V(t,function(e){return e!==n})).length&&e.focus()},a=function(t){e.editorManager.setActive(e),vm(e);var n=t();return o(n),n};return e.on("remove",function(){z(t,function(e){n().close(e)})}),{open:function(e,t){return a(function(){return n().open(e,t,i)})},openUrl:function(e){return a(function(){return n().openUrl(e,i)})},alert:function(e,t,o){n().alert(e,r(o||this,t))},confirm:function(e,t,o){n().confirm(e,r(o||this,t))},close:function(){w.from(t[t.length-1]).each(function(e){n().close(e),i(e)})}}},sh=function(e,t){e.notificationManager.open({type:"error",text:t})},fh=function(e,t){e._skinLoaded?sh(e,t):e.on("SkinLoaded",function(){sh(e,t)})},lh=function(t,n,r){!function(e,t,n){e.fire(t,n)}(t,n,{message:r}),e.console.error(r)},dh=function(e,t,n){return n?"Failed to load "+e+": "+n+" from url "+t:"Failed to load "+e+" url: "+t},mh=function(e,t,n){lh(e,"PluginLoadError",dh("plugin",t,n))},ph=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=e.window.console;o&&(o.error?o.error.apply(o,xe([t],n)):o.log.apply(o,xe([t],n)))},gh=function(e){var t=function(e){var t=e.getParam("content_css");return E(t)?U(t.split(","),Ie):_(t)?t:!1===t||e.inline?[]:["default"]}(e),n=e.editorManager.baseURL+"/skins/content",r="content"+e.editorManager.suffix+".css",o=!0===e.inline;return U(t,function(t){return function(e){return/^[a-z0-9\-]+$/i.test(e)}(t)&&!o?n+"/"+t+"/"+r:e.documentBaseURI.toAbsolute(t)})};var hh=function(e,t){var n=function(n){var r=t(n);if(r<=0||null===r){var o=Tn(n,e);return parseFloat(o)||0}return r},r=function(e,t){return $(t,function(t,n){var r=Tn(e,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?t:t+o},0)};return{set:function(t,n){if(!O(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);var r=t.dom();wn(r)&&(r.style[e]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(e,t,n){var o=r(e,n);return t>o?t-o:0}}}("height",function(e){var t=e.dom();return Kt(e)?t.getBoundingClientRect().height:t.offsetHeight}),vh=function(e,t){return e.view(t).fold(l([]),function(t){var n=e.owner(t),r=vh(e,n);return[t].concat(r)})},yh=Object.freeze({__proto__:null,view:function(t){return(t.dom()===e.document?w.none():w.from(t.dom().defaultView.frameElement)).map(st.fromDom)},owner:function(e){return St(e)}}),bh=function(t){var n=st.fromDom(e.document),r=Qt(n),o=function(e,t){var n=t.owner(e);return vh(t,n)}(t,yh),i=Jt(t),a=q(o,function(e,t){var n=Jt(t);return{left:e.left+n.left(),top:e.top+n.top()}},{left:0,top:0});return Yt(a.left+i.left()+r.left(),a.top+i.top()+r.top())},Ch=function(e){return"textarea"===ft(e)},wh=function(e,t){var n=function(e){var t=e.dom().ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement;if(n===e.dom())return Yt(n.offsetLeft,n.offsetTop);var i=Gt(r.pageYOffset,o.scrollTop),a=Gt(r.pageXOffset,o.scrollLeft),u=Gt(o.clientTop,n.clientTop),c=Gt(o.clientLeft,n.clientLeft);return Jt(e).translate(a-c,i-u)}(e),r=function(e){return hh.get(e)}(e);return{element:e,bottom:n.top()+r,height:r,pos:n,cleanup:t}},xh=function(e,t){var n=function(e,t){var n=Dt(e);if(0===n.length||Ch(e))return{element:e,offset:t};if(t<n.length&&!Ch(n[t]))return{element:n[t],offset:0};var r=n[n.length-1];return Ch(r)?{element:e,offset:t}:"img"===ft(r)?{element:r,offset:1}:pt(r)?{element:r,offset:el(r).length}:{element:r,offset:Dt(r).length}}(e,t),r=st.fromHtml('<span data-mce-bogus="all">\ufeff</span>');return Ut(n.element,r),wh(r,function(){return $t(r)})},Sh=function(e,t,n,r){_h(e,function(o,i){return Eh(e,t,n,r)},n)},Nh=function(e,t,n,r,o){var i={elm:r.element.dom(),alignToTop:o};(function(e,t){return e.fire("ScrollIntoView",t).isDefaultPrevented()})(e,i)||(n(t,Qt(t).top(),r,o),function(e,t){e.fire("AfterScrollIntoView",t)}(e,i))},Eh=function(e,t,n,r){var o=st.fromDom(e.getBody()),i=st.fromDom(e.getDoc());o.dom().offsetWidth;var a=xh(st.fromDom(n.startContainer),n.startOffset);Nh(e,i,t,a,r),a.cleanup()},kh=function(e,t,n,r){var o=st.fromDom(e.getDoc());Nh(e,o,n,function(e){return wh(st.fromDom(e),s)}(t),r)},_h=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(st.fromDom(r),st.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n)},Th=function(e,t,n,r){var o=e.pos;if(n)Zt(o.left(),o.top(),r);else{var i=o.top()-t+e.height;Zt(o.left(),i,r)}},Rh=function(e,t,n,r,o){var i=n+t,a=r.pos.top(),u=r.bottom,c=u-a>=n;if(a<t)Th(r,n,!1!==o,e);else if(a>i){Th(r,n,c?!1!==o:!0===o,e)}else u>i&&!c&&Th(r,n,!0===o,e)},Ah=function(e,t,n,r){var o=e.dom().defaultView.innerHeight;Rh(e,t,o,n,r)},Dh=function(t,n,r,o){var i=t.dom().defaultView.innerHeight;Rh(t,n,i,r,o);var a=bh(r.element),u=nn(e.window);a.top()<u.y?en(r.element,!1!==o):a.top()>u.bottom&&en(r.element,!0===o)},Oh=function(e,t,n){return Sh(e,Ah,t,n)},Bh=function(e,t,n){return kh(e,t,Ah,n)},Ph=function(e,t,n){return Sh(e,Dh,t,n)},Lh=function(e,t,n){return kh(e,t,Dh,n)},Ih=function(e,t,n){(e.inline?Oh:Ph)(e,t,n)},Mh=function(e){return bn(e)||Cn(e)},Fh=function(e,t,n){var r,o,i=n;if(i.caretPositionFromPoint)(o=i.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(i.body.createTextRange){r=i.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(a){r=function(e,t,n){var r,o=n.elementFromPoint(e,t),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),(r=(r=ut.toArray(i.getClientRects())).sort(function(e,n){return(e=Math.abs(Math.max(e.top-t,e.bottom-t)))-(n=Math.abs(Math.max(n.top-t,n.bottom-t)))})).length>0){t=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(e,t),i.collapse(!0),i}catch(a){}}return null}(e,t,n)}return function(e,t){var n=e&&e.parentElement?e.parentElement():null;return Cn(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(n,t,Mh))?null:e}(r,n.body)}return r},Uh=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return w.from(i).map(st.fromDom).map(function(e){return r&&t.collapsed?e:Ot(e,o(e,a)).getOr(e)}).bind(function(e){return mt(e)?w.some(e):kt(e).filter(mt)}).map(function(e){return e.dom()}).getOr(e)},zh=function(e,t,n){return Uh(e,t,!0,n,function(e,t){return Math.min(e.dom().childNodes.length,t)})},jh=function(e,t,n){return Uh(e,t,!1,n,function(e,t){return t>0?t-1:t})},Hh=function(e,t){for(var n=e;e&&pn(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},Vh=function(e,t){return void 0===t&&(t={}),function(e,t,n){return Ng(e).selection.getContent(t,n)}(e,t.format?t.format:"html",t)},qh=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},$h=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},Wh=function(e,t,n){return $h(e,t,function(e){return e.nodeName===n})},Kh=function(e){return e&&"TABLE"===e.nodeName},Xh=function(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)},Yh=function(e,t){return Ja(e)&&!1===$h(e,t,Qs)},Gh=function(e,t,n){for(var r=new xi(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(yn(t))return!0},Jh=function(e,t,n,r,o){var i,a,u=e.getRoot(),c=e.schema.getNonEmptyElements(),s=e.getParent(o.parentNode,e.isBlock)||u;if(r&&yn(o)&&t&&e.isEmpty(s))return w.some(Wu(o.parentNode,e.nodeIndex(o)));for(var f=new xi(o,s);a=f[r?"prev":"next"]();){if("false"===e.getContentEditableParent(a)||Yh(a,u))return w.none();if(pn(a)&&a.nodeValue.length>0)return!1===Wh(a,u,"A")?w.some(Wu(a,r?a.nodeValue.length:0)):w.none();if(e.isBlock(a)||c[a.nodeName.toLowerCase()])return w.none();i=a}return n&&i?w.some(Wu(i,0)):w.none()},Qh=function(e,t,n,r){var o,i,a,u,c=e.getRoot(),s=!1;o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"];var f=an(o)&&i===o.childNodes.length,l=e.schema.getNonEmptyElements();if(u=n,Ja(o))return w.none();if(an(o)&&i>o.childNodes.length-1&&(u=!1),hn(o)&&(o=c,i=0),o===c){if(u&&(a=o.childNodes[i>0?i-1:0])){if(Ja(a))return w.none();if(l[a.nodeName]||Kh(a))return w.none()}if(o.hasChildNodes()){if(i=Math.min(!u&&i>0?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=pn(o)&&f?o.data.length:0,!t&&o===c.lastChild&&Kh(o))return w.none();if(function(e,t){for(;t&&t!==e;){if(Cn(t))return!0;t=t.parentNode}return!1}(c,o)||Ja(o))return w.none();if(o.hasChildNodes()&&!1===Kh(o)){a=o;var d=new xi(o,c);do{if(Cn(a)||Ja(a)){s=!1;break}if(pn(a)&&a.nodeValue.length>0){i=u?0:a.nodeValue.length,o=a,s=!0;break}if(l[a.nodeName.toLowerCase()]&&!Xh(a)){i=e.nodeIndex(a),o=a.parentNode,u||i++,s=!0;break}}while(a=u?d.next():d.prev())}}}return t&&(pn(o)&&0===i&&Jh(e,f,t,!0,o).each(function(e){o=e.container(),i=e.offset(),s=!0}),an(o)&&((a=o.childNodes[i])||(a=o.childNodes[i-1]),!a||!yn(a)||function(e,t){return e.previousSibling&&e.previousSibling.nodeName===t}(a,"A")||Gh(e,a,!1)||Gh(e,a,!0)||Jh(e,f,t,!0,a).each(function(e){o=e.container(),i=e.offset(),s=!0}))),u&&!t&&pn(o)&&i===o.nodeValue.length&&Jh(e,f,t,!1,o).each(function(e){o=e.container(),i=e.offset(),s=!0}),s?w.some(Wu(o,i)):w.none()},Zh=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=Wu.fromRangeStart(t);return Qh(e,n,!0,r).each(function(e){n&&Wu.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||Qh(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),qh(t,r)?w.none():w.some(r)},ev=function(e){return 0===e.dom().length?($t(e),w.none()):w.some(e)},tv=function(e,t,n){void 0===n&&(n={});var r=function(e,t){return we(we({format:"html"},e),{set:!0,selection:!0,content:t})}(n,t);if(r.no_events||!(r=e.fire("BeforeSetContent",r)).isDefaultPrevented()){n.content=function(e,t){if("raw"!==t.format){var n=e.parser.parse(t.content,we({isRootContent:!0,forced_root_block:!1},t));return ml({validate:e.validate},e.schema).serialize(n)}return t.content}(e,r);var o=e.selection.getRng();!function(e,t){var n=w.from(t.firstChild).map(st.fromDom),r=w.from(t.lastChild).map(st.fromDom);e.deleteContents(),e.insertNode(t);var o=n.bind(_t).filter(pt).bind(ev),i=r.bind(Tt).filter(pt).bind(ev);iu(o,n.filter(pt),function(e,t){var n,r;n=t.dom(),r=e.dom().data,n.insertData(0,r),$t(e)}),iu(i,r.filter(pt),function(t,n){var r=n.dom().length;n.dom().appendData(t.dom().data),e.setEnd(n.dom(),r),$t(t)}),e.collapse(!1)}(o,o.createContextualFragment(n.content)),e.selection.setRng(o),Ih(e,o),r.no_events||e.fire("SetContent",r)}else e.fire("SetContent",r)};function nv(e){return{getBookmark:m(cf,e),moveToBookmark:m(sf,e)}}!function(e){e.isBookmarkNode=ff}(nv||(nv={}));var rv=nv,ov=function(e,t,n){if(n.collapsed)return!1;if(nt.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(an(r))return F(r.getClientRects(),function(n){return du(n,e,t)})}return F(n.getClientRects(),function(n){return du(n,e,t)})},iv={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,END:35,HOME:36,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return nt.mac?e.metaKey:e.ctrlKey&&!e.altKey}},av=Cn,uv=bn,cv=function(t,n){var r,o,i,a,u,c,s,f,l,d,m,p,g,h,v=n.dom,y=ut.each,b=n.getDoc(),C=e.document,w=Math.abs,x=Math.round,S=n.getBody(),N={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},E=function(e){return e&&("IMG"===e.nodeName||n.dom.is(e,"figure.image"))},k=function(e){var t=e.target;(function(e,t){if("longpress"===e.type||0===e.type.indexOf("touch")){var n=e.touches[0];return E(e.target)&&!ov(n.clientX,n.clientY,t)}return E(e.target)&&!ov(e.clientX,e.clientY,t)})(e,n.selection.getRng())&&!e.isDefaultPrevented()&&n.selection.select(t)},_=function(e){return n.dom.is(e,"figure.image")?e.querySelector("img"):e},T=function(e){var t=Bc(n);return!1!==t&&!nt.iOS&&("string"!=typeof t&&(t="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&(e!==n.getBody()&&yt(st.fromDom(e),t)))},R=function(e,t,n){v.setStyles(_(e),{width:t,height:n})},A=function(e){var t,y,b,C;t=e.screenX-u,y=e.screenY-c,m=t*a[2]+s,p=y*a[3]+f,m=m<5?5:m,p=p<5?5:p,(E(r)&&!1!==function(e){return e.getParam("resize_img_proportional",!0,"boolean")}(n)?!iv.modifierPressed(e):iv.modifierPressed(e))&&(w(t)>w(y)?(p=x(m*l),m=x(p/l)):(m=x(p/l),p=x(m*l))),R(o,m,p),b=(b=a.startPos.x+t)>0?b:0,C=(C=a.startPos.y+y)>0?C:0,v.setStyles(i,{left:b,top:C,display:"block"}),i.innerHTML=m+" × "+p,a[2]<0&&o.clientWidth<=m&&v.setStyle(o,"left",void 0+(s-m)),a[3]<0&&o.clientHeight<=p&&v.setStyle(o,"top",void 0+(f-p)),(t=S.scrollWidth-g)+(y=S.scrollHeight-h)!==0&&v.setStyles(i,{left:b-t,top:C-y}),d||(!function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})}(n,r,s,f),d=!0)},D=function(){var e=d;d=!1;var t=function(e,t){t&&(r.style[e]||!n.schema.isValid(r.nodeName.toLowerCase(),e)?v.setStyle(_(r),e,t):v.setAttrib(_(r),e,""+t))};e&&(t("width",m),t("height",p)),v.unbind(b,"mousemove",A),v.unbind(b,"mouseup",D),C!==b&&(v.unbind(C,"mousemove",A),v.unbind(C,"mouseup",D)),v.remove(o),v.remove(i),O(r),e&&(!function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})}(n,r,m,p),v.setAttrib(r,"style",v.getAttrib(r,"style"))),n.nodeChanged()},O=function(e){B(),I();var t=v.getPos(e,S),d=t.x,w=t.y,x=e.getBoundingClientRect(),E=x.width||x.right-x.left,k=x.height||x.bottom-x.top;r!==e&&(r=e,m=p=0);var O=n.fire("ObjectSelected",{target:e});T(e)&&!O.isDefaultPrevented()?y(N,function(e,t){var n;(n=v.get("mceResizeHandle"+t))&&v.remove(n),n=v.add(S,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),11===nt.ie&&(n.contentEditable=!1),v.bind(n,"mousedown",function(t){t.stopImmediatePropagation(),t.preventDefault(),function(t){u=t.screenX,c=t.screenY,s=_(r).clientWidth,f=_(r).clientHeight,l=f/s,a=e,e.startPos={x:E*e[0]+d,y:k*e[1]+w},g=S.scrollWidth,h=S.scrollHeight,o=r.cloneNode(!0),v.addClass(o,"mce-clonedresizable"),v.setAttrib(o,"data-mce-bogus","all"),o.contentEditable=!1,o.unSelectabe=!0,v.setStyles(o,{left:d,top:w,margin:0}),R(o,E,k),o.removeAttribute("data-mce-selected"),S.appendChild(o),v.bind(b,"mousemove",A),v.bind(b,"mouseup",D),C!==b&&(v.bind(C,"mousemove",A),v.bind(C,"mouseup",D)),i=v.add(S,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},s+" × "+f)}(t)}),e.elm=n,v.setStyles(n,{left:E*e[0]+d-n.offsetWidth/2,top:k*e[1]+w-n.offsetHeight/2})}):B(),r.setAttribute("data-mce-selected","1")},B=function(){I(),r&&r.removeAttribute("data-mce-selected"),re(N,function(e,t){var n=v.get("mceResizeHandle"+t);n&&(v.unbind(n),v.remove(n))})},P=function(e){var r,o=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};d||n.removed||(y(v.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),r="mousedown"===e.type?e.target:t.getNode(),o(r=v.$(r).closest("table,img,figure.image,hr")[0],S)&&(M(),o(t.getStart(!0),r)&&o(t.getEnd(!0),r))?O(r):B())},L=function(e){return av(function(e,t){for(;t&&t!==e;){if(uv(t)||av(t))return t;t=t.parentNode}return null}(n.getBody(),e))},I=function(){re(N,function(e){e.elm&&(v.unbind(e.elm),delete e.elm)})},M=function(){try{n.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};n.on("init",function(){if(M(),nt.browser.isIE()||nt.browser.isEdge()){n.on("mousedown click",function(e){var t=e.target,r=t.nodeName;d||!/^(TABLE|IMG|HR)$/.test(r)||L(t)||(2!==e.button&&n.selection.select(t,"TABLE"===r),"mousedown"===e.type&&n.nodeChanged())});var e=function(e){var t=function(e){Vi.setEditorTimeout(n,function(){return n.selection.select(e)})};if(L(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))};v.bind(S,"mscontrolselect",e),n.on("remove",function(){return v.unbind(S,"mscontrolselect",e)})}var t=Vi.throttle(function(e){n.composing||P(e)});n.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",t),n.on("keyup compositionend",function(e){r&&"TABLE"===r.nodeName&&t(e)}),n.on("hide blur",B),n.on("contextmenu longpress",k,!0)}),n.on("remove",I);return{isResizable:T,showResizeRect:O,hideResizeRect:B,updateResizeRect:P,destroy:function(){r=o=null}}},sv=function(e,t,n){if(e&&e.hasOwnProperty(t)){var r=V(e[t],function(e){return e!==n});0===r.length?delete e[t]:e[t]=r}};var fv=function(e){return!!e.select},lv=function(e){return!(!e||!e.ownerDocument)&&xt(st.fromDom(e.ownerDocument),st.fromDom(e))},dv=function(e,t,n,r){var o,i,a=function(e,t){var n,r;return{selectorChangedWithUnbind:function(o,i){return n||(n={},r={},t.on("NodeChange",function(t){var o=t.element,i=e.getParents(o,null,e.getRoot()),a={};ut.each(n,function(t,n){ut.each(i,function(o){if(e.is(o,n))return r[n]||(ut.each(t,function(e){e(!0,{node:o,selector:n,parents:i})}),r[n]=t),a[n]=t,!1})}),ut.each(r,function(e,t){a[t]||(delete r[t],ut.each(e,function(e){e(!1,{node:o,selector:t,parents:i})}))})})),n[o]||(n[o]=[]),n[o].push(i),{unbind:function(){sv(n,o,i),sv(r,o,i)}}}}}(e,r).selectorChangedWithUnbind,u=function(e,t){return tv(r,e,t)},c=function(e){var t=f();t.collapse(!!e),l(t)},s=function(){return t.getSelection?t.getSelection():t.document.selection},f=function(){var n,a,u,c=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!t)return null;var f=t.document;if(null==f)return null;if(void 0!==r.bookmark&&!1===Am(r)){var l=ym(r);if(l.isSome())return l.map(function(e){return Fp(r,[e])[0]}).getOr(f.createRange())}try{(n=s())&&!on(n.anchorNode)&&(a=n.rangeCount>0?n.getRangeAt(0):n.createRange?n.createRange():f.createRange())}catch(d){}return(a=Fp(r,[a])[0])||(a=f.createRange?f.createRange():f.body.createTextRange()),a.setStart&&9===a.startContainer.nodeType&&a.collapsed&&(u=e.getRoot(),a.setStart(u,0),a.setEnd(u,0)),o&&i&&(0===c(a.START_TO_START,a,o)&&0===c(a.END_TO_END,a,o)?a=i:(o=null,i=null)),a},l=function(e,t){var n;if(function(e){return!!e&&(!!fv(e)||lv(e.startContainer)&&lv(e.endContainer))}(e)){var a=fv(e)?e:null;if(a){i=null;try{a.select()}catch(c){}}else{var u=s();if(e=r.fire("SetSelectionRange",{range:e,forward:t}).range,u){i=e;try{u.removeAllRanges(),u.addRange(e)}catch(c){}!1===t&&u.extend&&(u.collapse(e.endContainer,e.endOffset),u.extend(e.startContainer,e.startOffset)),o=u.rangeCount>0?u.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!u.setBaseAndExtent||nt.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(n=e.startContainer.childNodes[e.startOffset])&&"IMG"===n.tagName&&(u.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),u.anchorNode===e.startContainer&&u.focusNode===e.endContainer||u.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:e,forward:t})}}},d=function(){var t=s();if(!t||!t.anchorNode||!t.focusNode)return!0;var n=e.createRng();n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0);var r=e.createRng();return r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0},m={bookmarkManager:null,controlSelection:null,dom:e,win:t,serializer:n,editor:r,collapse:c,setCursorLocation:function(t,n){var o=e.createRng();t?(o.setStart(t,n),o.setEnd(t,n),l(o),c(!1)):(Yf(e,o,r.getBody(),!0),l(o))},getContent:function(e){return Vh(r,e)},setContent:u,getBookmark:function(e,t){return p.getBookmark(e,t)},moveToBookmark:function(e){return p.moveToBookmark(e)},select:function(t,n){return function(e,t,n){return w.from(t).map(function(t){var r=e.nodeIndex(t),o=e.createRng();return o.setStart(t.parentNode,r),o.setEnd(t.parentNode,r+1),n&&(Yf(e,o,t,!0),Yf(e,o,t,!1)),o})}(e,t,n).each(l),t},isCollapsed:function(){var e=f(),t=s();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:d,setNode:function(t){return u(e.getOuterHTML(t)),t},getNode:function(){return function(e,t){var n,r,o;if(!t)return e;r=t.startContainer,o=t.endContainer;var i=t.startOffset,a=t.endOffset;return n=t.commonAncestorContainer,!t.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Hh(r.nextSibling,!0):r.parentNode,o=0===a?Hh(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n}(r.getBody(),f())},getSel:s,setRng:l,getRng:f,getStart:function(e){return zh(r.getBody(),f(),e)},getEnd:function(e){return jh(r.getBody(),f(),e)},getSelectedBlocks:function(t,n){return function(e,t,n,r){var o,i=[],a=e.getRoot();if(n=e.getParent(n||zh(a,t,t.collapsed),e.isBlock),r=e.getParent(r||jh(a,t,t.collapsed),e.isBlock),n&&n!==a&&i.push(n),n&&r&&n!==r){o=n;for(var u=new xi(n,a);(o=u.next())&&o!==r;)e.isBlock(o)&&i.push(o)}return r&&n!==r&&r!==a&&i.push(r),i}(e,f(),t,n)},normalize:function(){var t=f(),n=s();if(!(Hf(n).length>1)&&Gf(r)){var o=Zh(e,t);return o.each(function(e){l(e,d())}),o.getOr(t)}return t},selectorChanged:function(e,t){return a(e,t),m},selectorChangedWithUnbind:a,getScrollContainer:function(){for(var t,n=e.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){t=n;break}n=n.parentNode}return t},scrollIntoView:function(e,t){return function(e,t,n){(e.inline?Bh:Lh)(e,t,n)}(r,e,t)},placeCaretAt:function(e,t){return l(Fh(e,t,r.getDoc()))},getBoundingClientRect:function(){var e=f();return e.collapsed?Xu.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){t=o=i=null,g.destroy()}},p=rv(m),g=cv(m,r);return m.bookmarkManager=p,m.controlSelection=g,m},mv=function(e,t,n){e.addNodeFilter("font",function(e){z(e,function(e){var r=t.parse(e.attr("style")),o=e.attr("color"),i=e.attr("face"),a=e.attr("size");o&&(r.color=o),i&&(r["font-family"]=i),a&&(r["font-size"]=n[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",t.serialize(r)),function(e,t){z(t,function(t){e.attr(t,null)})}(e,["color","face","size"])})})},pv=function(e,t){var n=jr();t.convert_fonts_to_spans&&mv(e,n,ut.explode(t.font_size_legacy_values)),function(e,t){e.addNodeFilter("strike",function(e){z(e,function(e){var n=t.parse(e.attr("style"));n["text-decoration"]="line-through",e.name="span",e.attr("style",t.serialize(n))})})}(e,n)},gv=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},hv=function(t,n){var r;try{r=e.atob(n)}catch(fE){return w.none()}for(var o=new Uint8Array(r.length),i=0;i<o.length;i++)o[i]=r.charCodeAt(i);return w.some(new e.Blob([o],{type:t}))},vv=function(t){return 0===t.indexOf("blob:")?function(t){return new Ui(function(n,r){var o=function(){r("Cannot convert "+t+" to Blob. Resource might not exist or is inaccessible.")};try{var i=new e.XMLHttpRequest;i.open("GET",t,!0),i.responseType="blob",i.onload=function(){200===this.status?n(this.response):o()},i.onerror=o,i.send()}catch(a){o()}})}(t):0===t.indexOf("data:")?(n=t,new Ui(function(t){var r=gv(n),o=r.type,i=r.data;hv(o,i).fold(function(){return t(new e.Blob([]))},t)})):null;var n},yv=0,bv=function(e){return(e||"blobid")+yv++},Cv=function(t,n,r,o){var i,a;if(0!==n.src.indexOf("blob:")){var u=gv(n.src),c=u.data,s=u.type;i=c,(a=t.getByData(i,s))?r({image:n,blobInfo:a}):vv(n.src).then(function(e){a=t.create(bv(),e,i),t.add(a),r({image:n,blobInfo:a})},function(e){o(e)})}else(a=t.getByUri(n.src))?r({image:n,blobInfo:a}):vv(n.src).then(function(o){(function(t){return new Ui(function(n){var r=new e.FileReader;r.onloadend=function(){n(r.result)},r.readAsDataURL(t)})})(o).then(function(e){i=gv(e).data,a=t.create(bv(),o,i),t.add(a),r({image:n,blobInfo:a})})},function(e){o(e)})},wv=function(e){return e?ee(e.getElementsByTagName("img")):[]};var xv=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new fl("br",1)).shortEnded=!0:r.empty().append(new fl("#text",3)).value=" "},Sv=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},Nv=function(e,t,n,r){return r.isEmpty(t,n,function(t){return function(e,t){var n=e.getElementRule(t.name);return n&&n.paddEmpty}(e,t)})},Ev=function(t,n){var r=n.blob_cache,o=function(t){var o,i,a=t.attr("src");(function(e){return e.attr("src")===nt.transparentSrc||e.attr("data-mce-placeholder")})(t)||function(e){return e.attr("data-mce-bogus")}(t)||(o=a,i=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(o),i?w.some({type:i[1],data:decodeURIComponent(i[2])}):w.none()).filter(function(){return function(t,n){if(n.images_dataimg_filter){var r=new e.Image;return r.src=t.attr("src"),re(t.attributes.map,function(e,t){r.setAttribute(t,e)}),n.images_dataimg_filter(r)}return!0}(t,n)}).bind(function(e){var t=e.type,n=e.data;return w.from(r.getByData(n,t)).orThunk(function(){return hv(t,n).map(function(e){var t=r.create(bv(),e,n);return r.add(t),t})})}).each(function(e){t.attr("src",e.blobUri())})};r&&t.addAttributeFilter("src",function(e){return z(e,o)})},kv=ut.makeMap,_v=ut.each,Tv=ut.explode,Rv=ut.extend,Av=function(e,t){void 0===t&&(t=xr());var n={},r=[],o={},i={};(e=e||{}).validate=!("validate"in e)||e.validate,e.root_name=e.root_name||"body";var a=function(e){var t,a,u;(a=e.name)in n&&((u=o[a])?u.push(e):o[a]=[e]),t=r.length;for(;t--;)(a=r[t].name)in e.attributes.map&&((u=i[a])?u.push(e):i[a]=[e]);return e},u={schema:t,addAttributeFilter:function(e,t){_v(Tv(e),function(e){var n;for(n=0;n<r.length;n++)if(r[n].name===e)return void r[n].callbacks.push(t);r.push({name:e,callbacks:[t]})})},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(e,t){_v(Tv(e),function(e){var r=n[e];r||(n[e]=r=[]),r.push(t)})},getNodeFilters:function(){var e=[];for(var t in n)n.hasOwnProperty(t)&&e.push({name:t,callbacks:n[t]});return e},filterNode:a,parse:function(u,c){var s,f,l,d,m,p,g,h,v,y=[];c=c||{},o={},i={};var b=Rv(kv("script,style,head,html,body,title,meta,param"),t.getBlockElements()),C=t.getNonEmptyElements(),w=t.children,x=e.validate,S=function(e){return!1===e?"":!0===e?"p":e}("forced_root_block"in c?c.forced_root_block:e.forced_root_block),N=t.getWhiteSpaceElements(),E=/^[ \t\r\n]+/,k=/[ \t\r\n]+$/,_=/[ \t\r\n]+/g,T=/^[ \t\r\n]+$/;h=N.hasOwnProperty(c.context)||N.hasOwnProperty(e.root_name);var R=function(e,t){var r,i=new fl(e,t);return e in n&&((r=o[e])?r.push(i):o[e]=[i]),i},A=function(e){var n,r,o,i,a=t.getBlockElements();for(n=e.prev;n&&3===n.type;){if((o=n.value.replace(k,"")).length>0)return void(n.value=o);if(r=n.next){if(3===r.type&&r.value.length){n=n.prev;continue}if(!a[r.name]&&"script"!==r.name&&"style"!==r.name){n=n.prev;continue}}i=n.prev,n.remove(),n=i}},D=El({validate:x,allow_html_data_urls:e.allow_html_data_urls,allow_script_urls:e.allow_script_urls,allow_conditional_comments:e.allow_conditional_comments,preserve_cdata:e.preserve_cdata,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(t.getSelfClosingElements()),cdata:function(e){v.append(R("#cdata",4)).value=e},text:function(e,t){var n;h||(e=e.replace(_," "),function(e,t){return e&&(t[e.name]||"br"===e.name)}(v.lastChild,b)&&(e=e.replace(E,""))),0!==e.length&&((n=R("#text",3)).raw=!!t,v.append(n).value=e)},comment:function(e){v.append(R("#comment",8)).value=e},pi:function(e,t){v.append(R(e,7)).value=t,A(v)},doctype:function(e){v.append(R("#doctype",10)).value=e,A(v)},start:function(e,n,o){var a,u,c,s,f=x?t.getElementRule(e):{};if(f){for((a=R(f.outputName||e,1)).attributes=n,a.shortEnded=o,v.append(a),(s=w[v.name])&&w[a.name]&&!s[a.name]&&y.push(a),u=r.length;u--;)(c=r[u].name)in n.map&&((p=i[c])?p.push(a):i[c]=[a]);b[e]&&A(a),o||(v=a),!h&&N[e]&&(h=!0)}},end:function(n){var r,o,i,a,u=x?t.getElementRule(n):{};if(u){if(b[n]&&!h){if((r=v.firstChild)&&3===r.type)if((o=r.value.replace(E,"")).length>0)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,(0===o.length||T.test(o))&&(r.remove(),r=i),r=i;if((r=v.lastChild)&&3===r.type)if((o=r.value.replace(k,"")).length>0)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,(0===o.length||T.test(o))&&(r.remove(),r=i),r=i}if(h&&N[n]&&(h=!1),u.removeEmpty&&Nv(t,C,N,v))return a=v.parent,b[v.name]?v.empty().remove():v.unwrap(),void(v=a);u.paddEmpty&&(function(e){return Sv(e,"#text")&&" "===e.firstChild.value}(v)||Nv(t,C,N,v))&&xv(e,c,b,v),v=v.parent}}},t),O=v=new fl(c.context||e.root_name,11);if(D.parse(u,c.format),x&&y.length&&(c.context?c.invalid=!0:function(e){var n,r,o,i,u,c,s,f,l,d,m,p=kv("tr,td,th,tbody,thead,tfoot,table"),g=t.getNonEmptyElements(),h=t.getWhiteSpaceElements(),v=t.getTextBlockElements(),y=t.getSpecialElements();for(n=0;n<e.length;n++)if((r=e[n]).parent&&!r.fixed)if(v[r.name]&&"li"===r.parent.name){for(d=r.next;d&&v[d.name];)d.name="li",d.fixed=!0,r.parent.insert(d,r.parent),d=d.next;r.unwrap(r)}else{for(i=[r],o=r.parent;o&&!t.isValidChild(o.name,r.name)&&!p[o.name];o=o.parent)i.push(o);if(o&&i.length>1){for(i.reverse(),u=c=a(i[0].clone()),l=0;l<i.length-1;l++){for(t.isValidChild(c.name,i[l].name)?(s=a(i[l].clone()),c.append(s)):s=c,f=i[l].firstChild;f&&f!==i[l+1];)m=f.next,s.append(f),f=m;c=s}Nv(t,g,h,u)?o.insert(r,i[0],!0):(o.insert(u,i[0],!0),o.insert(r,u)),o=i[0],(Nv(t,g,h,o)||Sv(o,"br"))&&o.empty().remove()}else if(r.parent){if("li"===r.name){if((d=r.prev)&&("ul"===d.name||"ul"===d.name)){d.append(r);continue}if((d=r.next)&&("ul"===d.name||"ul"===d.name)){d.insert(r,d.firstChild,!0);continue}r.wrap(a(new fl("ul",1)));continue}t.isValidChild(r.parent.name,"div")&&t.isValidChild("div",r.name)?r.wrap(a(new fl("div",1))):y[r.name]?r.empty().remove():r.unwrap()}}}(y)),S&&("body"===O.name||c.isRootContent)&&function(){var n,r,o=O.firstChild,i=function(e){e&&((o=e.firstChild)&&3===o.type&&(o.value=o.value.replace(E,"")),(o=e.lastChild)&&3===o.type&&(o.value=o.value.replace(k,"")))};if(t.isValidChild(O.name,S.toLowerCase())){for(;o;)n=o.next,3===o.type||1===o.type&&"p"!==o.name&&!b[o.name]&&!o.attr("data-mce-type")?r?r.append(o):((r=R(S,1)).attr(e.forced_root_block_attrs),O.insert(r,o),r.append(o)):(i(r),r=null),o=n;i(r)}}(),!c.invalid){for(g in o)if(o.hasOwnProperty(g)){for(p=n[g],d=(s=o[g]).length;d--;)s[d].parent||s.splice(d,1);for(f=0,l=p.length;f<l;f++)p[f](s,g,c)}for(f=0,l=r.length;f<l;f++)if((p=r[f]).name in i){for(d=(s=i[p.name]).length;d--;)s[d].parent||s.splice(d,1);for(d=0,m=p.callbacks.length;d<m;d++)p.callbacks[d](s,p.name,c)}}return O}};return function(e,t){var n=e.schema;t.remove_trailing_brs&&e.addNodeFilter("br",function(e,r,o){var i,a,u,c,s,f,l,d,m=e.length,p=ut.extend({},n.getBlockElements()),g=n.getNonEmptyElements(),h=n.getWhiteSpaceElements();for(p.body=1,i=0;i<m;i++)if(u=(a=e[i]).parent,p[a.parent.name]&&a===u.lastChild){for(s=a.prev;s;){if("span"!==(f=s.name)||"bookmark"!==s.attr("data-mce-type")){if("br"!==f)break;if("br"===f){a=null;break}}s=s.prev}a&&(a.remove(),Nv(n,g,h,u)&&(l=n.getElementRule(u.name))&&(l.removeEmpty?u.remove():l.paddEmpty&&xv(t,o,p,u)))}else{for(c=a;u&&u.firstChild===c&&u.lastChild===c&&(c=u,!p[u.name]);)u=u.parent;c===u&&!0!==t.padd_empty_with_br&&((d=new fl("#text",3)).value=" ",a.replace(d))}}),e.addAttributeFilter("href",function(e){var n,r,o=e.length;if(!t.allow_unsafe_link_target)for(;o--;){var i=e[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(n=i.attr("rel"),r=void 0,r=n?ut.trim(n):"",/\b(noopener)\b/g.test(r)?r:function(e){return e.split(" ").filter(function(e){return e.length>0}).concat(["noopener"]).sort().join(" ")}(r)))}}),t.allow_html_in_named_anchor||e.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href")){r=o.parent,t=o.lastChild;do{n=t.prev,r.insert(t,o),t=n}while(t)}}),t.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new fl("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),t.validate&&n.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t,r,o,i,a,u,c,s=e.length,f=n.getValidClasses();s--;){for(r=(t=e[s]).attr("class").split(" "),a="",o=0;o<r.length;o++)i=r[o],c=!1,(u=f["*"])&&u[i]&&(c=!0),u=f[t.name],!c&&u&&u[i]&&(c=!0),c&&(a&&(a+=" "),a+=i);a.length||(a=null),t.attr("class",a)}}),Ev(e,t)}(u,e),function(e,t){t.inline_styles&&pv(e,t)}(u,e),u},Dv=function(t,n,r){return function(e,t){return e&&e.hasEventListeners("PreProcess")&&!t.no_events}(t,r)?function(t,n,r){var o,i,a=t.dom;n=n.cloneNode(!0);var u=e.document.implementation;return u.createHTMLDocument&&(o=u.createHTMLDocument(""),ut.each("BODY"===n.nodeName?n.childNodes:[n],function(e){o.body.appendChild(o.importNode(e,!0))}),n="BODY"!==n.nodeName?o.body.firstChild:o.body,i=a.doc,a.doc=o),function(e,t){e.fire("PreProcess",t)}(t,we(we({},r),{node:n})),i&&(a.doc=i),n}(t,n,r):n},Ov=function(e,t,n){-1===ut.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},Bv=function(e,t,n,r,o){return function(e,t,n){return!t.no_events&&e?function(e,t){return e.fire("PostProcess",t)}(e,we(we({},t),{content:n})).content:n}(e,o,function(e,t,n){return ml(e,t).serialize(n)}(t,n,r))},Pv=function(e,t){var n=["data-mce-selected"],r=t&&t.dom?t.dom:ea.DOM,o=t&&t.schema?t.schema:xr(e);e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs=!("remove_trailing_brs"in e)||e.remove_trailing_brs;var i=Av(e,o);!function(e,t,n){e.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n,r=e.length;r--;)(n=e[r]).attr("tabindex",n.attr("data-mce-tabindex")),n.attr(t,null)}),e.addAttributeFilter("src,href,style",function(e,r){for(var o,i,a=e.length,u="data-mce-"+r,c=t.url_converter,s=t.url_converter_scope;a--;)void 0!==(i=(o=e[a]).attr(u))?(o.attr(r,i.length>0?i:null),o.attr(u,null)):(i=o.attr(r),"style"===r?i=n.serializeStyle(n.parseStyle(i),o.name):c&&(i=c.call(s,i,r,o.name)),o.attr(r,i.length>0?i:null))}),e.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)(n=(t=e[r]).attr("class"))&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr("class",n.length>0?n:null))}),e.addAttributeFilter("data-mce-type",function(e,t,n){for(var r,o=e.length;o--;)"bookmark"!==(r=e[o]).attr("data-mce-type")||n.cleanup||(w.from(r.firstChild).exists(function(e){return!$a(e.value)})?r.unwrap():r.remove())}),e.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=lr.decode(t.value))}),e.addNodeFilter("script,style",function(e,n){for(var r,o,i,a=e.length,u=function(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};a--;)o=(r=e[a]).firstChild?r.firstChild.value:"","script"===n?((i=r.attr("type"))&&r.attr("type","mce-no/type"===i?null:i.replace(/^mce\-/,"")),"xhtml"===t.element_format&&o.length>0&&(r.firstChild.value="// <![CDATA[\n"+u(o)+"\n// ]]>")):"xhtml"===t.element_format&&o.length>0&&(r.firstChild.value="\x3c!--\n"+u(o)+"\n--\x3e")}),e.addNodeFilter("#comment",function(e){for(var r,o=e.length;o--;)r=e[o],t.preserve_cdata&&0===r.value.indexOf("[CDATA[")?(r.name="#cdata",r.type=4,r.value=n.decode(r.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===r.value.indexOf("mce:protected ")&&(r.name="#text",r.type=3,r.raw=!0,r.value=unescape(r.value).substr(14))}),e.addNodeFilter("xml:namespace,input",function(e,t){for(var n,r=e.length;r--;)7===(n=e[r]).type?n.remove():1===n.type&&("input"!==t||n.attr("type")||n.attr("type","text"))}),e.addAttributeFilter("data-mce-type",function(t){z(t,function(t){"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(e.schema.getNonEmptyElements())?t.remove():t.unwrap())})}),e.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})}(i,e,r);return{schema:o,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:function(n,a){void 0===a&&(a={});var u=we({format:"html"},a),c=Dv(t,n,u),s=function(e,t,n){var r=Wa(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||Kn(st.fromDom(t))?r:ut.trim(r)}(r,c,u),f=function(e,t,n){var r=n.selection?we({forced_root_block:!1},n):n,o=e.parse(t,r);return function(e){var t=function(e){return e&&"br"===e.name},n=e.lastChild;if(t(n)){var r=n.prev;t(r)&&(n.remove(),r.remove())}}(o),o}(i,s,u);return"tree"===u.format?f:Bv(t,e,o,f,u)},addRules:function(e){o.addValidElements(e)},setRules:function(e){o.setValidElements(e)},addTempAttr:m(Ov,i,n),getTempAttrs:function(){return n},getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters}},Lv=function(e,t){var n=Pv(e,t);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}};function Iv(t,n){var r={},o=function(t,r,o,i){var a=new e.XMLHttpRequest;a.open("POST",n.url),a.withCredentials=n.credentials,a.upload.onprogress=function(e){i(e.loaded/e.total*100)},a.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+a.status)},a.onload=function(){if(a.status<200||a.status>=300)o("HTTP Error: "+a.status);else{var e,t,i=JSON.parse(a.responseText);if(i&&"string"==typeof i.location)r((e=n.basePath,t=i.location,e?e.replace(/\/$/,"")+"/"+t.replace(/^\//,""):t));else o("Invalid JSON: "+a.responseText)}};var u=new e.FormData;u.append("file",t.blob(),t.filename()),a.send(u)},i=function(e,t){return{url:t,blobInfo:e,status:!0}},a=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},u=function(e,t){ut.each(r[e],function(e){e(t)}),delete r[e]},c=function(e,o){return e=ut.grep(e,function(e){return!t.isUploaded(e.blobUri())}),Ui.all(ut.map(e,function(e){return t.isPending(e.blobUri())?function(e){var t=e.blobUri();return new Ui(function(e){r[t]=r[t]||[],r[t].push(e)})}(e):function(e,n,r){return t.markPending(e.blobUri()),new Ui(function(o){var c;try{var s=function(){c&&c.close()};n(e,function(n){s(),t.markUploaded(e.blobUri(),n),u(e.blobUri(),i(e,n)),o(i(e,n))},function(n){s(),t.removeFailed(e.blobUri()),u(e.blobUri(),a(e,n)),o(a(e,n))},function(e){e<0||e>100||(c||(c=r()),c.progressBar.value(e))})}catch(f){o(a(e,f.message))}})}(e,n.handler,o)}))};return!1===D(n.handler)&&(n.handler=o),{upload:function(e,t){return n.url||n.handler!==o?c(e,t):new Ui(function(e){e([])})}}}var Mv=0,Fv=function(e){return e+Mv+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t},Uv=function(t){var n,r,o,i,a,u,c,s,f,d=(n=[],r=function(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var n,r=t.id||Fv("blobid"),o=t.name||r;return{id:l(r),name:l(o),filename:l(o+"."+(n=t.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[n.toLowerCase()]||"dat")),blob:l(t.blob),base64:l(t.base64),blobUri:l(t.blobUri||e.URL.createObjectURL(t.blob)),uri:l(t.uri)}},{create:function(e,t,n,o){if(E(e))return r({id:e,name:o,blob:t,base64:n});if(k(e))return r(e);throw new Error("Unknown input type")},add:function(e){i(e.id())||n.push(e)},get:i=function(e){return o(function(t){return t.id()===e})},getByUri:function(e){return o(function(t){return t.blobUri()===e})},getByData:function(e,t){return o(function(n){return n.base64()===e&&n.blob().type===t})},findFirst:o=function(e){return W(n,e).getOrUndefined()},removeByUri:function(t){n=V(n,function(n){return n.blobUri()!==t||(e.URL.revokeObjectURL(n.blobUri()),!1)})},destroy:function(){z(n,function(t){e.URL.revokeObjectURL(t.blobUri())}),n=[]}}),m=(c={},s=function(e,t){return{status:e,resultUri:t}},{hasBlobUri:f=function(e){return e in c},getResultUri:function(e){var t=c[e];return t?t.resultUri:null},isPending:function(e){return!!f(e)&&1===c[e].status},isUploaded:function(e){return!!f(e)&&2===c[e].status},markPending:function(e){c[e]=s(1,null)},markUploaded:function(e,t){c[e]=s(2,t)},removeFailed:function(e){delete c[e]},destroy:function(){c={}}}),p=[],g=function(e){return function(n){return t.selection?e(n):[]}},h=function(e,t,n){var r=0;do{-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1)}while(-1!==r);return e},v=function(e,t,n){return e=h(e,'src="'+t+'"','src="'+n+'"'),e=h(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},y=function(e,n){z(t.undoManager.data,function(t){"fragmented"===t.type?t.fragments=U(t.fragments,function(t){return v(t,e,n)}):t.content=v(t.content,e,n)})},b=function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},C=function(e){return a||(a=Iv(m,{url:Ec(t),basePath:kc(t),credentials:_c(t),handler:Tc(t)})),S().then(g(function(n){var r=U(n,function(e){return e.blobInfo});return a.upload(r,b).then(g(function(r){var o=U(r,function(e,r){var o=n[r].blobInfo,i=n[r].image;return e.status&&function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")}(t)?(d.removeByUri(i.src),function(e,n){var r,o=t.convertURL(n,"src");y(e.src,n),t.$(e).attr({src:Sc(t)?(r=n,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":o})}(i,e.url)):e.error&&function(e,t){fh(e,sa.translate(["Failed to upload image: {0}",t]))}(t,e.error),{element:i,status:e.status,uploadUri:e.url,blobInfo:o}});return e&&e(o),o}))}))},w=function(e){if(xc(t))return C(e)},x=function(e){return!1!==Y(p,function(t){return t(e)})&&(0!==e.getAttribute("src").indexOf("data:")||function(e){return e.getParam("images_dataimg_filter",l(!0),"function")}(t)(e))},S=function(){return u||(u=function(e,t){var n={};return{findAll:function(r,o){o||(o=l(!0));var i=V(wv(r),function(t){var n=t.src;return!!nt.fileApi&&!t.hasAttribute("data-mce-bogus")&&!t.hasAttribute("data-mce-placeholder")&&!(!n||n===nt.transparentSrc)&&(0===n.indexOf("blob:")?!e.isUploaded(n)&&o(t):0===n.indexOf("data:")&&o(t))}),a=U(i,function(e){if(void 0!==n[e.src])return new Ui(function(t){n[e.src].then(function(n){if("string"==typeof n)return n;t({image:e,blobInfo:n.blobInfo})})});var r=new Ui(function(n,r){Cv(t,e,n,r)}).then(function(e){return delete n[e.image.src],e}).catch(function(t){return delete n[e.src],t});return n[e.src]=r,r});return Ui.all(a)}}}(m,d)),u.findAll(t.getBody(),x).then(g(function(e){return e=V(e,function(e){return"string"!=typeof e||(fh(t,e),!1)}),z(e,function(e){y(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))},N=function(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var r=m.getResultUri(n);if(r)return'src="'+r+'"';var o=d.getByUri(n);return o||(o=$(t.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null)),o?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':e})};return t.on("SetContent",function(){xc(t)?w():S()}),t.on("RawSaveContent",function(e){e.content=N(e.content)}),t.on("GetContent",function(e){e.source_view||"raw"===e.format||(e.content=N(e.content))}),t.on("PostRender",function(){t.parser.addNodeFilter("img",function(e){z(e,function(e){var t=e.attr("src");if(!d.getByUri(t)){var n=m.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:d,addFilter:function(e){p.push(e)},uploadImages:C,uploadImagesAuto:w,scanForImages:S,destroy:function(){d.destroy(),m.destroy(),u=a=null}}},zv=function(e,t,n,r){var o=te(n.get()),i={},a={},u=V(Ef(e.dom,t),function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")});re(r,function(t,n){ut.each(u,function(r){return e.formatter.matchNode(r,n,{},t.similar)?(-1===o.indexOf(n)&&(z(t.callbacks,function(e){e(!0,{node:r,format:n,parents:u})}),i[n]=t.callbacks),a[n]=t.callbacks,!1):!Hm(e,r,n)&&void 0})});var c=jv(n.get(),a,t,u);n.set(we(we({},i),c))},jv=function(e,t,n,r){return ce(e,function(e,o){return!!de(t,o)||(z(e,function(e){e(!1,{node:n,format:o,parents:r})}),!1)}).t},Hv=function(e,t,n,r,o){return null===t.get()&&function(e,t){var n=ia({});e.set({}),t.on("NodeChange",function(r){zv(t,r.element,n,e.get())})}(t,e),function(e,t,n,r){var o=e.get();z(t.split(","),function(e){o[e]||(o[e]={similar:r,callbacks:[]}),o[e].callbacks.push(n)}),e.set(o)}(t,n,r,o),{unbind:function(){return function(e,t,n){var r=e.get();z(t.split(","),function(e){r[e].callbacks=V(r[e].callbacks,function(e){return e!==n}),0===r[e].callbacks.length&&delete r[e]}),e.set(r)}(t,n,r)}}},Vv=function(e){var t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(e,t,n){return an(e)&&e.hasAttribute("href")},onformat:function(t,n,r){ut.each(r,function(n,r){e.setAttrib(t,r,n)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return ut.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t};var qv,$v=ut.each,Wv=ea.DOM,Kv=function(e,t){var n,r,o,i=t&&t.schema||xr({}),a=function(e){r="string"==typeof e?{name:e,classes:[],attrs:{}}:e;var t=Wv.create(r.name);return function(e,t){t.classes.length&&Wv.addClass(e,t.classes.join(" ")),Wv.setAttribs(e,t.attrs)}(t,r),t},u=function(e,t,n){var r,o,c=t.length>0&&t[0],s=c&&c.name,f=function(e,t){var n="string"!=typeof e?e.nodeName.toLowerCase():e,r=i.getElementRule(n),o=r&&r.parentsRequired;return!(!o||!o.length)&&(t&&-1!==ut.inArray(o,t)?t:o[0])}(e,s);if(f)s===f?(o=t[0],t=t.slice(1)):o=f;else if(c)o=t[0],t=t.slice(1);else if(!n)return e;return o&&(r=a(o)).appendChild(e),n&&(r||(r=Wv.create("div")).appendChild(e),ut.each(n,function(t){var n=a(t);r.insertBefore(n,e)})),u(r,t,o&&o.siblings)};return e&&e.length?(r=e[0],n=a(r),(o=Wv.create("div")).appendChild(u(n,e.slice(1),r.siblings)),o):""},Xv=function(e){var t,n={classes:[],attrs:{}};return"*"!==(e=n.selector=ut.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,r,o,i){switch(t){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==ut.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}if("["===o){var a=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);a&&(n.attrs[a[1]]=a[2])}return""})),n.name=t||"div",n},Yv=function(e,t){var n,r,o,i="",a=function(e){var t=e.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");return E(t)?t:""}(e);if(""===a)return"";var u=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof t){if(!(t=e.formatter.get(t)))return;t=t[0]}if("preview"in t){var c=le(t,"preview");if(c.is(!1))return"";a=c.getOr(a)}n=t.block||t.inline||"span";var s,f=(s=t.selector)&&"string"==typeof s?(s=(s=s.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),ut.map(s.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=ut.map(e.split(/(?:~\+|~|\+)/),Xv),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[];f.length?(f[0].name||(f[0].name=n),n=t.selector,r=Kv(f,e)):r=Kv([n],e);var l=Wv.select(n,r)[0]||r.firstChild;return $v(t.styles,function(e,t){(e=u(e))&&Wv.setStyle(l,t,e)}),$v(t.attributes,function(e,t){(e=u(e))&&Wv.setAttrib(l,t,e)}),$v(t.classes,function(e){e=u(e),Wv.hasClass(l,e)||Wv.addClass(l,e)}),e.fire("PreviewFormats"),Wv.setStyles(r,{position:"absolute",left:-65535}),e.getBody().appendChild(r),o=Wv.getStyle(e.getBody(),"fontSize",!0),o=/px$/.test(o)?parseInt(o,10):0,$v(a.split(" "),function(t){var n=Wv.getStyle(l,t,!0);if(!("background-color"===t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=Wv.getStyle(e.getBody(),t,!0),"#ffffff"===Wv.toHex(n).toLowerCase())||"color"===t&&"#000000"===Wv.toHex(n).toLowerCase())){if("font-size"===t&&/em|%$/.test(n)){if(0===o)return;n=parseFloat(n)/(/%$/.test(n)?100:1)*o+"px"}"border"===t&&n&&(i+="padding:0 2px;"),i+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),Wv.remove(r),i},Gv=function(e){var t=function(e){var t={},n=function(e,r){e&&("string"!=typeof e?ut.each(e,function(e,t){n(t,e)}):(_(r)||(r=[r]),ut.each(r,function(e){void 0===e.deep&&(e.deep=!e.selector),void 0===e.split&&(e.split=!e.selector||e.inline),void 0===e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),t[e]=r))};return n(Vv(e.dom)),n(Uc(e)),{get:function(e){return e?t[e]:t},has:function(e){return de(t,e)},register:n,unregister:function(e){return e&&t[e]&&delete t[e],t}}}(e),n=ia(null);return function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])}(e),ip(e),{get:t.get,has:t.has,register:t.register,unregister:t.unregister,apply:function(t,n,r){!function(e,t,n,r){Ng(e).formatter.apply(t,n,r)}(e,t,n,r)},remove:function(t,n,r,o){!function(e,t,n,r,o){Ng(e).formatter.remove(t,n,r,o)}(e,t,n,r,o)},toggle:function(t,n,r){!function(e,t,n,r){Ng(e).formatter.toggle(t,n,r)}(e,t,n,r)},match:m(Km,e),matchAll:m(Xm,e),matchNode:m(Wm,e),canApply:m(Ym,e),formatChanged:m(Hv,e,n),getCssText:m(Yv,e)}},Jv=function(e){var t=ia(w.none()),n=ia(0),r=ia(0),o={data:[],typing:!1,beforeChange:function(){!function(e,t,n){Ng(e).undoManager.beforeChange(t,n)}(e,n,t)},add:function(i,a){return function(e,t,n,r,o,i,a){return Ng(e).undoManager.addUndoLevel(t,n,r,o,i,a)}(e,o,r,n,t,i,a)},undo:function(){return function(e,t,n,r){return Ng(e).undoManager.undo(t,n,r)}(e,o,n,r)},redo:function(){return function(e,t,n){return Ng(e).undoManager.redo(t,n)}(e,r,o.data)},clear:function(){!function(e,t,n){Ng(e).undoManager.clear(t,n)}(e,o,r)},reset:function(){!function(e,t){Ng(e).undoManager.reset(t)}(e,o)},hasUndo:function(){return function(e,t,n){return Ng(e).undoManager.hasUndo(t,n)}(e,o,r)},hasRedo:function(){return function(e,t,n){return Ng(e).undoManager.hasRedo(t,n)}(e,o,r)},transact:function(t){return function(e,t,n,r){return Ng(e).undoManager.transact(t,n,r)}(e,o,n,t)},ignore:function(t){!function(e,t,n){Ng(e).undoManager.ignore(t,n)}(e,n,t)},extra:function(t,n){!function(e,t,n,r,o){Ng(e).undoManager.extra(t,n,r,o)}(e,o,r,t,n)}};return wg(e)||function(e,t,n){var r=ia(!1),o=function(e){hg(t,!1,n),t.add({},e)};e.on("init",function(){t.add()}),e.on("BeforeExecCommand",function(e){var r=e.command.toLowerCase();"undo"!==r&&"redo"!==r&&"mcerepaint"!==r&&(vg(t,n),t.beforeChange())}),e.on("ExecCommand",function(e){var t=e.command.toLowerCase();"undo"!==t&&"redo"!==t&&"mcerepaint"!==t&&o(e)}),e.on("ObjectResizeStart cut",function(){t.beforeChange()}),e.on("SaveContent ObjectResized blur",o),e.on("dragend",o),e.on("keyup",function(n){var i=n.keyCode;n.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||n.ctrlKey)&&(o(),e.nodeChanged()),46!==i&&8!==i||e.nodeChanged(),r.get()&&t.typing&&!1===pg(fg(e),t.data[0])&&(!1===e.isDirty()&&(e.setDirty(!0),e.fire("change",{level:t.data[0],lastLevel:null})),e.fire("TypingUndo"),r.set(!1),e.nodeChanged()))}),e.on("keydown",function(e){var i=e.keyCode;if(!e.isDefaultPrevented())if(i>=33&&i<=36||i>=37&&i<=40||45===i)t.typing&&o(e);else{var a=e.ctrlKey&&!e.altKey||e.metaKey;!(i<16||i>20)||224===i||91===i||t.typing||a||(t.beforeChange(),hg(t,!0,n),t.add({},e),r.set(!0))}}),e.on("mousedown",function(e){t.typing&&o(e)});e.on("input",function(e){e.inputType&&("insertReplacementText"===e.inputType||function(e){return"insertText"===e.inputType&&null===e.data}(e)||function(e){return"insertFromPaste"===e.inputType||"insertFromDrop"===e.inputType}(e))&&o(e)}),e.on("AddUndo Undo Redo ClearUndos",function(t){t.isDefaultPrevented()||e.nodeChanged()})}(e,o,n),function(e){e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo")}(e),o},Qv=[9,27,iv.HOME,iv.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,iv.DOWN,iv.UP,iv.LEFT,iv.RIGHT].concat(nt.browser.isFirefox()?[224]:[]),Zv=function(e){return"keydown"===e.type||"keyup"===e.type},ey=function(e){var t=e.keyCode;return t===iv.BACKSPACE||t===iv.DELETE},ty=function(e){var t=e.dom,n=Cc(e),r=function(e){return e.getParam("placeholder",vc.getAttrib(e.getElement(),"placeholder"),"string")}(e),o=function(i,a){if(!function(e){if(Zv(e)){var t=e.keyCode;return!ey(e)&&(iv.metaKeyPressed(e)||e.altKey||t>=112&&t<=123||M(Qv,t))}return!1}(i)){var u=e.getBody(),c=!function(e){return Zv(e)&&!(ey(e)||"keyup"===e.type&&229===e.keyCode)}(i)&&function(e,t,n){if(Yl(st.fromDom(t),!1)){var r=""===n,o=t.firstElementChild;return!o||!e.getStyle(t.firstElementChild,"padding-left")&&!e.getStyle(t.firstElementChild,"padding-right")&&(r?!e.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(t,u,n);(""!==t.getAttrib(u,"data-mce-placeholder")!==c||a)&&(t.setAttrib(u,"data-mce-placeholder",c?r:null),t.setAttrib(u,"aria-placeholder",c?r:null),function(e,t){e.fire("PlaceholderToggle",{state:t})}(e,c),e.on(c?"keydown":"keyup",o),e.off(c?"keyup":"keydown",o))}};r&&e.on("init",function(t){o(t,!0),e.on("change SetContent ExecCommand",o),e.on("paste",function(t){return Vi.setEditorTimeout(e,function(){return o(t)})})})},ny=function(e){return void 0===e.touches||1!==e.touches.length?w.none():w.some(e.touches[0])},ry=function(e){var t=ia(w.none()),n=ia(!1),r=ma(function(t){e.fire("longpress",we(we({},t),{type:"longpress"})),n.set(!0)},400);e.on("touchstart",function(e){ny(e).each(function(o){r.cancel();var i={x:l(o.clientX),y:l(o.clientY),target:l(e.target)};r.throttle(e),n.set(!1),t.set(w.some(i))})},!0),e.on("touchmove",function(o){r.cancel(),ny(o).each(function(r){t.get().each(function(o){(function(e,t){var n=Math.abs(e.clientX-t.x()),r=Math.abs(e.clientY-t.y());return n>5||r>5})(r,o)&&(t.set(w.none()),n.set(!1),e.fire("longpresscancel"))})})},!0),e.on("touchend touchcancel",function(o){r.cancel(),"touchcancel"!==o.type&&t.get().filter(function(e){return e.target().isEqualNode(o.target)}).each(function(){n.get()?o.preventDefault():e.fire("tap",we(we({},o),{type:"tap"}))})},!0)},oy=function(e,t){return e.hasOwnProperty(t.nodeName)},iy=function(e,t){return!!pn(t)||!!an(t)&&(!oy(e,t)&&!ff(t))},ay=function(e,t){if(pn(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||oy(e,t.nextSibling)))return!0}return!1},uy=function(e){var t,n,r,o=e.dom,i=e.selection,a=e.schema,u=a.getBlockElements(),c=i.getStart(),s=e.getBody(),f=Cc(e);if(c&&an(c)&&f){var l=s.nodeName.toLowerCase();if(a.isValidChild(l,f.toLowerCase())&&!function(e,t,n){return F(ed(st.fromDom(n),st.fromDom(t)),function(t){return oy(e,t.dom())})}(u,s,c)){var d=i.getRng(),m=d.startContainer,p=d.startOffset,g=d.endContainer,h=d.endOffset,v=Am(e);for(c=s.firstChild;c;)if(iy(u,c)){if(ay(u,c)){n=c,c=c.nextSibling,o.remove(n);continue}t||(t=o.create(f,wc(e)),c.parentNode.insertBefore(t,c),r=!0),n=c,c=c.nextSibling,t.appendChild(n)}else t=null,c=c.nextSibling;r&&v&&(d.setStart(m,p),d.setEnd(g,h),i.setRng(d),e.nodeChanged())}}},cy=function(e,t,n){var r=e?1:-1;return t.setRng(Xu(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},sy=function(e,t){var n=t.selection.getRng(),r=e?Xu.fromRangeEnd(n):Xu.fromRangeStart(n);return!!function(e){return D(e.selection.getSel().modify)}(t)&&(e&&Za(r)?cy(!0,t.selection,r):!(e||!eu(r))&&cy(!1,t.selection,r))},fy=pn,ly=function(e){return fy(e)&&e.data[0]===qa},dy=function(e){return fy(e)&&e.data[e.data.length-1]===qa},my=function(e){return e.ownerDocument.createTextNode(qa)},py=function(e,t){return e?function(e){if(fy(e.previousSibling))return dy(e.previousSibling)?e.previousSibling:(e.previousSibling.appendData(qa),e.previousSibling);if(fy(e))return ly(e)?e:(e.insertData(0,qa),e);var t=my(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(fy(e.nextSibling))return ly(e.nextSibling)?e.nextSibling:(e.nextSibling.insertData(0,qa),e.nextSibling);if(fy(e))return dy(e)?e:(e.appendData(qa),e);var t=my(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},gy=m(py,!0),hy=m(py,!1),vy=function(e,t){return pn(e.container())?py(t,e.container()):py(t,e.getNode())},yy=function(e,t){var n=t.get();return n&&e.container()===n&&Ga(n)},by=function(e,t){return t.fold(function(t){Jc(e.get());var n=gy(t);return e.set(n),w.some(Xu(n,n.length-1))},function(t){return Gs(t).map(function(t){if(yy(t,e))return Xu(e.get(),1);Jc(e.get());var n=vy(t,!0);return e.set(n),Xu(n,1)})},function(t){return Js(t).map(function(t){if(yy(t,e))return Xu(e.get(),e.get().length-1);Jc(e.get());var n=vy(t,!1);return e.set(n),Xu(n,n.length-1)})},function(t){Jc(e.get());var n=hy(t);return e.set(n),w.some(Xu(n,1))})},Cy=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,wy=function(e,t){return yt(st.fromDom(t),function(e){return e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")}(e))},xy=function(e){return"rtl"===ea.DOM.getStyle(e,"direction",!0)||(t=e.textContent,Cy.test(t));var t},Sy=function(e,t,n){var r=function(e,t,n){return V(ea.DOM.getParents(n.container(),"*",t),e)}(e,t,n);return w.from(r[r.length-1])},Ny=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Ga(n)?pn(n.nextSibling)?Xu(n.nextSibling,0):Xu.after(n):Za(t)?Xu(n,r+1):t:Ga(n)?pn(n.previousSibling)?Xu(n.previousSibling,n.previousSibling.data.length):Xu.before(n):eu(t)?Xu(n,r-1):t},Ey=m(Ny,!0),ky=m(Ny,!1),_y=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return w.none()},Ty=Mi([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Ry=function(e,t){var n=ps(t,e);return n||e},Ay=function(e,t,n){var r=Ey(n),o=Ry(t,r.container());return Sy(e,o,r).fold(function(){return Xs(o,r).bind(m(Sy,e,o)).map(function(e){return Ty.before(e)})},w.none)},Dy=function(e,t){return null===Zs(e,t)},Oy=function(e,t,n){return Sy(e,t,n).filter(m(Dy,t))},By=function(e,t,n){var r=ky(n);return Oy(e,t,r).bind(function(e){return Ys(e,r).isNone()?w.some(Ty.start(e)):w.none()})},Py=function(e,t,n){var r=Ey(n);return Oy(e,t,r).bind(function(e){return Xs(e,r).isNone()?w.some(Ty.end(e)):w.none()})},Ly=function(e,t,n){var r=ky(n),o=Ry(t,r.container());return Sy(e,o,r).fold(function(){return Ys(o,r).bind(m(Sy,e,o)).map(function(e){return Ty.after(e)})},w.none)},Iy=function(e){return!1===xy(Fy(e))},My=function(e,t,n){return _y([Ay,By,Py,Ly],[e,t,n]).filter(Iy)},Fy=function(e){return e.fold(d,d,d,d)},Uy=function(e){return e.fold(l("before"),l("start"),l("end"),l("after"))},zy=function(e){return e.fold(Ty.before,Ty.before,Ty.after,Ty.after)},jy=function(e){return e.fold(Ty.start,Ty.start,Ty.end,Ty.end)},Hy=function(e,t,n,r,o,i){return iu(Sy(t,n,r),Sy(t,n,o),function(t,r){return t!==r&&function(e,t,n){var r=ps(t,e),o=ps(n,e);return r&&r===o}(n,t,r)?Ty.after(e?t:r):i}).getOr(i)},Vy=function(e,t){return e.fold(l(!0),function(e){return r=t,!(Uy(n=e)===Uy(r)&&Fy(n)===Fy(r));var n,r})},qy=function(e,t){return e?t.fold(f(w.some,Ty.start),w.none,f(w.some,Ty.after),w.none):t.fold(w.none,f(w.some,Ty.before),w.none,f(w.some,Ty.end))},$y=function(e,t,n,r){var o=Ny(e,r),i=My(t,n,o);return My(t,n,o).bind(m(qy,e)).orThunk(function(){return function(e,t,n,r,o){var i=Ny(e,o);return qs(e,n,i).map(m(Ny,e)).fold(function(){return r.map(zy)},function(o){return My(t,n,o).map(m(Hy,e,t,n,i,o)).filter(m(Vy,r))}).filter(Iy)}(e,t,n,i,r)})},Wy=(m($y,!1),m($y,!0),function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)}),Ky=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},Xy=function(e,t,n){return by(t,n).map(function(t){return Wy(e,t),n})},Yy=function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=Xu.fromRangeStart(e.selection.getRng());Xu.isTextPosition(n)&&!1===function(e){return Za(e)||eu(e)}(n)&&(Wy(e,Gc(t.get(),n)),t.set(null))}},Gy=function(e,t,n){return function(){return!!Fc(e)&&function(e,t,n){var r=e.getBody(),o=Xu.fromRangeStart(e.selection.getRng()),i=m(wy,e);return $y(n,i,r,o).bind(function(n){return Xy(e,t,n)})}(e,t,n).isSome()}},Jy=function(e,t,n){return function(){return!!Fc(t)&&sy(e,t)}},Qy=function(e){var t=ia(null),n=m(wy,e);return e.on("NodeChange",function(r){var o,i,a,u,c,s;!Fc(e)||nt.browser.isIE()&&r.initial||(o=n,i=e.dom,a=r.parents,u=U(xa(st.fromDom(i.getRoot()),'*[data-mce-selected="inline-boundary"]'),function(e){return e.dom()}),c=V(u,o),s=V(a,o),z(J(c,s),m(Ky,!1)),z(J(s,c),m(Ky,!0)),Yy(e,t),function(e,t,n,r){if(t.selection.isCollapsed()){var o=V(r,e);z(o,function(r){var o=Xu.fromRangeStart(t.selection.getRng());My(e,t.getBody(),o).bind(function(e){return Xy(t,n,e)})})}}(n,e,t,r.parents))}),t},Zy=m(Jy,!0),eb=m(Jy,!1);!function(e){e[e.Br=0]="Br",e[e.Block=1]="Block",e[e.Wrap=2]="Wrap",e[e.Eol=3]="Eol"}(qv||(qv={}));var tb,nb=function(e,t){return e===Ku.Backwards?G(t):t},rb=function(e,t,n){return e===Ku.Forwards?t.next(n):t.prev(n)},ob=function(e,t,n,r){return yn(r.getNode(t===Ku.Forwards))?qv.Br:!1===gs(n,r)?qv.Block:qv.Wrap},ib=function(e,t,n,r){for(var o,i=Us(n),a=r,u=[];a&&(o=rb(t,i,a));){if(yn(o.getNode(!1)))return t===Ku.Forwards?{positions:nb(t,u).concat([o]),breakType:qv.Br,breakAt:w.some(o)}:{positions:nb(t,u),breakType:qv.Br,breakAt:w.some(o)};if(o.isVisible()){if(e(a,o)){var c=ob(0,t,a,o);return{positions:nb(t,u),breakType:c,breakAt:w.some(o)}}u.push(o),a=o}else a=o}return{positions:nb(t,u),breakType:qv.Eol,breakAt:w.none()}},ab=function(e,t,n,r){return t(n,r).breakAt.map(function(r){var o=t(n,r).positions;return e===Ku.Backwards?o.concat(r):[r].concat(o)}).getOr([])},ub=function(e,t){return $(e,function(e,n){return e.fold(function(){return w.some(n)},function(r){return iu(Q(r.getClientRects()),Q(n.getClientRects()),function(e,o){var i=Math.abs(t-e.left);return Math.abs(t-o.left)<=i?n:r}).or(e)})},w.none())},cb=function(e,t){return Q(t.getClientRects()).bind(function(t){return ub(e,t.left)})},sb=m(ib,Wu.isAbove,-1),fb=m(ib,Wu.isBelow,1),lb=m(ab,-1,sb),db=m(ab,1,fb),mb=function(e){var t=function(t){return U(t,function(t){return(t=uu(t)).node=e,t})};if(an(e))return t(e.getClientRects());if(pn(e)){var n=e.ownerDocument.createRange();return n.setStart(e,0),n.setEnd(e,e.data.length),t(n.getClientRects())}},pb=function(e){return X(e,mb)};!function(e){e[e.Up=-1]="Up",e[e.Down=1]="Down"}(tb||(tb={}));var gb,hb,vb=function(e,t,n,r,o,i){var a=0,u=[],c=function(r){var i,c,f;for(f=pb([r]),-1===e&&(f=f.reverse()),i=0;i<f.length;i++)if(c=f[i],!n(c,s)){if(u.length>0&&t(c,Ce(u))&&a++,c.line=a,o(c))return!0;u.push(c)}},s=Ce(i.getClientRects());if(!s)return u;var f=i.getNode();return c(f),function(e,t,n,r){for(;r=ms(r,e,_u,t);)if(n(r))return}(e,r,c,f),u},yb=m(vb,tb.Up,fu,lu),bb=m(vb,tb.Down,lu,fu),Cb=function(e){return function(t){return function(e,t){return t.line>e}(e,t)}},wb=function(e){return function(t){return function(e,t){return t.line===e}(e,t)}},xb=Cn,Sb=ms,Nb=function(e,t){return Math.abs(e.left-t)},Eb=function(e,t){return Math.abs(e.right-t)},kb=function(e,t){return e>=t.left&&e<=t.right},_b=function(e,t){return e>=t.top&&e<=t.bottom},Tb=function(e,t){return ye(e,function(e,n){var r=Math.min(Nb(e,t),Eb(e,t)),o=Math.min(Nb(n,t),Eb(n,t));return kb(t,n)?n:kb(t,e)?e:o===r&&xb(n.node)?n:o<r?n:e})},Rb=function(e,t,n,r,o){var i=Sb(r,e,_u,t,!o);do{if(!i||n(i))return}while(i=Sb(i,e,_u,t))},Ab=function(e,t,n){var r=pb(function(e){return V(ee(e.getElementsByTagName("*")),rs)}(e)),o=V(r,m(_b,n)),i=Tb(o,t);if(i){var a=!ln(i.node);if((i=Tb(function(e,t,n){void 0===n&&(n=!0);var r=[],o=function(e,n){var o=V(pb([n]),function(n){return!e(n,t)});return r=r.concat(o),0===o.length};return r.push(t),Rb(tb.Up,e,m(o,fu),t.node,n),Rb(tb.Down,e,m(o,lu),t.node,n),r}(e,i,a),t))&&rs(i.node))return function(e,t){return{node:e.node,before:Nb(e,t)<Eb(e,t)}}(i,t)}return null},Db=bn,Ob=Cn,Bb=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},Pb=function(e,t){return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:function(e){var t=e.ownerDocument.createRange();return t.selectNode(e),t}(t)},Lb=function(e,t,n){var r=xs(1,e.getBody(),t),o=Xu.fromRangeStart(r),i=o.getNode();if(Ob(i))return Bb(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(Ob(a))return Bb(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return Ob(e)||Db(e)});return Ob(u)?Bb(1,e,u,!1,n):null},Ib=function(e,t,n){if(!t||!t.collapsed)return t;var r=Lb(e,t,n);return r||t},Mb=Cn,Fb=mu,Ub=function(e,t,n,r){var o=e===Ku.Forwards,i=o?Hl:Vl;if(!r.collapsed){var a=Fb(r);if(Mb(a))return Bb(e,t,a,e===Ku.Backwards,!0)}var u=function(e){return Ya(e.startContainer)}(r),c=Ns(e,t.getBody(),r);if(i(c))return Pb(t,c.getNode(!o));var s=Ny(o,n(c));if(!s)return u?r:null;if(i(s))return Bb(e,t,s.getNode(!o),o,!0);var f=n(s);return f&&i(f)&&_s(s,f)?Bb(e,t,f.getNode(!o),o,!0):u?Ib(t,s.toRange(),!0):null},zb=function(e,t,n,r){var o,i,a,u;u=Fb(r);var c=Ns(e,t.getBody(),r),s=n(t.getBody(),Cb(1),c),f=V(s,wb(1)),l=Ce(c.getClientRects());if((Hl(c)||zl(c))&&(u=c.getNode()),(Vl(c)||jl(c))&&(u=c.getNode(!0)),!l)return null;var d=l.left;if((o=Tb(f,d))&&Mb(o.node))return i=Math.abs(d-o.left),a=Math.abs(d-o.right),Bb(e,t,o.node,i<a,!0);if(u){var m=function(e,t,n,r){var o,i,a,u,c,s=Us(t),f=[],l=0,d=function(e){return Ce(e.getClientRects())};1===e?(o=s.next,i=lu,a=fu,u=Xu.after(r)):(o=s.prev,i=fu,a=lu,u=Xu.before(r));var m=d(u);do{if(u.isVisible()&&!a(c=d(u),m)){if(f.length>0&&i(c,Ce(f))&&l++,(c=uu(c)).position=u,c.line=l,n(c))return f;f.push(c)}}while(u=o(u));return f}(e,t.getBody(),Cb(1),u);if(o=Tb(V(m,wb(1)),d))return Ib(t,o.position.toRange(),!0);if(o=Ce(V(m,wb(0))))return Ib(t,o.position.toRange(),!0)}},jb=function(e,t,n){var r,o,i=Us(e.getBody()),a=m(ks,i.next),u=m(ks,i.prev);if(n.collapsed&&function(e){return""!==Cc(e)}(e)){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?a(Xu.fromRangeStart(n)):u(Xu.fromRangeStart(n)))||(o=function(e){var t=e.dom.create(Cc(e));return(!nt.ie||nt.ie>=11)&&(t.innerHTML='<br data-mce-bogus="1">'),t}(e),1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},Hb=function(e,t){return function(){var n=function(e,t){var n,r=Us(e.getBody()),o=m(ks,r.next),i=m(ks,r.prev),a=t?Ku.Forwards:Ku.Backwards,u=t?o:i,c=e.selection.getRng();return(n=Ub(a,e,u,c))?n:(n=jb(e,a,c))||null}(e,t);return!!n&&(e.selection.setRng(n),!0)}},Vb=function(e,t){return function(){var n=function(e,t){var n,r=t?1:-1,o=t?bb:yb,i=e.selection.getRng();return(n=zb(r,e,o,i))?n:(n=jb(e,r,i))||null}(e,t);return!!n&&(e.selection.setRng(n),!0)}},qb=function(e,t){return function(){var n=t?Xu.fromRangeEnd(e.selection.getRng()):Xu.fromRangeStart(e.selection.getRng()),r=t?fb(e.getBody(),n):sb(e.getBody(),n);return(t?Z(r.positions):Q(r.positions)).filter(function(e){return function(t){return e?Vl(t):Hl(t)}}(t)).fold(l(!1),function(t){return e.selection.setRng(t.toRange()),!0})}},$b=function(e,t,n,r,o){var i=xa(st.fromDom(n),"td,th,caption").map(function(e){return e.dom()});return function(e,t,n){return $(e,function(e,r){return e.fold(function(){return w.some(r)},function(e){var o=Math.sqrt(Math.abs(e.x-t)+Math.abs(e.y-n)),i=Math.sqrt(Math.abs(r.x-t)+Math.abs(r.y-n));return w.some(i<o?r:e)})},w.none())}(V(function(e,t){return X(t,function(t){var n=function(e,t){return{left:e.left-t,top:e.top-t,right:e.right+2*t,bottom:e.bottom+2*t,width:e.width+t,height:e.height+t}}(uu(t.getBoundingClientRect()),-1);return[{x:n.left,y:e(n),cell:t},{x:n.right,y:e(n),cell:t}]})}(e,i),function(e){return t(e,o)}),r,o).map(function(e){return e.cell})},Wb=m($b,function(e){return e.bottom},function(e,t){return e.y<t}),Kb=m($b,function(e){return e.top},function(e,t){return e.y>t}),Xb=function(e,t){return Q(t.getClientRects()).bind(function(t){return Wb(e,t.left,t.top)}).bind(function(e){return cb(Js(n=e).map(function(e){return sb(n,e).positions.concat(e)}).getOr([]),t);var n})},Yb=function(e,t){return Z(t.getClientRects()).bind(function(t){return Kb(e,t.left,t.top)}).bind(function(e){return cb(Gs(n=e).map(function(e){return[e].concat(fb(n,e).positions)}).getOr([]),t);var n})},Gb=function(e,t){e.selection.setRng(t),Ih(e,t)},Jb=function(e,t,n){var r=e(t,n);return function(e){return e.breakType===qv.Wrap&&0===e.positions.length}(r)||!yn(n.getNode())&&function(e){return e.breakType===qv.Br&&1===e.positions.length}(r)?!function(e,t,n){return n.breakAt.map(function(n){return e(t,n).breakAt.isSome()}).getOr(!1)}(e,t,r):r.breakAt.isNone()},Qb=m(Jb,sb),Zb=m(Jb,fb),eC=function(e,t,n,r){var o=e.selection.getRng(),i=t?1:-1;if(ns()&&function(e,t,n){var r=Xu.fromRangeStart(t);return Ks(!e,n).map(function(e){return e.isEqual(r)}).getOr(!1)}(t,o,n)){var a=Bb(i,e,n,!t,!0);return Gb(e,a),!0}return!1},tC=function(e,t){var n=t.getNode(e);return an(n)&&"TABLE"===n.nodeName?w.some(n):w.none()},nC=function(e,t,n){var r=tC(!!t,n),o=!1===t;r.fold(function(){return Gb(e,n.toRange())},function(r){return Ks(o,e.getBody()).filter(function(e){return e.isEqual(n)}).fold(function(){return Gb(e,n.toRange())},function(o){return function(e,t,n,r){var o=Cc(t);o?t.undoManager.transact(function(){var r=st.fromTag(o);Nn(r,wc(t)),Ht(r,st.fromTag("br")),e?zt(st.fromDom(n),r):Ut(st.fromDom(n),r);var i=t.dom.createRng();i.setStart(r.dom(),0),i.setEnd(r.dom(),0),Gb(t,i)}):Gb(t,r.toRange())}(t,e,r,n)})})},rC=function(e,t,n,r){var o=e.selection.getRng(),i=Xu.fromRangeStart(o),a=e.getBody();if(!t&&Qb(r,i)){var u=function(e,t,n){return Xb(t,n).orThunk(function(){return Q(n.getClientRects()).bind(function(n){return ub(lb(e,Xu.before(t)),n.left)})}).getOr(Xu.before(t))}(a,n,i);return nC(e,t,u),!0}if(t&&Zb(r,i)){u=function(e,t,n){return Yb(t,n).orThunk(function(){return Q(n.getClientRects()).bind(function(n){return ub(db(e,Xu.after(t)),n.left)})}).getOr(Xu.after(t))}(a,n,i);return nC(e,t,u),!0}return!1},oC=function(e,t){return function(){return w.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind(function(n){return w.from(e.dom.getParent(n,"table")).map(function(n){return eC(e,t,n)})}).getOr(!1)}},iC=function(e,t){return function(){return w.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind(function(n){return w.from(e.dom.getParent(n,"table")).map(function(r){return rC(e,t,r,n)})}).getOr(!1)}},aC=function(e){return M(["figcaption"],ft(e))},uC=function(t){var n=e.document.createRange();return n.setStartBefore(t.dom()),n.setEndBefore(t.dom()),n},cC=function(e,t,n){n?Ht(e,t):jt(e,t)},sC=function(e,t,n,r){return""===t?function(e,t){var n=st.fromTag("br");return cC(e,n,t),uC(n)}(e,r):function(e,t,n,r){var o=st.fromTag(n),i=st.fromTag("br");return Nn(o,r),Ht(o,i),cC(e,o,t),uC(i)}(e,r,t,n)},fC=function(e,t,n){return t?function(e,t){return fb(e,t).breakAt.isNone()}(e.dom(),n):function(e,t){return sb(e,t).breakAt.isNone()}(e.dom(),n)},lC=function(e,t){var n=st.fromDom(e.getBody()),r=Xu.fromRangeStart(e.selection.getRng()),o=Cc(e),i=wc(e);return function(e,t){var n=m(Ct,t);return Ea(st.fromDom(e.container()),Fn,n).filter(aC)}(r,n).exists(function(){if(fC(n,t,r)){var a=sC(n,o,i,t);return e.selection.setRng(a),!0}return!1})},dC=function(e,t){return function(){return!!e.selection.isCollapsed()&&lC(e,t)}},mC=function(e,t){return X(function(e){return U(e,function(e){return we({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:s},e)})}(e),function(e){return function(e,t){return t.keyCode===e.keyCode&&t.shiftKey===e.shiftKey&&t.altKey===e.altKey&&t.ctrlKey===e.ctrlKey&&t.metaKey===e.metaKey}(e,t)?[e]:[]})},pC=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){return e.apply(null,t)}},gC=function(e,t){return W(mC(e,t),function(e){return e.action()})},hC=function(e,t){e.on("keydown",function(n){!1===n.isDefaultPrevented()&&function(e,t,n){var r=Ke().os;gC([{keyCode:iv.RIGHT,action:Hb(e,!0)},{keyCode:iv.LEFT,action:Hb(e,!1)},{keyCode:iv.UP,action:Vb(e,!1)},{keyCode:iv.DOWN,action:Vb(e,!0)},{keyCode:iv.RIGHT,action:oC(e,!0)},{keyCode:iv.LEFT,action:oC(e,!1)},{keyCode:iv.UP,action:iC(e,!1)},{keyCode:iv.DOWN,action:iC(e,!0)},{keyCode:iv.RIGHT,action:Gy(e,t,!0)},{keyCode:iv.LEFT,action:Gy(e,t,!1)},{keyCode:iv.RIGHT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:Zy(e,t)},{keyCode:iv.LEFT,ctrlKey:!r.isOSX(),altKey:r.isOSX(),action:eb(e,t)},{keyCode:iv.UP,action:dC(e,!1)},{keyCode:iv.DOWN,action:dC(e,!0)}],n).each(function(e){n.preventDefault()})}(e,t,n)})},vC=function(e,t){return xt(e,t)?Ea(t,function(e){return jn(e)||Vn(e)},function(e){return function(t){return Ct(e,st.fromDom(t.dom().parentNode))}}(e)):w.none()},yC=function(e){e.dom.isEmpty(e.getBody())&&(e.setContent(""),function(e){var t=e.getBody(),n=t.firstChild&&e.dom.isBlock(t.firstChild)?t.firstChild:t;e.selection.setCursorLocation(n,0)}(e))},bC=function(e,t){return{from:e,to:t}},CC=function(e,t){var n=st.fromDom(e),r=st.fromDom(t.container());return vC(n,r).map(function(e){return function(e,t){return{block:e,position:t}}(e,t)})},wC=function(e,t,n){var r=CC(e,Xu.fromRangeStart(n)),o=r.bind(function(n){return qs(t,e,n.position).bind(function(n){return CC(e,n).map(function(n){return function(e,t,n){return yn(n.position.getNode())&&!1===Yl(n.block)?Ks(!1,n.block.dom()).bind(function(r){return r.isEqual(n.position)?qs(t,e,r).bind(function(t){return CC(e,t)}):w.some(n)}).getOr(n):n}(e,t,n)})})});return iu(r,o,bC).filter(function(e){return function(e){return!1===Ct(e.from.block,e.to.block)}(e)&&function(e){return kt(e.from.block).bind(function(t){return kt(e.to.block).filter(function(e){return Ct(t,e)})}).isSome()}(e)&&function(e){return!1===Cn(e.from.block.dom())&&!1===Cn(e.to.block.dom())}(e)})},xC=function(e){var t=Dt(e);return K(t,Fn).fold(function(){return t},function(e){return t.slice(0,e)})},SC=function(e){var t=xC(e);return z(t,$t),t},NC=function(e,t){var n=td(t,e);return W(n.reverse(),function(e){return Yl(e)}).each($t)},EC=function(e,t,n,r){if(Yl(n))return Jl(n),Gs(n.dom());0===V(Rt(r),function(e){return!Yl(e)}).length&&Yl(t)&&Ut(r,st.fromTag("br"));var o=Ys(n.dom(),Xu.before(r.dom()));return z(SC(t),function(e){Ut(r,e)}),NC(e,t),o},kC=function(e,t,n){if(Yl(n))return $t(n),Yl(t)&&Jl(t),Gs(t.dom());var r=Js(n.dom());return z(SC(t),function(e){Ht(n,e)}),NC(e,t),r},_C=function(e,t){return xt(t,e)?function(e,t){var n=td(t,e);return w.from(n[n.length-1])}(t,e):w.none()},TC=function(e,t){Ks(e,t.dom()).map(function(e){return e.getNode()}).map(st.fromDom).filter(zn).each($t)},RC=function(e,t,n){return TC(!0,t),TC(!1,n),_C(t,n).fold(m(kC,e,t,n),m(EC,e,t,n))},AC=function(e,t,n,r){return t?RC(e,r,n):RC(e,n,r)},DC=function(e,t){var n=st.fromDom(e.getBody()),r=function(e,t,n){return n.collapsed?wC(e,t,n):w.none()}(n.dom(),t,e.selection.getRng()).bind(function(e){return AC(n,t,e.from.block,e.to.block)});return r.each(function(t){e.selection.setRng(t.toRange())}),r.isSome()},OC=function(e,t){var n=st.fromDom(t),r=m(Ct,e);return Na(n,Wn,r).isSome()},BC=function(e,t){var n=Ys(e.dom(),Xu.fromRangeStart(t)).isNone(),r=Xs(e.dom(),Xu.fromRangeEnd(t)).isNone();return!function(e,t){return OC(e,t.startContainer)||OC(e,t.endContainer)}(e,t)&&n&&r},PC=function(e){var t=st.fromDom(e.getBody()),n=e.selection.getRng();return BC(t,n)?function(e){return e.setContent(""),e.selection.setCursorLocation(),!0}(e):function(e,t){var n=t.getRng();return iu(vC(e,st.fromDom(n.startContainer)),vC(e,st.fromDom(n.endContainer)),function(r,o){return!1===Ct(r,o)&&(n.deleteContents(),AC(e,!0,r,o).each(function(e){t.setRng(e.toRange())}),!0)}).getOr(!1)}(t,e.selection)},LC=function(e,t){return!e.selection.isCollapsed()&&PC(e)},IC=function(e){return Es(e).exists(zn)},MC=function(e,t,n){var r=V(td(st.fromDom(n.container()),t),Fn),o=Q(r).getOr(t);return qs(e,o.dom(),n).filter(IC)},FC=function(e,t){return Es(t).exists(zn)||MC(!0,e,t).isSome()},UC=function(e,t){return function(e){return w.from(e.getNode(!0)).map(st.fromDom)}(t).exists(zn)||MC(!1,e,t).isSome()},zC=m(MC,!1),jC=m(MC,!0),HC=Mi([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),VC=function(e,t,n,r){var o=r.getNode(!1===t);return vC(st.fromDom(e),st.fromDom(n.getNode())).map(function(e){return Yl(e)?HC.remove(e.dom()):HC.moveToElement(o)}).orThunk(function(){return w.some(HC.moveToElement(o))})},qC=function(e,t,n){return qs(t,e,n).bind(function(r){return o=r.getNode(),Wn(st.fromDom(o))||Vn(st.fromDom(o))?w.none():function(e,t,n,r){var o=function(t){return Un(st.fromDom(t))&&!gs(n,r,e)};return Ss(!t,n).fold(function(){return Ss(t,r).fold(l(!1),o)},o)}(e,t,n,r)?w.none():t&&Cn(r.getNode())?VC(e,t,n,r):!1===t&&Cn(r.getNode(!0))?VC(e,t,n,r):t&&Vl(n)?w.some(HC.moveToPosition(r)):!1===t&&Hl(n)?w.some(HC.moveToPosition(r)):w.none();var o})},$C=function(e,t,n){return function(e,t){var n=t.getNode(!1===e),r=e?"after":"before";return an(n)&&n.getAttribute("data-mce-caret")===r}(t,n)?function(e,t){return e&&Cn(t.nextSibling)?w.some(HC.moveToElement(t.nextSibling)):!1===e&&Cn(t.previousSibling)?w.some(HC.moveToElement(t.previousSibling)):w.none()}(t,n.getNode(!1===t)).fold(function(){return qC(e,t,n)},w.some):qC(e,t,n).bind(function(t){return function(e,t,n){return n.fold(function(e){return w.some(HC.remove(e))},function(e){return w.some(HC.moveToElement(e))},function(n){return gs(t,n,e)?w.none():w.some(HC.moveToPosition(n))})}(e,n,t)})},WC=function(e,t){return w.from(YC(e.getBody(),t))},KC=function(e,t){var n=e.selection.getNode();return WC(e,n).filter(Cn).fold(function(){return function(e,t,n){var r=xs(t?1:-1,e,n),o=Xu.fromRangeStart(r),i=st.fromDom(e);return!1===t&&Vl(o)?w.some(HC.remove(o.getNode(!0))):t&&Hl(o)?w.some(HC.remove(o.getNode())):!1===t&&Hl(o)&&UC(i,o)?zC(i,o).map(function(e){return HC.remove(e.getNode())}):t&&Vl(o)&&FC(i,o)?jC(i,o).map(function(e){return HC.remove(e.getNode())}):$C(e,t,o)}(e.getBody(),t,e.selection.getRng()).map(function(n){return n.fold(function(e,t){return function(n){return e._selectionOverrides.hideFakeCaret(),pd(e,t,st.fromDom(n)),!0}}(e,t),function(e,t){return function(n){var r=t?Xu.before(n):Xu.after(n);return e.selection.setRng(r.toRange()),!0}}(e,t),function(e){return function(t){return e.selection.setRng(t.toRange()),!0}}(e))}).getOr(!1)},function(){return!0})},XC=function(e,t){var n=e.selection.getNode();return!!Cn(n)&&WC(e,n.parentNode).filter(Cn).fold(function(){var n;return n=st.fromDom(e.getBody()),z(xa(n,".mce-offscreen-selection"),$t),pd(e,t,st.fromDom(e.selection.getNode())),yC(e),!0},function(){return!0})},YC=function(e,t){for(;t&&t!==e;){if(bn(t)||Cn(t))return t;t=t.parentNode}return null},GC=function(e){var t,n=YC(e.getBody(),e.selection.getNode());return bn(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(Xu.before(t).toRange())),!0},JC=function(e,t){return e.selection.isCollapsed()?KC(e,t):XC(e,t)},QC=function(e,t,n,r,o,i){var a=Bb(r,e,i.getNode(!o),o,!0);if(t.collapsed){var u=t.cloneRange();o?u.setEnd(a.startContainer,a.startOffset):u.setStart(a.endContainer,a.endOffset),u.deleteContents()}else t.deleteContents();return e.selection.setRng(a),function(e,t){pn(t)&&0===t.data.length&&e.remove(t)}(e.dom,n),!0},ZC=function(e,t){return function(e,t){var n=e.selection.getRng();if(!pn(n.commonAncestorContainer))return!1;var r=t?Ku.Forwards:Ku.Backwards,o=Us(e.getBody()),i=m(ks,o.next),a=m(ks,o.prev),u=t?i:a,c=t?Hl:Vl,s=Ns(r,e.getBody(),n),f=Ny(t,u(s));if(!f||!_s(s,f))return!1;if(c(f))return QC(e,n,s.getNode(),r,t,f);var l=u(f);return!!(l&&c(l)&&_s(f,l))&&QC(e,n,s.getNode(),r,t,l)}(e,t)},ew=function(e,t){return function(n){return by(t,n).map(function(t){return Wy(e,t),!0}).getOr(!1)}},tw=function(t,n,r,o){var i=t.getBody(),a=m(wy,t);t.undoManager.ignore(function(){t.selection.setRng(function(t,n){var r=e.document.createRange();return r.setStart(t.container(),t.offset()),r.setEnd(n.container(),n.offset()),r}(r,o)),t.execCommand("Delete"),My(a,i,Xu.fromRangeStart(t.selection.getRng())).map(jy).map(ew(t,n))}),t.nodeChanged()},nw=function(e,t,n,r){var o=function(e,t){var n=ps(t,e);return n||e}(e.getBody(),r.container()),i=m(wy,e),a=My(i,o,r);return a.bind(function(e){return n?e.fold(l(w.some(jy(e))),w.none,l(w.some(zy(e))),w.none):e.fold(w.none,l(w.some(zy(e))),w.none,l(w.some(jy(e))))}).map(ew(e,t)).getOrThunk(function(){var u=$s(n,o,r),c=u.bind(function(e){return My(i,o,e)});return a.isSome()&&c.isSome()?Sy(i,o,r).map(function(t){return!!function(e){return iu(Gs(e),Js(e),function(t,n){var r=Ny(!0,t),o=Ny(!1,n);return Xs(e,r).map(function(e){return e.isEqual(o)}).getOr(!0)}).getOr(!0)}(t)&&(pd(e,n,st.fromDom(t)),!0)}).getOr(!1):c.bind(function(o){return u.map(function(o){return n?tw(e,t,r,o):tw(e,t,o,r),!0})}).getOr(!1)})},rw=function(e,t,n){if(e.selection.isCollapsed()&&Fc(e)){var r=Xu.fromRangeStart(e.selection.getRng());return nw(e,t,n,r)}return!1},ow=function(e){return 1===Dt(e).length},iw=function(e,t,n,r){var o=m(ap,t),i=U(V(r,o),function(e){return e.dom()});if(0===i.length)pd(t,e,n);else{var a=function(e,t){var n=Zm(!1),r=rp(t,n.dom());return Ut(st.fromDom(e),n),$t(st.fromDom(e)),Xu(r,0)}(n.dom(),i);t.selection.setRng(a.toRange())}},aw=function(e,t){var n=st.fromDom(e.getBody()),r=st.fromDom(e.selection.getStart()),o=V(function(e,t){var n=td(t,e);return K(n,Fn).fold(l(n),function(e){return n.slice(0,e)})}(n,r),ow);return Z(o).map(function(n){var r,i=Xu.fromRangeStart(e.selection.getRng());return!(!function(e,t,n){return iu(Gs(n),Js(n),function(r,o){var i=Ny(!0,r),a=Ny(!1,o),u=Ny(!1,t);return e?Xs(n,u).map(function(e){return e.isEqual(a)&&t.isEqual(i)}).getOr(!1):Ys(n,u).map(function(e){return e.isEqual(i)&&t.isEqual(a)}).getOr(!1)}).getOr(!0)}(t,i,n.dom())||(r=n,Qs(r.dom())&&Jm(r.dom())))&&(iw(t,e,n,o),!0)}).getOr(!1)},uw=function(e,t){return!!e.selection.isCollapsed()&&aw(e,t)},cw=function(e,t){return!!e.selection.isCollapsed()&&function(e,t){var n=Xu.fromRangeStart(e.selection.getRng());return qs(t,e.getBody(),n).filter(function(e){return t?Fl(e):Ul(e)}).bind(function(e){return w.from(hs(t?0:-1,e))}).map(function(t){return e.selection.select(t),!0}).getOr(!1)}(e,t)},sw=function(e){var t=parseInt(e,10);return isNaN(t)?0:t},fw=function(e,t){return(e||"table"===ft(t)?"margin":"padding")+("rtl"===Tn(t,"direction")?"-right":"-left")},lw=function(e){var t=mw(e);return!e.mode.isReadOnly()&&(t.length>1||function(e,t){return Y(t,function(t){var n=fw(Oc(e),t),r=An(t,n).map(sw).getOr(0);return"false"!==e.dom.getContentEditable(t.dom())&&r>0})}(e,t))},dw=function(e){return Hn(e)||Vn(e)},mw=function(e){return V(U(e.selection.getSelectedBlocks(),st.fromDom),function(e){return!dw(e)&&!function(e){return kt(e).map(dw).getOr(!1)}(e)&&Ea(e,function(e){return bn(e.dom())||Cn(e.dom())}).exists(function(e){return bn(e.dom())})})},pw=function(e,t){var n=e.dom,r=e.selection,o=e.formatter,i=function(e){return e.getParam("indentation","40px","string")}(e),a=/[a-z%]+$/i.exec(i)[0],u=parseInt(i,10),c=Oc(e),s=Cc(e);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),z(mw(e),function(e){!function(e,t,n,r,o,i){var a=fw(n,st.fromDom(i));if("outdent"===t){var u=Math.max(0,sw(i.style[a])-r);e.setStyle(i,a,u?u+o:"")}else u=sw(i.style[a])+r+o,e.setStyle(i,a,u)}(n,t,c,u,a,e.dom())})},gw=function(e,t,n){return Ws(e,t,n,Pl)},hw=function(e,t){return W(td(st.fromDom(t.container()),e),Fn)},vw=function(e,t,n){return gw(e,t.dom(),n).forall(function(e){return hw(t,n).fold(function(){return!1===gs(e,n,t.dom())},function(r){return!1===gs(e,n,t.dom())&&xt(r,st.fromDom(e.container()))})})},yw=function(e,t,n){return hw(t,n).fold(function(){return gw(e,t.dom(),n).forall(function(e){return!1===gs(e,n,t.dom())})},function(t){return gw(e,t.dom(),n).isNone()})},bw=m(yw,!1),Cw=m(yw,!0),ww=m(vw,!1),xw=m(vw,!0),Sw=function(e,t,n){if(e.selection.isCollapsed()&&lw(e)){var r=e.dom,o=e.selection.getRng(),i=Xu.fromRangeStart(o),a=r.getParent(o.startContainer,r.isBlock);if(null!==a&&bw(st.fromDom(a),i))return pw(e,"outdent"),!0}return!1},Nw=function(e,t){e.on("keydown",function(n){!1===n.isDefaultPrevented()&&function(e,t,n){gC([{keyCode:iv.BACKSPACE,action:pC(Sw,e,!1)},{keyCode:iv.BACKSPACE,action:pC(JC,e,!1)},{keyCode:iv.DELETE,action:pC(JC,e,!0)},{keyCode:iv.BACKSPACE,action:pC(ZC,e,!1)},{keyCode:iv.DELETE,action:pC(ZC,e,!0)},{keyCode:iv.BACKSPACE,action:pC(rw,e,t,!1)},{keyCode:iv.DELETE,action:pC(rw,e,t,!0)},{keyCode:iv.BACKSPACE,action:pC(jd,e,!1)},{keyCode:iv.DELETE,action:pC(jd,e,!0)},{keyCode:iv.BACKSPACE,action:pC(cw,e,!1)},{keyCode:iv.DELETE,action:pC(cw,e,!0)},{keyCode:iv.BACKSPACE,action:pC(LC,e,!1)},{keyCode:iv.DELETE,action:pC(LC,e,!0)},{keyCode:iv.BACKSPACE,action:pC(DC,e,!1)},{keyCode:iv.DELETE,action:pC(DC,e,!0)},{keyCode:iv.BACKSPACE,action:pC(uw,e,!1)},{keyCode:iv.DELETE,action:pC(uw,e,!0)}],n).each(function(e){n.preventDefault()})}(e,t,n)}),e.on("keyup",function(t){!1===t.isDefaultPrevented()&&function(e,t){gC([{keyCode:iv.BACKSPACE,action:pC(GC,e)},{keyCode:iv.DELETE,action:pC(GC,e)}],t)}(e,t)})},Ew=function(e,t){var n,r=t,o=e.dom,i=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var a=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);a&&/^(UL|OL|DL)$/.test(a.nodeName)&&t.insertBefore(o.doc.createTextNode(" "),t.firstChild)}var u=o.createRng();if(t.normalize(),t.hasChildNodes()){for(var c=new xi(t,t);n=c.current();){if(pn(n)){u.setStart(n,0),u.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}r=n,n=c.next()}n||(u.setStart(r,0),u.setEnd(r,0))}else yn(t)?t.nextSibling&&o.isBlock(t.nextSibling)?(u.setStartBefore(t),u.setEndBefore(t)):(u.setStartAfter(t),u.setEndAfter(t)):(u.setStart(t,0),u.setEnd(t,0));e.selection.setRng(u),Ih(e,u)}},kw=function(e){return w.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},_w=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},Tw=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},Rw=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},Aw=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!an(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},Dw=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;Tw(u=n)&&Tw(u.parentNode)&&(o="LI");var c=o?t(o):i.create("BR");if(Aw(n,r,!0)&&Aw(n,r,!1))_w(n,"LI")?i.insertAfter(c,Rw(n)):i.replace(c,n);else if(Aw(n,r,!0))_w(n,"LI")?(i.insertAfter(c,Rw(n)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(n)):n.parentNode.insertBefore(c,n);else if(Aw(n,r,!1))i.insertAfter(c,Rw(n));else{n=Rw(n);var s=a.cloneRange();s.setStartAfter(r),s.setEndAfter(n);var f=s.extractContents();"LI"===o&&function(e,t){return e.firstChild&&e.firstChild.nodeName===t}(f,"LI")?(c=f.firstChild,i.insertAfter(f,n)):(i.insertAfter(f,n),i.insertAfter(c,n))}i.remove(r),Ew(e,c)}},Ow=function(e,t){return t&&"A"===t.nodeName&&e.isEmpty(t)},Bw=function(e){e.innerHTML='<br data-mce-bogus="1">'},Pw=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},Lw=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},Iw=function(e,t,n){return!1===pn(t)?n:e?1===n&&t.data.charAt(n-1)===qa?0:n:n===t.data.length-1&&t.data.charAt(n)===qa?t.data.length:n},Mw=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},Fw=function(e,t){var n=Cc(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&function(e,t,n){w.from(n.style).map(e.dom.parseStyle).each(function(n){var r=Dn(st.fromDom(t)),o=we(we({},r),n);e.dom.setStyles(t,o)});var r=w.from(n.class).map(function(e){return e.split(/\s+/)}),o=w.from(t.className).map(function(e){return V(e.split(/\s+/),function(e){return""!==e})});iu(r,o,function(n,r){var o=V(r,function(e){return!M(n,e)}),i=xe(n,o);e.dom.setAttrib(t,"class",i.join(" "))});var i=["style","class"],a=se(n,function(e,t){return!M(i,t)});e.dom.setAttribs(t,a)}(e,t,wc(e))},Uw=function(e,t){var n,r,o,i,a,u,c,s,f,l,d=e.dom,m=e.schema,p=m.getNonEmptyElements(),g=e.selection.getRng(),h=function(t){var n,o,a,u=r,c=m.getTextInlineElements();if(a=n=t||"TABLE"===s||"HR"===s?d.create(t||f):i.cloneNode(!1),!1===function(e){return e.getParam("keep_styles",!0)}(e))d.setAttrib(n,"style",null),d.setAttrib(n,"class",null);else do{if(c[u.nodeName]){if(Qs(u)||ff(u))continue;o=u.cloneNode(!1),d.setAttrib(o,"id",""),n.hasChildNodes()?(o.appendChild(n.firstChild),n.appendChild(o)):(a=o,n.appendChild(o))}}while((u=u.parentNode)&&u!==w);return Fw(e,n),Bw(a),n},v=function(e){var t,n,a=Iw(e,r,o);if(pn(r)&&(e?a>0:a<r.nodeValue.length))return!1;if(r.parentNode===i&&l&&!e)return!0;if(e&&an(r)&&r===i.firstChild)return!0;if(Pw(r,"TABLE")||Pw(r,"HR"))return l&&!e||!l&&e;var u=new xi(r,i);for(pn(r)&&(e&&0===a?u.prev():e||a!==r.nodeValue.length||u.next());t=u.current();){if(an(t)){if(!t.getAttribute("data-mce-bogus")&&(n=t.nodeName.toLowerCase(),p[n]&&"br"!==n))return!1}else if(pn(t)&&!Yn(t.nodeValue))return!1;e?u.prev():u.next()}return!0},y=function(){a=/^(H[1-6]|PRE|FIGURE)$/.test(s)&&"HGROUP"!==x?h(f):h(),function(e){return e.getParam("end_container_on_empty_block",!1)}(e)&&Lw(d,c)&&d.isEmpty(i)?a=d.split(c,i):d.insertAfter(a,i),Ew(e,a)};Zh(d,g).each(function(e){g.setStart(e.startContainer,e.startOffset),g.setEnd(e.endContainer,e.endOffset)}),r=g.startContainer,o=g.startOffset,f=Cc(e);var b=!(!t||!t.shiftKey),C=!(!t||!t.ctrlKey);an(r)&&r.hasChildNodes()&&(l=o>r.childNodes.length-1,r=r.childNodes[Math.min(o,r.childNodes.length-1)]||r,o=l&&pn(r)?r.nodeValue.length:0);var w=Mw(d,r);if(w){(f&&!b||!f&&b)&&(r=function(e,t,n,r,o){var i,a,u,c,s,f,l=t||"P",d=e.dom,m=Mw(d,r);if(!(a=d.getParent(r,d.isBlock))||!Lw(d,a)){if(f=(a=a||m)===e.getBody()||function(e){return e&&/^(TD|TH|CAPTION)$/.test(e.nodeName)}(a)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=d.create(l),Fw(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(c=r;c.parentNode!==a;)c=c.parentNode;for(;c&&!d.isBlock(c);)u=c,c=c.previousSibling;if(u&&e.schema.isValidChild(f,l.toLowerCase())){for(i=d.create(l),Fw(e,i),u.parentNode.insertBefore(i,u),c=u;c&&!d.isBlock(c);)s=c.nextSibling,i.appendChild(c),c=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(e,f,g,r,o)),i=d.getParent(r,d.isBlock),c=i?d.getParent(i.parentNode,d.isBlock):null,s=i?i.nodeName.toUpperCase():"";var x=c?c.nodeName.toUpperCase():"";"LI"!==x||C||(i=c,c=c.parentNode,s=x),/^(LI|DT|DD)$/.test(s)&&d.isEmpty(i)?Dw(e,h,c,i,f):f&&i===e.getBody()||(f=f||"P",Ya(i)?(a=ou(i),d.isEmpty(i)&&Bw(i),Fw(e,a),Ew(e,a)):v()?y():v(!0)?(a=i.parentNode.insertBefore(h(),i),Ew(e,Pw(i,"HR")?a:i)):((n=function(e){var t=e.cloneRange();return t.setStart(e.startContainer,Iw(!0,e.startContainer,e.startOffset)),t.setEnd(e.endContainer,Iw(!1,e.endContainer,e.endOffset)),t}(g).cloneRange()).setEndAfter(i),function(e){z(wa(st.fromDom(e),pt),function(e){var t=e.dom();t.nodeValue=Wa(t.nodeValue)})}(u=n.extractContents()),function(e){do{pn(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild}while(e)}(u),a=u.firstChild,d.insertAfter(u,i),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;an(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):Ow(e,o)&&e.remove(o)}}(d,p,a),function(e,t){t.normalize();var n=t.lastChild;n&&!/^(left|right)$/gi.test(e.getStyle(n,"float",!0))||e.add(t,"br")}(d,i),d.isEmpty(i)&&Bw(i),a.normalize(),d.isEmpty(a)?(d.remove(a),y()):(Fw(e,a),Ew(e,a))),d.setAttrib(a,"id",""),e.fire("NewBlock",{newBlock:a}))}},zw=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},jw=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},Hw=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();Zh(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u=a.startOffset,c=a.startContainer;if(1===c.nodeType&&c.hasChildNodes()){var s=u>c.childNodes.length-1;c=c.childNodes[Math.min(u,c.childNodes.length-1)]||c,u=s&&3===c.nodeType?c.nodeValue.length:0}var f=i.getParent(c,i.isBlock),l=f?i.getParent(f.parentNode,i.isBlock):null,d=l?l.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(f=l),c&&3===c.nodeType&&u>=c.nodeValue.length&&(function(e,t,n){for(var r,o=new xi(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||r.length>0)return!0}(e.schema,c,f)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),Gu(i,a,n),zw(i,o,n),jw(i,o,n,r),e.undoManager.add()},Vw=function(e,t){var n=st.fromTag("br");Ut(st.fromDom(t),n),e.undoManager.add()},qw=function(e,t){$w(e.getBody(),t)||zt(st.fromDom(t),st.fromTag("br"));var n=st.fromTag("br");zt(st.fromDom(t),n),zw(e.dom,e.selection,n.dom()),jw(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},$w=function(e,t){return n=Xu.after(t),!!yn(n.getNode())||Xs(e,Xu.after(t)).map(function(e){return yn(e.getNode())}).getOr(!1);var n},Ww=function(e){return e&&"A"===e.nodeName&&"href"in e},Kw=function(e){return e.fold(l(!1),Ww,Ww,l(!1))},Xw=function(e,t){t.fold(s,m(Vw,e),m(qw,e),s)},Yw=function(e,t){var n=function(e){var t=m(wy,e),n=Xu.fromRangeStart(e.selection.getRng());return My(t,e.getBody(),n).filter(Kw)}(e);n.isSome()?n.each(m(Xw,e)):Hw(e,t)},Gw=function(e,t){return kw(e).filter(function(e){return t.length>0&&yt(st.fromDom(e),t)}).isSome()},Jw=Mi([{br:[]},{block:[]},{none:[]}]),Qw=function(e,t){return function(e){return Gw(e,function(e){return e.getParam("no_newline_selector","")}(e))}(e)},Zw=function(e){return function(t,n){return""===Cc(t)===e}},ex=function(e){return function(t,n){return function(e){return kw(e).filter(function(e){return Vn(st.fromDom(e))}).isSome()}(t)===e}},tx=function(e,t){return function(n,r){return function(e){return kw(e).fold(l(""),function(e){return e.nodeName.toUpperCase()})}(n)===e.toUpperCase()===t}},nx=function(e){return tx("pre",e)},rx=function(e){return function(t,n){return function(e){return e.getParam("br_in_pre",!0)}(t)===e}},ox=function(e,t){return function(e){return Gw(e,function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")}(e))}(e)},ix=function(e,t){return t},ax=function(e){var t=Cc(e),n=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o}(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},ux=function(e,t){return function(n,r){return $(e,function(e,t){return e&&t(n,r)},!0)?w.some(t):w.none()}},cx=function(e,t){(function(e,t){return _y([ux([Qw],Jw.none()),ux([tx("summary",!0)],Jw.br()),ux([nx(!0),rx(!1),ix],Jw.br()),ux([nx(!0),rx(!1)],Jw.block()),ux([nx(!0),rx(!0),ix],Jw.block()),ux([nx(!0),rx(!0)],Jw.br()),ux([ex(!0),ix],Jw.br()),ux([ex(!0)],Jw.block()),ux([Zw(!0),ix,ax],Jw.block()),ux([Zw(!0)],Jw.br()),ux([ox],Jw.br()),ux([Zw(!1),ix],Jw.br()),ux([ax],Jw.block())],[e,!(!t||!t.shiftKey)]).getOr(Jw.none())})(e,t).fold(function(){Yw(e,t)},function(){Uw(e,t)},s)},sx=function(e){e.on("keydown",function(t){t.keyCode===iv.ENTER&&function(e,t){var n;t.isDefaultPrevented()||(t.preventDefault(),(n=e.undoManager).typing&&(n.typing=!1,n.add()),e.undoManager.transact(function(){!1===e.selection.isCollapsed()&&e.execCommand("Delete"),cx(e,t)}))}(e,t)})},fx=function(e,t){var n=t.container(),r=t.offset();return pn(n)?(n.insertData(r,e),w.some(Wu(n,r+e.length))):Es(t).map(function(n){var r=st.fromText(e);return t.isAtEnd()?zt(n,r):Ut(n,r),Wu(r.dom(),e.length)})},lx=m(fx," "),dx=m(fx," "),mx=function(e){return Wu.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},px=function(e,t){var n=V(td(st.fromDom(t.container()),e),Fn);return Q(n).getOr(e)},gx=function(e,t){return mx(t)?Bl(t):Bl(t)||Ys(px(e,t).dom(),t).exists(Bl)},hx=function(e,t){return mx(t)?Ol(t):Ol(t)||Xs(px(e,t).dom(),t).exists(Ol)},vx=function(e){return Es(e).bind(function(e){return Ea(e,mt)}).exists(function(e){return t=Tn(e,"white-space"),M(["pre","pre-wrap"],t);var t})},yx=function(e,t){return function(e,t){return Ys(e.dom(),t).isNone()}(e,t)||function(e,t){return Xs(e.dom(),t).isNone()}(e,t)||bw(e,t)||Cw(e,t)||UC(e,t)||FC(e,t)},bx=function(e,t){var n=function(e){var t=e.container(),n=e.offset();return pn(t)&&n<t.data.length?Wu(t,n+1):e}(t);return!vx(n)&&(Cw(e,n)||xw(e,n)||FC(e,n)||hx(e,n))},Cx=function(e,t){return function(e,t){return!vx(t)&&(bw(e,t)||ww(e,t)||UC(e,t)||gx(e,t))}(e,t)||bx(e,t)},wx=function(e,t){return lf(e.charAt(t))},xx=function(e){var t=e.container();return pn(t)&&Be(t.data," ")},Sx=function(e){var t=e.data,n=function(e){var t=e.split("");return U(t,function(e,n){return lf(e)&&n>0&&n<t.length-1&&mf(t[n-1])&&mf(t[n+1])?" ":e}).join("")}(t);return n!==t&&(e.data=n,!0)},Nx=function(e,t){return w.some(t).filter(xx).bind(function(t){var n=t.container();return function(e,t){var n=t.data,r=Wu(t,0);return!(!wx(n,0)||Cx(e,r)||(t.data=" "+n.slice(1),0))}(e,n)||Sx(n)||function(e,t){var n=t.data,r=Wu(t,n.length-1);return!(!wx(n,n.length-1)||Cx(e,r)||(t.data=n.slice(0,-1)+" ",0))}(e,n)?w.some(t):w.none()})},Ex=function(e){var t=st.fromDom(e.getBody());e.selection.isCollapsed()&&Nx(t,Wu.fromRangeStart(e.selection.getRng())).each(function(t){e.selection.setRng(t.toRange())})},kx=function(e,t){return function(n){return function(e,t){return!vx(t)&&(yx(e,t)||gx(e,t)||hx(e,t))}(e,n)?lx(t):dx(t)}},_x=function(e){var t=Xu.fromRangeStart(e.selection.getRng()),n=st.fromDom(e.getBody());if(e.selection.isCollapsed()){var r=m(wy,e),o=Xu.fromRangeStart(e.selection.getRng());return My(r,e.getBody(),o).bind(function(e){return function(t){return t.fold(function(t){return Ys(e.dom(),Xu.before(t))},function(e){return Gs(e)},function(e){return Js(e)},function(t){return Xs(e.dom(),Xu.after(t))})}}(n)).bind(kx(n,t)).exists(function(e){return function(t){return e.selection.setRng(t.toRange()),e.nodeChanged(),!0}}(e))}return!1},Tx=function(e){e.on("keydown",function(t){!1===t.isDefaultPrevented()&&function(e,t){gC([{keyCode:iv.SPACEBAR,action:pC(_x,e)}],t).each(function(e){t.preventDefault()})}(e,t)})},Rx=function(e,t){t.hasAttribute("data-mce-caret")&&(ou(t),function(e){e.selection.setRng(e.selection.getRng())}(e),e.selection.scrollIntoView(t))},Ax=function(e,t){var n=function(e){return _a(st.fromDom(e.getBody()),"*[data-mce-caret]").fold(l(null),function(e){return e.dom()})}(e);if(n)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void Rx(e,n)):void(Qa(n)&&(Rx(e,n),e.undoManager.add()))},Dx=Ke().browser,Ox=function(e){!function(e){var t=da(function(){e.composing||Ex(e)},0);Dx.isIE()&&(e.on("keypress",function(e){t.throttle()}),e.on("remove",function(e){t.cancel()}))}(e),e.on("input",function(t){!1===t.isComposing&&Ex(e)})},Bx=function(e){e.on("keydown",function(t){!1===t.isDefaultPrevented()&&function(e,t){gC([{keyCode:iv.END,action:qb(e,!0)},{keyCode:iv.HOME,action:qb(e,!1)}],t).each(function(e){t.preventDefault()})}(e,t)})},Px=function(e){var t=Qy(e);!function(e){e.on("keyup compositionstart",m(Ax,e))}(e),hC(e,t),Nw(e,t),sx(e),Tx(e),Ox(e),Bx(e)},Lx=function(){function e(e){var t;this.lastPath=[],this.editor=e;var n=this;"onselectionchange"in e.getDoc()||e.on("NodeChange click mouseup keyup focus",function(n){var r=e.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&qh(o,t)||e.fire("SelectionChange"),t=o}),e.on("contextmenu",function(){e.fire("SelectionChange")}),e.on("SelectionChange",function(){var t=e.selection.getStart(!0);!t||!nt.range&&e.selection.isCollapsed()||Gf(e)&&!n.isSameElementPath(t)&&e.dom.isChildOf(t,e.getBody())&&e.nodeChanged({selectionChange:!0})}),e.on("mouseup",function(t){!t.isDefaultPrevented()&&Gf(e)&&("IMG"===e.selection.getNode().nodeName?Vi.setEditorTimeout(e,function(){e.nodeChanged()}):e.nodeChanged())})}return e.prototype.nodeChanged=function(e){var t,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(t=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(t,r)||(t=r),n=[],this.editor.dom.getParent(t,function(e){if(e===r)return!0;n.push(e)}),(e=e||{}).element=t,e.parents=n,this.editor.fire("NodeChange",e))},e.prototype.isSameElementPath=function(e){var t,n=this.editor.$(e).parentsUntil(this.editor.getBody()).add(e);if(n.length===this.lastPath.length){for(t=n.length;t>=0&&n[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1},e}(),Ix=function(e){!function(e){e.on("click",function(t){e.dom.getParent(t.target,"details")&&t.preventDefault()})}(e),function(e){e.parser.addNodeFilter("details",function(e){z(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),e.serializer.addNodeFilter("details",function(e){z(e,function(e){var t=e.attr("data-mce-open");e.attr("open",E(t)?t:null),e.attr("data-mce-open",null)})})}(e)},Mx=function(e){return an(e)&&jn(st.fromDom(e))},Fx=function(e){e.on("click",function(t){t.detail>=3&&function(e){var t=e.selection.getRng(),n=Wu.fromRangeStart(t),r=Wu.fromRangeEnd(t);if(Wu.isElementPosition(n)){var o=n.container();Mx(o)&&Gs(o).each(function(e){return t.setStart(e.container(),e.offset())})}Wu.isElementPosition(r)&&(o=n.container(),Mx(o)&&Js(o).each(function(e){return t.setEnd(e.container(),e.offset())}));e.selection.setRng(Vd(t))}(e)})},Ux=function(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:t.top+o.pageYOffset-r.clientTop,left:t.left+o.pageXOffset-r.clientLeft}},zx=function(e,t){return n=function(e){return e.inline?Ux(e.getBody()):{left:0,top:0}}(e),r=function(e){var t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}}(e),{pageX:(o=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=Ux(e.getContentAreaContainer()),r=function(e){var t=e.getBody(),n=e.getDoc().documentElement,r={left:t.scrollLeft,top:t.scrollTop},o={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?r:o}(e);return{left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}return{left:t.pageX,top:t.pageY}}(e,t)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o},jx=Cn,Hx=bn,Vx=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},qx=function(e,t){return function(n){if(function(e){return 0===e.button}(n)){var r=W(t.dom.getParents(n.target),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){for(var n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}(jx,Hx)).getOr(null);if(u=t.getBody(),jx(c=r)&&c!==u){var o=t.dom.getPos(r),i=t.getBody(),a=t.getDoc().documentElement;e.element=r,e.screenX=n.screenX,e.screenY=n.screenY,e.maxX=(t.inline?i.scrollWidth:a.offsetWidth)-2,e.maxY=(t.inline?i.scrollHeight:a.offsetHeight)-2,e.relX=n.pageX-o.x,e.relY=n.pageY-o.y,e.width=r.offsetWidth,e.height=r.offsetHeight,e.ghost=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(t,r,e.width,e.height)}}var u,c}},$x=function(e,t){return function(n){if(e.dragging&&function(e,t,n){return t!==n&&!e.dom.isChildOf(t,n)&&!jx(t)}(t,(u=t.selection,3===(c=u.getSel().getRangeAt(0).startContainer).nodeType?c.parentNode:c),e.element)){var r=(i=e.element,(a=i.cloneNode(!0)).removeAttribute("data-mce-selected"),a),o=t.fire("drop",{targetClone:r,clientX:n.clientX,clientY:n.clientY});o.isDefaultPrevented()||(r=o.targetClone,t.undoManager.transact(function(){Vx(e.element),t.insertContent(t.dom.getOuterHTML(r)),t._selectionOverrides.hideFakeCaret()}))}var i,a,u,c;Wx(e)}},Wx=function(e){e.dragging=!1,e.element=null,Vx(e.ghost)},Kx=function(t){var n={},r=ea.DOM,o=e.document,i=qx(n,t),a=function(e,t){var n=Vi.throttle(function(e,n){t._selectionOverrides.hideFakeCaret(),t.selection.placeCaretAt(e,n)},0);return function(r){var o,i,a=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(function(e){return e.element}(e)&&!e.dragging&&a>10){if(t.fire("dragstart",{target:e.element}).isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){var u=function(e,t){return{pageX:t.pageX-e.relX,pageY:t.pageY+5}}(e,zx(t,r));o=e.ghost,i=t.getBody(),o.parentNode!==i&&i.appendChild(o),function(e,t,n,r,o,i){var a=0,u=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>o&&(a=t.pageX+n-o),t.pageY+r>i&&(u=t.pageY+r-i),e.style.width=n-a+"px",e.style.height=r-u+"px"}(e.ghost,u,e.width,e.height,e.maxX,e.maxY),n(r.clientX,r.clientY)}}}(n,t),u=$x(n,t),c=function(e,t){return function(){e.dragging&&t.fire("dragend"),Wx(e)}}(n,t);t.on("mousedown",i),t.on("mousemove",a),t.on("mouseup",u),r.bind(o,"mousemove",a),r.bind(o,"mouseup",c),t.on("remove",function(){r.unbind(o,"mousemove",a),r.unbind(o,"mouseup",c)})},Xx=function(t){Kx(t),function(e){e.on("drop",function(t){var n=void 0!==t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;(jx(n)||jx(e.dom.getContentEditableParent(n)))&&t.preventDefault()})}(t),function(e){return e.getParam("block_unsupported_drop",!0,"boolean")}(t)&&function(t){var n=function(e){if(!e.defaultPrevented){var t=e.dataTransfer;t&&(M(t.types,"Files")||t.files.length>0)&&e.preventDefault()}},r=function(e){Sm(t,e.target)&&n(e)},o=function(){var o=ea.DOM,i=t.dom,a=e.document,u=t.inline?t.getBody():t.getDoc(),c=["drop","dragover"];z(c,function(e){o.bind(a,e,r),i.bind(u,e,n)}),t.on("remove",function(){z(c,function(e){o.unbind(a,e,r),i.unbind(u,e,n)})})};t.on("init",function(){Vi.setEditorTimeout(t,o,0)})}(t)},Yx=bn,Gx=Cn,Jx=function(e,t){for(var n=e.getBody();t&&t!==n;){if(Yx(t)||Gx(t))return t;t=t.parentNode}return null},Qx=function(t){var n,r=t.getBody(),o=ts(t,r,function(e){return t.dom.isBlock(e)},function(){return Am(t)}),i="sel-"+t.dom.uniqueId(),a=function(e){e&&t.selection.setRng(e)},u=function(){return t.selection.getRng()},c=function(e,n,r,i){return void 0===i&&(i=!0),t.fire("ShowCaret",{target:n,direction:e,before:r}).isDefaultPrevented()?null:(i&&t.selection.scrollIntoView(n,-1===e),o.show(r,n))},s=function(e){return Ja(e)||nu(e)||ru(e)},f=function(e){return s(e.startContainer)||s(e.endContainer)},l=function(e){var n=t.schema.getShortEndedElements(),r=t.dom.createRng(),o=e.startContainer,i=e.startOffset,a=e.endContainer,u=e.endOffset;return de(n,o.nodeName.toLowerCase())?0===i?r.setStartBefore(o):r.setStartAfter(o):r.setStart(o,i),de(n,a.nodeName.toLowerCase())?0===u?r.setEndBefore(a):r.setEndAfter(a):r.setEnd(a,u),r},d=function(e,o){var a,u,s,l,d,m,g,h=t.$,v=t.dom;if(!e)return null;if(e.collapsed){if(!f(e))if(!1===o){if(d=Ns(-1,r,e),rs(d.getNode(!0)))return c(-1,d.getNode(!0),!1,!1);if(rs(d.getNode()))return c(-1,d.getNode(),!d.isAtEnd(),!1)}else{if(d=Ns(1,r,e),rs(d.getNode()))return c(1,d.getNode(),!d.isAtEnd(),!1);if(rs(d.getNode(!0)))return c(1,d.getNode(!0),!1,!1)}return null}s=e.startContainer,l=e.startOffset;var y=e.endOffset;if(3===s.nodeType&&0===l&&Gx(s.parentNode)&&(s=s.parentNode,l=v.nodeIndex(s),s=s.parentNode),1!==s.nodeType)return null;if(y===l+1&&s===e.endContainer&&(a=s.childNodes[l]),!Gx(a))return null;m=g=a.cloneNode(!0);var b=t.fire("ObjectSelected",{target:a,targetClone:m});if(b.isDefaultPrevented())return null;u=_a(st.fromDom(t.getBody()),"#"+i).fold(function(){return h([])},function(e){return h([e.dom()])}),m=b.targetClone,0===u.length&&(u=h('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",i)).appendTo(t.getBody()),e=t.dom.createRng(),m===g&&nt.ie?(u.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(m),e.setStartAfter(u[0].firstChild.firstChild),e.setEndAfter(m)):(u.empty().append(" ").append(m).append(" "),e.setStart(u[0].firstChild,1),e.setEnd(u[0].lastChild,0)),u.css({top:v.getPos(a,t.getBody()).y}),u[0].focus();var C=t.selection.getSel();C.removeAllRanges(),C.addRange(e);var w=st.fromDom(a);return z(xa(st.fromDom(t.getBody()),"*[data-mce-selected]"),function(e){Ct(w,e)||kn(e,"data-mce-selected")}),t.dom.getAttrib(a,"data-mce-selected")||a.setAttribute("data-mce-selected","1"),n=a,p(),e},m=function(){n&&(n.removeAttribute("data-mce-selected"),_a(st.fromDom(t.getBody()),"#"+i).each($t),n=null),_a(st.fromDom(t.getBody()),"#"+i).each($t),n=null},p=function(){o.hide()};return nt.ceFalse&&function(){t.on("mouseup",function(e){var n=u();n.collapsed&&rh(t,e.clientX,e.clientY)&&a(Lb(t,n,!1))}),t.on("click",function(e){var n=Jx(t,e.target);n&&(Gx(n)&&(e.preventDefault(),t.focus()),Yx(n)&&t.dom.isChildOf(n,t.selection.getNode())&&m())}),t.on("blur NewBlock",function(){m()}),t.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var s=function(e,n){var r,o,i=t.dom.getParent(e,t.dom.isBlock),a=t.dom.getParent(n,t.dom.isBlock);return!(!i||!t.dom.isChildOf(i,a)||!1!==Gx(Jx(t,i)))||i&&(r=i,o=a,!(t.dom.getParent(r,t.dom.isBlock)===t.dom.getParent(o,t.dom.isBlock)))&&function(e){var t=Us(e);if(!e.firstChild)return!1;var n=Xu.before(e.firstChild),r=t.next(n);return r&&!Hl(r)&&!Vl(r)}(i)};!function(e){e.on("tap",function(t){var n=Jx(e,t.target);Gx(n)&&(t.preventDefault(),d(Pb(e,n)))},!0)}(t),t.on("mousedown",function(e){var n=e.target;if((n===r||"HTML"===n.nodeName||t.dom.isChildOf(n,r))&&!1!==rh(t,e.clientX,e.clientY)){var o=Jx(t,n);if(o)Gx(o)?(e.preventDefault(),d(Pb(t,o))):(m(),Yx(o)&&e.shiftKey||ov(e.clientX,e.clientY,t.selection.getRng())||(p(),t.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===rs(n)){m(),p();var i=Ab(r,e.clientX,e.clientY);if(i&&!s(e.target,i.node)){e.preventDefault();var u=c(1,i.node,i.before,!1);t.getBody().focus(),a(u)}}}}),t.on("keypress",function(e){iv.modifierPressed(e)||(e.keyCode,Gx(t.selection.getNode())&&e.preventDefault())}),t.on("GetSelectionRange",function(e){var t=e.range;if(n){if(!n.parentNode)return void(n=null);(t=t.cloneRange()).selectNode(n),e.range=t}}),t.on("SetSelectionRange",function(e){e.range=l(e.range);var t=d(e.range,e.forward);t&&(e.range=t)});t.on("AfterSetSelectionRange",function(e){var n,r=e.range;f(r)||"mcepastebin"===r.startContainer.parentNode.id||p(),n=r.startContainer.parentNode,t.dom.hasClass(n,"mce-offscreen-selection")||m()}),t.on("copy",function(e){var n,r=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!nt.ie){var o=(n=t.dom.get(i))?n.getElementsByTagName("*")[0]:n;o&&(e.preventDefault(),r.clearData(),r.setData("text/html",o.outerHTML),r.setData("text/plain",o.outerText))}}),Xx(t),function(t){var n=da(function(){if(!t.removed&&t.getBody().contains(e.document.activeElement)&&t.selection.getRng().collapsed){var n=Ib(t,t.selection.getRng(),!1);t.selection.setRng(n)}},0);t.on("focus",function(){n.throttle()}),t.on("blur",function(){n.cancel()})}(t)}(),{showCaret:c,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(ou(e),a(u()),t.selection.scrollIntoView(e))},hideFakeCaret:p,destroy:function(){o.destroy(),n=null}}},Zx=function(t){var n,r,o,i=ut.each,a=iv.BACKSPACE,u=iv.DELETE,c=t.dom,s=t.selection,f=t.parser,l=nt.gecko,d=nt.ie,m=nt.webkit,p=d?"Text":"URL",g=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(r){}},h=function(e){return e.isDefaultPrevented()},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},y=function(){t.on("keydown",function(e){if(!h(e)&&e.keyCode===a&&s.isCollapsed()&&0===s.getRng().startOffset){var t=s.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},b=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",function(e){var n;if("HTML"===e.target.nodeName){if(nt.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}}))};return t.on("keydown",function(e){var n,r;if(!h(e)&&e.keyCode===iv.BACKSPACE){var o=(n=s.getRng()).startContainer,i=n.startOffset,a=c.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==a;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=c.createRng()).setStart(o,0),n.setEnd(o,0),s.setRng(n))}}}),n=function(e){var t=c.create("body"),n=e.cloneContents();return t.appendChild(n),s.serializer.serialize(t,{format:"html"})},t.on("keydown",function(e){var r,o,i,s,f,l=e.keyCode;if(!h(e)&&(l===u||l===a)){if(r=t.selection.isCollapsed(),o=t.getBody(),r&&!c.isEmpty(o))return;if(!r&&(i=t.selection.getRng(),s=n(i),(f=c.createRng()).selectNode(t.getBody()),s!==n(f)))return;e.preventDefault(),t.setContent(""),o.firstChild&&c.isBlock(o.firstChild)?t.selection.setCursorLocation(o.firstChild,0):t.selection.setCursorLocation(o,0),t.nodeChanged()}}),nt.windowsPhone||t.on("keyup focusin mouseup",function(e){iv.modifierPressed(e)||s.normalize()},!0),m&&(t.inline||c.bind(t.getDoc(),"mousedown mouseup",function(e){var n;if(e.target===t.getDoc().documentElement)if(n=s.getRng(),t.getBody().focus(),"mousedown"===e.type){if(Ja(n.startContainer))return;s.placeCaretAt(e.clientX,e.clientY)}else s.setRng(n)}),t.on("click",function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==c.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&c.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),s.select(n))}),Cc(t)&&t.on("init",function(){g("DefaultParagraphSeparator",Cc(t))}),t.on("init",function(){t.dom.bind(t.getBody(),"submit",function(e){e.preventDefault()})}),y(),f.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),nt.iOS?(t.inline||t.on("keydown",function(){e.document.activeElement===e.document.body&&t.getWin().focus()}),b(),t.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):v()),nt.ie>=11&&(b(),y()),nt.ie&&(v(),g("AutoUrlDetect",!1),t.on("dragstart",function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&s.select(e.target),(n=t.selection.getContent()).length>0&&(r="data:text/mce-internal,"+escape(t.id)+","+escape(n),e.dataTransfer.setData(p,r)))}(e)}),t.on("drop",function(e){if(!h(e)){var n=function(e){var t;return e.dataTransfer&&(t=e.dataTransfer.getData(p))&&t.indexOf("data:text/mce-internal,")>=0?(t=t.substr("data:text/mce-internal,".length).split(","),{id:unescape(t[0]),html:unescape(t[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=Fh(e.x,e.y,t.getDoc());s.setRng(r),o=n.html,i=!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):t.execCommand("mceInsertContent",!1,o)}}var o,i})),l&&(t.on("keydown",function(e){if(!h(e)&&e.keyCode===a){if(!t.getBody().getElementsByTagName("hr").length)return;if(s.isCollapsed()&&0===s.getRng().startOffset){var n=s.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return c.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(c.remove(r),e.preventDefault())}}}),e.Range.prototype.getClientRects||t.on("mousedown",function(e){if(!h(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),Vi.setEditorTimeout(t,function(){n.focus()})}}),r=function(){var e=c.getAttribs(s.getStart().cloneNode(!1));return function(){var n=s.getStart();n!==t.getBody()&&(c.setAttrib(n,"style",null),i(e,function(e){n.setAttributeNode(e.cloneNode(!0))}))}},o=function(){return!s.isCollapsed()&&c.getParent(s.getStart(),c.isBlock)!==c.getParent(s.getEnd(),c.isBlock)},t.on("keypress",function(e){var n;if(!h(e)&&(8===e.keyCode||46===e.keyCode)&&o())return n=r(),t.getDoc().execCommand("delete",!1,null),n(),e.preventDefault(),!1}),c.bind(t.getDoc(),"cut",function(e){var n;!h(e)&&o()&&(n=r(),Vi.setEditorTimeout(t,function(){n()}))}),function(e){return e.getParam("readonly")}(t)||t.on("BeforeExecCommand mousedown",function(){g("StyleWithCSS",!1),g("enableInlineTableEditing",!1),Bc(t)||g("enableObjectResizing",!1)}),t.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||i(c.select("a"),function(e){var t=e.parentNode,n=c.getRoot();if(t.lastChild===e){for(;t&&!c.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}c.add(t,"br",{"data-mce-bogus":1})}})}),t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),nt.mac&&t.on("keydown",function(e){!iv.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}),y()),{refreshContentEditable:function(){},isHidden:function(){if(!l||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},eS=ea.DOM,tS=function(e){return e.inline?e.getElement().nodeName.toLowerCase():void 0},nS=function(e){return se(e,function(e){return!1===A(e)})},rS=function(e){var t=e.settings,n=e.editorUpload.blobCache;return nS({allow_conditional_comments:t.allow_conditional_comments,allow_html_data_urls:t.allow_html_data_urls,allow_html_in_named_anchor:t.allow_html_in_named_anchor,allow_script_urls:t.allow_script_urls,allow_unsafe_link_target:t.allow_unsafe_link_target,convert_fonts_to_spans:t.convert_fonts_to_spans,fix_list_elements:t.fix_list_elements,font_size_legacy_values:t.font_size_legacy_values,forced_root_block:t.forced_root_block,forced_root_block_attrs:t.forced_root_block_attrs,padd_empty_with_br:t.padd_empty_with_br,preserve_cdata:t.preserve_cdata,remove_trailing_brs:t.remove_trailing_brs,inline_styles:t.inline_styles,root_name:tS(e),validate:!0,blob_cache:n,images_dataimg_filter:t.images_dataimg_filter})},oS=function(e){var t=e.dom.getRoot();e.inline||Gf(e)&&e.selection.getStart(!0)!==t||Gs(t).each(function(t){var n=t.getNode(),r=ln(n)?Gs(n).getOr(t):t;nt.browser.isIE()?function(e,t){var n=st.fromDom(e.getBody()),r=(mm(e)?w.from(t):w.none()).map(pm).filter(dm(n));e.bookmark=r.isSome()?r:e.bookmark}(e,r.toRange()):e.selection.setRng(r.toRange())})},iS=function(e){e.bindPendingEventDelegates(),e.initialized=!0,function(e){e.fire("Init")}(e),e.focus(!0),oS(e),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),function(e){e.settings.auto_focus&&Vi.setEditorTimeout(e,function(){var t;(t=!0===e.settings.auto_focus?e:e.editorManager.get(e.settings.auto_focus)).destroyed||t.focus()},100)}(e)},aS=function(e,t){var n=e.settings,r=e.getDoc(),o=e.getBody();n.browser_spellcheck||n.gecko_spellcheck||(r.body.spellcheck=!1,eS.setAttrib(o,"spellcheck","false")),e.quirks=Zx(e),function(e){e.fire("PostRender")}(e);var i=function(e){return e.getParam("directionality",sa.isRtl()?"rtl":void 0)}(e);if(void 0!==i&&(o.dir=i),n.protect&&e.on("BeforeSetContent",function(e){ut.each(n.protect,function(t){e.content=e.content.replace(t,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),e.on("SetContent",function(){e.addVisual(e.getBody())}),!1===t&&e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"}),e.on("compositionstart compositionend",function(t){e.composing="compositionstart"===t.type}),e.contentStyles.length>0){var a="";ut.each(e.contentStyles,function(e){a+=e+"\r\n"}),e.dom.addStyle(a)}(function(e){return e.inline?eS.styleSheetLoader:e.dom.styleSheetLoader})(e).loadAll(e.contentCSS,function(t){iS(e)},function(t){iS(e)}),n.content_style&&function(e,t){var n=st.fromDom(e.getDoc().head),r=st.fromTag("style");Sn(r,"type","text/css"),Ht(r,st.fromText(t)),Ht(n,r)}(e,n.content_style)},uS=function(t,n){var r=t.settings,o=t.getElement(),i=t.getDoc();r.inline||(t.getElement().style.visibility=t.orgVisibility),n||t.inline||(i.open(),i.write(t.iframeHTML),i.close()),t.inline&&(eS.addClass(o,"mce-content-body"),t.contentDocument=i=e.document,t.contentWindow=e.window,t.bodyElement=o,t.contentAreaContainer=o);var a=t.getBody();a.disabled=!0,t.readonly=!!r.readonly,t.readonly||(t.inline&&"static"===eS.getStyle(a,"position",!0)&&(a.style.position="relative"),a.contentEditable=t.getParam("content_editable_state",!0)),a.disabled=!1,t.editorUpload=Uv(t),t.schema=xr(r),t.dom=ea(i,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:r.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:Rc(t),referrerPolicy:Ac(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(e){var t=Av(rS(e),e.schema);return t.addAttributeFilter("src,href,style,tabindex",function(t,n){for(var r,o,i=t.length,a=e.dom,u="data-mce-"+n;i--;)if((o=(r=t[i]).attr(n))&&!r.attr(u)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(u,o),r.attr(n,o)):"tabindex"===n?(r.attr(u,o),r.attr(n,null)):r.attr(u,e.convertURL(o,n,r.name))}}),t.addNodeFilter("script",function(e){for(var t=e.length;t--;){var n=e[t],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}}),e.settings.preserve_cdata&&t.addNodeFilter("#cdata",function(t){for(var n=t.length;n--;){var r=t[n];r.type=8,r.name="#comment",r.value="[CDATA["+e.dom.encode(r.value)+"]]"}}),t.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t){for(var n=t.length,r=e.schema.getNonEmptyElements();n--;){var o=t[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new fl("br",1)).shortEnded=!0)}}),t}(t),t.serializer=Lv(function(e){var t=e.settings;return we(we({},rS(e)),nS({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope,element_format:t.element_format,entities:t.entities,entity_encoding:t.entity_encoding,indent:t.indent,indent_after:t.indent_after,indent_before:t.indent_before,block_elements:t.block_elements,boolean_attributes:t.boolean_attributes,custom_elements:t.custom_elements,extended_valid_elements:t.extended_valid_elements,invalid_elements:t.invalid_elements,invalid_styles:t.invalid_styles,move_caret_before_on_enter_elements:t.move_caret_before_on_enter_elements,non_empty_elements:t.non_empty_elements,schema:t.schema,self_closing_elements:t.self_closing_elements,short_ended_elements:t.short_ended_elements,special:t.special,text_block_elements:t.text_block_elements,text_inline_elements:t.text_inline_elements,valid_children:t.valid_children,valid_classes:t.valid_classes,valid_elements:t.valid_elements,valid_styles:t.valid_styles,verify_html:t.verify_html,whitespace_elements:t.whitespace_elements}))}(t),t),t.selection=dv(t.dom,t.getWin(),t.serializer,t),t.annotator=il(t),t.formatter=Gv(t),t.undoManager=Jv(t),t._nodeChangeDispatcher=new Lx(t),t._selectionOverrides=Qx(t),ry(t),Ix(t),wg(t)||Fx(t),function(e){wg(e)||Px(e)}(t),function(e){Cc(e)&&e.on("NodeChange",m(uy,e))}(t),ty(t),function(e){e.fire("PreInit")}(t),xg(t).fold(function(){aS(t,!1)},function(e){t.setProgressState(!0),e.then(function(e){t.setProgressState(!1),aS(t,e)})})},cS=ea.DOM,sS=function(e){var t=function(e){return e.getParam("doctype","<!DOCTYPE html>")}(e)+"<html><head>";(function(e){return e.getParam("document_base_url","")})(e)!==e.documentBaseUrl&&(t+='<base href="'+e.documentBaseURI.getURI()+'" />'),t+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=function(e){return yc(e,"body_id","tinymce")}(e),r=function(e){return yc(e,"body_class","")}(e);return bc(e)&&(t+='<meta http-equiv="Content-Security-Policy" content="'+bc(e)+'" />'),t+='</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+e.id+'"><br></body></html>'},fS=function(t,n){var r=t.editorManager.translate("Rich Text Area. Press ALT-0 for help."),o=function(e,t,n,r){var o=st.fromTag("iframe");return Nn(o,r),Nn(o,{id:e+"_ifr",frameBorder:"0",allowTransparency:"true",title:t}),ya(o,"tox-edit-area__iframe"),o}(t.id,r,n.height,function(e){return e.getParam("iframe_attrs",{})}(t)).dom();o.onload=function(){o.onload=null,t.fire("load")};var i=function(t,n){if(e.document.domain!==e.window.location.hostname&&nt.browser.isIE()){var r=Fv("mce");t[r]=function(){uS(t)};var o='javascript:(function(){document.open();document.domain="'+e.document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+r+"(true);})()";return cS.setAttrib(n,"src",o),!0}return!1}(t,o);return t.contentAreaContainer=n.iframeContainer,t.iframeElement=o,t.iframeHTML=sS(t),cS.add(n.iframeContainer,o),i},lS=ea.DOM,dS=function(e,t,n){var r=ah.get(n),o=ah.urls[n]||e.documentBaseUrl.replace(/\/$/,"");if(n=ut.trim(n),r&&-1===ut.inArray(t,n)){if(ut.each(ah.dependencies(n),function(n){dS(e,t,n)}),e.plugins[n])return;try{var i=new r(e,o,e.$);e.plugins[n]=i,i.init&&(i.init(e,o),t.push(n))}catch(fE){!function(e,t,n){var r=sa.translate(["Failed to initialize plugin: {0}",t]);ph(r,n),fh(e,r)}(e,n,fE)}}},mS=function(e){return e.replace(/^\-/,"")},pS=function(e){return{editorContainer:e,iframeContainer:e}},gS=function(e){var t=e.getElement();return e.inline?pS(null):function(e){var t=lS.create("div");return lS.insertAfter(t,e),pS(t)}(t)},hS=function(e){var t=e.getElement();return e.orgDisplay=t.style.display,E(Ic(e))?function(e){return e.theme.renderUI()}(e):D(Ic(e))?function(e){var t=e.getElement(),n=Ic(e)(e,t);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||e.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||e.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:t.offsetHeight,n}(e):gS(e)},vS=function(e){e.fire("ScriptsLoaded"),function(e){var t=ut.trim(Nc(e)),n=e.ui.registry.getAll().icons,r=we(we({},Gg.get("default").icons),Gg.get(t).icons);re(r,function(t,r){de(n,r)||e.ui.registry.addIcon(r,t)})}(e),function(e){var t=Ic(e);if(E(t)){e.settings.theme=mS(t);var n=uh.get(t);e.theme=new n(e,uh.urls[t]),e.theme.init&&e.theme.init(e,uh.urls[t]||e.documentBaseUrl.replace(/\/$/,""),e.$)}else e.theme={}}(e),function(e){var t=[];ut.each(jc(e).split(/[ ,]/),function(n){dS(e,t,mS(n))})}(e);var t=hS(e);return e.editorContainer=t.editorContainer?t.editorContainer:null,function(e){e.contentCSS=e.contentCSS.concat(gh(e))}(e),e.inline?uS(e):function(e,t){var n=fS(e,t);t.editorContainer&&(cS.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=cS.isHidden(t.editorContainer)),e.getElement().style.display="none",cS.setAttrib(e.id,"aria-hidden","true"),n||uS(e)}(e,t)},yS=ea.DOM,bS=function(e){return"-"===e.charAt(0)},CS=function(e,t){var n=Dc(t),r=function(e){return e.getParam("language_url","","string")}(t);if(!1===sa.hasCode(n)&&"en"!==n){var o=""!==r?r:t.editorManager.baseURL+"/langs/"+n+".js";e.add(o,s,void 0,function(){!function(e,t,n){lh(e,"LanguageLoadError",dh("language",t,n))}(t,o,n)})}},wS=function(e,t,n){return w.from(t).filter(function(e){return e.length>0&&!Gg.has(e)}).map(function(t){return{url:e.editorManager.baseURL+"/icons/"+t+"/icons"+n+".js",name:w.some(t)}})},xS=function(e,t,n){var r=wS(t,"default",n),o=function(e){return w.from(function(e){return e.getParam("icons_url","","string")}(e)).filter(function(e){return e.length>0}).map(function(e){return{url:e,name:w.none()}})}(t).orThunk(function(){return wS(t,Nc(t),"")});z(function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t}([r,o]),function(n){e.add(n.url,s,void 0,function(){!function(e,t,n){lh(e,"IconsLoadError",dh("icons",t,n))}(t,n.url,n.name.getOrUndefined())})})},SS=function(e,t){var n=oa.ScriptLoader;!function(e,t,n,r){var o=Ic(t);if(E(o)){if(!bS(o)&&!uh.urls.hasOwnProperty(o)){var i=function(e){return e.getParam("theme_url")}(t);i?uh.load(o,t.documentBaseURI.toAbsolute(i)):uh.load(o,"themes/"+o+"/theme"+n+".js")}e.loadQueue(function(){uh.waitFor(o,r)})}else r()}(n,e,t,function(){CS(n,e),xS(n,e,t),function(e,t){ut.each(function(e){return e.getParam("external_plugins")}(e),function(t,n){ah.load(n,t,s,void 0,function(){mh(e,t,n)}),e.settings.plugins+=" "+n}),ut.each(jc(e).split(/[ ,]/),function(n){if((n=ut.trim(n))&&!ah.urls[n])if(bS(n)){n=n.substr(1,n.length);var r=ah.dependencies(n);ut.each(r,function(n){var r={prefix:"plugins/",resource:n,suffix:"/plugin"+t+".js"},o=ah.createUrl(r,n);ah.load(o.resource,o,s,void 0,function(){mh(e,o.prefix+o.resource+o.suffix,o.resource)})})}else{var o={prefix:"plugins/",resource:n,suffix:"/plugin"+t+".js"};ah.load(n,o,s,void 0,function(){mh(e,o.prefix+o.resource+o.suffix,n)})}})}(e,t),n.loadQueue(function(){e.removed||vS(e)},e,function(){e.removed||vS(e)})})},NS=function(t){var n=t.id;sa.setCode(Dc(t));var r=function(){yS.unbind(e.window,"ready",r),t.render()};if(Jr.Event.domLoaded){if(t.getElement()&&nt.contentEditable){var o=st.fromDom(t.getElement()),i=function(e){return $(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})}(o);t.on("remove",function(){j(o.dom().attributes,function(e){return kn(o,e.name)}),Nn(o,i)}),t.ui.styleSheetLoader=function(e,t){return $i.forElement(e,{contentCssCors:zc(t),referrerPolicy:Ac(t)})}(o,t),!function(e){return e.getParam("inline")}(t)?(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden"):t.inline=!0;var a=t.getElement().form||yS.getParent(n,"form");a&&(t.formElement=a,function(e){return e.getParam("hidden_input")}(t)&&!mn(t.getElement())&&(yS.insertAfter(yS.create("input",{type:"hidden",name:n}),n),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},yS.bind(a,"submit reset",t.formEventDelegate),t.on("reset",function(){t.resetContent()}),!function(e){return e.getParam("submit_patch")}(t)||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),a._mceOldSubmit(a)})),t.windowManager=ch(t),t.notificationManager=ih(t),function(e){return"xml"===e.getParam("encoding")}(t)&&t.on("GetContent",function(e){e.save&&(e.content=yS.encode(e.content))}),function(e){return e.getParam("add_form_submit_trigger")}(t)&&t.on("submit",function(){t.initialized&&t.save()}),function(e){return e.getParam("add_unload_trigger")}(t)&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),SS(t,t.suffix)}}else yS.bind(e.window,"ready",r)},ES=function(e){return D(e)?e:l(!1)},kS=function(e,t,n){var r=t(e),o=ES(n);return r.orThunk(function(){return o(e)?w.none():function(e,t,n){for(var r=e.dom(),o=ES(n);r.parentNode;){r=r.parentNode;var i=st.fromDom(r),a=t(i);if(a.isSome())return a;if(o(i))break}return w.none()}(e,t,o)})},_S={"font-size":"size","font-family":"face"},TS=function(e,t,n){var r=function(t){return An(t,e).orThunk(function(){return"font"===ft(t)?le(_S,e).bind(function(e){return n=t,r=e,w.from(En(n,r));var n,r}):w.none()})};return kS(st.fromDom(n),function(e){return r(e)},function(e){return Ct(st.fromDom(t),e)})},RS=function(e){return function(t,n){return w.from(n).map(st.fromDom).filter(mt).bind(function(n){return TS(e,t,n.dom()).or(function(e,t){return w.from(ea.DOM.getStyle(t,e,!0))}(e,n.dom()))}).getOr("")}},AS=RS("font-size"),DS=f(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},RS("font-family")),OS=function(e){return Gs(e.getBody()).map(function(e){var t=e.container();return pn(t)?t.parentNode:t})},BS=function(e){return w.from(e.selection.getRng()).bind(function(t){return function(e,t){return e.startContainer===t&&0===e.startOffset}(t,e.getBody())?w.none():w.from(e.selection.getStart(!0))})},PS=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(n>=1&&n<=7){var r=function(e){return ut.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large"))}(e),o=function(e){return ut.explode(e.getParam("font_size_classes",""))}(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},LS=function(e){var t=e.split(/\s*,\s*/);return U(t,function(e){return-1===e.indexOf(" ")||Pe(e,'"')||Pe(e,"'")?e:"'"+e+"'"}).join(",")},IS=function(e,t){var n=function(e){var t;return"string"!=typeof e?(t=ut.extend({paste:e.paste,data:{paste:e.paste}},e),{content:e.content,details:t}):{content:e,details:{}}}(t);!function(e,t,n){Sg(e).editor.insertContent(t,n)}(e,n.content,n.details)},MS=function(e,t){e.getDoc().execCommand(t,!1,null)},FS=ut.each,US=ut.map,zS=ut.inArray,jS=function(){function e(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e)}return e.prototype.execCommand=function(e,t,n,r){var o,i=!1,a=this;if(!a.editor.removed){var u;if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus?(u=a.editor,ym(u).each(function(e){u.selection.setRng(e)})):a.editor.focus(),(r=a.editor.fire("BeforeExecCommand",{command:e,ui:t,value:n})).isDefaultPrevented())return!1;var c=e.toLowerCase();if(o=a.commands.exec[c])return o(c,t,n),a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0;if(FS(this.editor.plugins,function(r){if(r.execCommand&&r.execCommand(e,t,n))return a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),i=!0,!1}),i)return i;if(a.editor.theme&&a.editor.theme.execCommand&&a.editor.theme.execCommand(e,t,n))return a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0;try{i=a.editor.getDoc().execCommand(e,t,n)}catch(s){}return!!i&&(a.editor.fire("ExecCommand",{command:e,ui:t,value:n}),!0)}},e.prototype.queryCommandState=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.state[e])return t(e);try{return this.editor.getDoc().queryCommandState(e)}catch(n){}return!1}},e.prototype.queryCommandValue=function(e){var t;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(e=e.toLowerCase(),t=this.commands.value[e])return t(e);try{return this.editor.getDoc().queryCommandValue(e)}catch(n){}}},e.prototype.addCommands=function(e,t){var n=this;t=t||"exec",FS(e,function(e,r){FS(r.toLowerCase().split(","),function(r){n.commands[t][r]=e})})},e.prototype.addCommand=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.exec[e]=function(e,o,i,a){return t.call(n||r.editor,o,i,a)}},e.prototype.queryCommandSupported=function(e){if(e=e.toLowerCase(),this.commands.exec[e])return!0;try{return this.editor.getDoc().queryCommandSupported(e)}catch(t){}return!1},e.prototype.addQueryStateHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.state[e]=function(){return t.call(n||r.editor)}},e.prototype.addQueryValueHandler=function(e,t,n){var r=this;e=e.toLowerCase(),this.commands.value[e]=function(){return t.call(n||r.editor)}},e.prototype.hasCustomCommand=function(e){return e=e.toLowerCase(),!!this.commands.exec[e]},e.prototype.execNativeCommand=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(e,t,n)},e.prototype.isFormatMatch=function(e){return this.editor.formatter.match(e)},e.prototype.toggleFormat=function(e,t){this.editor.formatter.toggle(e,t?{value:t}:void 0),this.editor.nodeChanged()},e.prototype.storeSelection=function(e){this.selectionBookmark=this.editor.selection.getBookmark(e)},e.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},e.prototype.setupCommands=function(e){var t=this;this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){e.undoManager.add()},"Cut,Copy,Paste":function(n){var r,o=e.getDoc();try{t.execNativeCommand(n)}catch(a){r=!0}if("paste"!==n||o.queryCommandEnabled(n)||(r=!0),r||!o.queryCommandSupported(n)){var i=e.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");nt.mac&&(i=i.replace(/Ctrl\+/g,"⌘+")),e.notificationManager.open({text:i,type:"error"})}},unlink:function(){if(e.selection.isCollapsed()){var t=e.dom.getParent(e.selection.getStart(),"a");t&&e.dom.remove(t,!0)}else e.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),FS("left,center,right,justify".split(","),function(t){r!==t&&e.formatter.remove("align"+t)}),"none"!==r&&t.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;t.execNativeCommand(n);var o=e.dom.getParent(e.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(t.storeSelection(),e.dom.split(r,o),t.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){t.toggleFormat(e)},"ForeColor,HiliteColor":function(e,n,r){t.toggleFormat(e,r)},FontName:function(t,n,r){!function(e,t){var n=PS(e,t);e.formatter.toggle("fontname",{value:LS(n)}),e.nodeChanged()}(e,r)},FontSize:function(t,n,r){!function(e,t){e.formatter.toggle("fontsize",{value:PS(e,t)}),e.nodeChanged()}(e,r)},RemoveFormat:function(t){e.formatter.remove(t)},mceBlockQuote:function(){t.toggleFormat("blockquote")},FormatBlock:function(e,n,r){return t.toggleFormat(r||"p")},mceCleanup:function(){var t=e.selection.getBookmark();e.setContent(e.getContent()),e.selection.moveToBookmark(t)},mceRemoveNode:function(n,r,o){var i=o||e.selection.getNode();i!==e.getBody()&&(t.storeSelection(),e.dom.remove(i,!0),t.restoreSelection())},mceSelectNodeDepth:function(t,n,r){var o=0;e.dom.getParent(e.selection.getNode(),function(t){if(1===t.nodeType&&o++===r)return e.selection.select(t),!1},e.getBody())},mceSelectNode:function(t,n,r){e.selection.select(r)},mceInsertContent:function(t,n,r){IS(e,r)},mceInsertRawHTML:function(t,n,r){e.selection.setContent("tiny_mce_marker");var o=e.getContent();e.setContent(o.replace(/tiny_mce_marker/g,function(){return r}))},mceInsertNewLine:function(t,n,r){cx(e,r)},mceToggleFormat:function(e,n,r){t.toggleFormat(r)},mceSetContent:function(t,n,r){e.setContent(r)},"Indent,Outdent":function(t){pw(e,t)},mceRepaint:function(){},InsertHorizontalRule:function(){e.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){e.hasVisual=!e.hasVisual,e.addVisual()},mceReplaceContent:function(t,n,r){e.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,e.selection.getContent({format:"text"})))},mceInsertLink:function(t,n,r){"string"==typeof r&&(r={href:r});var o=e.dom.getParent(e.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||e.formatter.remove("link"),r.href&&e.formatter.apply("link",r,o)},selectAll:function(){var t=e.dom.getParent(e.selection.getStart(),bn);if(t){var n=e.dom.createRng();n.selectNodeContents(t),e.selection.setRng(n)}},delete:function(){!function(e){Sw(e)||JC(e,!1)||ZC(e,!1)||rw(e,!1)||DC(e,!1)||jd(e)||LC(e)||uw(e,!1)||(MS(e,"Delete"),yC(e))}(e)},forwardDelete:function(){!function(e){JC(e,!0)||ZC(e,!0)||rw(e,!0)||DC(e,!0)||jd(e)||LC(e)||uw(e,!0)||MS(e,"ForwardDelete")}(e)},mceNewDocument:function(){e.setContent("")},InsertLineBreak:function(t,n,r){return Yw(e,r),!0}});var n=function(t){return function(){var n=e.selection.isCollapsed()?[e.dom.getParent(e.selection.getNode(),e.dom.isBlock)]:e.selection.getSelectedBlocks(),r=US(n,function(n){return!!e.formatter.matchNode(n,t)});return-1!==zS(r,!0)}};t.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return t.isFormatMatch(e)},mceBlockQuote:function(){return t.isFormatMatch("blockquote")},Outdent:function(){return lw(e)},"InsertUnorderedList,InsertOrderedList":function(t){var n=e.dom.getParent(e.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===t&&"UL"===n.tagName||"insertorderedlist"===t&&"OL"===n.tagName)}},"state"),t.addCommands({Undo:function(){e.undoManager.undo()},Redo:function(){e.undoManager.redo()}}),t.addQueryValueHandler("FontName",function(){return function(e){return BS(e).fold(function(){return OS(e).map(function(t){return DS(e.getBody(),t)}).getOr("")},function(t){return DS(e.getBody(),t)})}(e)},this),t.addQueryValueHandler("FontSize",function(){return function(e){return BS(e).fold(function(){return OS(e).map(function(t){return AS(e.getBody(),t)}).getOr("")},function(t){return AS(e.getBody(),t)})}(e)},this)},e}(),HS=function(e,t,n){Ca(e,t)&&!1===n?function(e,t){ga(e)?e.dom().classList.remove(t):va(e,t);ba(e)}(e,t):n&&ya(e,t)},VS=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},qS=function(e,t){e.dom().contentEditable=t?"true":"false"},$S=function(e,t){var n=st.fromDom(e.getBody());HS(n,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),function(e){w.from(e.selection.getNode()).each(function(e){e.removeAttribute("data-mce-selected")})}(e),e.readonly=!0,qS(n,!1),z(xa(n,'*[contenteditable="true"]'),function(e){Sn(e,"data-mce-contenteditable","true"),qS(e,!1)})):(e.readonly=!1,qS(n,!0),function(e){z(xa(e,'*[data-mce-contenteditable="true"]'),function(e){kn(e,"data-mce-contenteditable"),qS(e,!0)})}(n),VS(e,"StyleWithCSS",!1),VS(e,"enableInlineTableEditing",!1),VS(e,"enableObjectResizing",!1),Dm(e)&&e.focus(),function(e){e.selection.setRng(e.selection.getRng())}(e),e.nodeChanged())},WS=function(e){return e.readonly},KS=function(e){e.parser.addAttributeFilter("contenteditable",function(t){WS(e)&&z(t,function(e){e.attr("data-mce-contenteditable",e.attr("contenteditable")),e.attr("contenteditable","false")})}),e.serializer.addAttributeFilter("data-mce-contenteditable",function(t){WS(e)&&z(t,function(e){e.attr("contenteditable",e.attr("data-mce-contenteditable"))})}),e.serializer.addTempAttr("data-mce-contenteditable")},XS=ut.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),YS=function(){function e(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||h}return e.isNative=function(e){return!!XS[e.toLowerCase()]},e.prototype.fire=function(e,t){e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=this.scope),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=v},t.stopPropagation=function(){t.isPropagationStopped=v},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=v},t.isDefaultPrevented=h,t.isPropagationStopped=h,t.isImmediatePropagationStopped=h),this.settings.beforeFire&&this.settings.beforeFire(t);var n=this.bindings[e];if(n)for(var r=0,o=n.length;r<o;r++){var i=n[r];if(i.once&&this.off(e,i.func),t.isImmediatePropagationStopped())return t.stopPropagation(),t;if(!1===i.func.call(this.scope,t))return t.preventDefault(),t}return t},e.prototype.on=function(e,t,n,r){var o,i,a;if(!1===t&&(t=h),t){var u={func:t};for(r&&ut.extend(u,r),a=(i=e.toLowerCase().split(" ")).length;a--;)e=i[a],(o=this.bindings[e])||(o=this.bindings[e]=[],this.toggleEvent(e,!0)),n?o.unshift(u):o.push(u)}return this},e.prototype.off=function(e,t){var n,r,o,i,a=this;if(e)for(n=(o=e.toLowerCase().split(" ")).length;n--;){if(e=o[n],r=this.bindings[e],!e)return re(this.bindings,function(e,t){a.toggleEvent(t,!1),delete a.bindings[t]}),this;if(r){if(t)for(i=r.length;i--;)r[i].func===t&&(r=r.slice(0,i).concat(r.slice(i+1)),this.bindings[e]=r);else r.length=0;r.length||(this.toggleEvent(e,!1),delete this.bindings[e])}}else re(this.bindings,function(e,t){a.toggleEvent(t,!1)}),this.bindings={};return this},e.prototype.once=function(e,t,n){return this.on(e,t,n,{once:!0})},e.prototype.has=function(e){return e=e.toLowerCase(),!(!this.bindings[e]||0===this.bindings[e].length)},e}(),GS=function(e){return e._eventDispatcher||(e._eventDispatcher=new YS({scope:e,toggleEvent:function(t,n){YS.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,n)}})),e._eventDispatcher},JS={fire:function(e,t,n){if(this.removed&&"remove"!==e&&"detach"!==e)return t;var r=GS(this).fire(e,t);if(!1!==n&&this.parent)for(var o=this.parent();o&&!r.isPropagationStopped();)o.fire(e,r,!1),o=o.parent();return r},on:function(e,t,n){return GS(this).on(e,t,n)},off:function(e,t){return GS(this).off(e,t)},once:function(e,t){return GS(this).once(e,t)},hasEventListeners:function(e){return GS(this).has(e)}},QS=ea.DOM,ZS=function(e,t){if("selectionchange"===t)return e.getDoc();if(!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t))return e.getDoc().documentElement;var n=Pc(e);return n?(e.eventRoot||(e.eventRoot=QS.select(n)[0]),e.eventRoot):e.getBody()},eN=function(e,t,n){!function(e){return!e.hidden&&!WS(e)}(e)?WS(e)&&function(e,t){var n=t.target;(function(e){return"click"===e.type})(t)&&!iv.metaKeyPressed(t)&&function(e,t){return null!==e.dom.getParent(t,"a")}(e,n)&&t.preventDefault()}(e,n):e.fire(t,n)},tN=function(e,t){var n;if(e.delegates||(e.delegates={}),!e.delegates[t]&&!e.removed){var r=ZS(e,t);if(Pc(e)){if(gb||(gb={},e.editorManager.on("removeEditor",function(){e.editorManager.activeEditor||gb&&(re(gb,function(t,n){e.dom.unbind(ZS(e,n))}),gb=null)})),gb[t])return;n=function(n){for(var r=n.target,o=e.editorManager.get(),i=o.length;i--;){var a=o[i].getBody();(a===r||QS.isChildOf(r,a))&&eN(o[i],t,n)}},gb[t]=n,QS.bind(r,t,n)}else n=function(n){eN(e,t,n)},QS.bind(r,t,n),e.delegates[t]=n}},nN=we(we({},JS),{bindPendingEventDelegates:function(){var e=this;ut.each(e._pendingNativeEvents,function(t){tN(e,t)})},toggleNativeEvent:function(e,t){"focus"!==e&&"blur"!==e&&(t?this.initialized?tN(this,e):this._pendingNativeEvents?this._pendingNativeEvents.push(e):this._pendingNativeEvents=[e]:this.initialized&&(this.dom.unbind(ZS(this,e),e,this.delegates[e]),delete this.delegates[e]))},unbindAllNativeEvents:function(){var e=this,t=e.getBody(),n=e.dom;e.delegates&&(re(e.delegates,function(t,n){e.dom.unbind(ZS(e,n),n,t)}),delete e.delegates),!e.inline&&t&&n&&(t.onload=null,n.unbind(e.getWin()),n.unbind(e.getDoc())),n&&(n.unbind(t),n.unbind(e.getContainer()))}}),rN=["design","readonly"],oN=function(t,n,r,o){var i=r[n.get()],a=r[o];try{a.activate()}catch(fE){return void e.console.error("problem while activating editor mode "+o+":",fE)}i.deactivate(),i.editorReadOnly!==a.editorReadOnly&&$S(t,a.editorReadOnly),n.set(o),function(e,t){e.fire("SwitchMode",{mode:t})}(t,o)},iN=function(t){var n=ia("design"),r=ia({design:{activate:s,deactivate:s,editorReadOnly:!1},readonly:{activate:s,deactivate:s,editorReadOnly:!0}});return function(e){e.serializer?KS(e):e.on("PreInit",function(){KS(e)})}(t),function(e){e.on("ShowCaret",function(t){WS(e)&&t.preventDefault()}),e.on("ObjectSelected",function(t){WS(e)&&t.preventDefault()})}(t),{isReadOnly:function(){return WS(t)},set:function(e){return function(e,t,n,r){if(r!==n.get()){if(!de(t,r))throw new Error("Editor mode '"+r+"' is invalid");e.initialized?oN(e,n,t,r):e.on("init",function(){return oN(e,n,t,r)})}}(t,r.get(),n,e)},get:function(){return n.get()},register:function(t,n){r.set(function(t,n,r){var o;if(M(rN,n))throw new Error("Cannot override default mode "+n);return we(we({},t),((o={})[n]=we(we({},r),{deactivate:function(){try{r.deactivate()}catch(fE){e.console.error("problem while deactivating editor mode "+n+":",fE)}}}),o))}(r.get(),t,n))}}},aN=ut.each,uN=ut.explode,cN={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},sN=ut.makeMap("alt,ctrl,shift,meta,access"),fN=function(){function e(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var t=this;e.on("keyup keypress keydown",function(e){!t.hasModifier(e)&&!t.isFunctionKey(e)||e.isDefaultPrevented()||(aN(t.shortcuts,function(n){if(t.matchShortcut(e,n))return t.pendingPatterns=n.subpatterns.slice(0),"keydown"===e.type&&t.executeShortcutAction(n),!0}),t.matchShortcut(e,t.pendingPatterns[0])&&(1===t.pendingPatterns.length&&"keydown"===e.type&&t.executeShortcutAction(t.pendingPatterns[0]),t.pendingPatterns.shift()))})}return e.prototype.add=function(e,t,n,r){var o=this,i=n;return"string"==typeof i?n=function(){o.editor.execCommand(i,!1,null)}:ut.isArray(i)&&(n=function(){o.editor.execCommand(i[0],i[1],i[2])}),aN(uN(ut.trim(e)),function(e){var i=o.createShortcut(e,t,n,r);o.shortcuts[i.id]=i}),!0},e.prototype.remove=function(e){var t=this.createShortcut(e);return!!this.shortcuts[t.id]&&(delete this.shortcuts[t.id],!0)},e.prototype.parseShortcut=function(e){var t,n={};aN(uN(e.toLowerCase(),"+"),function(e){e in sN?n[e]=!0:/^[0-9]{2,}$/.test(e)?n.keyCode=parseInt(e,10):(n.charCode=e.charCodeAt(0),n.keyCode=cN[e]||e.toUpperCase().charCodeAt(0))});var r=[n.keyCode];for(t in sN)n[t]?r.push(t):n[t]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,nt.mac?n.ctrl=!0:n.shift=!0),n.meta&&(nt.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n},e.prototype.createShortcut=function(e,t,n,r){var o=ut.map(uN(e,">"),this.parseShortcut);return o[o.length-1]=ut.extend(o[o.length-1],{func:n,scope:r||this.editor}),ut.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},e.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},e.prototype.isFunctionKey=function(e){return"keydown"===e.type&&e.keyCode>=112&&e.keyCode<=123},e.prototype.matchShortcut=function(e,t){return!!t&&(t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&(t.alt===e.altKey&&t.shift===e.shiftKey&&(!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0))))},e.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},e}(),lN=function(){var e,t,n,r,o,i,a,u,c=(t={},n={},r={},o={},i={},a={},{addButton:(u=function(e,t){return function(n,r){return e[n.toLowerCase()]=we(we({},r),{type:t})}})(e={},"button"),addGroupToolbarButton:u(e,"grouptoolbarbutton"),addToggleButton:u(e,"togglebutton"),addMenuButton:u(e,"menubutton"),addSplitButton:u(e,"splitbutton"),addMenuItem:u(t,"menuitem"),addNestedMenuItem:u(t,"nestedmenuitem"),addToggleMenuItem:u(t,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:function(e,t){return r[e.toLowerCase()]=t},getAll:function(){return{buttons:e,menuItems:t,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}});return{addAutocompleter:c.addAutocompleter,addButton:c.addButton,addContextForm:c.addContextForm,addContextMenu:c.addContextMenu,addContextToolbar:c.addContextToolbar,addIcon:c.addIcon,addMenuButton:c.addMenuButton,addMenuItem:c.addMenuItem,addNestedMenuItem:c.addNestedMenuItem,addSidebar:c.addSidebar,addSplitButton:c.addSplitButton,addToggleButton:c.addToggleButton,addGroupToolbarButton:c.addGroupToolbarButton,addToggleMenuItem:c.addToggleMenuItem,getAll:c.getAll}},dN=ut.each,mN=ut.trim,pN="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),gN={ftp:21,http:80,https:443,mailto:25},hN=function(){function t(n,r){n=mN(n),this.settings=r||{};var o=this.settings.base_uri,i=this;if(/^([\w\-]+):([^\/]{2})/i.test(n)||/^\s*#/.test(n))i.source=n;else{var a=0===n.indexOf("//");if(0!==n.indexOf("/")||a||(n=(o&&o.protocol||"http")+"://mce_host"+n),!/^[\w\-]*:?\/\//.test(n)){var u=this.settings.base_uri?this.settings.base_uri.path:new t(e.document.location.href).directory;if(this.settings.base_uri&&""==this.settings.base_uri.protocol)n="//mce_host"+i.toAbsPath(u,n);else{var c=/([^#?]*)([#?]?.*)/.exec(n);n=(o&&o.protocol||"http")+"://mce_host"+i.toAbsPath(u,c[1])+c[2]}}n=n.replace(/@@/g,"(mce_at)");var s=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(n);dN(pN,function(e,t){var n=s[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),i[e]=n}),o&&(i.protocol||(i.protocol=o.protocol),i.userInfo||(i.userInfo=o.userInfo),i.port||"mce_host"!==i.host||(i.port=o.port),i.host&&"mce_host"!==i.host||(i.host=o.host),i.source=""),a&&(i.protocol="")}}return t.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},t.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},t.prototype.setPath=function(e){var t=/^(.*?)\/?(\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[2],this.source="",this.getURI()},t.prototype.toRelative=function(e){var n;if("./"===e)return e;var r=new t(e,{base_uri:this});if("mce_host"!==r.host&&this.host!==r.host&&r.host||this.port!==r.port||this.protocol!==r.protocol&&""!==r.protocol)return r.getURI();var o=this.getURI(),i=r.getURI();return o===i||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===i?o:(n=this.toRelPath(this.path,r.path),r.query&&(n+="?"+r.query),r.anchor&&(n+="#"+r.anchor),n)},t.prototype.toAbsolute=function(e,n){var r=new t(e,{base_uri:this});return r.getURI(n&&this.isSameOrigin(r))},t.prototype.isSameOrigin=function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=gN[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},t.prototype.toRelPath=function(e,t){var n,r,o=0,i="",a=e.substring(0,e.lastIndexOf("/")).split("/"),u=t.split("/");if(a.length>=u.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||a[n]!==u[n]){o=n+1;break}if(a.length<u.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return t;for(n=0,r=a.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=u.length;n<r;n++)i+=n!==o-1?"/"+u[n]:u[n];return i},t.prototype.toAbsPath=function(e,t){var n,r,o=0,i=[],a=/\/$/.test(t)?"/":"",u=e.split("/"),c=t.split("/");for(dN(u,function(e){e&&i.push(e)}),u=i,n=c.length-1,i=[];n>=0;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?o>0?o--:i.push(c[n]):o++);return 0!==(r=(n=u.length-o)<=0?G(i).join("/"):u.slice(0,n).join("/")+"/"+G(i).join("/")).indexOf("/")&&(r="/"+r),a&&r.lastIndexOf("/")!==r.length-1&&(r+=a),r},t.prototype.getURI=function(e){var t;return void 0===e&&(e=!1),this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source},t}(),vN=ea.DOM,yN=ut.extend,bN=ut.each,CN=ut.resolve,wN=nt.ie,xN=function(){function e(e,t,n){var r=this;this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,yN(this,nN),this.settings=Kg(this,e,this.documentBaseUrl,n.defaultSettings,t),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(oa.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),ea.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),la.languageLoad=this.settings.language_load,la.baseURL=n.baseURL,this.id=e,this.setDirty(!1),this.documentBaseURI=new hN(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new fN(this),this.editorCommands=new jS(this),this.settings.cache_suffix&&(nt.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:lN(),styleSheetLoader:void 0};var o=iN(this);this.mode=o,this.setMode=o.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=wi.overrideDefaults(function(){return{context:r.inline?r.getBody():r.getDoc(),element:r.getBody()}})}return e.prototype.render=function(){NS(this)},e.prototype.focus=function(e){Bm(this,e)},e.prototype.hasFocus=function(){return Am(this)},e.prototype.execCallback=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?CN(r):0,o=CN(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,t)},e.prototype.translate=function(e){return sa.translate(e)},e.prototype.getParam=function(e,t,n){return Yg(this,e,t,n)},e.prototype.nodeChanged=function(e){this._nodeChangeDispatcher.nodeChanged(e)},e.prototype.addCommand=function(e,t,n){this.editorCommands.addCommand(e,t,n)},e.prototype.addQueryStateHandler=function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},e.prototype.addQueryValueHandler=function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},e.prototype.addShortcut=function(e,t,n,r){this.shortcuts.add(e,t,n,r)},e.prototype.execCommand=function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},e.prototype.queryCommandState=function(e){return this.editorCommands.queryCommandState(e)},e.prototype.queryCommandValue=function(e){return this.editorCommands.queryCommandValue(e)},e.prototype.queryCommandSupported=function(e){return this.editorCommands.queryCommandSupported(e)},e.prototype.show=function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable="true":(vN.show(this.getContainer()),vN.hide(this.id)),this.load(),this.fire("show"))},e.prototype.hide=function(){var e=this.getDoc();this.hidden||(wN&&e&&!this.inline&&e.execCommand("SelectAll"),this.save(),this.inline?(this.getBody().contentEditable="false",this===this.editorManager.focusedEditor&&(this.editorManager.focusedEditor=null)):(vN.hide(this.getContainer()),vN.setStyle(this.id,"display",this.orgDisplay)),this.hidden=!0,this.fire("hide"))},e.prototype.isHidden=function(){return!!this.hidden},e.prototype.setProgressState=function(e,t){this.fire("ProgressState",{state:e,time:t})},e.prototype.load=function(e){var t,n=this.getElement();if(this.removed)return"";if(n){(e=e||{}).load=!0;var r=mn(n)?n.value:n.innerHTML;return t=this.setContent(r,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t}},e.prototype.save=function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,mn(o)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=vN.getParent(r.id,"form"))&&bN(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},e.prototype.setContent=function(e,t){return kg(this,e,t)},e.prototype.getContent=function(e){return Eg(this,e)},e.prototype.insertContent=function(e,t){t&&(e=yN({content:e},t)),this.execCommand("mceInsertContent",!1,e)},e.prototype.resetContent=function(e){void 0===e?kg(this,this.startContent,{format:"raw"}):kg(this,e),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},e.prototype.isDirty=function(){return!this.isNotDirty},e.prototype.setDirty=function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},e.prototype.getContainer=function(){return this.container||(this.container=vN.get(this.editorContainer||this.id+"_parent")),this.container},e.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},e.prototype.getElement=function(){return this.targetElm||(this.targetElm=vN.get(this.id)),this.targetElm},e.prototype.getWin=function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},e.prototype.getDoc=function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},e.prototype.getBody=function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},e.prototype.convertURL=function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},e.prototype.addVisual=function(e){var t,n=this,r=n.settings,o=n.dom;e=e||n.getBody(),void 0===n.hasVisual&&(n.hasVisual=r.visual),bN(o.select("table,a",e),function(e){var i;switch(e.nodeName){case"TABLE":return t=r.visual_table_class||"mce-item-table",void((i=o.getAttrib(e,"border"))&&"0"!==i||!n.hasVisual?o.removeClass(e,t):o.addClass(e,t));case"A":return void(o.getAttrib(e,"href")||(i=o.getAttrib(e,"name")||e.id,t=r.visual_anchor_class||"mce-item-anchor",i&&n.hasVisual?o.addClass(e,t):o.removeClass(e,t)))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},e.prototype.remove=function(){Rg(this)},e.prototype.destroy=function(e){Ag(this,e)},e.prototype.uploadImages=function(e){return this.editorUpload.uploadImages(e)},e.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},e.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},e.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},e.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},e.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},e}(),SN=ea.DOM,NN=ut.explode,EN=ut.each,kN=ut.extend,_N=0,TN=!1,RN=[],AN=[],DN=function(e){var t=e.type;EN(LN.get(),function(n){switch(t){case"scroll":n.fire("ScrollWindow",e);break;case"resize":n.fire("ResizeWindow",e)}})},ON=function(e){e!==TN&&(e?wi(window).on("resize scroll",DN):wi(window).off("resize scroll",DN),TN=e)},BN=function(e){var t=AN;delete RN[e.id];for(var n=0;n<RN.length;n++)if(RN[n]===e){RN.splice(n,1);break}return AN=V(AN,function(t){return e!==t}),LN.activeEditor===e&&(LN.activeEditor=AN.length>0?AN[0]:null),LN.focusedEditor===e&&(LN.focusedEditor=null),t.length!==AN.length},PN="CSS1Compat"!==e.document.compatMode,LN=we(we({},JS),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:wi,majorVersion:"5",minorVersion:"4.2",releaseDate:"2020-08-17",editors:RN,i18n:sa,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,n,r="";n=hN.getDocumentBaseUrl(e.document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"));var o,i=window.tinymce||window.tinyMCEPreInit;if(i)t=i.base||i.baseURL,r=i.suffix;else{for(var a=e.document.getElementsByTagName("script"),u=0;u<a.length;u++){var c;if(""!==(c=a[u].src||"")){var s=c.substring(c.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(c)){-1!==s.indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/"));break}}}if(!t&&e.document.currentScript)-1!==(c=e.document.currentScript.src).indexOf(".min")&&(r=".min"),t=c.substring(0,c.lastIndexOf("/"))}this.baseURL=new hN(n).toAbsolute(t),this.documentBaseURL=n,this.baseURI=new hN(this.baseURL),this.suffix=r,(o=this).on("AddEditor",m(Nm,o)),o.on("RemoveEditor",m(Em,o))},overrideDefaults:function(e){var t=e.base_url;t&&this._setBaseUrl(t);var n=e.suffix;e.suffix&&(this.suffix=n),this.defaultSettings=e;var r=e.plugin_base_urls;void 0!==r&&re(r,function(e,t){la.PluginManager.urls[t]=e})},init:function(t){var n,r=this,o=ut.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," "),i=function(e){var t=e.id;return t||(t=le(e,"name").filter(function(e){return!SN.get(e)}).getOrThunk(SN.uniqueId),e.setAttribute("id",t)),t},a=function(e,t){return t.constructor===RegExp?t.test(e.className):SN.hasClass(e,t)},u=function(e){n=e},c=function(){var n,s=0,f=[],l=function(e,t,o){var i=new xN(e,t,r);f.push(i),i.on("init",function(){++s===n.length&&u(f)}),i.targetElm=i.targetElm||o,i.render()};SN.unbind(window,"ready",c),function(e){var n=t[e];if(n)n.apply(r,Array.prototype.slice.call(arguments,2))}("onpageload"),n=wi.unique(function(t){var n=[];if(nt.browser.isIE()&&nt.browser.version.major<11)return ph("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(PN)return ph("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return EN(t.types,function(e){n=n.concat(SN.select(e.selector))}),n;if(t.selector)return SN.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var r=t.elements||"";r.length>0&&EN(NN(r),function(t){var r=SN.get(t);r?n.push(r):EN(e.document.forms,function(e){EN(e.elements,function(e){e.name===t&&(t="mce_editor_"+_N++,SN.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":EN(SN.select("textarea"),function(e){t.editor_deselector&&a(e,t.editor_deselector)||t.editor_selector&&!a(e,t.editor_selector)||n.push(e)})}return n}(t)),t.types?EN(t.types,function(e){ut.each(n,function(n){return!SN.is(n,e.selector)||(l(i(n),kN({},t,e),n),!1)})}):(ut.each(n,function(e){var t;(t=r.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(BN(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(n=ut.grep(n,function(e){return!r.get(e.id)})).length?u([]):EN(n,function(e){!function(e,t){return e.inline&&t.tagName.toLowerCase()in o}(t,e)?l(i(e),t,e):ph("Could not initialize inline editor on invalid inline target element",e)}))};return r.settings=t,SN.bind(window,"ready",c),new Ui(function(e){n?e(n):u=function(t){e(t)}})},get:function(e){return 0===arguments.length?AN.slice(0):E(e)?W(AN,function(t){return t.id===e}).getOr(null):O(e)&&AN[e]?AN[e]:null},add:function(e){var t=this;return RN[e.id]===e?e:(null===t.get(e.id)&&("length"!==e.id&&(RN[e.id]=e),RN.push(e),AN.push(e)),ON(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),hb||(hb=function(e){var n=t.fire("BeforeUnload");if(n.returnValue)return e.preventDefault(),e.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",hb)),e)},createEditor:function(e,t){return this.add(new xN(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!E(e))return n=e,T(r.get(n.id))?null:(BN(n)&&r.fire("RemoveEditor",{editor:n}),0===AN.length&&window.removeEventListener("beforeunload",hb),n.remove(),ON(AN.length>0),n);EN(SN.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})}else for(t=AN.length-1;t>=0;t--)r.remove(AN[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new xN(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?(r.isHidden()?r.show():r.hide(),!0):(this.execCommand("mceAddEditor",0,n),!0)}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){EN(AN,function(e){e.save()})},addI18n:function(e,t){sa.add(e,t)},translate:function(e){return sa.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e},_setBaseUrl:function(e){this.baseURL=new hN(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new hN(this.baseURL)}});function IN(e){return{walk:function(t,n){return jf(e,t,n)},split:zm,normalize:function(t){return Zh(e,t).fold(l(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}LN.setup(),function(e){e.compareRanges=qh,e.getCaretRangeFromPoint=Fh,e.getSelectedNode=mu,e.getNode=pu}(IN||(IN={}));var MN,FN,UN,zN,jN=IN,HN=(MN={},FN={},{load:function(t,n){var r='Script at URL "'+n+'" failed to load',o='Script at URL "'+n+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==MN[t])return MN[t];var i=new Ui(function(i,a){var u=function(t,n,r){void 0===r&&(r=1e3);var o=!1,i=null,a=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];o||(o=!0,null!==i&&(e.clearTimeout(i),i=null),t.apply(null,n))}},u=a(t),c=a(n);return{start:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];o||null!==i||(i=e.setTimeout(function(){return c.apply(null,t)},r))},resolve:u,reject:c}}(i,a);FN[t]=u.resolve,oa.ScriptLoader.loadScript(n,function(){return u.start(o)},function(){return u.reject(r)})});return MN[t]=i,i},add:function(e,t){void 0!==FN[e]&&(FN[e](t),delete FN[e]),MN[e]=Ui.resolve(t)}}),VN=Math.min,qN=Math.max,$N=Math.round,WN=function(e,t,n){var r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,c=t.h;return"b"===(n=(n||"").split(""))[0]&&(o+=c),"r"===n[1]&&(r+=u),"c"===n[0]&&(o+=$N(c/2)),"c"===n[1]&&(r+=$N(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=$N(a/2)),"c"===n[4]&&(r-=$N(i/2)),KN(r,o,i,a)},KN=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},XN={inflate:function(e,t,n){return KN(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:WN,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=WN(e,t,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n=qN(e.x,t.x),r=qN(e.y,t.y),o=VN(e.x+e.w,t.x+t.w),i=VN(e.y+e.h,t.y+t.h);return o-n<0||i-r<0?null:KN(n,r,o-n,i-r)},clamp:function(e,t,n){var r=e.x,o=e.y,i=e.x+e.w,a=e.y+e.h,u=t.x+t.w,c=t.y+t.h,s=qN(0,t.x-r),f=qN(0,t.y-o),l=qN(0,i-u),d=qN(0,a-c);return r+=s,o+=f,n&&(i+=s,a+=f,r-=l,o-=d),KN(r,o,(i-=l)-r,(a-=d)-o)},create:KN,fromClientRect:function(e){return KN(e.left,e.top,e.width,e.height)}},YN=ut.each,GN=ut.extend,JN=function(){};JN.extend=UN=function(e){var t=this.prototype,n=function(){var e,t,n;if(!zN&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},r=function(){return this};zN=!0;var o=new this;return zN=!1,e.Mixins&&(YN(e.Mixins,function(t){for(var n in t)"init"!==n&&(e[n]=t[n])}),t.Mixins&&(e.Mixins=t.Mixins.concat(e.Mixins))),e.Methods&&YN(e.Methods.split(","),function(t){e[t]=r}),e.Properties&&YN(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){return void 0!==e?(this[n]=e,this):this[n]}}),e.Statics&&YN(e.Statics,function(e,t){n[t]=e}),e.Defaults&&t.Defaults&&(e.Defaults=GN({},t.Defaults,e.Defaults)),re(e,function(e,n){"function"==typeof e&&t[n]?o[n]=function(e,n){return function(){var r=this._super;this._super=t[e];var o=n.apply(this,arguments);return this._super=r,o}}(n,e):o[n]=e}),n.prototype=o,n.constructor=n,n.extend=UN,n};var QN,ZN=Math.min,eE=Math.max,tE=Math.round,nE={serialize:function(e){var t=JSON.stringify(e);return E(t)?t.replace(/[\u0080-\uFFFF]/g,function(e){var t=e.charCodeAt(0).toString(16);return"\\u"+"0000".substring(t.length)+t}):t},parse:function(e){try{return JSON.parse(e)}catch(t){}}},rE={callbacks:{},count:0,send:function(e){var t=this,n=ea.DOM,r=void 0!==e.count?e.count:t.count,o="tinymce_jsonp_"+r;t.callbacks[r]=function(i){n.remove(o),delete t.callbacks[r],e.callback(i)},n.add(n.doc.body,"script",{id:o,src:e.url,type:"text/javascript"}),t.count++}},oE=we(we({},JS),{send:function(t){var n,r=0,o=function(){!t.async||4===n.readyState||r++>1e4?(t.success&&r<1e4&&200===n.status?t.success.call(t.success_scope,""+n.responseText,n,t):t.error&&t.error.call(t.error_scope,r>1e4?"TIMED_OUT":"GENERAL",n,t),n=null):Vi.setTimeout(o,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",oE.fire("beforeInitialize",{settings:t}),n=new e.XMLHttpRequest){if(n.overrideMimeType&&n.overrideMimeType(t.content_type),n.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(n.withCredentials=!0),t.content_type&&n.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&ut.each(t.requestheaders,function(e){n.setRequestHeader(e.key,e.value)}),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),(n=oE.fire("beforeSend",{xhr:n,settings:t}).xhr).send(t.data),!t.async)return o();Vi.setTimeout(o,10)}}}),iE=ut.extend,aE=function(){function e(e){this.settings=iE({},e),this.count=0}return e.sendRPC=function(t){return(new e).send(t)},e.prototype.send=function(e){var t=e.error,n=e.success,r=iE(this.settings,e);r.success=function(e,o){void 0===(e=nE.parse(e))&&(e={error:"JSON Parse error."}),e.error?t.call(r.error_scope||r.scope,e.error,o):n.call(r.success_scope||r.scope,e.result)},r.error=function(e,n){t&&t.call(r.error_scope||r.scope,e,n)},r.data=nE.serialize({id:e.id||"c"+this.count++,method:e.method,params:e.params}),r.content_type="application/json",oE.send(r)},e}();try{var uE="__storage_test__";(QN=e.window.localStorage).setItem(uE,uE),QN.removeItem(uE)}catch(fE){QN=function(){return e={},t=[],n={getItem:function(t){var n=e[t];return n||null},setItem:function(n,r){t.push(n),e[n]=String(r)},key:function(e){return t[e]},removeItem:function(n){t=t.filter(function(e){return e===n}),delete e[n]},clear:function(){t=[],e={}},length:0},Object.defineProperty(n,"length",{get:function(){return t.length},configurable:!1,enumerable:!1}),n;var e,t,n}()}var cE={geom:{Rect:XN},util:{Promise:Ui,Delay:Vi,Tools:ut,VK:iv,URI:hN,Class:JN,EventDispatcher:YS,Observable:JS,I18n:sa,XHR:oE,JSON:nE,JSONRequest:aE,JSONP:rE,LocalStorage:QN,Color:function(e){var t={},n=0,r=0,o=0,i=function(e){var i;return"object"==typeof e?"r"in e?(n=e.r,r=e.g,o=e.b):"v"in e&&function(e,t,i){if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,i=parseInt(i,10)/100,t=eE(0,ZN(t,1)),i=eE(0,ZN(i,1)),0!==t){var a=e/60,u=i*t,c=u*(1-Math.abs(a%2-1)),s=i-u;switch(Math.floor(a)){case 0:n=u,r=c,o=0;break;case 1:n=c,r=u,o=0;break;case 2:n=0,r=u,o=c;break;case 3:n=0,r=c,o=u;break;case 4:n=c,r=0,o=u;break;case 5:n=u,r=0,o=c;break;default:n=r=o=0}n=tE(255*(n+s)),r=tE(255*(r+s)),o=tE(255*(o+s))}else n=r=o=tE(255*i)}(e.h,e.s,e.v):(i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10)):(i=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16)):(i=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),o=parseInt(i[3]+i[3],16)),n=n<0?0:n>255?255:n,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,t};return e&&i(e),t.toRgb=function(){return{r:n,g:r,b:o}},t.toHsv=function(){return function(e,t,n){var r,o;o=0;var i=ZN(e/=255,ZN(t/=255,n/=255)),a=eE(e,eE(t,n));return i===a?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,o=a,{h:tE(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/(a-i))),s:tE(100*r),v:tE(100*o)})}(n,r,o)},t.toHex=function(){var e=function(e){return(e=parseInt(e,10).toString(16)).length>1?e:"0"+e};return"#"+e(n)+e(r)+e(o)},t.parse=i,t}},dom:{EventUtils:Jr,Sizzle:Lo,DomQuery:wi,TreeWalker:xi,TextSeeker:Va,DOMUtils:ea,ScriptLoader:oa,RangeUtils:jN,Serializer:Lv,StyleSheetLoader:qi,ControlSelection:cv,BookmarkManager:rv,Selection:dv,Event:Jr.Event},html:{Styles:jr,Entities:lr,Node:fl,Schema:xr,SaxParser:El,DomParser:Av,Writer:dl,Serializer:ml},Env:nt,AddOnManager:la,Annotator:il,Formatter:Gv,UndoManager:Jv,EditorCommands:jS,WindowManager:ch,NotificationManager:ih,EditorObservable:nN,Shortcuts:fN,Editor:xN,FocusManager:bm,EditorManager:LN,DOM:ea.DOM,ScriptLoader:oa.ScriptLoader,PluginManager:la.PluginManager,ThemeManager:la.ThemeManager,IconManager:Gg,Resource:HN,trim:ut.trim,isArray:ut.isArray,is:ut.is,toArray:ut.toArray,makeMap:ut.makeMap,each:ut.each,map:ut.map,grep:ut.grep,inArray:ut.inArray,extend:ut.extend,create:ut.create,walk:ut.walk,createNS:ut.createNS,resolve:ut.resolve,explode:ut.explode,_addCacheSuffix:ut._addCacheSuffix,isOpera:nt.opera,isWebKit:nt.webkit,isIE:nt.ie,isGecko:nt.gecko,isMac:nt.mac},sE=ut.extend(LN,cE);!function(e){window.tinymce=e,window.tinyMCE=e}(sE),function(e){if("object"==typeof module)try{module.exports=e}catch(t){}}(sE)}(window); },{"process":"g5IB"}],"n3pW":[function(require,module,exports) { var process = require("process"); var define; var global = arguments[3]; var n,t=require("process"),e=arguments[3];!function(n){"use strict";var t=function(){},o=function(n,t){return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return n(t.apply(null,e))}},r=function(n){return function(){return n}},i=function(n){return n};function u(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];var r=t.concat(e);return n.apply(null,r)}}var a=function(n){return function(t){return!n(t)}},c=function(n){return function(){throw new Error(n)}},s=r(!1),f=r(!0),l=tinymce.util.Tools.resolve("tinymce.ThemeManager"),d=function(){return(d=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++)for(var r in t=arguments[e])Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}).apply(this,arguments)};function m(n,t){var e={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&t.indexOf(o)<0&&(e[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(n);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(e[o[r]]=n[o[r]])}return e}function g(){for(var n=0,t=0,e=arguments.length;t<e;t++)n+=arguments[t].length;var o=Array(n),r=0;for(t=0;t<e;t++)for(var i=arguments[t],u=0,a=i.length;u<a;u++,r++)o[r]=i[u];return o}var p,h=function(){return v},v=function(){var n=function(n){return n.isNone()},e=function(n){return n()},o=function(n){return n};return{fold:function(n,t){return n()},is:s,isSome:s,isNone:f,getOr:o,getOrThunk:e,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:r(null),getOrUndefined:r(void 0),or:o,orThunk:e,map:h,each:t,bind:h,exists:s,forall:f,filter:h,equals:n,equals_:n,toArray:function(){return[]},toString:r("none()")}}(),b=function(n){var t=r(n),e=function(){return i},o=function(t){return t(n)},i={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:f,isNone:s,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return b(t(n))},each:function(t){t(n)},bind:o,exists:o,forall:o,filter:function(t){return t(n)?i:v},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(s,function(t){return e(n,t)})}};return i},y={some:b,none:h,from:function(n){return null==n?v:b(n)}},x=function(n){return function(t){return o=typeof(e=t),(null===e?"null":"object"===o&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===o&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":o)===n;var e,o}},w=function(n){return function(t){return typeof t===n}},S=x("string"),k=x("object"),C=x("array"),O=w("boolean"),_=function(n){return function(t){return n===t}}(void 0),T=function(n){return!function(n){return null==n}(n)},E=w("function"),B=w("number"),D=function(n,t){if(C(n)){for(var e=0,o=n.length;e<o;++e)if(!t(n[e]))return!1;return!0}return!1},A=Array.prototype.slice,M=Array.prototype.indexOf,F=Array.prototype.push,I=function(n,t){return M.call(n,t)},R=function(n,t){var e=I(n,t);return-1===e?y.none():y.some(e)},V=function(n,t){return I(n,t)>-1},P=function(n,t){for(var e=0,o=n.length;e<o;e++){if(t(n[e],e))return!0}return!1},H=function(n,t){for(var e=[],o=0;o<n;o++)e.push(t(o));return e},z=function(n,t){for(var e=[],o=0;o<n.length;o+=t){var r=A.call(n,o,o+t);e.push(r)}return e},N=function(n,t){for(var e=n.length,o=new Array(e),r=0;r<e;r++){var i=n[r];o[r]=t(i,r)}return o},L=function(n,t){for(var e=0,o=n.length;e<o;e++){t(n[e],e)}},j=function(n,t){for(var e=[],o=[],r=0,i=n.length;r<i;r++){var u=n[r];(t(u,r)?e:o).push(u)}return{pass:e,fail:o}},U=function(n,t){for(var e=[],o=0,r=n.length;o<r;o++){var i=n[o];t(i,o)&&e.push(i)}return e},W=function(n,t,e){return function(n,t){for(var e=n.length-1;e>=0;e--)t(n[e],e)}(n,function(n){e=t(e,n)}),e},G=function(n,t,e){return L(n,function(n){e=t(e,n)}),e},X=function(n,t){return function(n,t,e){for(var o=0,r=n.length;o<r;o++){var i=n[o];if(t(i,o))return y.some(i);if(e(i,o))break}return y.none()}(n,t,s)},Y=function(n,t){for(var e=0,o=n.length;e<o;e++){if(t(n[e],e))return y.some(e)}return y.none()},q=function(n){for(var t=[],e=0,o=n.length;e<o;++e){if(!C(n[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+n);F.apply(t,n[e])}return t},K=function(n,t){return q(N(n,t))},J=function(n,t){for(var e=0,o=n.length;e<o;++e){if(!0!==t(n[e],e))return!1}return!0},$=function(n){var t=A.call(n,0);return t.reverse(),t},Q=function(n,t){return U(n,function(n){return!V(t,n)})},Z=function(n,t){var e=A.call(n,0);return e.sort(t),e},nn=function(n){return 0===n.length?y.none():y.some(n[0])},tn=function(n){return 0===n.length?y.none():y.some(n[n.length-1])},en=E(Array.from)?Array.from:function(n){return A.call(n)},on=function(n,t){for(var e=0;e<n.length;e++){var o=t(n[e],e);if(o.isSome())return o}return y.none()},rn=function(n){return{is:function(t){return n===t},isValue:f,isError:s,getOr:r(n),getOrThunk:r(n),getOrDie:r(n),or:function(t){return rn(n)},orThunk:function(t){return rn(n)},fold:function(t,e){return e(n)},map:function(t){return rn(t(n))},mapError:function(t){return rn(n)},each:function(t){t(n)},bind:function(t){return t(n)},exists:function(t){return t(n)},forall:function(t){return t(n)},toOption:function(){return y.some(n)}}},un=function(n){return{is:s,isValue:s,isError:f,getOr:i,getOrThunk:function(n){return n()},getOrDie:function(){return c(String(n))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(t,e){return t(n)},map:function(t){return un(n)},mapError:function(t){return un(t(n))},each:t,bind:function(t){return un(n)},exists:s,forall:f,toOption:y.none}},an={value:rn,error:un,fromOption:function(n,t){return n.fold(function(){return un(t)},rn)}};!function(n){n[n.Error=0]="Error",n[n.Value=1]="Value"}(p||(p={}));var cn=function(n,t,e){return n.stype===p.Error?t(n.serror):e(n.svalue)},sn=function(n){return{stype:p.Value,svalue:n}},fn=function(n){return{stype:p.Error,serror:n}},ln=function(n){return n.fold(fn,sn)},dn=function(n){return cn(n,an.error,an.value)},mn=sn,gn=function(n){var t=[],e=[];return L(n,function(n){cn(n,function(n){return e.push(n)},function(n){return t.push(n)})}),{values:t,errors:e}},pn=fn,hn=function(n,t){return n.stype===p.Value?t(n.svalue):n},vn=function(n,t){return n.stype===p.Error?t(n.serror):n},bn=function(n,t){return n.stype===p.Value?{stype:p.Value,svalue:t(n.svalue)}:n},yn=function(n,t){return n.stype===p.Error?{stype:p.Error,serror:t(n.serror)}:n},xn=Object.keys,wn=Object.hasOwnProperty,Sn=function(n,t){for(var e=xn(n),o=0,r=e.length;o<r;o++){var i=e[o];t(n[i],i)}},kn=function(n,t){return Cn(n,function(n,e){return{k:e,v:t(n,e)}})},Cn=function(n,t){var e={};return Sn(n,function(n,o){var r=t(n,o);e[r.k]=r.v}),e},On=function(n,e){var o,r={};return function(n,t,e,o){Sn(n,function(n,r){(t(n,r)?e:o)(n,r)})}(n,e,(o=r,function(n,t){o[t]=n}),t),r},_n=function(n,t){var e=[];return Sn(n,function(n,o){e.push(t(n,o))}),e},Tn=function(n,t){for(var e=xn(n),o=0,r=e.length;o<r;o++){var i=e[o],u=n[i];if(t(u,i,n))return y.some(u)}return y.none()},En=function(n){return _n(n,function(n){return n})},Bn=function(n,t){return Dn(n,t)?y.from(n[t]):y.none()},Dn=function(n,t){return wn.call(n,t)},An=function(n,t){return Dn(n,t)&&void 0!==n[t]&&null!==n[t]},Mn=function(t){if(!C(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],o={};return L(t,function(r,i){var u=xn(r);if(1!==u.length)throw new Error("one and only one name per case");var a=u[0],c=r[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!C(c))throw new Error("case arguments must be an array");e.push(a),o[a]=function(){var o=arguments.length;if(o!==c.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+o);for(var r=new Array(o),u=0;u<r.length;u++)r[u]=arguments[u];return{fold:function(){if(arguments.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+arguments.length);return arguments[i].apply(null,r)},match:function(n){var t=xn(n);if(e.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+t.join(","));if(!J(e,function(n){return V(t,n)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+e.join(", "));return n[a].apply(null,r)},log:function(t){n.console.log(t,{constructors:e,constructor:a,params:r})}}}}),o},Fn=Object.prototype.hasOwnProperty,In=function(n){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var o={},r=0;r<t.length;r++){var i=t[r];for(var u in i)Fn.call(i,u)&&(o[u]=n(o[u],i[u]))}return o}},Rn=In(function(n,t){return k(n)&&k(t)?Rn(n,t):t}),Vn=In(function(n,t){return t}),Pn=function(n){var t,e=!1;return function(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];return e||(e=!0,t=n.apply(null,o)),t}},Hn=Mn([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),zn=function(n){return Hn.defaultedThunk(r(n))},Nn=Hn.strict,Ln=Hn.asOption,jn=Hn.defaultedThunk,Un=(Hn.asDefaultedOptionThunk,Hn.mergeWithThunk),Wn=function(n,t){var e;return(e={})[n]=t,e},Gn=(Mn([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n,t){return function(n,t){var e={};return Sn(n,function(n,o){V(t,o)||(e[o]=n)}),e}(n,t)}),Xn=function(n,t){return Wn(n,t)},Yn=function(n){return function(n){var t={};return L(n,function(n){t[n.key]=n.value}),t}(n)},qn=function(n,t){var e,o,r=(e=[],o=[],L(n,function(n){n.fold(function(n){e.push(n)},function(n){o.push(n)})}),{errors:e,values:o});return r.errors.length>0?function(n){return an.error(q(n))}(r.errors):function(n,t){return 0===n.length?an.value(t):an.value(Rn(t,Vn.apply(void 0,n)))}(r.values,t)},Kn=function(n){return o(pn,q)(n)},Jn=function(n,t){var e=gn(n);return e.errors.length>0?Kn(e.errors):function(n,t){return n.length>0?mn(Rn(t,Vn.apply(void 0,n))):mn(t)}(e.values,t)},$n=function(n){var t=gn(n);return t.errors.length>0?Kn(t.errors):mn(t.values)},Qn=function(n){return k(n)&&xn(n).length>100?" removed due to size":JSON.stringify(n,null,2)},Zn=function(n,t){return pn([{path:n,getErrorInfo:t}])},nt=Mn([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),tt=function(n,t,e){return Bn(t,e).fold(function(){return function(n,t,e){return Zn(n,function(){return'Could not find valid *strict* value for "'+t+'" in '+Qn(e)})}(n,e,t)},mn)},et=function(n,t,e){var o=Bn(n,t).fold(function(){return e(n)},i);return mn(o)},ot=function(n,t,e,o){return e.fold(function(e,i,u,a){var c=function(t){var r=a.extract(n.concat([e]),o,t);return bn(r,function(n){return Wn(i,o(n))})},s=function(t){return t.fold(function(){var n=Wn(i,o(y.none()));return mn(n)},function(t){var r=a.extract(n.concat([e]),o,t);return bn(r,function(n){return Wn(i,o(y.some(n)))})})};return u.fold(function(){return hn(tt(n,t,e),c)},function(n){return hn(et(t,e,n),c)},function(){return hn(function(n,t){return mn(Bn(n,t))}(t,e),s)},function(n){return hn(function(n,t,e){var o=Bn(n,t).map(function(t){return!0===t?e(n):t});return mn(o)}(t,e,n),s)},function(n){var o=n(t),i=bn(et(t,e,r({})),function(n){return Rn(o,n)});return hn(i,c)})},function(n,e){var r=e(t);return mn(Wn(n,o(r)))})},rt=function(n){return{extract:function(t,e,o){return vn(n(o,e),function(n){return function(n,t){return Zn(n,function(){return t})}(t,n)})},toString:function(){return"val"}}},it=function(n){return xn(On(n,function(n){return null!=n}))},ut=function(n){var t=at(n),e=W(n,function(n,t){return t.fold(function(t){return Rn(n,Xn(t,!0))},r(n))},{});return{extract:function(n,o,r){var i=O(r)?[]:it(r),u=U(i,function(n){return!An(e,n)});return 0===u.length?t.extract(n,o,r):function(n,t){return Zn(n,function(){return"There are unsupported fields: ["+t.join(", ")+"] specified"})}(n,u)},toString:t.toString}},at=function(n){return{extract:function(t,e,o){return function(n,t,e,o){var r=N(e,function(e){return ot(n,t,e,o)});return Jn(r,{})}(t,o,n,e)},toString:function(){return"obj{\n"+N(n,function(n){return n.fold(function(n,t,e,o){return n+" -> "+o.toString()},function(n,t){return"state("+n+")"})}).join("\n")+"}"}}},ct=function(n){return{extract:function(t,e,o){var r=N(o,function(o,r){return n.extract(t.concat(["["+r+"]"]),e,o)});return $n(r)},toString:function(){return"array("+n.toString()+")"}}},st=function(n,t){return{extract:function(e,o,r){var u=xn(r),a=function(t,e){return ct(rt(n)).extract(t,i,e)}(e,u);return hn(a,function(n){var i=N(n,function(n){return nt.field(n,n,Nn(),t)});return at(i).extract(e,o,r)})},toString:function(){return"setOf("+t.toString()+")"}}},ft=r(rt(mn)),lt=o(ct,at),dt=nt.state,mt=nt.field,gt=function(n,t,e,o,r){return Bn(o,r).fold(function(){return function(n,t,e){return Zn(n,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Qn(t)})}(n,o,r)},function(o){return o.extract(n.concat(["branch: "+r]),t,e)})},pt=function(n,t){return{extract:function(e,o,r){return Bn(r,n).fold(function(){return function(n,t){return Zn(n,function(){return'Choice schema did not contain choice key: "'+t+'"'})}(e,n)},function(n){return gt(e,o,r,t,n)})},toString:function(){return"chooseOn("+n+"). Possible values: "+xn(t)}}},ht=rt(mn),vt=function(n){return lt(n)},bt=function(n){return{extract:function(t,e,o){return n().extract(t,e,o)},toString:function(){return n().toString()}}},yt=function(n){return rt(function(t){return n(t).fold(pn,mn)})},xt=function(n,t){return st(function(t){return ln(n(t))},t)},wt=function(n,t,e){return dn(function(n,t,e,o){var r=t.extract([n],e,o);return yn(r,function(n){return{input:o,errors:n}})}(n,t,i,e))},St=function(n){return n.fold(function(n){throw new Error(Ct(n))},i)},kt=function(n,t,e){return St(wt(n,t,e))},Ct=function(n){return"Errors: \n"+(t=n.errors,e=t.length>10?t.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):t,N(e,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()})).join("\n")+"\n\nInput object: "+Qn(n.input);var t,e},Ot=function(n,t){return pt(n,t)},_t=function(n,t){return pt(n,kn(t,at))},Tt=r(ht),Et=function(n,t){return rt(function(e){var o=typeof e;return n(e)?mn(e):pn("Expected type: "+t+" but got: "+o)})},Bt=Et(B,"number"),Dt=Et(S,"string"),At=Et(O,"boolean"),Mt=Et(E,"function"),Ft=function(n){var t=function(n,t){for(var e=n.next();!e.done;){if(!t(e.value))return!1;e=n.next()}return!0};if(Object(n)!==n)return!0;switch({}.toString.call(n).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(n).every(function(t){return Ft(n[t])});case"Map":return t(n.keys(),Ft)&&t(n.values(),Ft);case"Set":return t(n.keys(),Ft);default:return!1}},It=rt(function(n){return Ft(n)?mn(n):pn("Expected value to be acceptable for sending via postMessage")}),Rt=function(n){return yt(function(t){return V(n,t)?an.value(t):an.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})},Vt=function(n){return mt(n,n,Nn(),ft())},Pt=function(n,t){return mt(n,n,Nn(),t)},Ht=function(n){return Pt(n,Dt)},zt=function(n,t){return mt(n,n,Nn(),Rt(t))},Nt=function(n){return Pt(n,Mt)},Lt=function(n,t){return mt(n,n,Nn(),at(t))},jt=function(n,t){return mt(n,n,Nn(),lt(t))},Ut=function(n,t){return mt(n,n,Nn(),ct(t))},Wt=function(n){return mt(n,n,Ln(),ft())},Gt=function(n,t){return mt(n,n,Ln(),t)},Xt=function(n){return Gt(n,Bt)},Yt=function(n){return Gt(n,Dt)},qt=function(n){return Gt(n,Mt)},Kt=function(n,t){return Gt(n,at(t))},Jt=function(n,t){return mt(n,n,zn(t),ft())},$t=function(n,t,e){return mt(n,n,zn(t),e)},Qt=function(n,t){return $t(n,t,Bt)},Zt=function(n,t){return $t(n,t,Dt)},ne=function(n,t,e){return $t(n,t,Rt(e))},te=function(n,t){return $t(n,t,At)},ee=function(n,t){return $t(n,t,Mt)},oe=function(n,t,e){return $t(n,t,at(e))},re=function(n,t){return dt(n,t)},ie=function(n){var t=n;return{get:function(){return t},set:function(n){t=n}}},ue=function(n){if(null==n)throw new Error("Node cannot be null or undefined");return{dom:r(n)}},ae={fromHtml:function(t,e){var o=(e||n.document).createElement("div");if(o.innerHTML=t,!o.hasChildNodes()||o.childNodes.length>1)throw n.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return ue(o.childNodes[0])},fromTag:function(t,e){var o=(e||n.document).createElement(t);return ue(o)},fromText:function(t,e){var o=(e||n.document).createTextNode(t);return ue(o)},fromDom:ue,fromPoint:function(n,t,e){var o=n.dom();return y.from(o.elementFromPoint(t,e)).map(ue)}},ce=function(){return se(0,0)},se=function(n,t){return{major:n,minor:t}},fe={nu:se,detect:function(n,t){var e=String(t).toLowerCase();return 0===n.length?ce():function(n,t){var e=function(n,t){for(var e=0;e<n.length;e++){var o=n[e];if(o.test(t))return o}}(n,t);if(!e)return{major:0,minor:0};var o=function(n){return Number(t.replace(e,"$"+n))};return se(o(1),o(2))}(n,e)},unknown:ce},le=function(n){var t=n.current,e=n.version,o=function(n){return function(){return t===n}};return{current:t,version:e,isEdge:o("Edge"),isChrome:o("Chrome"),isIE:o("IE"),isOpera:o("Opera"),isFirefox:o("Firefox"),isSafari:o("Safari")}},de={unknown:function(){return le({current:void 0,version:fe.unknown()})},nu:le,edge:r("Edge"),chrome:r("Chrome"),ie:r("IE"),opera:r("Opera"),firefox:r("Firefox"),safari:r("Safari")},me=function(n){var t=n.current,e=n.version,o=function(n){return function(){return t===n}};return{current:t,version:e,isWindows:o("Windows"),isiOS:o("iOS"),isAndroid:o("Android"),isOSX:o("OSX"),isLinux:o("Linux"),isSolaris:o("Solaris"),isFreeBSD:o("FreeBSD"),isChromeOS:o("ChromeOS")}},ge={unknown:function(){return me({current:void 0,version:fe.unknown()})},nu:me,windows:r("Windows"),ios:r("iOS"),android:r("Android"),linux:r("Linux"),osx:r("OSX"),solaris:r("Solaris"),freebsd:r("FreeBSD"),chromeos:r("ChromeOS")},pe=function(n,t){var e=String(t).toLowerCase();return X(n,function(n){return n.search(e)})},he=function(n,t){return pe(n,t).map(function(n){var e=fe.detect(n.versionRegexes,t);return{current:n.name,version:e}})},ve=function(n,t){return pe(n,t).map(function(n){var e=fe.detect(n.versionRegexes,t);return{current:n.name,version:e}})},be=function(n,t){return-1!==n.indexOf(t)},ye=function(n){return function(t){return t.replace(n,"")}}(/^\s+|\s+$/g),xe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,we=function(n){return function(t){return be(t,n)}},Se=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return be(n,"edge/")&&be(n,"chrome")&&be(n,"safari")&&be(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,xe],search:function(n){return be(n,"chrome")&&!be(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return be(n,"msie")||be(n,"trident")}},{name:"Opera",versionRegexes:[xe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:we("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:we("firefox")},{name:"Safari",versionRegexes:[xe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(be(n,"safari")||be(n,"mobile/"))&&be(n,"applewebkit")}}],ke=[{name:"Windows",search:we("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return be(n,"iphone")||be(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:we("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:we("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:we("linux"),versionRegexes:[]},{name:"Solaris",search:we("sunos"),versionRegexes:[]},{name:"FreeBSD",search:we("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:we("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ce={browsers:r(Se),oses:r(ke)},Oe=function(n,t){var e=Ce.browsers(),o=Ce.oses(),i=he(e,n).fold(de.unknown,de.nu),u=ve(o,n).fold(ge.unknown,ge.nu),a=function(n,t,e,o){var i=n.isiOS()&&!0===/ipad/i.test(e),u=n.isiOS()&&!i,a=n.isiOS()||n.isAndroid(),c=a||o("(pointer:coarse)"),s=i||!u&&a&&o("(min-device-width:768px)"),f=u||a&&!s,l=t.isSafari()&&n.isiOS()&&!1===/safari/i.test(e),d=!f&&!s&&!l;return{isiPad:r(i),isiPhone:r(u),isTablet:r(s),isPhone:r(f),isTouch:r(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:r(l),isDesktop:r(d)}}(u,i,n,t);return{browser:i,os:u,deviceType:a}},_e=function(t){return n.window.matchMedia(t).matches},Te=Pn(function(){return Oe(n.navigator.userAgent,_e)}),Ee=function(){return Te()},Be=function(n,t){var e=n.dom();if(1!==e.nodeType)return!1;var o=e;if(void 0!==o.matches)return o.matches(t);if(void 0!==o.msMatchesSelector)return o.msMatchesSelector(t);if(void 0!==o.webkitMatchesSelector)return o.webkitMatchesSelector(t);if(void 0!==o.mozMatchesSelector)return o.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},De=function(n){return 1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount},Ae=function(n,t){return n.dom()===t.dom()},Me=function(t,e){return o=t.dom(),r=e.dom(),function(n,t,e){return 0!=(n.compareDocumentPosition(t)&e)}(o,r,n.Node.DOCUMENT_POSITION_CONTAINED_BY);var o,r},Fe=function(n,t){return Ee().browser.isIE()?Me(n,t):function(n,t){var e=n.dom(),o=t.dom();return e!==o&&e.contains(o)}(n,t)},Ie=function(n){return E(n)?n:r(!1)},Re=function(n,t,e){for(var o=n.dom(),r=Ie(e);o.parentNode;){o=o.parentNode;var i=ae.fromDom(o),u=t(i);if(u.isSome())return u;if(r(i))break}return y.none()},Ve=function(n,t,e){var o=t(n),r=Ie(e);return o.orThunk(function(){return r(n)?y.none():Re(n,t,r)})},Pe=function(n,t){return Ae(n.element(),t.event().target())},He=function(n){if(!An(n,"can")&&!An(n,"abort")&&!An(n,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(n,null,2)+" does not have can, abort, or run!");return kt("Extracting event.handler",ut([Jt("can",r(!0)),Jt("abort",r(!1)),Jt("run",t)]),n)},ze=function(n){var t=function(n,t){return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return G(n,function(n,o){return n&&t(o).apply(void 0,e)},!0)}}(n,function(n){return n.can}),e=function(n,t){return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];return G(n,function(n,o){return n||t(o).apply(void 0,e)},!1)}}(n,function(n){return n.abort});return He({can:t,abort:e,run:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];L(n,function(n){n.run.apply(void 0,t)})}})},Ne=r("touchstart"),Le=r("touchmove"),je=r("touchend"),Ue=r("touchcancel"),We=r("mousedown"),Ge=r("mousemove"),Xe=r("mouseout"),Ye=r("mouseup"),qe=r("mouseover"),Ke=r("focusin"),Je=r("focusout"),$e=r("keydown"),Qe=r("keyup"),Ze=r("input"),no=r("change"),to=r("click"),eo=r("transitionend"),oo=r("selectstart"),ro={tap:r("alloy.tap")},io=r("alloy.focus"),uo=r("alloy.blur.post"),ao=r("alloy.paste.post"),co=r("alloy.receive"),so=r("alloy.execute"),fo=r("alloy.focus.item"),lo=ro.tap,mo=r("alloy.longpress"),go=r("alloy.sandbox.close"),po=r("alloy.typeahead.cancel"),ho=r("alloy.system.init"),vo=r("alloy.system.touchmove"),bo=r("alloy.system.touchend"),yo=r("alloy.system.scroll"),xo=r("alloy.system.resize"),wo=r("alloy.system.attached"),So=r("alloy.system.detached"),ko=r("alloy.system.dismissRequested"),Co=r("alloy.system.repositionRequested"),Oo=r("alloy.focusmanager.shifted"),_o=r("alloy.slotcontainer.visibility"),To=r("alloy.change.tab"),Eo=r("alloy.dismiss.tab"),Bo=r("alloy.highlight"),Do=r("alloy.dehighlight"),Ao=function(n,t){Ro(n,n.element(),t,{})},Mo=function(n,t,e){Ro(n,n.element(),t,e)},Fo=function(n){Ao(n,so())},Io=function(n,t,e){Ro(n,t,e,{})},Ro=function(n,t,e,o){var i=d({target:t},o);n.getSystem().triggerEvent(e,t,kn(i,r))},Vo=function(n,t,e,o){n.getSystem().triggerEvent(e,t,o.event())},Po=function(n){return Yn(n)},Ho=function(n,t){return{key:n,value:He({abort:t})}},zo=function(n){return{key:n,value:He({run:function(n,t){t.event().prevent()}})}},No=function(n,t){return{key:n,value:He({run:t})}},Lo=function(n,t,e){return{key:n,value:He({run:function(n,o){t.apply(void 0,[n,o].concat(e))}})}},jo=function(n){return function(t){return{key:n,value:He({run:function(n,e){Pe(n,e)&&t(n,e)}})}}},Uo=function(n,t,e){return function(n,t){return No(n,function(e,o){e.getSystem().getByUid(t).each(function(t){Vo(t,t.element(),n,o)})})}(n,t.partUids[e])},Wo=function(n,t){return No(n,function(n,e){var o=e.event(),i=n.getSystem().getByDom(o.target()).fold(function(){return Ve(o.target(),function(t){return n.getSystem().getByDom(t).toOption()},r(!1)).getOr(n)},function(n){return n});t(n,i,e)})},Go=function(n){return No(n,function(n,t){t.cut()})},Xo=function(n,t){return jo(n)(t)},Yo=jo(wo()),qo=jo(So()),Ko=jo(ho()),Jo=function(n){return function(t){return No(n,t)}}(so()),$o=(void 0!==n.window?n.window:Function("return this;")(),function(n){return n.dom().nodeName.toLowerCase()}),Qo=function(n){return function(t){return function(n){return n.dom().nodeType}(t)===n}},Zo=Qo(1),nr=Qo(3),tr=Qo(9),er=Qo(11),or=function(n){return ae.fromDom(n.dom().ownerDocument)},rr=function(n){return tr(n)?n:or(n)},ir=function(n){return ae.fromDom(n.dom().ownerDocument.documentElement)},ur=function(n){return ae.fromDom(n.dom().ownerDocument.defaultView)},ar=function(n){return y.from(n.dom().parentNode).map(ae.fromDom)},cr=function(n){return y.from(n.dom().offsetParent).map(ae.fromDom)},sr=function(n){return N(n.dom().childNodes,ae.fromDom)},fr=function(n,t){var e=n.dom().childNodes;return y.from(e[t]).map(ae.fromDom)},lr=function(n,t){ar(n).each(function(e){e.dom().insertBefore(t.dom(),n.dom())})},dr=function(n,t){(function(n){return y.from(n.dom().nextSibling).map(ae.fromDom)})(n).fold(function(){ar(n).each(function(n){gr(n,t)})},function(n){lr(n,t)})},mr=function(n,t){(function(n){return fr(n,0)})(n).fold(function(){gr(n,t)},function(e){n.dom().insertBefore(t.dom(),e.dom())})},gr=function(n,t){n.dom().appendChild(t.dom())},pr=function(n,t){L(t,function(t){gr(n,t)})},hr=function(n){n.dom().textContent="",L(sr(n),function(n){vr(n)})},vr=function(n){var t=n.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},br=function(n){var t,e=sr(n);e.length>0&&(t=n,L(e,function(n){lr(t,n)})),vr(n)},yr=function(n){return n.dom().innerHTML},xr=function(t,e){var o,r,i=or(t).dom(),u=ae.fromDom(i.createDocumentFragment()),a=(o=e,(r=(i||n.document).createElement("div")).innerHTML=o,sr(ae.fromDom(r)));pr(u,a),hr(t),gr(t,u)},wr=function(t,e,o){if(!(S(o)||O(o)||B(o)))throw n.console.error("Invalid call to Attr.set. Key ",e,":: Value ",o,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,o+"")},Sr=function(n,t,e){wr(n.dom(),t,e)},kr=function(n,t){var e=n.dom().getAttribute(t);return null===e?void 0:e},Cr=function(n,t){return y.from(kr(n,t))},Or=function(n,t){var e=n.dom();return!(!e||!e.hasAttribute)&&e.hasAttribute(t)},_r=function(n,t){n.dom().removeAttribute(t)},Tr=function(n){return function(n,t){return ae.fromDom(n.dom().cloneNode(t))}(n,!1)},Er=function(n){return function(n){var t=ae.fromTag("div"),e=ae.fromDom(n.dom().cloneNode(!0));return gr(t,e),yr(t)}(Tr(n))},Br=function(n){return Er(n)},Dr=Po([function(n,t){return{key:n,value:He({can:t})}}(io(),function(t,e){var o=e.event().originator(),r=e.event().target();return!function(n,t,e){return Ae(t,n.element())&&!Ae(t,e)}(t,o,r)||(n.console.warn(io()+" did not get interpreted by the desired target. \nOriginator: "+Br(o)+"\nTarget: "+Br(r)+"\nCheck the "+io()+" event handlers"),!1)})]),Ar=Object.freeze({__proto__:null,events:Dr}),Mr=0,Fr=function(n){var t=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++Mr+String(t)},Ir=r("alloy-id-"),Rr=r("data-alloy-id"),Vr=Ir(),Pr=Rr(),Hr=function(n,t){var e=Fr(Vr+n);return zr(t,e),e},zr=function(n,t){Object.defineProperty(n.dom(),Pr,{value:t,writable:!0})},Nr=function(n){var t=Zo(n)?n.dom()[Pr]:null;return y.from(t)},Lr=function(n){return Fr(n)},jr=i,Ur=function(n){var t=function(t){return function(){throw new Error("The component must be in a context to send: "+t+(n?"\n"+Br(n().element())+" is not in context.":""))}};return{debugInfo:r("fake"),triggerEvent:t("triggerEvent"),triggerFocus:t("triggerFocus"),triggerEscape:t("triggerEscape"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),broadcast:t("broadcast"),broadcastOn:t("broadcastOn"),broadcastEvent:t("broadcastEvent"),isConnected:r(!1)}},Wr=Ur(),Gr=function(n){return N(n,function(n){return function(n,t,e){return""===t||n.length>=t.length&&n.substr(e,e+t.length)===t}(t=n,e="/*",t.length-e.length)?n.substring(0,n.length-"/*".length):n;var t,e})},Xr=function(n,t){var e=n.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:t,parameters:Gr(i)}},n},Yr=Fr("alloy-premade"),qr=function(n){return Xn(Yr,n)},Kr=function(n){return function(n,t){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Gr(i.slice(1))}},n}(function(t){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];return n.apply(void 0,g([t.getApis(),t],e))},n)},Jr={init:function(){return $r({readState:function(){return"No State required"}})}},$r=function(n){return n},Qr=function(n,t){var e={};return Sn(n,function(n,o){Sn(n,function(n,r){var i=Bn(e,r).getOr([]);e[r]=i.concat([t(o,n)])})}),e},Zr=function(n){return{classes:void 0!==n.classes?n.classes:[],attributes:void 0!==n.attributes?n.attributes:{},styles:void 0!==n.styles?n.styles:{}}},ni=function(n,t){return e=u.apply(void 0,[n.handler].concat(t)),o=n.purpose(),{cHandler:e,purpose:r(o)};var e,o},ti=function(n){return n.cHandler},ei=function(n,t){return{name:r(n),handler:r(t)}},oi=function(n,t,e){var o=d(d({},e),function(n,t){var e={};return L(n,function(n){e[n.name()]=n.handlers(t)}),e}(t,n));return Qr(o,ei)},ri=function(n){var t=function(n){return E(n)?{can:r(!0),abort:r(!1),run:n}:n}(n);return function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];var i=[n,e].concat(o);t.abort.apply(void 0,i)?e.stop():t.can.apply(void 0,i)&&t.run.apply(void 0,i)}},ii=function(n,t,e){var o=t[e];return o?function(n,t,e,o){try{var r=Z(e,function(e,r){var i=e[t](),u=r[t](),a=o.indexOf(i),c=o.indexOf(u);if(-1===a)throw new Error("The ordering for "+n+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(o,null,2));if(-1===c)throw new Error("The ordering for "+n+" does not have an entry for "+u+".\nOrder specified: "+JSON.stringify(o,null,2));return a<c?-1:c<a?1:0});return an.value(r)}catch(i){return an.error([i])}}("Event: "+e,"name",n,o).map(function(n){var t=N(n,function(n){return n.handler()});return ze(t)}):function(n,t){return an.error(["The event ("+n+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(N(t,function(n){return n.name()}),null,2)])}(e,n)},ui=function(n,t){var e=_n(n,function(n,e){return(1===n.length?an.value(n[0].handler()):ii(n,t,e)).map(function(o){var i=ri(o),u=n.length>1?U(t[e],function(t){return P(n,function(n){return n.name()===t})}).join(" > "):n[0].name();return Xn(e,function(n,t){return{handler:n,purpose:r(t)}}(i,u))})});return qn(e,{})},ai=function(n){return n.events},ci=function(n,t){var e=kr(n,t);return void 0===e||""===e?[]:e.split(" ")},si=function(n){return void 0!==n.dom().classList},fi=function(n,t){return function(n,t,e){var o=ci(n,t).concat([e]);return Sr(n,t,o.join(" ")),!0}(n,"class",t)},li=function(n,t){return function(n,t,e){var o=U(ci(n,t),function(n){return n!==e});return o.length>0?Sr(n,t,o.join(" ")):_r(n,t),!1}(n,"class",t)},di=function(n,t){si(n)?n.dom().classList.add(t):fi(n,t)},mi=function(n){0===(si(n)?n.dom().classList:function(n){return ci(n,"class")}(n)).length&&_r(n,"class")},gi=function(n,t){si(n)?n.dom().classList.remove(t):li(n,t);mi(n)},pi=function(n,t){return si(n)&&n.dom().classList.contains(t)},hi=function(n,t){L(t,function(t){di(n,t)})},vi=function(n,t){L(t,function(t){gi(n,t)})},bi=function(n){return void 0!==n.style&&E(n.style.getPropertyValue)},yi=function(n){return er(n)},xi=E(n.Element.prototype.attachShadow)&&E(n.Node.prototype.getRootNode),wi=r(xi),Si=xi?function(n){return ae.fromDom(n.dom().getRootNode())}:rr,ki=function(n){return ae.fromDom(n.dom().host)},Ci=function(n){return T(n.dom().shadowRoot)},Oi=function(n){var t,e,o,r,i=nr(n)?n.dom().parentNode:n.dom();return null!=i&&null!==i.ownerDocument&&(o=ae.fromDom(i),r=Si(o),yi(r)?y.some(r):y.none()).fold(function(){return i.ownerDocument.body.contains(i)},(t=Oi,e=ki,function(n){return t(e(n))}))},_i=function(){return Ti(ae.fromDom(n.document))},Ti=function(n){var t=n.dom().body;if(null==t)throw new Error("Body is not available yet");return ae.fromDom(t)},Ei=function(t,e,o){if(!S(o))throw n.console.error("Invalid call to CSS.set. Property ",e,":: Value ",o,":: Element ",t),new Error("CSS value must be a string: "+o);bi(t)&&t.style.setProperty(e,o)},Bi=function(n,t){bi(n)&&n.style.removeProperty(t)},Di=function(n,t,e){var o=n.dom();Ei(o,t,e)},Ai=function(n,t){var e=n.dom();Sn(t,function(n,t){Ei(e,t,n)})},Mi=function(n,t){var e=n.dom();Sn(t,function(n,t){n.fold(function(){Bi(e,t)},function(n){Ei(e,t,n)})})},Fi=function(t,e){var o=t.dom(),r=n.window.getComputedStyle(o).getPropertyValue(e);return""!==r||Oi(t)?r:Ii(o,e)},Ii=function(n,t){return bi(n)?n.style.getPropertyValue(t):""},Ri=function(n,t){var e=n.dom(),o=Ii(e,t);return y.from(o).filter(function(n){return n.length>0})},Vi=function(n){var t={},e=n.dom();if(bi(e))for(var o=0;o<e.style.length;o++){var r=e.style.item(o);t[r]=e.style[r]}return t},Pi=function(n,t,e){var o=ae.fromTag(n);return Di(o,t,e),Ri(o,t).isSome()},Hi=function(n,t){var e=n.dom();Bi(e,t),Cr(n,"style").map(ye).is("")&&_r(n,"style")},zi=function(n){return n.dom().offsetWidth},Ni=function(n){return n.dom().value},Li=function(n,t){if(void 0===t)throw new Error("Value.set was undefined");n.dom().value=t},ji=function(n){var t,e,o,r=ae.fromTag(n.tag);t=r,e=n.attributes,o=t.dom(),Sn(e,function(n,t){wr(o,t,n)}),hi(r,n.classes),Ai(r,n.styles),n.innerHtml.each(function(n){return xr(r,n)});var i=n.domChildren;return pr(r,i),n.value.each(function(n){Li(r,n)}),n.uid,zr(r,n.uid),r},Ui=function(n,t){return function(n,t){var e=N(t,function(n){return Kt(n.name(),[Vt("config"),Jt("state",Jr)])}),o=wt("component.behaviours",at(e),n.behaviours).fold(function(t){throw new Error(Ct(t)+"\nComplete spec:\n"+JSON.stringify(n,null,2))},function(n){return n});return{list:t,data:kn(o,function(n){var t=n.map(function(n){return{config:n.config,state:n.state.init(n.config)}});return function(){return t}})}}(n,t)},Wi=function(n){var t=function(n){var t=Bn(n,"behaviours").getOr({}),e=U(xn(t),function(n){return void 0!==t[n]});return N(e,function(n){return t[n].me})}(n);return Ui(n,t)},Gi=function(n,t,e){var o,r,i,u=d(d({},(o=n).dom),{uid:o.uid,domChildren:N(o.components,function(n){return n.element()})}),a=function(n){return n.domModification.fold(function(){return Zr({})},Zr)}(n),c={"alloy.base.modification":a},s=t.length>0?function(n,t,e,o){var r=d({},t);L(e,function(t){r[t.name()]=t.exhibit(n,o)});var i=Qr(r,function(n,t){return{name:n,modification:t}}),u=function(n){return W(n,function(n,t){return d(d({},t.modification),n)},{})},a=W(i.classes,function(n,t){return t.modification.concat(n)},[]),c=u(i.attributes),s=u(i.styles);return Zr({classes:a,attributes:c,styles:s})}(e,c,t,u):a;return i=s,d(d({},r=u),{attributes:d(d({},r.attributes),i.attributes),styles:d(d({},r.styles),i.styles),classes:r.classes.concat(i.classes)})},Xi=function(n,t,e){var o={"alloy.base.behaviour":ai(n)};return function(n,t,e,o){var r=oi(n,e,o);return ui(r,t)}(e,n.eventOrder,t,o).getOrDie()},Yi=function(n){var t=function(){return d},e=ie(Wr),o=St(function(n){return wt("custom.definition",at([mt("dom","dom",Nn(),at([Vt("tag"),Jt("styles",{}),Jt("classes",[]),Jt("attributes",{}),Wt("value"),Wt("innerHtml")])),Vt("components"),Vt("uid"),Jt("events",{}),Jt("apis",{}),mt("eventOrder","eventOrder",(t={"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],touchstart:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"],"alloy.receive":["receiving","reflecting","tooltipping"]},Hn.mergeWithThunk(r(t))),Tt()),Wt("domModification")]),n);var t}(n)),i=Wi(n),u=function(n){return n.list}(i),a=function(n){return n.data}(i),c=Gi(o,u,a),s=ji(c),f=Xi(o,u,a),l=ie(o.components),d={getSystem:e.get,config:function(t){var e=a;return(E(e[t.name()])?e[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(n,null,2))})()},hasConfigured:function(n){return E(a[n.name()])},spec:r(n),readState:function(n){return a[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},getApis:function(){return o.apis},connect:function(n){e.set(n)},disconnect:function(){e.set(Ur(t))},element:r(s),syncComponents:function(){var n=sr(s),t=K(n,function(n){return e.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});l.set(t)},components:l.get,events:r(f)};return d},qi=function(n){var t=jr(n),e=t.events,o=m(t,["events"]),r=function(n){var t=Bn(n,"components").getOr([]);return N(t,Qi)}(o),i=d(d({},o),{events:d(d({},Ar),e),components:r});return an.value(Yi(i))},Ki=function(n){var t=ae.fromText(n);return Ji({element:t})},Ji=function(n){var e=kt("external.component",ut([Vt("element"),Wt("uid")]),n),o=ie(Ur());e.uid.each(function(n){zr(e.element,n)});var i={getSystem:o.get,config:y.none,hasConfigured:r(!1),connect:function(n){o.set(n)},disconnect:function(){o.set(Ur(function(){return i}))},getApis:function(){return{}},element:r(e.element),spec:r(n),readState:r("No state"),syncComponents:t,components:r([]),events:r({})};return qr(i)},$i=Lr,Qi=function(n){return function(n){return Bn(n,Yr)}(n).fold(function(){var t=n.hasOwnProperty("uid")?n:d({uid:$i("")},n);return qi(t).getOrDie()},function(n){return n})},Zi=qr;function nu(n,t){var e=function(e){var o=t(e);if(o<=0||null===o){var r=Fi(e,n);return parseFloat(r)||0}return o},o=function(n,t){return G(t,function(t,e){var o=Fi(n,e),r=void 0===o?0:parseInt(o,10);return isNaN(r)?t:t+r},0)};return{set:function(t,e){if(!B(e)&&!e.match(/^[0-9]+$/))throw new Error(n+".set accepts only positive integer values. Value was "+e);var o=t.dom();bi(o)&&(o.style[n]=e+"px")},get:e,getOuter:e,aggregate:o,max:function(n,t,e){var r=o(n,e);return t>r?t-r:0}}}var tu=nu("height",function(n){var t=n.dom();return Oi(n)?t.getBoundingClientRect().height:t.offsetHeight}),eu=function(n){return tu.get(n)},ou=function(n){return tu.getOuter(n)},ru=function(n,t){return{left:r(n),top:r(t),translate:function(e,o){return ru(n+e,t+o)}}},iu=ru,uu=function(n,t){return void 0!==n?n:void 0!==t?t:0},au=function(n){var t=n.dom().ownerDocument,e=t.body,o=t.defaultView,r=t.documentElement;if(e===n.dom())return iu(e.offsetLeft,e.offsetTop);var i=uu(o.pageYOffset,r.scrollTop),u=uu(o.pageXOffset,r.scrollLeft),a=uu(r.clientTop,e.clientTop),c=uu(r.clientLeft,e.clientLeft);return cu(n).translate(u-c,i-a)},cu=function(n){var t=n.dom(),e=t.ownerDocument.body;return e===t?iu(e.offsetLeft,e.offsetTop):Oi(n)?function(n){var t=n.getBoundingClientRect();return iu(t.left,t.top)}(t):iu(0,0)},su=nu("width",function(n){return n.dom().offsetWidth}),fu=function(n){return su.get(n)},lu=function(n){return su.getOuter(n)},du=function(n){var t=ae.fromDom(function(n){if(wi()&&T(n.target)){var t=ae.fromDom(n.target);if(Zo(t)&&Ci(ae.fromDom(n.target))){var e=n;if(e.composed&&e.composedPath){var o=e.composedPath();if(o)return nn(o)}}}return y.from(n.target)}(n).getOr(n.target)),e=function(){return n.stopPropagation()},i=function(){return n.preventDefault()},u=o(i,e);return function(n,t,e,o,i,u,a){return{target:r(n),x:r(t),y:r(e),stop:o,prevent:i,kill:u,raw:r(a)}}(t,n.clientX,n.clientY,e,i,u,n)},mu=function(n,t,e,o,r){var i=function(n,t){return function(e){n(e)&&t(du(e))}}(e,o);return n.dom().addEventListener(t,i,r),{unbind:u(gu,n,t,i,r)}},gu=function(n,t,e,o){n.dom().removeEventListener(t,e,o)},pu=function(t){var e=void 0!==t?t.dom():n.document,o=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return iu(o,r)},hu=function(t,e,o){(void 0!==o?o.dom():n.document).defaultView.scrollTo(t,e)},vu=function(n,t,e,o){return{x:n,y:t,width:e,height:o,right:n+e,bottom:t+o}},bu=function(t){var e=void 0===t?n.window:t,o=e.document,r=pu(ae.fromDom(o));return function(t){var e=void 0===t?n.window:t;return y.from(e.visualViewport)}(e).fold(function(){var n=e.document.documentElement,t=n.clientWidth,o=n.clientHeight;return vu(r.left(),r.top(),t,o)},function(n){return vu(Math.max(n.pageLeft,r.left()),Math.max(n.pageTop,r.top()),n.width,n.height)})},yu=function(n,t){return n.view(t).fold(r([]),function(t){var e=n.owner(t),o=yu(n,e);return[t].concat(o)})},xu=Object.freeze({__proto__:null,view:function(t){return(t.dom()===n.document?y.none():y.from(t.dom().defaultView.frameElement)).map(ae.fromDom)},owner:function(n){return or(n)}}),wu=function(t){var e=ae.fromDom(n.document),o=pu(e);return function(n,t){var e=t.owner(n),o=yu(t,e);return y.some(o)}(t,xu).fold(u(au,t),function(n){var e=cu(t),r=W(n,function(n,t){var e=cu(t);return{left:n.left+e.left(),top:n.top+e.top()}},{left:0,top:0});return iu(r.left+e.left()+o.left(),r.top+e.top()+o.top())})},Su=function(n,t,e,o){return{x:n,y:t,width:e,height:o,right:n+e,bottom:t+o}},ku=function(n){var t=au(n),e=lu(n),o=ou(n);return Su(t.left(),t.top(),e,o)},Cu=function(n){var t=wu(n),e=lu(n),o=ou(n);return Su(t.left(),t.top(),e,o)},Ou=function(){return bu(n.window)};function _u(n,t,e,o,r){return n(e,o)?y.some(e):E(r)&&r(e)?y.none():t(e,o,r)}var Tu,Eu=function(n,t,e){for(var o=n.dom(),i=E(e)?e:r(!1);o.parentNode;){o=o.parentNode;var u=ae.fromDom(o);if(t(u))return y.some(u);if(i(u))break}return y.none()},Bu=function(n,t,e){return _u(function(n,t){return t(n)},Eu,n,t,e)},Du=function(n,t,e){return Bu(n,t,e).isSome()},Au=function(n,t,e){return Eu(n,function(n){return Be(n,t)},e)},Mu=function(t,e){return function(t,e){var o=void 0===e?n.document:e.dom();return De(o)?y.none():y.from(o.querySelector(t)).map(ae.fromDom)}(e,t)},Fu=function(n,t,e){return _u(function(n,t){return Be(n,t)},Au,n,t,e)},Iu=function(){var n=Fr("aria-owns");return{id:n,link:function(t){Sr(t,"aria-owns",n)},unlink:function(n){_r(n,"aria-owns")}}},Ru=function(n,t){return function(n){return Bu(n,function(n){if(!Zo(n))return!1;var t=kr(n,"id");return void 0!==t&&t.indexOf("aria-owns")>-1}).bind(function(n){var t=kr(n,"id"),e=or(n);return Mu(e,'[aria-owns="'+t+'"]')})}(t).exists(function(t){return Vu(n,t)})},Vu=function(n,t){return Du(t,function(t){return Ae(t,n.element())},r(!1))||Ru(n,t)};!function(n){n[n.STOP=0]="STOP",n[n.NORMAL=1]="NORMAL",n[n.LOGGING=2]="LOGGING"}(Tu||(Tu={}));var Pu,Hu=ie({}),zu=function(t,e,o){switch(Bn(Hu.get(),t).orThunk(function(){var n=xn(Hu.get());return on(n,function(n){return t.indexOf(n)>-1?y.some(Hu.get()[n]):y.none()})}).getOr(Tu.NORMAL)){case Tu.NORMAL:return o(ju());case Tu.LOGGING:var r=function(t,e){var o=[],r=(new Date).getTime();return{logEventCut:function(n,t,e){o.push({outcome:"cut",target:t,purpose:e})},logEventStopped:function(n,t,e){o.push({outcome:"stopped",target:t,purpose:e})},logNoParent:function(n,t,e){o.push({outcome:"no-parent",target:t,purpose:e})},logEventNoHandlers:function(n,t){o.push({outcome:"no-handlers-left",target:t})},logEventResponse:function(n,t,e){o.push({outcome:"response",purpose:e,target:t})},write:function(){var i=(new Date).getTime();V(["mousemove","mouseover","mouseout",ho()],t)||n.console.log(t,{event:t,time:i-r,target:e.dom(),sequence:N(o,function(n){return V(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+Br(n.target)+")":n.outcome})})}}}(t,e),i=o(r);return r.write(),i;case Tu.STOP:return!0}},Nu=["alloy/data/Fields","alloy/debugging/Debugging"],Lu=function(n,t,e){return zu(n,t,e)},ju=r({logEventCut:t,logEventStopped:t,logNoParent:t,logEventNoHandlers:t,logEventResponse:t,write:t}),Uu=r([Vt("menu"),Vt("selectedMenu")]),Wu=r([Vt("item"),Vt("selectedItem")]),Gu=(r(at(Wu().concat(Uu()))),r(at(Wu()))),Xu=Lt("initSize",[Vt("numColumns"),Vt("numRows")]),Yu=function(){return Lt("markers",[Vt("backgroundMenu")].concat(Uu()).concat(Wu()))},qu=function(n){return Lt("markers",N(n,Vt))},Ku=function(n,t,e){!function(){var n=new Error;if(void 0!==n.stack){var t=n.stack.split("\n");return X(t,function(n){return n.indexOf("alloy")>0&&!P(Nu,function(t){return n.indexOf(t)>-1})}).getOr("unknown")}}();return mt(t,t,e,yt(function(n){return an.value(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.apply(void 0,t)})}))},Ju=function(n){return Ku(0,n,zn(t))},$u=function(n){return Ku(0,n,zn(y.none))},Qu=function(n){return Ku(0,n,Nn())},Zu=function(n){return Ku(0,n,Nn())},na=function(n,t){return re(n,r(t))},ta=function(n){return re(n,i)},ea=r(Xu),oa=function(n,t,e,o,i,u){return{x:r(n),y:r(t),bubble:r(e),direction:r(o),boundsRestriction:r(i),label:r(u)}},ra=Mn([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),ia=ra.southeast,ua=ra.southwest,aa=ra.northeast,ca=ra.northwest,sa=ra.south,fa=ra.north,la=ra.east,da=ra.west,ma=function(n,t){return function(n,t){for(var e={},o=0,r=n.length;o<r;o++){var i=n[o];e[String(i)]=t(i,o)}return e}(["left","right","top","bottom"],function(e){return Bn(t,e).map(function(t){return function(n,t){switch(t){case 1:return n.x;case 0:return n.x+n.width;case 2:return n.y;case 3:return n.y+n.height}}(n,t)})})},ga=function(n){return n.x},pa=function(n,t){return n.x+n.width/2-t.width/2},ha=function(n,t){return n.x+n.width-t.width},va=function(n,t){return n.y-t.height},ba=function(n){return n.y+n.height},ya=function(n,t){return n.y+n.height/2-t.height/2},xa=function(n,t,e){return oa(ga(n),ba(n),e.southeast(),ia(),ma(n,{left:1,top:3}),"layout-se")},wa=function(n,t,e){return oa(ha(n,t),ba(n),e.southwest(),ua(),ma(n,{right:0,top:3}),"layout-sw")},Sa=function(n,t,e){return oa(ga(n),va(n,t),e.northeast(),aa(),ma(n,{left:1,bottom:2}),"layout-ne")},ka=function(n,t,e){return oa(ha(n,t),va(n,t),e.northwest(),ca(),ma(n,{right:0,bottom:2}),"layout-nw")},Ca=function(n,t,e){return oa(pa(n,t),va(n,t),e.north(),fa(),ma(n,{bottom:2}),"layout-n")},Oa=function(n,t,e){return oa(pa(n,t),ba(n),e.south(),sa(),ma(n,{top:3}),"layout-s")},_a=function(n,t,e){return oa(function(n){return n.x+n.width}(n),ya(n,t),e.east(),la(),ma(n,{left:0}),"layout-e")},Ta=function(n,t,e){return oa(function(n,t){return n.x-t.width}(n,t),ya(n,t),e.west(),da(),ma(n,{right:1}),"layout-w")},Ea=function(){return[xa,wa,Sa,ka,Oa,Ca,_a,Ta]},Ba=function(){return[wa,xa,ka,Sa,Oa,Ca,_a,Ta]},Da=function(){return[Sa,ka,xa,wa,Ca,Oa]},Aa=function(){return[xa,wa,Sa,ka,Oa,Ca]},Ma=function(){return[wa,xa,ka,Sa,Oa,Ca]},Fa=function(n,t,e){return Ko(function(o,r){e(o,n,t)})},Ia=function(n,t,e){return function(n,t,e){var o=e.toString(),r=o.indexOf(")")+1,i=o.indexOf("("),u=o.substring(i+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:t,parameters:Gr(u.slice(0,1).concat(u.slice(3)))}},n}(function(o){for(var i=[],u=1;u<arguments.length;u++)i[u-1]=arguments[u];var a=[o].concat(i);return o.config({name:r(n)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+n+". Using API: "+e)},function(n){var e=Array.prototype.slice.call(a,1);return t.apply(void 0,[o,n.config,n.state].concat(e))})},e,t)},Ra=function(n){return{key:n,value:void 0}},Va=function(n,t,e,o,r,i,a){var c=function(n){return An(n,e)?n[e]():y.none()},s=kn(r,function(n,t){return Ia(e,n,t)}),f=kn(i,function(n,t){return Xr(n,t)}),l=d(d(d({},f),s),{revoke:u(Ra,e),config:function(t){var o=kt(e+"-config",n,t);return{key:e,value:{config:o,me:l,configAsRaw:Pn(function(){return kt(e+"-config",n,t)}),initialConfig:t,state:a}}},schema:function(){return t},exhibit:function(n,t){return c(n).bind(function(n){return Bn(o,"exhibit").map(function(e){return e(t,n.config,n.state)})}).getOr(Zr({}))},name:function(){return e},handlers:function(n){return c(n).map(function(n){return Bn(o,"events").getOr(function(){return{}})(n.config,n.state)}).getOr({})}});return l},Pa=function(n){return Yn(n)},Ha=ut([Vt("fields"),Vt("name"),Jt("active",{}),Jt("apis",{}),Jt("state",Jr),Jt("extra",{})]),za=function(n){var t,e,o,r,i,u,a,c,s,f,l=kt("Creating behaviour: "+n.name,Ha,n);return t=l.fields,e=l.name,o=l.active,r=l.apis,i=l.extra,u=l.state,s=ut(t),f=Kt(e,[(a="config",c=t,Gt(a,ut(c)))]),Va(s,f,e,o,r,i,u)},Na=ut([Vt("branchKey"),Vt("branches"),Vt("name"),Jt("active",{}),Jt("apis",{}),Jt("state",Jr),Jt("extra",{})]),La=function(n){var t,e,o,r,i,u,a,c,s=kt("Creating behaviour: "+n.name,Na,n);return t=_t(s.branchKey,s.branches),e=s.name,o=s.active,r=s.apis,i=s.extra,u=s.state,a=t,c=Kt(e,[Gt("config",t)]),Va(a,c,e,o,r,i,u)},ja=r(void 0),Ua=Object.freeze({__proto__:null,events:function(n){return Po([No(co(),function(t,e){var o=n.channels,r=xn(o),i=e,u=function(n,t){return t.universal()?n:U(n,function(n){return V(t.channels(),n)})}(r,i);L(u,function(n){var e=o[n],r=e.schema,u=kt("channel["+n+"] data\nReceiver: "+Br(t.element()),r,i.data());e.onReceive(t,u)})})])}}),Wa=[Pt("channels",xt(an.value,ut([Qu("onReceive"),Jt("schema",Tt())])))],Ga=za({fields:Wa,name:"receiving",active:Ua}),Xa=Object.freeze({__proto__:null,exhibit:function(n,t){return Zr({classes:[],styles:t.useFixed()?{}:{position:"relative"}})}}),Ya=function(n){return n.dom().focus()},qa=function(t){return void 0===t&&(t=ae.fromDom(n.document)),y.from(t.dom().activeElement).map(ae.fromDom)},Ka=function(n){return qa(Si(n)).filter(function(t){return n.dom().contains(t.dom())})},Ja=function(n,e){var o=or(e),r=qa(o).bind(function(n){var t,o,r=function(t){return Ae(n,t)};return r(e)?y.some(e):(t=r,(o=function(n){for(var e=0;e<n.childNodes.length;e++){var r=ae.fromDom(n.childNodes[e]);if(t(r))return y.some(r);var i=o(n.childNodes[e]);if(i.isSome())return i}return y.none()})(e.dom()))}),i=n(e);return r.each(function(n){qa(o).filter(function(t){return Ae(t,n)}).fold(function(){Ya(n)},t)}),i},$a=function(n,t,e,o,i){return{position:r(n),left:r(t),top:r(e),right:r(o),bottom:r(i)}},Qa=function(n,t){var e=function(n){return n+"px"};Mi(n,{position:y.some(t.position()),left:t.left().map(e),top:t.top().map(e),right:t.right().map(e),bottom:t.bottom().map(e)})},Za=Mn([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),nc=function(n,t,e,o,r,i){var u,a,c,s,f,l,d,m,g,p=t.x-e,h=t.y-o,v=r-(p+t.width),b=i-(h+t.height),x=y.some(p),w=y.some(h),S=y.some(v),k=y.some(b),C=y.none();return u=t.direction,a=function(){return $a(n,x,w,C,C)},c=function(){return $a(n,C,w,S,C)},s=function(){return $a(n,x,C,C,k)},f=function(){return $a(n,C,C,S,k)},l=function(){return $a(n,x,w,C,C)},d=function(){return $a(n,x,C,C,k)},m=function(){return $a(n,x,w,C,C)},g=function(){return $a(n,C,w,S,C)},u.fold(a,c,s,f,l,d,m,g)},tc=function(n,t){var e=u(wu,t),o=n.fold(e,e,function(){var n=pu();return wu(t).translate(-n.left(),-n.top())}),r=lu(t),i=ou(t);return Su(o.left(),o.top(),r,i)},ec=function(n,t){return t.fold(function(){return n.fold(Ou,Ou,Su)},function(t){return n.fold(t,t,function(){var e=t(),o=oc(n,e.x,e.y);return Su(o.left(),o.top(),e.width,e.height)})})},oc=function(n,t,e){var o=iu(t,e);return n.fold(r(o),r(o),function(){var n=pu();return o.translate(-n.left(),-n.top())})},rc=(Za.none,Za.relative),ic=Za.fixed,uc=function(n,t){return function(n,t){return{anchorBox:r(n),origin:r(t)}}(n,t)},ac=function(n,t,e,o){var r=n+t;return r>o?e:r<e?o:r},cc=function(n,t,e){return Math.min(Math.max(n,t),e)},sc=Mn([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),fc=function(n,t,e,o){var u,a,c,s,f=n.x(),l=n.y(),d=n.bubble().offset(),m=d.left(),g=d.top(),p=function(n,t,e){var o=function(n,o){var r="top"===n||"bottom"===n?e.top():e.left();return Bn(t,n).bind(i).bind(function(t){return"left"===n||"top"===n?t>=o?y.some(t):y.none():t<=o?y.some(t):y.none()}).map(function(n){return n+r}).getOr(o)},r=o("left",n.x),u=o("top",n.y),a=o("right",n.right),c=o("bottom",n.bottom);return Su(r,u,a-r,c-u)}(o,n.boundsRestriction(),d),h=p.y,v=p.bottom,b=p.x,x=p.right,w=l+g,S=function(n,t,e,o,r){var i=r.x,u=r.y,a=r.width,c=r.height,s=n>=i,f=t>=u,l=s&&f,d=n+e<=i+a&&t+o<=u+c,m=Math.abs(Math.min(e,s?i+a-n:i-(n+e))),g=Math.abs(Math.min(o,f?u+c-t:u-(t+o))),p=Math.max(r.x,r.right-e),h=Math.max(r.y,r.bottom-o);return{originInBounds:l,sizeInBounds:d,limitX:cc(n,r.x,p),limitY:cc(t,r.y,h),deltaW:m,deltaH:g}}(f+m,w,t,e,p),k=S.originInBounds,C=S.sizeInBounds,O=S.limitX,_=S.limitY,T=S.deltaW,E=S.deltaH,B=r(_+E-h),D=r(v-_),A=(u=n.direction(),a=D,c=D,s=B,u.fold(a,a,s,s,a,s,c,c)),M=r(O+T-b),F=r(x-O),I={x:O,y:_,width:T,height:E,maxHeight:A,maxWidth:function(n,t,e,o){return n.fold(t,o,t,o,e,e,t,o)}(n.direction(),F,F,M),direction:n.direction(),classes:{on:n.bubble().classesOn(),off:n.bubble().classesOff()},label:n.label(),candidateYforTest:w};return k&&C?sc.fit(I):sc.nofit(I,T,E)},lc=function(n,t,e,o){Hi(t,"max-height"),Hi(t,"max-width");var r,a={width:lu(r=t),height:ou(r)};return function(n,t,e,o,r){var a=e.width,c=e.height,s=function(n,i,u,s){var f=n(t,e,o);return fc(f,a,c,r).fold(sc.fit,function(n,t,e){return e>s||t>u?sc.nofit(n,t,e):sc.nofit(i,u,s)})};return G(n,function(n,t){var e=u(s,t);return n.fold(sc.fit,e)},sc.nofit({x:t.x,y:t.y,width:e.width,height:e.height,maxHeight:e.height,maxWidth:e.width,direction:ia(),classes:{on:[],off:[]},label:"none",candidateYforTest:t.y},-1,-1)).fold(i,i)}(o.preference,n,a,e,o.bounds)},dc=function(n,t,e){Qa(n,function(n,t){return n.fold(function(){return $a("absolute",y.some(t.x),y.some(t.y),y.none(),y.none())},function(n,e,o,r){return nc("absolute",t,n,e,o,r)},function(n,e,o,r){return nc("fixed",t,n,e,o,r)})}(e.origin,t))},mc=function(n,t){!function(n,t){var e=tu.max(n,t,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Di(n,"max-height",e+"px")}(n,Math.floor(t))},gc=r(function(n,t){mc(n,t),Ai(n,{"overflow-x":"hidden","overflow-y":"auto"})}),pc=r(function(n,t){mc(n,t)}),hc=function(n,t,e){return void 0===n[t]?e:n[t]},vc=function(n,t,e,o){var r=lc(n,t,e,o);dc(t,r,o),function(n,t){var e=t.classes;vi(n,e.off),hi(n,e.on)}(t,r),function(n,t,e){(0,e.maxHeightFunction)(n,t.maxHeight)}(t,r,o),function(n,t,e){(0,e.maxWidthFunction)(n,t.maxWidth)}(t,r,o)},bc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],yc=function(n,t,e){var o=function(n){return Bn(e,n).getOr([])},r=function(n,t,e){var r=Q(bc,e);return{offset:function(){return iu(n,t)},classesOn:function(){return K(e,o)},classesOff:function(){return K(r,o)}}};return{southeast:function(){return r(-n,t,["top","alignLeft"])},southwest:function(){return r(n,t,["top","alignRight"])},south:function(){return r(-n/2,t,["top","alignCentre"])},northeast:function(){return r(-n,-t,["bottom","alignLeft"])},northwest:function(){return r(n,-t,["bottom","alignRight"])},north:function(){return r(-n/2,-t,["bottom","alignCentre"])},east:function(){return r(n,-t/2,["valignCentre","left"])},west:function(){return r(-n,-t/2,["valignCentre","right"])},innerNorthwest:function(){return r(-n,t,["top","alignRight"])},innerNortheast:function(){return r(n,t,["top","alignLeft"])},innerNorth:function(){return r(-n/2,t,["top","alignCentre"])},innerSouthwest:function(){return r(-n,-t,["bottom","alignRight"])},innerSoutheast:function(){return r(n,-t,["bottom","alignLeft"])},innerSouth:function(){return r(-n/2,-t,["bottom","alignCentre"])},innerWest:function(){return r(n,-t/2,["valignCentre","right"])},innerEast:function(){return r(-n,-t/2,["valignCentre","left"])}}},xc=function(){return yc(0,0,{})},wc=function(n){return n},Sc=function(n,t){return function(e){return"rtl"===kc(e)?t:n}},kc=function(n){return"rtl"===Fi(n,"direction")?"rtl":"ltr"};!function(n){n.TopToBottom="toptobottom",n.BottomToTop="bottomtotop"}(Pu||(Pu={}));var Cc="data-alloy-vertical-dir",Oc=function(n){return Du(n,function(n){return Zo(n)&&kr(n,Cc)===Pu.BottomToTop})},_c=function(){return Kt("layouts",[Vt("onLtr"),Vt("onRtl"),Wt("onBottomLtr"),Wt("onBottomRtl")])},Tc=function(n,t,e,o,r,i,u){var a=u.map(Oc).getOr(!1),c=t.layouts.map(function(t){return t.onLtr(n)}),s=t.layouts.map(function(t){return t.onRtl(n)}),f=a?t.layouts.bind(function(t){return t.onBottomLtr.map(function(t){return t(n)})}).or(c).getOr(r):c.getOr(e),l=a?t.layouts.bind(function(t){return t.onBottomRtl.map(function(t){return t(n)})}).or(s).getOr(i):s.getOr(o);return Sc(f,l)(n)},Ec=[Vt("hotspot"),Wt("bubble"),Jt("overrides",{}),_c(),na("placement",function(n,t,e){var o=t.hotspot,r=tc(e,o.element()),i=Tc(n.element(),t,Aa(),Ma(),Da(),[ka,Sa,wa,xa,Ca,Oa],y.some(t.hotspot.element()));return y.some(wc({anchorBox:r,bubble:t.bubble.getOr(xc()),overrides:t.overrides,layouts:i,placer:y.none()}))})],Bc=[Vt("x"),Vt("y"),Jt("height",0),Jt("width",0),Jt("bubble",xc()),Jt("overrides",{}),_c(),na("placement",function(n,t,e){var o=oc(e,t.x,t.y),r=Su(o.left(),o.top(),t.width,t.height),i=Tc(n.element(),t,Ea(),Ba(),Ea(),Ba(),y.none());return y.some(wc({anchorBox:r,bubble:t.bubble,overrides:t.overrides,layouts:i,placer:y.none()}))})],Dc=function(n,t,e,o){return{start:r(n),soffset:r(t),finish:r(e),foffset:r(o)}},Ac=Mn([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Mc=(Ac.before,Ac.on,Ac.after,function(n){return n.fold(i,i,i)}),Fc=Mn([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ic={domRange:Fc.domRange,relative:Fc.relative,exact:Fc.exact,exactFromRange:function(n){return Fc.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){var t=function(n){return n.match({domRange:function(n){return ae.fromDom(n.startContainer)},relative:function(n,t){return Mc(n)},exact:function(n,t,e,o){return n}})}(n);return ur(t)},range:Dc},Rc=function(n,t,e){var o,r=n.document.createRange();return o=r,t.fold(function(n){o.setStartBefore(n.dom())},function(n,t){o.setStart(n.dom(),t)},function(n){o.setStartAfter(n.dom())}),function(n,t){t.fold(function(t){n.setEndBefore(t.dom())},function(t,e){n.setEnd(t.dom(),e)},function(t){n.setEndAfter(t.dom())})}(r,e),r},Vc=function(n,t,e,o,r){var i=n.document.createRange();return i.setStart(t.dom(),e),i.setEnd(o.dom(),r),i},Pc=function(n){return{left:r(n.left),top:r(n.top),right:r(n.right),bottom:r(n.bottom),width:r(n.width),height:r(n.height)}},Hc=Mn([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),zc=function(n,t,e){return t(ae.fromDom(e.startContainer),e.startOffset,ae.fromDom(e.endContainer),e.endOffset)},Nc=function(n,t){return function(n,t){var e=t.ltr();return e.collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Hc.rtl(ae.fromDom(n.endContainer),n.endOffset,ae.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return zc(0,Hc.ltr,e)}):zc(0,Hc.ltr,e)}(0,function(n,t){return t.match({domRange:function(n){return{ltr:r(n),rtl:y.none}},relative:function(t,e){return{ltr:Pn(function(){return Rc(n,t,e)}),rtl:Pn(function(){return y.some(Rc(n,e,t))})}},exact:function(t,e,o,r){return{ltr:Pn(function(){return Vc(n,t,e,o,r)}),rtl:Pn(function(){return y.some(Vc(n,o,r,t,e))})}}})}(n,t))};Hc.ltr,Hc.rtl;var Lc=function(n,t){var e=function(t){return n(t)?y.from(t.dom().nodeValue):y.none()};return{get:function(o){if(!n(o))throw new Error("Can only get "+t+" value of a "+t+" node");return e(o).getOr("")},getOption:e,set:function(e,o){if(!n(e))throw new Error("Can only set raw "+t+" value of a "+t+" node");e.dom().nodeValue=o}}}(nr,"text"),jc=function(n){return Lc.getOption(n)},Uc=["img","br"],Wc=function(n){return jc(n).filter(function(n){return 0!==n.trim().length||n.indexOf(" ")>-1}).isSome()||V(Uc,$o(n))},Gc=function(n,t){var e=function(n){for(var o=sr(n),r=o.length-1;r>=0;r--){var i=o[r];if(t(i))return y.some(i);var u=e(i);if(u.isSome())return u}return y.none()};return e(n)},Xc=function(t,e){return function(t,e){var o=void 0===e?n.document:e.dom();return De(o)?[]:N(o.querySelectorAll(t),ae.fromDom)}(e,t)},Yc=function(n,t,e,o){var r=function(n,t,e,o){var r=or(n).dom().createRange();return r.setStart(n.dom(),t),r.setEnd(e.dom(),o),r}(n,t,e,o),i=Ae(n,e)&&t===o;return r.collapsed&&!i},qc=function(n){var t=ae.fromDom(n.anchorNode),e=ae.fromDom(n.focusNode);return Yc(t,n.anchorOffset,e,n.focusOffset)?y.some(Dc(t,n.anchorOffset,e,n.focusOffset)):function(n){if(n.rangeCount>0){var t=n.getRangeAt(0),e=n.getRangeAt(n.rangeCount-1);return y.some(Dc(ae.fromDom(t.startContainer),t.startOffset,ae.fromDom(e.endContainer),e.endOffset))}return y.none()}(n)},Kc=function(n,t){return function(n){var t=n.getClientRects(),e=t.length>0?t[0]:n.getBoundingClientRect();return e.width>0||e.height>0?y.some(e).map(Pc):y.none()}(function(n,t){return Nc(n,t).match({ltr:function(t,e,o,r){var i=n.document.createRange();return i.setStart(t.dom(),e),i.setEnd(o.dom(),r),i},rtl:function(t,e,o,r){var i=n.document.createRange();return i.setStart(o.dom(),r),i.setEnd(t.dom(),e),i}})}(n,t))},Jc=function(n,t){return{element:n,offset:t}},$c=function(n,t){var e=sr(n);if(0===e.length)return Jc(n,t);if(t<e.length)return Jc(e[t],0);var o=e[e.length-1],r=nr(o)?function(n){return Lc.get(n)}(o).length:sr(o).length;return Jc(o,r)},Qc=Mn([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Zc=function(n){return n.fold(i,function(n,t,e){return n.translate(-t,-e)})},ns=function(n){return n.fold(i,i)},ts=function(n){return G(n,function(n,t){return n.translate(t.left(),t.top())},iu(0,0))},es=function(n){var t=N(n,ns);return ts(t)},os=Qc.screen,rs=Qc.absolute,is=function(n,t,e){var o=or(n.element()),r=pu(o),i=function(n,t,e){var o=ur(e.root).dom();return y.from(o.frameElement).map(ae.fromDom).filter(function(t){var e=or(t),o=or(n.element());return Ae(e,o)}).map(au)}(n,0,e).getOr(r);return rs(i,r.left(),r.top())},us=function(n,t,e,o){var r=n,i=t,u=e,a=o;n<0&&(r=0,u=e+n),t<0&&(i=0,a=o+t);var c=os(iu(r,i));return y.some(function(n,t,e){return{point:n,width:t,height:e}}(c,u,a))},as=function(n,t,e,o,r){return n.map(function(n){var i,u,a,c,s,f,l,d=[t,n.point],m=(i=function(){return es(d)},u=function(){return es(d)},a=function(){return function(n){var t=N(n,Zc);return ts(t)}(d)},o.fold(i,u,a)),g=(c=m.left(),s=m.top(),f=n.width,l=n.height,{x:c,y:s,width:f,height:l}),p=e.showAbove?Da():Aa(),h=(e.showAbove,Ma()),v=Tc(r,e,p,h,p,h,y.none());return wc({anchorBox:g,bubble:e.bubble.getOr(xc()),overrides:e.overrides,layouts:v,placer:y.none()})})},cs=function(n,t){return nr(n)?function(n,t){return{element:n,offset:t}}(n,t):$c(n,t)},ss=function(n,t){return t.getSelection.getOrThunk(function(){return function(){return function(n){return y.from(n.getSelection()).filter(function(n){return n.rangeCount>0}).bind(qc)}(n)}})().map(function(n){var t=cs(n.start(),n.soffset()),e=cs(n.finish(),n.foffset());return Ic.range(t.element,t.offset,e.element,e.offset)})},fs=[Wt("getSelection"),Vt("root"),Wt("bubble"),_c(),Jt("overrides",{}),Jt("showAbove",!1),na("placement",function(n,t,e){var o=ur(t.root).dom(),r=is(n,0,t),i=ss(o,t).bind(function(n){return Kc(o,Ic.exactFromRange(n)).orThunk(function(){var t=ae.fromText("\ufeff");return lr(n.start(),t),Kc(o,Ic.exact(t,0,t,1)).map(function(n){return vr(t),n})}).bind(function(n){return us(n.left(),n.top(),n.width(),n.height())})}),u=ss(o,t).bind(function(n){return Zo(n.start())?y.some(n.start()):ar(n.start())}).getOr(n.element());return as(i,r,t,e,u)})],ls=[Vt("node"),Vt("root"),Wt("bubble"),_c(),Jt("overrides",{}),Jt("showAbove",!1),na("placement",function(n,t,e){var o=is(n,0,t);return t.node.bind(function(r){var i=r.dom().getBoundingClientRect(),u=us(i.left,i.top,i.width,i.height),a=t.node.getOr(n.element());return as(u,o,t,e,a)})})],ds=function(n){return n.x+n.width},ms=function(n,t){return n.x-t.width},gs=function(n,t){return n.y-t.height+n.height},ps=function(n){return n.y},hs=function(n,t,e){return oa(ds(n),ps(n),e.southeast(),ia(),ma(n,{left:0,top:2}),"link-layout-se")},vs=function(n,t,e){return oa(ms(n,t),ps(n),e.southwest(),ua(),ma(n,{right:1,top:2}),"link-layout-sw")},bs=function(n,t,e){return oa(ds(n),gs(n,t),e.northeast(),aa(),ma(n,{left:0,bottom:3}),"link-layout-ne")},ys=function(n,t,e){return oa(ms(n,t),gs(n,t),e.northwest(),ca(),ma(n,{right:1,bottom:3}),"link-layout-nw")},xs=function(){return[hs,vs,bs,ys]},ws=function(){return[vs,hs,ys,bs]},Ss=[Vt("item"),_c(),Jt("overrides",{}),na("placement",function(n,t,e){var o=tc(e,t.item.element()),r=Tc(n.element(),t,xs(),ws(),xs(),ws(),y.none());return y.some(wc({anchorBox:o,bubble:xc(),overrides:t.overrides,layouts:r,placer:y.none()}))})],ks=_t("anchor",{selection:fs,node:ls,hotspot:Ec,submenu:Ss,makeshift:Bc}),Cs=function(n,e,o,r,i){!function(n,e,o,r,i,u){var a=hc(u,"maxHeightFunction",gc()),c=hc(u,"maxWidthFunction",t),s=n.anchorBox(),f=n.origin(),l={bounds:ec(f,i),origin:f,preference:r,maxHeightFunction:a,maxWidthFunction:c};vc(s,e,o,l)}(uc(o.anchorBox,e),i.element(),o.bubble,o.layouts,r,o.overrides)},Os=function(n,t,e,o,r,i){var u=i.map(ku);return _s(n,t,e,o,r,u)},_s=function(t,e,o,i,u,a){var c=kt("positioning anchor.info",ks,i);Ja(function(){Di(u.element(),"position","fixed");var o=Ri(u.element(),"visibility");Di(u.element(),"visibility","hidden");var i,s=e.useFixed()?(i=n.document.documentElement,ic(0,0,i.clientWidth,i.clientHeight)):function(n){var t=au(n.element()),e=n.element().dom().getBoundingClientRect();return rc(t.left(),t.top(),e.width,e.height)}(t),f=c.placement,l=a.map(r).or(e.getBounds);f(t,c,s).each(function(n){n.placer.getOr(Cs)(t,s,n,l,u)}),o.fold(function(){Hi(u.element(),"visibility")},function(n){Di(u.element(),"visibility",n)}),Ri(u.element(),"left").isNone()&&Ri(u.element(),"top").isNone()&&Ri(u.element(),"right").isNone()&&Ri(u.element(),"bottom").isNone()&&Ri(u.element(),"position").is("fixed")&&Hi(u.element(),"position")},u.element())},Ts=Object.freeze({__proto__:null,position:function(n,t,e,o,r){Os(n,t,e,o,r,y.none())},positionWithin:Os,positionWithinBounds:_s,getMode:function(n,t,e){return t.useFixed()?"fixed":"absolute"}}),Es=[Jt("useFixed",s),Wt("getBounds")],Bs=za({fields:Es,name:"positioning",active:Xa,apis:Ts}),Ds=function(n){Ao(n,So());var t=n.components();L(t,Ds)},As=function(n){var t=n.components();L(t,As),Ao(n,wo())},Ms=function(n,t){gr(n.element(),t.element())},Fs=function(n,t){var e=n.components();!function(n){L(n.components(),function(n){return vr(n.element())}),hr(n.element()),n.syncComponents()}(n);var o=Q(e,t);L(o,function(t){Ds(t),n.getSystem().removeFromWorld(t)}),L(t,function(t){t.getSystem().isConnected()?Ms(n,t):(n.getSystem().addToWorld(t),Ms(n,t),Oi(n.element())&&As(t)),n.syncComponents()})},Is=function(n,t){Rs(n,t,gr)},Rs=function(n,t,e){n.getSystem().addToWorld(t),e(n.element(),t.element()),Oi(n.element())&&As(t),n.syncComponents()},Vs=function(n){Ds(n),vr(n.element()),n.getSystem().removeFromWorld(n)},Ps=function(n){var t=ar(n.element()).bind(function(t){return n.getSystem().getByDom(t).toOption()});Vs(n),t.each(function(n){n.syncComponents()})},Hs=function(n){var t=n.components();L(t,Vs),hr(n.element()),n.syncComponents()},zs=function(n,t){Ns(n,t,gr)},Ns=function(n,t,e){e(n,t.element());var o=sr(t.element());L(o,function(n){t.getByDom(n).each(As)})},Ls=function(n){var t=sr(n.element());L(t,function(t){n.getByDom(t).each(Ds)}),vr(n.element())},js=function(n,t,e,o){e.get().each(function(t){Hs(n)});var r=t.getAttachPoint(n);Is(r,n);var i=n.getSystem().build(o);return Is(n,i),e.set(i),i},Us=function(n,t,e,o){var r=js(n,t,e,o);return t.onOpen(n,r),r},Ws=function(n,t,e){e.get().each(function(o){Hs(n),Ps(n),t.onClose(n,o),e.clear()})},Gs=function(n,t,e){return e.isOpen()},Xs=function(n,t,e){var o=t.getAttachPoint(n);Di(n.element(),"position",Bs.getMode(o)),function(n,t,e,o){Ri(n.element(),t).fold(function(){_r(n.element(),e)},function(t){Sr(n.element(),e,t)}),Di(n.element(),t,o)}(n,"visibility",t.cloakVisibilityAttr,"hidden")},Ys=function(n,t,e){var o;o=n.element(),P(["top","left","right","bottom"],function(n){return Ri(o,n).isSome()})||Hi(n.element(),"position"),function(n,t,e){Cr(n.element(),e).fold(function(){return Hi(n.element(),t)},function(e){return Di(n.element(),t,e)})}(n,"visibility",t.cloakVisibilityAttr)},qs=Object.freeze({__proto__:null,cloak:Xs,decloak:Ys,open:Us,openWhileCloaked:function(n,t,e,o,r){Xs(n,t),Us(n,t,e,o),r(),Ys(n,t)},close:Ws,isOpen:Gs,isPartOf:function(n,t,e,o){return Gs(0,0,e)&&e.get().exists(function(e){return t.isPartOf(n,e,o)})},getState:function(n,t,e){return e.get()},setContent:function(n,t,e,o){return e.get().map(function(){return js(n,t,e,o)})}}),Ks=Object.freeze({__proto__:null,events:function(n,t){return Po([No(go(),function(e,o){Ws(e,n,t)})])}}),Js=[Ju("onOpen"),Ju("onClose"),Vt("isPartOf"),Vt("getAttachPoint"),Jt("cloakVisibilityAttr","data-precloak-visibility")],$s=za({fields:Js,name:"sandboxing",active:Ks,apis:qs,state:Object.freeze({__proto__:null,init:function(){var n=ie(y.none()),t=r("not-implemented");return $r({readState:t,isOpen:function(){return n.get().isSome()},clear:function(){n.set(y.none())},set:function(t){n.set(y.some(t))},get:function(){return n.get()}})}})}),Qs=r("dismiss.popups"),Zs=r("reposition.popups"),nf=r("mouse.released"),tf=ut([Jt("isExtraPart",r(!1)),Kt("fireEventInstead",[Jt("event",ko())])]),ef=function(n){var t,e=kt("Dismissal",tf,n);return(t={})[Qs()]={schema:ut([Vt("target")]),onReceive:function(n,t){$s.isOpen(n)&&($s.isPartOf(n,t.target)||e.isExtraPart(n,t.target)||e.fireEventInstead.fold(function(){return $s.close(n)},function(t){return Ao(n,t.event)}))}},t},of=ut([Kt("fireEventInstead",[Jt("event",Co())]),Nt("doReposition")]),rf=function(n){var t,e=kt("Reposition",of,n);return(t={})[Zs()]={onReceive:function(n){$s.isOpen(n)&&e.fireEventInstead.fold(function(){return e.doReposition(n)},function(t){return Ao(n,t.event)})}},t},uf=function(n,t,e){t.store.manager.onLoad(n,t,e)},af=function(n,t,e){t.store.manager.onUnload(n,t,e)},cf=Object.freeze({__proto__:null,onLoad:uf,onUnload:af,setValue:function(n,t,e,o){t.store.manager.setValue(n,t,e,o)},getValue:function(n,t,e){return t.store.manager.getValue(n,t,e)},getState:function(n,t,e){return e}}),sf=Object.freeze({__proto__:null,events:function(n,t){var e=n.resetOnDom?[Yo(function(e,o){uf(e,n,t)}),qo(function(e,o){af(e,n,t)})]:[Fa(n,t,uf)];return Po(e)}}),ff=function(){var n=ie(null);return $r({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})},lf=function(){var n=ie({}),t=ie({});return $r({readState:function(){return{mode:"dataset",dataByValue:n.get(),dataByText:t.get()}},lookup:function(e){return Bn(n.get(),e).orThunk(function(){return Bn(t.get(),e)})},update:function(e){var o=n.get(),r=t.get(),i={},u={};L(e,function(n){i[n.value]=n,Bn(n,"meta").each(function(t){Bn(t,"text").each(function(t){u[t]=n})})}),n.set(d(d({},o),i)),t.set(d(d({},r),u))},clear:function(){n.set({}),t.set({})}})},df=Object.freeze({__proto__:null,memory:ff,dataset:lf,manual:function(){return $r({readState:function(){}})},init:function(n){return n.store.manager.state(n)}}),mf=function(n,t,e,o){var r=t.store;e.update([o]),r.setValue(n,o),t.onSetValue(n,o)},gf=[Wt("initialValue"),Vt("getFallbackEntry"),Vt("getDataKey"),Vt("setValue"),na("manager",{setValue:mf,getValue:function(n,t,e){var o=t.store,r=o.getDataKey(n);return e.lookup(r).fold(function(){return o.getFallbackEntry(r)},function(n){return n})},onLoad:function(n,t,e){t.store.initialValue.each(function(o){mf(n,t,e,o)})},onUnload:function(n,t,e){e.clear()},state:lf})],pf=[Vt("getValue"),Jt("setValue",t),Wt("initialValue"),na("manager",{setValue:function(n,t,e,o){t.store.setValue(n,o),t.onSetValue(n,o)},getValue:function(n,t,e){return t.store.getValue(n)},onLoad:function(n,t,e){t.store.initialValue.each(function(e){t.store.setValue(n,e)})},onUnload:t,state:Jr.init})],hf=[Wt("initialValue"),na("manager",{setValue:function(n,t,e,o){e.set(o),t.onSetValue(n,o)},getValue:function(n,t,e){return e.get()},onLoad:function(n,t,e){t.store.initialValue.each(function(n){e.isNotSet()&&e.set(n)})},onUnload:function(n,t,e){e.clear()},state:ff})],vf=[$t("store",{mode:"memory"},_t("mode",{memory:hf,manual:pf,dataset:gf})),Ju("onSetValue"),Jt("resetOnDom",!1)],bf=za({fields:vf,name:"representing",active:sf,apis:cf,extra:{setValueFrom:function(n,t){var e=bf.getValue(t);bf.setValue(n,e)}},state:df}),yf=function(n,t){return oe(n,{},N(t,function(t){return e=t.name(),o="Cannot configure "+t.name()+" for "+n,mt(e,e,Ln(),rt(function(n){return pn("The field: "+e+" is forbidden. "+o)}));var e,o}).concat([re("dump",i)]))},xf=function(n){return n.dump},wf=function(n,t){return d(d({},n.dump),Pa(t))},Sf=yf,kf=wf,Cf=Mn([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Of=function(n){return Dn(n,"uiType")},_f=function(n,t,e,o){return Of(e)&&"placeholder"===e.uiType?function(n,t,e,o){return n.exists(function(n){return n!==e.owner})?Cf.single(!0,r(e)):Bn(o,e.name).fold(function(){throw new Error("Unknown placeholder component: "+e.name+"\nKnown: ["+xn(o)+"]\nNamespace: "+n.getOr("none")+"\nSpec: "+JSON.stringify(e,null,2))},function(n){return n.replace()})}(n,0,e,o):Cf.single(!1,r(e))},Tf=function(n,t,e,o){return _f(n,0,e,o).fold(function(r,i){var u=Of(e)?i(t,e.config,e.validated):i(t),a=Bn(u,"components").getOr([]),c=K(a,function(e){return Tf(n,t,e,o)});return[d(d({},u),{components:c})]},function(n,o){if(Of(e)){var r=o(t,e.config,e.validated);return e.validated.preprocess.getOr(i)(r)}return o(t)})},Ef=function(n,t,e,o){var i=kn(o,function(n,t){return o=n,i=!1,{name:r(e=t),required:function(){return o.fold(function(n,t){return n},function(n,t){return n})},used:function(){return i},replace:function(){if(i)throw new Error("Trying to use the same placeholder more than once: "+e);return i=!0,o}};var e,o,i}),u=function(n,t,e,o){return K(e,function(e){return Tf(n,t,e,o)})}(n,t,e,i);return Sn(i,function(e){if(!1===e.used()&&e.required())throw new Error("Placeholder: "+e.name()+" was not found in components list\nNamespace: "+n.getOr("none")+"\nComponents: "+JSON.stringify(t.components,null,2))}),u},Bf=Cf.single,Df=Cf.multiple,Af=r("placeholder"),Mf=Mn([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Ff=Jt("factory",{sketch:i}),If=Jt("schema",[]),Rf=Vt("name"),Vf=mt("pname","pname",jn(function(n){return"<alloy."+Fr(n.name)+">"}),Tt()),Pf=re("schema",function(){return[Wt("preprocess")]}),Hf=Jt("defaults",r({})),zf=Jt("overrides",r({})),Nf=at([Ff,If,Rf,Vf,Hf,zf]),Lf=at([Ff,If,Rf,Hf,zf]),jf=at([Ff,If,Rf,Vf,Hf,zf]),Uf=at([Ff,Pf,Rf,Vt("unit"),Vf,Hf,zf]),Wf=function(n){return n.fold(y.some,y.none,y.some,y.some)},Gf=function(n){var t=function(n){return n.name};return n.fold(t,t,t,t)},Xf=function(n,t){return function(e){var o=kt("Converting part type",t,e);return n(o)}},Yf=Xf(Mf.required,Nf),qf=Xf(Mf.external,Lf),Kf=Xf(Mf.optional,jf),Jf=Xf(Mf.group,Uf),$f=r("entirety"),Qf=Object.freeze({__proto__:null,required:Yf,external:qf,optional:Kf,group:Jf,asNamedPart:Wf,name:Gf,asCommon:function(n){return n.fold(i,i,i,i)},original:$f}),Zf=function(n,t,e,o){return Rn(t.defaults(n,e,o),e,{uid:n.partUids[t.name]},t.overrides(n,e,o))},nl=function(n,t){var e={};return L(t,function(t){Wf(t).each(function(t){var o=tl(n,t.pname);e[t.name]=function(e){var r=kt("Part: "+t.name+" in "+n,at(t.schema),e);return d(d({},o),{config:e,validated:r})}})}),e},tl=function(n,t){return{uiType:Af(),owner:n,name:t}},el=function(n,t,e){return{uiType:Af(),owner:n,name:t,config:e,validated:{}}},ol=function(n){return K(n,function(n){return n.fold(y.none,y.some,y.none,y.none).map(function(n){return Lt(n.name,n.schema.concat([ta($f())]))}).toArray()})},rl=function(n){return N(n,Gf)},il=function(n,t,e){return function(n,t,e){var o={},i={};return L(e,function(n){n.fold(function(n){o[n.pname]=Bf(!0,function(t,e,o){return n.factory.sketch(Zf(t,n,e,o))})},function(n){var e=t.parts[n.name];i[n.name]=r(n.factory.sketch(Zf(t,n,e[$f()]),e))},function(n){o[n.pname]=Bf(!1,function(t,e,o){return n.factory.sketch(Zf(t,n,e,o))})},function(n){o[n.pname]=Df(!0,function(t,e,o){var r=t[n.name];return N(r,function(e){return n.factory.sketch(Rn(n.defaults(t,e,o),e,n.overrides(t,e)))})})})}),{internals:r(o),externals:r(i)}}(0,t,e)},ul=function(n,t,e){return Ef(y.some(n),t,t.components,e)},al=function(n,t,e){var o=t.partUids[e];return n.getSystem().getByUid(o).toOption()},cl=function(n,t,e){return al(n,t,e).getOrDie("Could not find part: "+e)},sl=function(n,t,e){var o={},i=t.partUids,u=n.getSystem();return L(e,function(n){o[n]=r(u.getByUid(i[n]))}),o},fl=function(n,t){var e=n.getSystem();return kn(t.partUids,function(n,t){return r(e.getByUid(n))})},ll=function(n){return xn(n.partUids)},dl=function(n,t,e){var o={},i=t.partUids,u=n.getSystem();return L(e,function(n){o[n]=r(u.getByUid(i[n]).getOrDie())}),o},ml=function(n,t){var e=rl(t);return Yn(N(e,function(t){return{key:t,value:n+"-"+t}}))},gl=function(n){return mt("partUids","partUids",Un(function(t){return ml(t.uid,n)}),Tt())},pl=Object.freeze({__proto__:null,generate:nl,generateOne:el,schemas:ol,names:rl,substitutes:il,components:ul,defaultUids:ml,defaultUidsSchema:gl,getAllParts:fl,getAllPartNames:ll,getPart:al,getPartOrDie:cl,getParts:sl,getPartsOrDie:dl}),hl=function(n,t,e,o,r){var i=function(n,t){return(n.length>0?[Lt("parts",n)]:[]).concat([Vt("uid"),Jt("dom",{}),Jt("components",[]),ta("originalSpec"),Jt("debug.sketcher",{})]).concat(t)}(o,r);return kt(n+" [SpecSchema]",ut(i.concat(t)),e)},vl=function(n,t,e,o,r){var i=bl(r),u=ol(e),a=gl(e),c=hl(n,t,i,u,[a]),s=il(0,c,e);return o(c,ul(n,c,s.internals()),i,s.externals())},bl=function(n){return function(n){return Dn(n,"uid")}(n)?n:d(d({},n),{uid:Lr("uid")})};var yl,xl=ut([Vt("name"),Vt("factory"),Vt("configFields"),Jt("apis",{}),Jt("extraApis",{})]),wl=ut([Vt("name"),Vt("factory"),Vt("configFields"),Vt("partFields"),Jt("apis",{}),Jt("extraApis",{})]),Sl=function(n){var t=kt("Sketcher for "+n.name,xl,n),e=kn(t.apis,Kr),o=kn(t.extraApis,function(n,t){return Xr(n,t)});return d(d({name:r(t.name),configFields:r(t.configFields),sketch:function(n){return function(n,t,e,o){var r=bl(o);return e(hl(n,t,r,[],[]),r)}(t.name,t.configFields,t.factory,n)}},e),o)},kl=function(n){var t=kt("Sketcher for "+n.name,wl,n),e=nl(t.name,t.partFields),o=kn(t.apis,Kr),i=kn(t.extraApis,function(n,t){return Xr(n,t)});return d(d({name:r(t.name),partFields:r(t.partFields),configFields:r(t.configFields),sketch:function(n){return vl(t.name,t.configFields,t.partFields,t.factory,n)},parts:r(e)},o),i)},Cl=function(n){for(var t=[],e=function(n){t.push(n)},o=0;o<n.length;o++)n[o].each(e);return t},Ol=function(n){return"input"===$o(n)&&"radio"!==kr(n,"type")||"textarea"===$o(n)},_l=Object.freeze({__proto__:null,getCurrent:function(n,t,e){return t.find(n)}}),Tl=[Vt("find")],El=za({fields:Tl,name:"composing",apis:_l}),Bl=function(n,t,e,o){var r=Xc(n.element(),"."+t.highlightClass);L(r,function(e){P(o,function(n){return n.element()===e})||(gi(e,t.highlightClass),n.getSystem().getByDom(e).each(function(e){t.onDehighlight(n,e),Ao(e,Do())}))})},Dl=function(n,t,e,o){Bl(n,t,0,[o]),Al(n,t,e,o)||(di(o.element(),t.highlightClass),t.onHighlight(n,o),Ao(o,Bo()))},Al=function(n,t,e,o){return pi(o.element(),t.highlightClass)},Ml=function(n,t,e,o){var r=Xc(n.element(),"."+t.itemClass);return y.from(r[o]).fold(function(){return an.error("No element found with index "+o)},n.getSystem().getByDom)},Fl=function(n,t,e){return Mu(n.element(),"."+t.itemClass).bind(function(t){return n.getSystem().getByDom(t).toOption()})},Il=function(n,t,e){var o=Xc(n.element(),"."+t.itemClass);return(o.length>0?y.some(o[o.length-1]):y.none()).bind(function(t){return n.getSystem().getByDom(t).toOption()})},Rl=function(n,t,e,o){var r=Xc(n.element(),"."+t.itemClass);return Y(r,function(n){return pi(n,t.highlightClass)}).bind(function(t){var e=ac(t,o,0,r.length-1);return n.getSystem().getByDom(r[e]).toOption()})},Vl=function(n,t,e){var o=Xc(n.element(),"."+t.itemClass);return Cl(N(o,function(t){return n.getSystem().getByDom(t).toOption()}))},Pl=Object.freeze({__proto__:null,dehighlightAll:function(n,t,e){return Bl(n,t,0,[])},dehighlight:function(n,t,e,o){Al(n,t,e,o)&&(gi(o.element(),t.highlightClass),t.onDehighlight(n,o),Ao(o,Do()))},highlight:Dl,highlightFirst:function(n,t,e){Fl(n,t).each(function(o){Dl(n,t,e,o)})},highlightLast:function(n,t,e){Il(n,t).each(function(o){Dl(n,t,e,o)})},highlightAt:function(n,t,e,o){Ml(n,t,e,o).fold(function(n){throw new Error(n)},function(o){Dl(n,t,e,o)})},highlightBy:function(n,t,e,o){var r=Vl(n,t);X(r,o).each(function(o){Dl(n,t,e,o)})},isHighlighted:Al,getHighlighted:function(n,t,e){return Mu(n.element(),"."+t.highlightClass).bind(function(t){return n.getSystem().getByDom(t).toOption()})},getFirst:Fl,getLast:Il,getPrevious:function(n,t,e){return Rl(n,t,0,-1)},getNext:function(n,t,e){return Rl(n,t,0,1)},getCandidates:Vl}),Hl=[Vt("highlightClass"),Vt("itemClass"),Ju("onHighlight"),Ju("onDehighlight")],zl=za({fields:Hl,name:"highlighting",apis:Pl}),Nl=function(n,t,e){var o=$(n.slice(0,t)),r=$(n.slice(t+1));return X(o.concat(r),e)},Ll=function(n,t,e){var o=$(n.slice(0,t));return X(o,e)},jl=function(n,t,e){var o=n.slice(0,t),r=n.slice(t+1);return X(r.concat(o),e)},Ul=function(n,t,e){var o=n.slice(t+1);return X(o,e)},Wl=function(n){return function(t){var e=t.raw();return V(n,e.which)}},Gl=function(n){return function(t){return J(n,function(n){return n(t)})}},Xl=function(n){return!0===n.raw().shiftKey},Yl=function(n){return!0===n.raw().ctrlKey},ql=a(Xl),Kl=function(n,t){return{matches:n,classification:t}},Jl=function(n,t,e){t.exists(function(n){return e.exists(function(t){return Ae(t,n)})})||Mo(n,Oo(),{prevFocus:t,newFocus:e})},$l=function(){var n=function(n){return Ka(n.element())};return{get:n,set:function(t,e){var o=n(t);t.getSystem().triggerFocus(e,t.element());var r=n(t);Jl(t,o,r)}}},Ql=function(){var n=function(n){return zl.getHighlighted(n).map(function(n){return n.element()})};return{get:n,set:function(e,o){var r=n(e);e.getSystem().getByDom(o).fold(t,function(n){zl.highlight(e,n)});var i=n(e);Jl(e,r,i)}}};!function(n){n.OnFocusMode="onFocus",n.OnEnterOrSpaceMode="onEnterOrSpace",n.OnApiMode="onApi"}(yl||(yl={}));var Zl,nd=function(n,t,e,o,r){var i=function(n,t,e,o,r){var i,u,a=e(n,t,o,r);return(i=a,u=t.event(),X(i,function(n){return n.matches(u)}).map(function(n){return n.classification})).bind(function(e){return e(n,t,o,r)})},u={schema:function(){return n.concat([Jt("focusManager",$l()),$t("focusInside","onFocus",yt(function(n){return V(["onFocus","onEnterOrSpace","onApi"],n)?an.value(n):an.error("Invalid value for focusInside")})),na("handler",u),na("state",t),na("sendFocusIn",r)])},processKey:i,toEvents:function(n,t){var u=n.focusInside!==yl.OnFocusMode?y.none():r(n).map(function(e){return No(io(),function(o,r){e(o,n,t),r.stop()})}),a=[No($e(),function(o,u){i(o,u,e,n,t).fold(function(){!function(e,o){var i=Wl([32].concat([13]))(o.event());n.focusInside===yl.OnEnterOrSpaceMode&&i&&Pe(e,o)&&r(n).each(function(r){r(e,n,t),o.stop()})}(o,u)},function(n){u.stop()})}),No(Qe(),function(e,r){i(e,r,o,n,t).each(function(n){r.stop()})})];return Po(u.toArray().concat(a))}};return u},td=function(n){var t=[Wt("onEscape"),Wt("onEnter"),Jt("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Jt("firstTabstop",0),Jt("useTabstopAt",r(!0)),Wt("visibilitySelector")].concat([n]),e=function(n,t){var e=n.visibilitySelector.bind(function(n){return Fu(t,n)}).getOr(t);return eu(e)>0},o=function(n,t,o){(function(n,t){var o=Xc(n.element(),t.selector),r=U(o,function(n){return e(t,n)});return y.from(r[t.firstTabstop])})(n,t).each(function(e){t.focusManager.set(n,e)})},i=function(n,t,o,r,i){return i(t,o,function(n){return function(n,t){return e(n,t)&&n.useTabstopAt(t)}(r,n)}).fold(function(){return r.cyclic?y.some(!0):y.none()},function(t){return r.focusManager.set(n,t),y.some(!0)})},a=function(n,t,e,o){var r=Xc(n.element(),e.selector);return function(n,t){return t.focusManager.get(n).bind(function(n){return Fu(n,t.selector)})}(n,e).bind(function(t){return Y(r,u(Ae,t)).bind(function(t){return i(n,r,t,e,o)})})},c=r([Kl(Gl([Xl,Wl([9])]),function(n,t,e){var o=e.cyclic?Nl:Ll;return a(n,0,e,o)}),Kl(Wl([9]),function(n,t,e){var o=e.cyclic?jl:Ul;return a(n,0,e,o)}),Kl(Wl([27]),function(n,t,e){return e.onEscape.bind(function(e){return e(n,t)})}),Kl(Gl([ql,Wl([13])]),function(n,t,e){return e.onEnter.bind(function(e){return e(n,t)})})]),s=r([]);return nd(t,Jr.init,c,s,function(){return y.some(o)})},ed=td(re("cyclic",r(!1))),od=td(re("cyclic",r(!0))),rd=function(n,t,e){return Ol(e)&&Wl([32])(t.event())?y.none():function(n,t,e){return Io(n,e,so()),y.some(!0)}(n,0,e)},id=function(n,t){return y.some(!0)},ud=[Jt("execute",rd),Jt("useSpace",!1),Jt("useEnter",!0),Jt("useControlEnter",!1),Jt("useDown",!1)],ad=function(n,t,e){return e.execute(n,t,n.element())},cd=nd(ud,Jr.init,function(n,t,e,o){var r=e.useSpace&&!Ol(n.element())?[32]:[],i=e.useEnter?[13]:[],u=e.useDown?[40]:[],a=r.concat(i).concat(u);return[Kl(Wl(a),ad)].concat(e.useControlEnter?[Kl(Gl([Yl,Wl([13])]),ad)]:[])},function(n,t,e,o){return e.useSpace&&!Ol(n.element())?[Kl(Wl([32]),id)]:[]},function(){return y.none()}),sd=function(){var n=ie(y.none());return $r({readState:function(){return n.get().map(function(n){return{numRows:String(n.numRows),numColumns:String(n.numColumns)}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(t,e){n.set(y.some({numRows:t,numColumns:e}))},getNumRows:function(){return n.get().map(function(n){return n.numRows})},getNumColumns:function(){return n.get().map(function(n){return n.numColumns})}})},fd=Object.freeze({__proto__:null,flatgrid:sd,init:function(n){return n.state(n)}}),ld=function(n){return function(t,e,o,r){var i=n(t.element());return pd(i,t,e,o,r)}},dd=function(n,t){var e=Sc(n,t);return ld(e)},md=function(n,t){var e=Sc(t,n);return ld(e)},gd=function(n){return function(t,e,o,r){return pd(n,t,e,o,r)}},pd=function(n,t,e,o,r){return o.focusManager.get(t).bind(function(e){return n(t.element(),e,o,r)}).map(function(n){return o.focusManager.set(t,n),!0})},hd=gd,vd=gd,bd=gd,yd=function(n){return!((t=n.dom()).offsetWidth<=0&&t.offsetHeight<=0);var t},xd=function(n,t,e){var o=Xc(n,e);return function(n,t){return Y(n,t).map(function(t){return{index:r(t),candidates:r(n)}})}(U(o,yd),function(n){return Ae(n,t)})},wd=function(n,t){return Y(n,function(n){return Ae(t,n)})},Sd=function(n,t,e,o){return o(Math.floor(t/e),t%e).bind(function(t){var o=t.row()*e+t.column();return o>=0&&o<n.length?y.some(n[o]):y.none()})},kd=function(n,t,e,o,i){return Sd(n,t,o,function(t,u){var a=t===e-1?n.length-t*o:o,c=ac(u,i,0,a-1);return y.some({row:r(t),column:r(c)})})},Cd=function(n,t,e,o,i){return Sd(n,t,o,function(t,u){var a=ac(t,i,0,e-1),c=a===e-1?n.length-a*o:o,s=cc(u,0,c-1);return y.some({row:r(a),column:r(s)})})},Od=[Vt("selector"),Jt("execute",rd),$u("onEscape"),Jt("captureTab",!1),ea()],_d=function(n,t,e){Mu(n.element(),t.selector).each(function(e){t.focusManager.set(n,e)})},Td=function(n){return function(t,e,o,r){return xd(t,e,o.selector).bind(function(t){return n(t.candidates(),t.index(),r.getNumRows().getOr(o.initSize.numRows),r.getNumColumns().getOr(o.initSize.numColumns))})}},Ed=function(n,t,e){return e.captureTab?y.some(!0):y.none()},Bd=Td(function(n,t,e,o){return kd(n,t,e,o,-1)}),Dd=Td(function(n,t,e,o){return kd(n,t,e,o,1)}),Ad=Td(function(n,t,e,o){return Cd(n,t,e,o,-1)}),Md=Td(function(n,t,e,o){return Cd(n,t,e,o,1)}),Fd=r([Kl(Wl([37]),dd(Bd,Dd)),Kl(Wl([39]),md(Bd,Dd)),Kl(Wl([38]),hd(Ad)),Kl(Wl([40]),vd(Md)),Kl(Gl([Xl,Wl([9])]),Ed),Kl(Gl([ql,Wl([9])]),Ed),Kl(Wl([27]),function(n,t,e){return e.onEscape(n,t)}),Kl(Wl([32].concat([13])),function(n,t,e,o){return function(n,t){return t.focusManager.get(n).bind(function(n){return Fu(n,t.selector)})}(n,e).bind(function(o){return e.execute(n,t,o)})})]),Id=r([Kl(Wl([32]),id)]),Rd=nd(Od,sd,Fd,Id,function(){return y.some(_d)}),Vd=function(n,t,e,o){var r=function(n,t,e){var i,u=ac(t,o,0,e.length-1);return u===n?y.none():(i=e[u],"button"===$o(i)&&"disabled"===kr(i,"disabled")?r(n,u,e):y.from(e[u]))};return xd(n,e,t).bind(function(n){var t=n.index(),e=n.candidates();return r(t,t,e)})},Pd=[Vt("selector"),Jt("getInitial",y.none),Jt("execute",rd),$u("onEscape"),Jt("executeOnMove",!1),Jt("allowVertical",!0)],Hd=function(n,t,e){return function(n,t){return t.focusManager.get(n).bind(function(n){return Fu(n,t.selector)})}(n,e).bind(function(o){return e.execute(n,t,o)})},zd=function(n,t,e){t.getInitial(n).orThunk(function(){return Mu(n.element(),t.selector)}).each(function(e){t.focusManager.set(n,e)})},Nd=function(n,t,e){return Vd(n,e.selector,t,-1)},Ld=function(n,t,e){return Vd(n,e.selector,t,1)},jd=function(n){return function(t,e,o,r){return n(t,e,o,r).bind(function(){return o.executeOnMove?Hd(t,e,o):y.some(!0)})}},Ud=function(n,t,e){return e.onEscape(n,t)},Wd=r([Kl(Wl([32]),id)]),Gd=nd(Pd,Jr.init,function(n,t,e,o){var r=[37].concat(e.allowVertical?[38]:[]),i=[39].concat(e.allowVertical?[40]:[]);return[Kl(Wl(r),jd(dd(Nd,Ld))),Kl(Wl(i),jd(md(Nd,Ld))),Kl(Wl([13]),Hd),Kl(Wl([32]),Hd),Kl(Wl([27]),Ud)]},Wd,function(){return y.some(zd)}),Xd=function(n,t,e){return y.from(n[t]).bind(function(n){return y.from(n[e]).map(function(n){return{rowIndex:t,columnIndex:e,cell:n}})})},Yd=function(n,t,e,o){var r=n[t].length,i=ac(e,o,0,r-1);return Xd(n,t,i)},qd=function(n,t,e,o){var r=ac(e,o,0,n.length-1),i=n[r].length,u=cc(t,0,i-1);return Xd(n,r,u)},Kd=function(n,t,e,o){var r=n[t].length,i=cc(e+o,0,r-1);return Xd(n,t,i)},Jd=function(n,t,e,o){var r=cc(e+o,0,n.length-1),i=n[r].length,u=cc(t,0,i-1);return Xd(n,r,u)},$d=[Lt("selectors",[Vt("row"),Vt("cell")]),Jt("cycles",!0),Jt("previousSelector",y.none),Jt("execute",rd)],Qd=function(n,t,e){t.previousSelector(n).orThunk(function(){var e=t.selectors;return Mu(n.element(),e.cell)}).each(function(e){t.focusManager.set(n,e)})},Zd=function(n,t){return function(e,o,r){var i=r.cycles?n:t;return Fu(o,r.selectors.row).bind(function(n){var t=Xc(n,r.selectors.cell);return wd(t,o).bind(function(t){var o=Xc(e,r.selectors.row);return wd(o,n).bind(function(n){var e=function(n,t){return N(n,function(n){return Xc(n,t.selectors.cell)})}(o,r);return i(e,n,t).map(function(n){return n.cell})})})})}},nm=Zd(function(n,t,e){return Yd(n,t,e,-1)},function(n,t,e){return Kd(n,t,e,-1)}),tm=Zd(function(n,t,e){return Yd(n,t,e,1)},function(n,t,e){return Kd(n,t,e,1)}),em=Zd(function(n,t,e){return qd(n,e,t,-1)},function(n,t,e){return Jd(n,e,t,-1)}),om=Zd(function(n,t,e){return qd(n,e,t,1)},function(n,t,e){return Jd(n,e,t,1)}),rm=r([Kl(Wl([37]),dd(nm,tm)),Kl(Wl([39]),md(nm,tm)),Kl(Wl([38]),hd(em)),Kl(Wl([40]),vd(om)),Kl(Wl([32].concat([13])),function(n,t,e){return Ka(n.element()).bind(function(o){return e.execute(n,t,o)})})]),im=r([Kl(Wl([32]),id)]),um=nd($d,Jr.init,rm,im,function(){return y.some(Qd)}),am=[Vt("selector"),Jt("execute",rd),Jt("moveOnTab",!1)],cm=function(n,t,e){return e.focusManager.get(n).bind(function(o){return e.execute(n,t,o)})},sm=function(n,t,e){Mu(n.element(),t.selector).each(function(e){t.focusManager.set(n,e)})},fm=function(n,t,e){return Vd(n,e.selector,t,-1)},lm=function(n,t,e){return Vd(n,e.selector,t,1)},dm=r([Kl(Wl([38]),bd(fm)),Kl(Wl([40]),bd(lm)),Kl(Gl([Xl,Wl([9])]),function(n,t,e,o){return e.moveOnTab?bd(fm)(n,t,e,o):y.none()}),Kl(Gl([ql,Wl([9])]),function(n,t,e,o){return e.moveOnTab?bd(lm)(n,t,e,o):y.none()}),Kl(Wl([13]),cm),Kl(Wl([32]),cm)]),mm=r([Kl(Wl([32]),id)]),gm=nd(am,Jr.init,dm,mm,function(){return y.some(sm)}),pm=[$u("onSpace"),$u("onEnter"),$u("onShiftEnter"),$u("onLeft"),$u("onRight"),$u("onTab"),$u("onShiftTab"),$u("onUp"),$u("onDown"),$u("onEscape"),Jt("stopSpaceKeyup",!1),Wt("focusIn")],hm=nd(pm,Jr.init,function(n,t,e){return[Kl(Wl([32]),e.onSpace),Kl(Gl([ql,Wl([13])]),e.onEnter),Kl(Gl([Xl,Wl([13])]),e.onShiftEnter),Kl(Gl([Xl,Wl([9])]),e.onShiftTab),Kl(Gl([ql,Wl([9])]),e.onTab),Kl(Wl([38]),e.onUp),Kl(Wl([40]),e.onDown),Kl(Wl([37]),e.onLeft),Kl(Wl([39]),e.onRight),Kl(Wl([32]),e.onSpace),Kl(Wl([27]),e.onEscape)]},function(n,t,e){return e.stopSpaceKeyup?[Kl(Wl([32]),id)]:[]},function(n){return n.focusIn}),vm=ed.schema(),bm=od.schema(),ym=Gd.schema(),xm=Rd.schema(),wm=um.schema(),Sm=cd.schema(),km=gm.schema(),Cm=hm.schema(),Om=La({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:vm,cyclic:bm,flow:ym,flatgrid:xm,matrix:wm,execution:Sm,menu:km,special:Cm}),name:"keying",active:{events:function(n,t){return n.handler.toEvents(n,t)}},apis:{focusIn:function(n,t,e){t.sendFocusIn(t).fold(function(){n.getSystem().triggerFocus(n.element(),n.element())},function(o){o(n,t,e)})},setGridSize:function(t,e,o,r,i){!function(n){return An(n,"setGridSize")}(o)?n.console.error("Layout does not support setGridSize"):o.setGridSize(r,i)}},state:fd}),_m=function(n,t,e,o){var r=n.getSystem().build(o);Rs(n,r,e)},Tm=function(n,t,e,o){var r=Em(n);X(r,function(n){return Ae(o.element(),n.element())}).each(Ps)},Em=function(n,t){return n.components()},Bm=function(n,t,e,o,r){var i=Em(n);return y.from(i[o]).map(function(t){return Tm(n,0,0,t),r.each(function(t){_m(n,0,function(n,t){var e,r;r=t,fr(e=n,o).fold(function(){gr(e,r)},function(n){lr(n,r)})},t)}),t})},Dm=za({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(n,t,e,o){_m(n,0,gr,o)},prepend:function(n,t,e,o){_m(n,0,mr,o)},remove:Tm,replaceAt:Bm,replaceBy:function(n,t,e,o,r){var i=Em(n);return Y(i,o).bind(function(t){return Bm(n,0,0,t,r)})},set:function(n,t,e,o){Ja(function(){var t=N(o,n.getSystem().build);Fs(n,t)},n.element())},contents:Em})}),Am=function(n,t){return{key:n,value:{config:{},me:function(n,t){var e=Po(t);return za({fields:[Vt("enabled")],name:n,active:{events:r(e)}})}(n,t),configAsRaw:r({}),initialConfig:{},state:Jr}}},Mm=function(n,t){t.ignore||(Ya(n.element()),t.onFocus(n))},Fm=Object.freeze({__proto__:null,focus:Mm,blur:function(n,t){t.ignore||n.element().dom().blur()},isFocused:function(n){return t=n.element(),e=Si(t).dom(),t.dom()===e.activeElement;var t,e}}),Im=Object.freeze({__proto__:null,exhibit:function(n,t){var e=t.ignore?{}:{attributes:{tabindex:"-1"}};return Zr(e)},events:function(n){return Po([No(io(),function(t,e){Mm(t,n),e.stop()})].concat(n.stopMousedown?[No(We(),function(n,t){t.event().prevent()})]:[]))}}),Rm=[Ju("onFocus"),Jt("stopMousedown",!1),Jt("ignore",!1)],Vm=za({fields:Rm,name:"focusing",active:Im,apis:Fm}),Pm=function(n,t,e){var o=t.aria;o.update(n,o,e.get())},Hm=function(n,t,e){t.toggleClass.each(function(t){e.get()?di(n.element(),t):gi(n.element(),t)})},zm=function(n,t,e){jm(n,t,e,!e.get())},Nm=function(n,t,e){e.set(!0),Hm(n,t,e),Pm(n,t,e)},Lm=function(n,t,e){e.set(!1),Hm(n,t,e),Pm(n,t,e)},jm=function(n,t,e,o){(o?Nm:Lm)(n,t,e)},Um=function(n,t,e){jm(n,t,e,t.selected)},Wm=Object.freeze({__proto__:null,onLoad:Um,toggle:zm,isOn:function(n,t,e){return e.get()},on:Nm,off:Lm,set:jm}),Gm=Object.freeze({__proto__:null,exhibit:function(){return Zr({})},events:function(n,t){var e,o,r,i=(e=n,o=t,r=zm,Jo(function(n){r(n,e,o)})),u=Fa(n,t,Um);return Po(q([n.toggleOnExecute?[i]:[],[u]]))}}),Xm=function(n,t,e){Sr(n.element(),"aria-expanded",e)},Ym=[Jt("selected",!1),Wt("toggleClass"),Jt("toggleOnExecute",!0),$t("aria",{mode:"none"},_t("mode",{pressed:[Jt("syncWithExpanded",!1),na("update",function(n,t,e){Sr(n.element(),"aria-pressed",e),t.syncWithExpanded&&Xm(n,t,e)})],checked:[na("update",function(n,t,e){Sr(n.element(),"aria-checked",e)})],expanded:[na("update",Xm)],selected:[na("update",function(n,t,e){Sr(n.element(),"aria-selected",e)})],none:[na("update",t)]}))],qm=za({fields:Ym,name:"toggling",active:Gm,apis:Wm,state:(Zl=!1,{init:function(){var n=ie(Zl);return{get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(Zl)},readState:function(){return n.get()}}}})}),Km=function(){var n=function(n,t){t.stop(),Fo(n)};return[No(to(),n),No(lo(),n),Go(Ne()),Go(We())]},Jm=function(n){return Po(q([n.map(function(n){return Jo(function(t,e){n(t),e.stop()})}).toArray(),Km()]))},$m=function(n){(Ka(n.element()).isNone()||Vm.isFocused(n))&&(Vm.isFocused(n)||Vm.focus(n),Mo(n,"alloy.item-hover",{item:n}))},Qm=function(n){Mo(n,"alloy.item-focus",{item:n})},Zm=r("alloy.item-hover"),ng=r("alloy.item-focus"),tg=[Vt("data"),Vt("components"),Vt("dom"),Jt("hasSubmenu",!1),Wt("toggling"),Sf("itemBehaviours",[qm,Vm,Om,bf]),Jt("ignoreFocus",!1),Jt("domModification",{}),na("builder",function(n){return{dom:n.dom,domModification:d(d({},n.domModification),{attributes:d(d(d({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes),{"aria-haspopup":n.hasSubmenu}),n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:kf(n.itemBehaviours,[n.toggling.fold(qm.revoke,function(n){return qm.config(d({aria:{mode:"checked"}},n))}),Vm.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){Qm(n)}}),Om.config({mode:"execution"}),bf.config({store:{mode:"memory",initialValue:n.data}}),Am("item-type-events",g(Km(),[No(qe(),$m),No(fo(),Vm.focus)]))]),components:n.components,eventOrder:n.eventOrder}}),Jt("eventOrder",{})],eg=[Vt("dom"),Vt("components"),na("builder",function(n){return{dom:n.dom,components:n.components,events:Po([(t=fo(),No(t,function(n,t){t.stop()}))])};var t})],og=r([Yf({name:"widget",overrides:function(n){return{behaviours:Pa([bf.config({store:{mode:"manual",getValue:function(t){return n.data},setValue:function(){}}})])}}})]),rg=[Vt("uid"),Vt("data"),Vt("components"),Vt("dom"),Jt("autofocus",!1),Jt("ignoreFocus",!1),Sf("widgetBehaviours",[bf,Vm,Om]),Jt("domModification",{}),gl(og()),na("builder",function(n){var t=il(0,n,og()),e=ul("item-widget",n,t.internals()),o=function(t){return al(t,n,"widget").map(function(n){return Om.focusIn(n),n})},r=function(t,e){return Ol(e.event().target())?y.none():n.autofocus?(e.setSource(t.element()),y.none()):y.none()};return{dom:n.dom,components:e,domModification:n.domModification,events:Po([Jo(function(n,t){o(n).each(function(n){t.stop()})}),No(qe(),$m),No(fo(),function(t,e){n.autofocus?o(t):Vm.focus(t)})]),behaviours:kf(n.widgetBehaviours,[bf.config({store:{mode:"memory",initialValue:n.data}}),Vm.config({ignore:n.ignoreFocus,onFocus:function(n){Qm(n)}}),Om.config({mode:"special",focusIn:n.autofocus?function(n){o(n)}:ja(),onLeft:r,onRight:r,onEscape:function(t,e){return Vm.isFocused(t)||n.autofocus?n.autofocus?(e.setSource(t.element()),y.none()):y.none():(Vm.focus(t),y.some(!0))}})])}})],ig=_t("type",{widget:rg,item:tg,separator:eg}),ug=r([Jf({factory:{sketch:function(n){var t=kt("menu.spec item",ig,n);return t.builder(t)}},name:"items",unit:"item",defaults:function(n,t){return t.hasOwnProperty("uid")?t:d(d({},t),{uid:Lr("item")})},overrides:function(n,t){return{type:t.type,ignoreFocus:n.fakeFocus,domModification:{classes:[n.markers.item]}}}})]),ag=r([Vt("value"),Vt("items"),Vt("dom"),Vt("components"),Jt("eventOrder",{}),yf("menuBehaviours",[zl,bf,El,Om]),$t("movement",{mode:"menu",moveOnTab:!0},_t("mode",{grid:[ea(),na("config",function(n,t){return{mode:"flatgrid",selector:"."+n.markers.item,initSize:{numColumns:t.initSize.numColumns,numRows:t.initSize.numRows},focusManager:n.focusManager}})],matrix:[na("config",function(n,t){return{mode:"matrix",selectors:{row:t.rowSelector,cell:"."+n.markers.item},focusManager:n.focusManager}}),Vt("rowSelector")],menu:[Jt("moveOnTab",!0),na("config",function(n,t){return{mode:"menu",selector:"."+n.markers.item,moveOnTab:t.moveOnTab,focusManager:n.focusManager}})]})),Pt("markers",Gu()),Jt("fakeFocus",!1),Jt("focusManager",$l()),Ju("onHighlight")]),cg=r("alloy.menu-focus"),sg=kl({name:"Menu",configFields:ag(),partFields:ug(),factory:function(n,t,e,o){return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:wf(n.menuBehaviours,[zl.config({highlightClass:n.markers.selectedItem,itemClass:n.markers.item,onHighlight:n.onHighlight}),bf.config({store:{mode:"memory",initialValue:n.value}}),El.config({find:y.some}),Om.config(n.movement.config(n,n.movement))]),events:Po([No(ng(),function(n,t){var e=t.event();n.getSystem().getByDom(e.target()).each(function(e){zl.highlight(n,e),t.stop(),Mo(n,cg(),{menu:n,item:e})})}),No(Zm(),function(n,t){var e=t.event().item();zl.highlight(n,e)})]),components:t,eventOrder:n.eventOrder,domModification:{attributes:{role:"menu"}}}}}),fg=function(n,t,e,o){return Bn(e,o).bind(function(o){return Bn(n,o).bind(function(o){var r=fg(n,t,e,o);return y.some([o].concat(r))})}).getOr([])},lg=function(n,t){var e={};Sn(n,function(n,t){L(n,function(n){e[n]=t})});var o=t,r=Cn(t,function(n,t){return{k:n,v:t}}),i=kn(r,function(n,t){return[t].concat(fg(e,o,r,t))});return kn(e,function(n){return Bn(i,n).getOr([n])})},dg=function(n){return"prepared"===n.type?y.some(n.menu):y.none()},mg={init:function(){var n=ie({}),t=ie({}),e=ie({}),o=ie(y.none()),r=ie({}),i=function(t,e,o){return u(t).bind(function(r){return function(t){return Tn(n.get(),function(n,e){return n===t})}(t).bind(function(n){return e(n).map(function(n){return{triggeredMenu:r,triggeringItem:n,triggeringPath:o}})})})},u=function(n){return a(n).bind(dg)},a=function(n){return Bn(t.get(),n)},c=function(t){return Bn(n.get(),t)};return{setMenuBuilt:function(n,e){var o;t.set(d(d({},t.get()),((o={})[n]={type:"prepared",menu:e},o)))},setContents:function(i,u,a,c){o.set(y.some(i)),n.set(a),t.set(u),r.set(c);var s=lg(c,a);e.set(s)},expand:function(t){return Bn(n.get(),t).map(function(n){var o=Bn(e.get(),t).getOr([]);return[n].concat(o)})},refresh:function(n){return Bn(e.get(),n)},collapse:function(n){return Bn(e.get(),n).bind(function(n){return n.length>1?y.some(n.slice(1)):y.none()})},lookupMenu:a,lookupItem:c,otherMenus:function(n){var t=r.get();return Q(xn(t),n)},getPrimary:function(){return o.get().bind(u)},getMenus:function(){return t.get()},clear:function(){n.set({}),t.set({}),e.set({}),o.set(y.none())},isClear:function(){return o.get().isNone()},getTriggeringPath:function(n,t){var r=U(c(n).toArray(),function(n){return u(n).isSome()});return Bn(e.get(),n).bind(function(n){var e=$(r.concat(n));return function(n){for(var t=[],e=0;e<n.length;e++){var o=n[e];if(!o.isSome())return y.none();t.push(o.getOrDie())}return y.some(t)}(K(e,function(n,r){return i(n,t,e.slice(0,r+1)).fold(function(){return o.get().is(n)?[]:[y.none()]},function(n){return[y.some(n)]})}))})}}},extractPreparedMenu:dg},gg=r("collapse-item"),pg=Sl({name:"TieredMenu",configFields:[Zu("onExecute"),Zu("onEscape"),Qu("onOpenMenu"),Qu("onOpenSubmenu"),Ju("onRepositionMenu"),Ju("onCollapseMenu"),Jt("highlightImmediately",!0),Lt("data",[Vt("primary"),Vt("menus"),Vt("expansions")]),Jt("fakeFocus",!1),Ju("onHighlight"),Ju("onHover"),Yu(),Vt("dom"),Jt("navigateOnHover",!0),Jt("stayInDom",!1),yf("tmenuBehaviours",[Om,zl,El,Dm]),Jt("eventOrder",{})],apis:{collapseMenu:function(n,t){n.collapseMenu(t)},highlightPrimary:function(n,t){n.highlightPrimary(t)},repositionMenus:function(n,t){n.repositionMenus(t)}},factory:function(n,t){var e,o=ie(y.none()),r=mg.init(),i=function(t){var e=function(t,e,o){return kn(o,function(o,r){var i=function(){return sg.sketch(d(d({},o),{value:r,markers:n.markers,fakeFocus:n.fakeFocus,onHighlight:n.onHighlight,focusManager:n.fakeFocus?Ql():$l()}))};return r===e?{type:"prepared",menu:t.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}})}(t,n.data.primary,n.data.menus),o=a();return r.setContents(n.data.primary,e,n.data.expansions,o),r.getPrimary()},u=function(n){return bf.getValue(n).value},a=function(t){return kn(n.data.menus,function(n,t){return K(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})},c=function(n,t){zl.highlight(n,t),zl.getHighlighted(t).orThunk(function(){return zl.getFirst(t)}).each(function(t){Io(n,t.element(),fo())})},s=function(n,t){return Cl(N(t,function(t){return n.lookupMenu(t).bind(function(n){return"prepared"===n.type?y.some(n.menu):y.none()})}))},f=function(t,e,o){var r=s(e,e.otherMenus(o));L(r,function(e){vi(e.element(),[n.markers.backgroundMenu]),n.stayInDom||Dm.remove(t,e)})},l=function(t,e){var r=function(t){return o.get().getOrThunk(function(){var e={},r=Xc(t.element(),"."+n.markers.item),i=U(r,function(n){return"true"===kr(n,"aria-haspopup")});return L(i,function(n){t.getSystem().getByDom(n).each(function(n){var t=u(n);e[t]=n})}),o.set(y.some(e)),e})}(t);Sn(r,function(n,t){var o=V(e,t);Sr(n.element(),"aria-expanded",o)})},m=function(t,e,o){return y.from(o[0]).bind(function(r){return e.lookupMenu(r).bind(function(r){if("notbuilt"===r.type)return y.none();var i=r.menu,u=s(e,o.slice(1));return L(u,function(t){di(t.element(),n.markers.backgroundMenu)}),Oi(i.element())||Dm.append(t,Zi(i)),vi(i.element(),[n.markers.backgroundMenu]),c(t,i),f(t,e,o),y.some(i)})})};!function(n){n[n.HighlightSubmenu=0]="HighlightSubmenu",n[n.HighlightParent=1]="HighlightParent"}(e||(e={}));var g=function(t,o,i){void 0===i&&(i=e.HighlightSubmenu);var a=u(o);return r.expand(a).bind(function(u){return l(t,u),y.from(u[0]).bind(function(a){return r.lookupMenu(a).bind(function(c){var s=function(n,t,e){if("notbuilt"===e.type){var o=n.getSystem().build(e.nbMenu());return r.setMenuBuilt(t,o),o}return e.menu}(t,a,c);return Oi(s.element())||Dm.append(t,Zi(s)),n.onOpenSubmenu(t,o,s,$(u)),i===e.HighlightSubmenu?(zl.highlightFirst(s),m(t,r,u)):(zl.dehighlightAll(s),y.some(o))})})})},p=function(t,e){var o=u(e);return r.collapse(o).bind(function(o){return l(t,o),m(t,r,o).map(function(o){return n.onCollapseMenu(t,e,o),o})})},h=function(t){return function(e,o){return Fu(o.getSource(),"."+n.markers.item).bind(function(n){return e.getSystem().getByDom(n).toOption().bind(function(n){return t(e,n).map(function(){return!0})})})}},v=Po([No(cg(),function(n,t){var e=t.event().item();r.lookupItem(u(e)).each(function(){var e=t.event().menu();zl.highlight(n,e);var o=u(t.event().item());r.refresh(o).each(function(t){return f(n,r,t)})})}),Jo(function(t,o){var r=o.event().target();t.getSystem().getByDom(r).each(function(o){0===u(o).indexOf("collapse-item")&&p(t,o),g(t,o,e.HighlightSubmenu).fold(function(){n.onExecute(t,o)},function(){})})}),Yo(function(t,e){i(t).each(function(e){Dm.append(t,Zi(e)),n.onOpenMenu(t,e),n.highlightImmediately&&c(t,e)})})].concat(n.navigateOnHover?[No(Zm(),function(t,o){var i=o.event().item();!function(n,t){var e=u(t);r.refresh(e).bind(function(t){return l(n,t),m(n,r,t)})}(t,i),g(t,i,e.HighlightParent),n.onHover(t,i)})]:[])),b=function(n){return zl.getHighlighted(n).bind(zl.getHighlighted)},x={collapseMenu:function(n){b(n).each(function(t){p(n,t)})},highlightPrimary:function(n){r.getPrimary().each(function(t){c(n,t)})},repositionMenus:function(t){r.getPrimary().bind(function(n){return b(t).bind(function(n){var t=u(n),e=En(r.getMenus()),o=Cl(N(e,mg.extractPreparedMenu));return r.getTriggeringPath(t,function(n){return t=n,on(o,function(n){if(!n.getSystem().isConnected())return y.none();var e=zl.getCandidates(n);return X(e,function(n){return u(n)===t})});var t})}).map(function(t){return{primary:n,triggeringPath:t}})}).fold(function(){(function(n){return y.from(n.components()[0]).filter(function(n){return"menu"===kr(n.element(),"role")})})(t).each(function(e){n.onRepositionMenu(t,e,[])})},function(e){var o=e.primary,r=e.triggeringPath;n.onRepositionMenu(t,o,r)})}};return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:wf(n.tmenuBehaviours,[Om.config({mode:"special",onRight:h(function(n,t){return Ol(t.element())?y.none():g(n,t,e.HighlightSubmenu)}),onLeft:h(function(n,t){return Ol(t.element())?y.none():p(n,t)}),onEscape:h(function(t,e){return p(t,e).orThunk(function(){return n.onEscape(t,e).map(function(){return t})})}),focusIn:function(n,t){r.getPrimary().each(function(t){Io(n,t.element(),fo())})}}),zl.config({highlightClass:n.markers.selectedMenu,itemClass:n.markers.menu}),El.config({find:function(n){return zl.getHighlighted(n)}}),Dm.config({})]),eventOrder:n.eventOrder,apis:x,events:v}},extraApis:{tieredData:function(n,t,e){return{primary:n,menus:t,expansions:e}},singleData:function(n,t){return{primary:n,menus:Xn(n,t),expansions:{}}},collapseItem:function(n){return{value:Fr(gg()),meta:{text:n}}}}}),hg=Sl({name:"InlineView",configFields:[Vt("lazySink"),Ju("onShow"),Ju("onHide"),qt("onEscape"),yf("inlineBehaviours",[$s,bf,Ga]),Kt("fireDismissalEventInstead",[Jt("event",ko())]),Kt("fireRepositionEventInstead",[Jt("event",Co())]),Jt("getRelated",y.none),Jt("isExtraPart",s),Jt("eventOrder",y.none)],factory:function(n,t){var e=function(n,t,e,r){o(n,t,e,function(){return r.map(function(n){return ku(n)})})},o=function(t,e,o,r){var i=n.lazySink(t).getOrDie();$s.openWhileCloaked(t,o,function(){return Bs.positionWithinBounds(i,e,t,r())}),bf.setValue(t,y.some({mode:"position",anchor:e,getBounds:r}))},r=function(t,e,o,r){var i=function(n,t,e,o,r){var i=function(){return n.lazySink(t)},u="horizontal"===o.type?{layouts:{onLtr:function(){return Aa()},onRtl:function(){return Ma()}}}:{},a=function(n){return function(n){return 2===n.length}(n)?u:{}};return pg.sketch({dom:{tag:"div"},data:o.data,markers:o.menu.markers,highlightImmediately:o.menu.highlightImmediately,onEscape:function(){return $s.close(t),n.onEscape.map(function(n){return n(t)}),y.some(!0)},onExecute:function(){return y.some(!0)},onOpenMenu:function(n,t){Bs.positionWithinBounds(i().getOrDie(),e,t,r())},onOpenSubmenu:function(n,t,e,o){var r=i().getOrDie();Bs.position(r,d({anchor:"submenu",item:t},a(o)),e)},onRepositionMenu:function(n,t,o){var u=i().getOrDie();Bs.positionWithinBounds(u,e,t,r()),L(o,function(n){var t=a(n.triggeringPath);Bs.position(u,d({anchor:"submenu",item:n.triggeringItem},t),n.triggeredMenu)})}})}(n,t,e,o,r);$s.open(t,i),bf.setValue(t,y.some({mode:"menu",menu:i}))},i=function(t){$s.isOpen(t)&&bf.getValue(t).each(function(e){switch(e.mode){case"menu":$s.getState(t).each(function(n){pg.repositionMenus(n)});break;case"position":var o=n.lazySink(t).getOrDie();Bs.positionWithinBounds(o,e.anchor,t,e.getBounds())}})},u={setContent:function(n,t){$s.setContent(n,t)},showAt:function(n,t,o){e(n,t,o,y.none())},showWithin:e,showWithinBounds:o,showMenuAt:function(n,t,e){r(n,t,e,function(){return y.none()})},showMenuWithinBounds:r,hide:function(n){$s.isOpen(n)&&(bf.setValue(n,y.none()),$s.close(n))},getContent:function(n){return $s.getState(n)},reposition:i,isOpen:$s.isOpen};return{uid:n.uid,dom:n.dom,behaviours:wf(n.inlineBehaviours,[$s.config({isPartOf:function(t,e,o){return Vu(e,o)||function(t,e){return n.getRelated(t).exists(function(n){return Vu(n,e)})}(t,o)},getAttachPoint:function(t){return n.lazySink(t).getOrDie()},onOpen:function(t){n.onShow(t)},onClose:function(t){n.onHide(t)}}),bf.config({store:{mode:"memory",initialValue:y.none()}}),Ga.config({channels:d(d({},ef(d({isExtraPart:t.isExtraPart},n.fireDismissalEventInstead.map(function(n){return{fireEventInstead:{event:n.event}}}).getOr({})))),rf(d(d({},n.fireRepositionEventInstead.map(function(n){return{fireEventInstead:{event:n.event}}}).getOr({})),{doReposition:i})))})]),eventOrder:n.eventOrder,apis:u}},apis:{showAt:function(n,t,e,o){n.showAt(t,e,o)},showWithin:function(n,t,e,o,r){n.showWithin(t,e,o,r)},showWithinBounds:function(n,t,e,o,r){n.showWithinBounds(t,e,o,r)},showMenuAt:function(n,t,e,o){n.showMenuAt(t,e,o)},showMenuWithinBounds:function(n,t,e,o,r){n.showMenuWithinBounds(t,e,o,r)},hide:function(n,t){n.hide(t)},isOpen:function(n,t){return n.isOpen(t)},getContent:function(n,t){return n.getContent(t)},setContent:function(n,t,e){n.setContent(t,e)},reposition:function(n,t){n.reposition(t)}}}),vg=function(n){return n.x},bg=function(n,t){return n.x+n.width/2-t.width/2},yg=function(n,t){return n.x+n.width-t.width},xg=function(n){return n.y},wg=function(n,t){return n.y+n.height-t.height},Sg=function(n,t,e){return oa(yg(n,t),wg(n,t),e.innerSoutheast(),ca(),ma(n,{right:0,bottom:3}),"layout-inner-se")},kg=function(n,t,e){return oa(vg(n),wg(n,t),e.innerSouthwest(),aa(),ma(n,{left:1,bottom:3}),"layout-inner-sw")},Cg=function(n,t,e){return oa(yg(n,t),xg(n),e.innerNortheast(),ua(),ma(n,{right:0,top:2}),"layout-inner-ne")},Og=function(n,t,e){return oa(vg(n),xg(n),e.innerNorthwest(),ia(),ma(n,{left:1,top:2}),"layout-inner-nw")},_g=function(n,t,e){return oa(bg(n,t),xg(n),e.innerNorth(),sa(),ma(n,{top:2}),"layout-inner-n")},Tg=function(n,t,e){return oa(bg(n,t),wg(n,t),e.innerSouth(),fa(),ma(n,{bottom:3}),"layout-inner-s")},Eg=tinymce.util.Tools.resolve("tinymce.util.Delay"),Bg=Sl({name:"Button",factory:function(n){var t=Jm(n.action),e=n.dom.tag,o=function(t){return Bn(n.dom,"attributes").bind(function(n){return Bn(n,t)})};return{uid:n.uid,dom:n.dom,components:n.components,events:t,behaviours:kf(n.buttonBehaviours,[Vm.config({}),Om.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===e){var n=o("type").getOr("button"),t=o("role").map(function(n){return{role:n}}).getOr({});return d({type:n},t)}return{role:o("role").getOr("button")}}()},eventOrder:n.eventOrder}},configFields:[Jt("uid",void 0),Vt("dom"),Jt("components",[]),Sf("buttonBehaviours",[Vm,Om]),Wt("action"),Wt("role"),Jt("eventOrder",{})]}),Dg=function(n){var t=function(n){return void 0!==n.uid}(n)&&An(n,"uid")?n.uid:Lr("memento");return{get:function(n){return n.getSystem().getByUid(t).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(t).toOption()},asSpec:function(){return d(d({},n),{uid:t})}}},Ag=function(n){return y.from(n()["temporary-placeholder"]).getOr("!not found!")},Mg=function(n,t){return y.from(t()[n.toLowerCase()]).getOrThunk(function(){return Ag(t)})},Fg={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Ig=Sl({name:"Notification",factory:function(n){var t,e,o=Dg({dom:{tag:"p",innerHtml:n.translationProvider(n.text)},behaviours:Pa([Dm.config({})])}),r=function(n){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+n+"%"}}}},i=function(n){return{dom:{tag:"div",classes:["tox-text"],innerHtml:n+"%"}}},u=Dg({dom:{tag:"div",classes:n.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[r(0)]},i(0)],behaviours:Pa([Dm.config({})])}),a={updateProgress:function(n,t){n.getSystem().isConnected()&&u.getOpt(n).each(function(n){Dm.set(n,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[r(t)]},i(t)])})},updateText:function(n,t){if(n.getSystem().isConnected()){var e=o.get(n);Dm.set(e,[Ki(t)])}}},c=q([n.icon.toArray(),n.level.toArray(),n.level.bind(function(n){return y.from(Fg[n])}).toArray()]),s=Dg(Bg.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:Mg("close",n.iconProvider),attributes:{"aria-label":n.translationProvider("Close")}}}],action:function(t){n.onAction(t)}})),f=[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:(t=c,e=n.iconProvider,on(t,function(n){return y.from(e()[n.toLowerCase()])}).getOrThunk(function(){return Ag(e)}))}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[o.asSpec()],behaviours:Pa([Dm.config({})])}];return{uid:n.uid,dom:{tag:"div",attributes:{role:"alert"},classes:n.level.map(function(n){return["tox-notification","tox-notification--in","tox-notification--"+n]}).getOr(["tox-notification","tox-notification--in"])},behaviours:Pa([Vm.config({}),Am("notification-events",[No(Ke(),function(n){s.getOpt(n).each(Vm.focus)})])]),components:f.concat(n.progress?[u.asSpec()]:[]).concat(n.closeButton?[s.asSpec()]:[]),apis:a}},configFields:[Wt("level"),Vt("progress"),Vt("icon"),Vt("onAction"),Vt("text"),Vt("iconProvider"),Vt("translationProvider"),te("closeButton",!0)],apis:{updateProgress:function(n,t,e){n.updateProgress(t,e)},updateText:function(n,t,e){n.updateText(t,e)}}});function Rg(n,t,e){var o=t.backstage;return{open:function(n,r){var i=!n.closeButton&&n.timeout&&(n.timeout>0||n.timeout<0),u=function(){r(),hg.hide(c)},a=Qi(Ig.sketch({text:n.text,level:V(["success","error","warning","warn","info"],n.type)?n.type:void 0,progress:!0===n.progressBar,icon:y.from(n.icon),closeButton:!i,onAction:u,iconProvider:o.shared.providers.icons,translationProvider:o.shared.providers.translate})),c=Qi(hg.sketch(d({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:t.backstage.shared.getSink,fireDismissalEventInstead:{}},o.shared.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return e.add(c),n.timeout>0&&Eg.setTimeout(function(){u()},n.timeout),{close:u,moveTo:function(n,t){hg.showAt(c,{anchor:"makeshift",x:n,y:t},Zi(a))},moveRel:function(n,e){if("banner"!==e){var o=function(n){switch(n){case"bc-bc":return Tg;case"tc-tc":return _g;case"tc-bc":return Ca;case"bc-tc":default:return Oa}}(e),r={anchor:"node",root:_i(),node:y.some(ae.fromDom(n)),layouts:{onRtl:function(){return[o]},onLtr:function(){return[o]}}};hg.showAt(c,r,Zi(a))}else hg.showAt(c,t.backstage.shared.anchors.banner(),Zi(a))},text:function(n){Ig.updateText(a,n)},settings:n,getEl:function(){return a.element().dom()},progressBar:{value:function(n){Ig.updateProgress(a,n)}}}},close:function(n){n.close()},reposition:function(n){!function(n){L(n,function(n){return n.moveTo(0,0)})}(n),function(n){n.length>0&&(nn(n).each(function(n){return n.moveRel(null,"banner")}),L(n,function(t,e){e>0&&t.moveRel(n[e-1].getEl(),"bc-tc")}))}(n)},getArgs:function(n){return n.settings}}}var Vg,Pg=function(t,e){var o=null;return{cancel:function(){null!==o&&(n.clearTimeout(o),o=null)},throttle:function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];null!==o&&n.clearTimeout(o),o=n.setTimeout(function(){t.apply(null,r),o=null},e)}}},Hg=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),zg=function(n,t,e,o,r){var i=Hg(n,function(t){return function(n,t){return n.isBlock(t)||V(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===n.getContentEditable(t)}(n,t)});return y.from(i.backwards(t,e,o,r))},Ng=function(n,t){return Lg(ae.fromDom(n.selection.getNode())).getOrThunk(function(){var e,o=ae.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',n.getDoc());return gr(o,ae.fromDom(t.extractContents())),t.insertNode(o.dom()),ar(o).each(function(n){return n.dom().normalize()}),(e=o,Gc(e,Wc)).map(function(t){var e;n.selection.setCursorLocation(t.dom(),"img"===$o(e=t)?1:jc(e).fold(function(){return sr(e).length},function(n){return n.length}))}),o})},Lg=function(n){return Fu(n,"[data-mce-autocompleter]")},jg=function(n){return n.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Ug=function(n){return""!==n&&-1!==" \f\n\r\t\v".indexOf(n)},Wg=function(n,t){return n.substring(t.length)},Gg=function(n,t,e,o){if(void 0===o&&(o=0),!(r=t).collapsed||3!==r.startContainer.nodeType)return y.none();var r,i=n.getParent(t.startContainer,n.isBlock)||n.getRoot();return zg(n,t.startContainer,t.startOffset,function(n,t,o){return function(n,t,e){var o;for(o=t-1;o>=0;o--){var r=n.charAt(o);if(Ug(r))return y.none();if(r===e)break}return y.some(o)}(o,t,e).getOr(t)},i).bind(function(n){var r=t.cloneRange();if(r.setStart(n.container,n.offset),r.setEnd(t.endContainer,t.endOffset),r.collapsed)return y.none();var i=jg(r);return 0!==i.lastIndexOf(e)||Wg(i,e).length<o?y.none():y.some({text:Wg(i,e),range:r,triggerChar:e})})},Xg=function(n,t,e,o){return void 0===o&&(o=0),Lg(ae.fromDom(t.startContainer)).fold(function(){return Gg(n,t,e,o)},function(t){var o=n.createRng();o.selectNode(t.dom());var r=jg(o);return y.some({range:o,text:Wg(r,e),triggerChar:e})})},Yg=function(n,t){t.on("keypress compositionend",n.onKeypress.throttle),t.on("remove",n.onKeypress.cancel);var e=function(n,t){Mo(n,$e(),{raw:t})};t.on("keydown",function(t){var o=function(){return n.getView().bind(zl.getHighlighted)};8===t.which&&n.onKeypress.throttle(t),n.isActive()&&(27===t.which&&n.cancelIfNecessary(),n.isMenuOpen()?13===t.which?(o().each(Fo),t.preventDefault()):40===t.which?(o().fold(function(){n.getView().each(zl.highlightFirst)},function(n){e(n,t)}),t.preventDefault(),t.stopImmediatePropagation()):37!==t.which&&38!==t.which&&39!==t.which||o().each(function(n){e(n,t),t.preventDefault(),t.stopImmediatePropagation()}):13!==t.which&&38!==t.which&&40!==t.which||n.cancelIfNecessary())}),t.on("NodeChange",function(t){n.isActive()&&!n.isProcessingAction()&&Lg(ae.fromDom(t.element)).isNone()&&n.cancelIfNecessary()})},qg=tinymce.util.Tools.resolve("tinymce.util.Promise"),Kg=function(n,t){return{container:n,offset:t}},Jg=function(t){if(function(t){return t.nodeType===n.Node.TEXT_NODE}(t))return Kg(t,t.data.length);var e=t.childNodes;return e.length>0?Jg(e[e.length-1]):Kg(t,e.length)},$g=function(t,e){var o=t.childNodes;return o.length>0&&e<o.length?$g(o[e],0):o.length>0&&function(t){return t.nodeType===n.Node.ELEMENT_NODE}(t)&&o.length===e?Jg(o[o.length-1]):Kg(t,e)},Qg=function(n){return function(t){var e=$g(t.startContainer,t.startOffset);return!function(n,t){return zg(n,t.container,t.offset,function(n,t){return 0===t?-1:t},n.getRoot()).filter(function(n){var t=n.container.data.charAt(n.offset-1);return!Ug(t)}).isSome()}(n,e)}},Zg=function(n,t){var e=t(),o=n.selection.getRng();return function(n,t,e){return on(e.triggerChars,function(e){return Xg(n,t,e)})}(n.dom,o,e).bind(function(e){return np(n,t,e)})},np=function(n,t,e,o){void 0===o&&(o={});var r=t(),i=n.selection.getRng().startContainer.nodeValue,u=U(r.lookupByChar(e.triggerChar),function(t){return e.text.length>=t.minChars&&t.matches.getOrThunk(function(){return Qg(n.dom)})(e.range,i,e.text)});if(0===u.length)return y.none();var a=qg.all(N(u,function(n){return n.fetch(e.text,n.maxResults,o).then(function(t){return{matchText:e.text,items:t,columns:n.columns,onAction:n.onAction}})}));return y.some({lookupData:a,context:e})},tp=at([Ht("type"),Yt("text")]),ep=at([re("type",function(){return"autocompleteitem"}),re("active",function(){return!1}),re("disabled",function(){return!1}),Jt("meta",{}),Ht("value"),Yt("text"),Yt("icon")]),op=at([Ht("type"),Ht("ch"),Qt("minChars",1),Jt("columns",1),Qt("maxResults",10),qt("matches"),Nt("fetch"),Nt("onAction")]),rp=function(n){var t,e,o=n.ui.registry.getAll().popups,r=kn(o,function(n){return(t=n,wt("Autocompleter",op,t)).fold(function(n){throw new Error(Ct(n))},function(n){return n});var t}),i=(t=_n(r,function(n){return n.ch}),e={},L(t,function(n){e[n]={}}),xn(e)),u=En(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return U(u,function(t){return t.ch===n})}}};!function(n){n[n.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",n[n.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Vg||(Vg={}));var ip,up=Vg,ap="tox-menu-nav__js",cp="tox-collection__item",sp={normal:ap,color:"tox-swatch"},fp="tox-collection__item-label",lp="tox-collection__item--active",dp=function(n){return Bn(sp,n).getOr(ap)},mp=function(n){return"color"===n?"tox-swatches":"tox-menu"},gp=function(n){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:mp(n),tieredMenu:"tox-tiered-menu"}},pp=function(n){var t=gp(n);return{backgroundMenu:t.backgroundMenu,selectedMenu:t.selectedMenu,menu:t.menu,selectedItem:t.selectedItem,item:dp(n)}},hp=function(n,t,e){var o=gp(e);return{tag:"div",classes:q([[o.menu,"tox-menu-"+t+"-column"],n?[o.hasIcons]:[]])}},vp=[sg.parts().items({})],bp=function(n,t,e){var o=gp(e);return{dom:{tag:"div",classes:q([[o.tieredMenu]])},markers:pp(e)}},yp=function(n,t){return function(e){var o=z(e,t);return N(o,function(t){return{dom:n,components:t}})}},xp=function(n,t){var e=[],o=[];return L(n,function(n,r){t(n,r)?(o.length>0&&e.push(o),o=[],Dn(n.dom,"innerHtml")&&o.push(n)):o.push(n)}),o.length>0&&e.push(o),N(e,function(n){return{dom:{tag:"div",classes:["tox-collection__group"]},components:n}})},wp=function(n,t,e){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===n?["tox-collection--list"]:["tox-collection--grid"])},components:[sg.parts().items({preprocess:function(e){return"auto"!==n&&n>1?yp({tag:"div",classes:["tox-collection__group"]},n)(e):xp(e,function(n,e){return"separator"===t[e].type})}})]}},Sp=function(n){return P(n,function(n){return"icon"in n&&void 0!==n.icon})},kp=function(t){return n.console.error(Ct(t)),n.console.log(t),y.none()},Cp=function(n,t,e,o,r){var i,u=(i=e,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[sg.parts().items({preprocess:function(n){return xp(n,function(n,t){return"separator"===i[t].type})}})]});return{value:n,dom:u.dom,components:u.components,items:e}},Op=function(n,t,e,o,r){var u;return"color"===r?{value:n,dom:(u=function(n){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[sg.parts().items({preprocess:"auto"!==n?yp({tag:"div",classes:["tox-swatches__row"]},n):i})]}]}}(o)).dom,components:u.components,items:e}:"normal"===r&&"auto"===o?{value:n,dom:(u=wp(o,e)).dom,components:u.components,items:e}:"normal"===r&&1===o?{value:n,dom:(u=wp(1,e)).dom,components:u.components,items:e}:"normal"===r?{value:n,dom:(u=wp(o,e)).dom,components:u.components,items:e}:"listpreview"===r&&"auto"!==o?{value:n,dom:(u=function(n){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[sg.parts().items({preprocess:yp({tag:"div",classes:["tox-collection__group"]},n)})]}}(o)).dom,components:u.components,items:e}:{value:n,dom:hp(t,o,r),components:vp,items:e}},_p=[te("disabled",!1),Yt("text"),Yt("shortcut"),mt("value","value",jn(function(){return Fr("menuitem-value")}),Tt()),Jt("meta",{})],Tp=at([Ht("type"),te("active",!1),Yt("icon")].concat(_p)),Ep=at([Ht("type"),zt("fancytype",["inserttable","colorswatch"]),ee("onAction",t)]),Bp=at([Ht("type"),ee("onSetup",function(){return t}),ee("onAction",t),Yt("icon")].concat(_p)),Dp=at([Ht("type"),Nt("getSubmenuItems"),ee("onSetup",function(){return t}),Yt("icon")].concat(_p)),Ap=at([Ht("type"),Yt("icon"),te("active",!1),ee("onSetup",function(){return t}),Nt("onAction")].concat(_p)),Mp=function(n,t,e){var o=Xc(n.element(),"."+e);if(o.length>0){var r=Y(o,function(n){var e=n.dom().getBoundingClientRect().top,r=o[0].dom().getBoundingClientRect().top;return Math.abs(e-r)>t}).getOr(o.length);return y.some({numColumns:r,numRows:Math.ceil(o.length/r)})}return y.none()},Fp=function(n,t){return Pa([Am(n,t)])},Ip=function(n){return Fp(Fr("unnamed-events"),n)},Rp=[Vt("lazySink"),Vt("tooltipDom"),Jt("exclusive",!0),Jt("tooltipComponents",[]),Jt("delay",300),ne("mode","normal",["normal","follow-highlight"]),Jt("anchor",function(n){return{anchor:"hotspot",hotspot:n,layouts:{onLtr:r([Oa,Ca,xa,Sa,wa,ka]),onRtl:r([Oa,Ca,xa,Sa,wa,ka])}}}),Ju("onHide"),Ju("onShow")],Vp=Object.freeze({__proto__:null,init:function(){var t=ie(y.none()),e=ie(y.none()),o=function(){t.get().each(function(t){n.clearTimeout(t)})},i=r("not-implemented");return $r({getTooltip:function(){return e.get()},isShowing:function(){return e.get().isSome()},setTooltip:function(n){e.set(y.some(n))},clearTooltip:function(){e.set(y.none())},clearTimer:o,resetTimer:function(e,r){o(),t.set(y.some(n.setTimeout(function(){e()},r)))},readState:i})}}),Pp=Fr("tooltip.exclusive"),Hp=Fr("tooltip.show"),zp=Fr("tooltip.hide"),Np=function(n,t,e){n.getSystem().broadcastOn([Pp],{})},Lp=Object.freeze({__proto__:null,hideAllExclusive:Np,setComponents:function(n,t,e,o){e.getTooltip().each(function(n){n.getSystem().isConnected()&&Dm.set(n,o)})}}),jp=za({fields:Rp,name:"tooltipping",active:Object.freeze({__proto__:null,events:function(n,t){var e=function(e){t.getTooltip().each(function(o){Ps(o),n.onHide(e,o),t.clearTooltip()}),t.clearTimer()};return Po(q([[No(Hp,function(e){t.resetTimer(function(){!function(e){if(!t.isShowing()){Np(e);var o=n.lazySink(e).getOrDie(),r=e.getSystem().build({dom:n.tooltipDom,components:n.tooltipComponents,events:Po("normal"===n.mode?[No(qe(),function(n){Ao(e,Hp)}),No(Xe(),function(n){Ao(e,zp)})]:[]),behaviours:Pa([Dm.config({})])});t.setTooltip(r),Is(o,r),n.onShow(e,r),Bs.position(o,n.anchor(e),r)}}(e)},n.delay)}),No(zp,function(o){t.resetTimer(function(){e(o)},n.delay)}),No(co(),function(n,t){V(t.channels(),Pp)&&e(n)}),qo(function(n){e(n)})],"normal"===n.mode?[No(Ke(),function(n){Ao(n,Hp)}),No(uo(),function(n){Ao(n,zp)}),No(qe(),function(n){Ao(n,Hp)}),No(Xe(),function(n){Ao(n,zp)})]:[No(Bo(),function(n,t){Ao(n,Hp)}),No(Do(),function(n){Ao(n,zp)})]]))}}),state:Vp,apis:Lp}),Up=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Wp=tinymce.util.Tools.resolve("tinymce.util.I18n"),Gp=["input","button","textarea","select"],Xp=function(n,t,e){(t.disabled()?Qp:Zp)(n,t,e)},Yp=function(n,t){return!0===t.useNative&&V(Gp,$o(n.element()))},qp=function(n){Sr(n.element(),"disabled","disabled")},Kp=function(n){_r(n.element(),"disabled")},Jp=function(n){Sr(n.element(),"aria-disabled","true")},$p=function(n){Sr(n.element(),"aria-disabled","false")},Qp=function(n,t,e){t.disableClass.each(function(t){di(n.element(),t)}),(Yp(n,t)?qp:Jp)(n),t.onDisabled(n)},Zp=function(n,t,e){t.disableClass.each(function(t){gi(n.element(),t)}),(Yp(n,t)?Kp:$p)(n),t.onEnabled(n)},nh=function(n,t){return Yp(n,t)?function(n){return Or(n.element(),"disabled")}(n):function(n){return"true"===kr(n.element(),"aria-disabled")}(n)},th=Object.freeze({__proto__:null,enable:Zp,disable:Qp,isDisabled:nh,onLoad:Xp,set:function(n,t,e,o){(o?Qp:Zp)(n,t,e)}}),eh=Object.freeze({__proto__:null,exhibit:function(n,t){return Zr({classes:t.disabled()?t.disableClass.toArray():[]})},events:function(n,t){return Po([Ho(so(),function(t,e){return nh(t,n)}),Fa(n,t,Xp)])}}),oh=[ee("disabled",s),Jt("useNative",!0),Wt("disableClass"),Ju("onDisabled"),Ju("onEnabled")],rh=za({fields:oh,name:"disabling",active:eh,apis:th}),ih=tinymce.util.Tools.resolve("tinymce.EditorManager"),uh=function(n){return n.getParam("height",Math.max(n.getElement().offsetHeight,200))},ah=function(n){return n.getParam("width",Up.DOM.getStyle(n.getElement(),"width"))},ch=function(n){return y.from(n.getParam("min_width")).filter(B)},sh=function(n){return y.from(n.getParam("min_height")).filter(B)},fh=function(n){return y.from(n.getParam("max_width")).filter(B)},lh=function(n){return y.from(n.getParam("max_height")).filter(B)},dh=function(n){return!1!==n.getParam("menubar",!0,"boolean")},mh=function(n){var t=n.getParam("toolbar",!0),e=!0===t,o=S(t),r=C(t)&&t.length>0;return!ph(n)&&(r||o||e)},gh=function(n){var t=H(9,function(t){return n.getParam("toolbar"+(t+1),!1,"string")}),e=U(t,function(n){return"string"==typeof n});return e.length>0?y.some(e):y.none()},ph=function(n){return gh(n).fold(function(){return n.getParam("toolbar",[],"string[]").length>0},function(){return!0})};!function(n){n.default="wrap",n.floating="floating",n.sliding="sliding",n.scrolling="scrolling"}(ip||(ip={}));var hh,vh=function(n){return n.getParam("toolbar_mode","","string")};!function(n){n.auto="auto",n.top="top",n.bottom="bottom"}(hh||(hh={}));var bh,yh=function(n){return n.getParam("toolbar_location",hh.auto,"string")},xh=function(n){return yh(n)===hh.bottom},wh=function(n){var t=function(n){return n.getParam("fixed_toolbar_container","","string")}(n);return t.length>0&&n.inline?Mu(_i(),t):y.none()},Sh=function(n){return n.inline&&wh(n).isSome()},kh=function(n){return n.inline&&!dh(n)&&!mh(n)&&!ph(n)},Ch=function(n){return(n.getParam("toolbar_sticky",!1,"boolean")||n.inline)&&!Sh(n)&&!kh(n)},Oh=function(n){var t=n.getParam("menu");return t?kn(t,function(n){return d(d({},n),{items:n.items})}):{}},_h=function(n){return n.getParam("menubar")},Th=function(n){return n.getParam("anchor_top","#top")},Eh=function(n){return n.getParam("anchor_bottom","#bottom")},Bh=at([(bh="readonly",Pt(bh,At))]),Dh=function(n,t){var e=n.outerContainer.element();t&&(n.mothership.broadcastOn([Qs()],{target:e}),n.uiMothership.broadcastOn([Qs()],{target:e})),n.mothership.broadcastOn(["silver.readonly"],{readonly:t}),n.uiMothership.broadcastOn(["silver.readonly"],{readonly:t})},Ah=function(n,t){n.on("init",function(){n.mode.isReadOnly()&&Dh(t,!0)}),n.on("SwitchMode",function(){return Dh(t,n.mode.isReadOnly())}),function(n){return n.getParam("readonly",!1,"boolean")}(n)&&n.setMode("readonly")},Mh=function(){var n;return Ga.config({channels:(n={},n["silver.readonly"]={schema:Bh,onReceive:function(n,t){rh.set(n,t.readonly)}},n)})},Fh=function(n){return rh.config({disabled:n,disableClass:"tox-collection__item--state-disabled"})},Ih=function(n){return rh.config({disabled:n})},Rh=function(n){return rh.config({disabled:n,disableClass:"tox-tbtn--disabled"})},Vh=function(n){return rh.config({disabled:n,disableClass:"tox-tbtn--disabled",useNative:!1})},Ph=function(n,t){var e=n.getApi(t);return function(n){n(e)}},Hh=function(n,t){return Yo(function(e){Ph(n,e)(function(e){var o=n.onSetup(e);null!=o&&t.set(o)})})},zh=function(n,t){return qo(function(e){return Ph(n,e)(t.get())})},Nh=function(n,t){return Jo(function(e,o){Ph(n,e)(n.onAction),n.triggersSubmenu||t!==up.CLOSE_ON_EXECUTE||(Ao(e,go()),o.stop())})},Lh={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},jh=function(n){return K(n,function(n){return n.toArray()})},Uh=function(n,e,o,r){var i=ie(t);return{type:"item",dom:e.dom,components:jh(e.optComponents),data:n.data,eventOrder:Lh,hasSubmenu:n.triggersSubmenu,itemBehaviours:Pa([Am("item-events",[Nh(n,o),Hh(n,i),zh(n,i)]),Fh(function(){return n.disabled||r.isReadOnly()}),Mh(),Dm.config({})].concat(n.itemBehaviours))}},Wh=function(n){return{value:n.value,meta:d({text:n.text.getOr("")},n.meta)}},Gh=tinymce.util.Tools.resolve("tinymce.Env"),Xh=function(n){var t=Gh.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},e=n.split("+"),o=N(e,function(n){var e=n.toLowerCase().trim();return Dn(t,e)?t[e]:n});return Gh.mac?o.join(""):o.join("+")},Yh=function(n){return{dom:{tag:"div",classes:["tox-collection__item-icon"],innerHtml:n}}},qh=function(n){return{dom:{tag:"div",classes:[fp]},components:[Ki(Wp.translate(n))]}},Kh=function(n,t){return{dom:{tag:"div",classes:[fp]},components:[{dom:{tag:n.tag,styles:n.styles},components:[Ki(Wp.translate(t))]}]}},Jh=function(n){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:Xh(n)}}},$h=function(n){return{dom:{tag:"div",classes:["tox-collection__item-checkmark"],innerHtml:Mg("checkmark",n)}}},Qh=function(n,t,e,o,r){var i=e?t.or(y.some("")).map(Yh):y.none(),u=n.checkMark,a=n.ariaLabel.map(function(n){return{attributes:{title:Wp.translate(n)}}}).getOr({});return{dom:d({tag:"div",classes:[ap,cp].concat(r?["tox-collection__item-icon-rtl"]:[])},a),optComponents:[i,n.htmlContent.fold(function(){return n.textContent.map(o)},function(n){return y.some(function(n){return{dom:{tag:"div",classes:[fp],innerHtml:n}}}(n))}),n.shortcutContent.map(Jh),u,n.caret]}},Zh=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],nv=["list-bull-circle","list-bull-default","list-bull-square"],tv=function(n,t,e,o){void 0===o&&(o=y.none());var r,i=Wp.isRtl()&&n.iconContent.exists(function(n){return V(nv,n)}),a=(r=n.iconContent,r.map(function(n){return Wp.isRtl()&&V(Zh,n)?n+"-rtl":n})).map(function(n){return e=n,r=t.icons,i=o,y.from(r()[e.toLowerCase()]).or(i).getOrThunk(function(){return Ag(r)});var e,r,i}),c=y.from(n.meta).fold(function(){return qh},function(n){return Dn(n,"style")?u(Kh,n.style):qh});return"color"===n.presets?function(n,t,e,o){var r,i;return{dom:(r=e.getOr(""),i={tag:"div",attributes:n.map(function(n){return{title:o.translate(n)}}).getOr({}),classes:["tox-swatch"]},d(d({},i),"custom"===t?{tag:"button",classes:g(i.classes,["tox-swatches__picker-btn"]),innerHtml:r}:"remove"===t?{classes:g(i.classes,["tox-swatch--remove"]),innerHtml:r}:{attributes:d(d({},i.attributes),{"data-mce-color":t}),styles:{"background-color":t}})),optComponents:[]}}(n.ariaLabel,n.value,a,t):Qh(n,a,e,c,i)},ev=function(n,t){return Bn(n,"tooltipWorker").map(function(n){return[jp.config({lazySink:t.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(n){return{anchor:"submenu",item:n,overrides:{maxHeightFunction:pc}}},mode:"follow-highlight",onShow:function(t,e){n(function(n){jp.setComponents(t,[Ji({element:ae.fromDom(n)})])})}})]}).getOr([])},ov=function(n,t){var e=function(n){return Up.DOM.encode(n)}(Wp.translate(n));if(t.length>0){var o=new RegExp(function(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"gi");return e.replace(o,function(n){return'<span class="tox-autocompleter-highlight">'+n+"</span>"})}return e},rv=r(nl("item-widget",og())),iv=Fr("cell-over"),uv=Fr("cell-execute"),av=function(n,t,e){var o,r=function(e){return Mo(e,uv,{row:n,col:t})},i=function(n,t){t.stop(),r(n)};return Qi({dom:{tag:"div",attributes:(o={role:"button"},o["aria-labelledby"]=e,o)},behaviours:Pa([Am("insert-table-picker-cell",[No(qe(),Vm.focus),No(so(),r),No(to(),i),No(lo(),i)]),qm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Vm.config({onFocus:function(e){return Mo(e,iv,{row:n,col:t})}})])})},cv=function(n){return K(n,function(n){return N(n,Zi)})},sv=function(n,t){return Ki(t+1+"x"+(n+1))},fv=function(n){return{value:n}},lv=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,dv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,mv=function(n){return lv.test(n)||dv.test(n)},gv=function(n){var t=function(n){return{value:n.value.replace(lv,function(n,t,e,o){return t+t+e+e+o+o})}}(n),e=dv.exec(t.value);return null===e?["FFFFFF","FF","FF","FF"]:e},pv=function(n){var t=n.toString(16);return 1===t.length?"0"+t:t},hv=function(n){var t=pv(n.red)+pv(n.green)+pv(n.blue);return fv(t)},vv=Math.min,bv=Math.max,yv=Math.round,xv=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,wv=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Sv=function(n,t,e,o){return{red:n,green:t,blue:e,alpha:o}},kv=function(n){var t=parseInt(n,10);return t.toString()===n&&t>=0&&t<=255},Cv=function(n){var t,e,o,r=(n.hue||0)%360,i=n.saturation/100,u=n.value/100;if(i=bv(0,vv(i,1)),u=bv(0,vv(u,1)),0===i)return t=e=o=yv(255*u),Sv(t,e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),f=u-c;switch(Math.floor(a)){case 0:t=c,e=s,o=0;break;case 1:t=s,e=c,o=0;break;case 2:t=0,e=c,o=s;break;case 3:t=0,e=s,o=c;break;case 4:t=s,e=0,o=c;break;case 5:t=c,e=0,o=s;break;default:t=e=o=0}return t=yv(255*(t+f)),e=yv(255*(e+f)),o=yv(255*(o+f)),Sv(t,e,o,1)},Ov=function(n){var t=gv(n),e=parseInt(t[1],16),o=parseInt(t[2],16),r=parseInt(t[3],16);return Sv(e,o,r,1)},_v=function(n,t,e,o){var r=parseInt(n,10),i=parseInt(t,10),u=parseInt(e,10),a=parseFloat(o);return Sv(r,i,u,a)},Tv=function(n){return"rgba("+n.red+","+n.green+","+n.blue+","+n.alpha+")"},Ev=Sv(255,0,0,1),Bv=function(n,t){return n.fire("ResizeContent",t)},Dv=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Av="tinymce-custom-colors";var Mv="choiceitem",Fv=[{type:Mv,text:"Light Green",value:"#BFEDD2"},{type:Mv,text:"Light Yellow",value:"#FBEEB8"},{type:Mv,text:"Light Red",value:"#F8CAC6"},{type:Mv,text:"Light Purple",value:"#ECCAFA"},{type:Mv,text:"Light Blue",value:"#C2E0F4"},{type:Mv,text:"Green",value:"#2DC26B"},{type:Mv,text:"Yellow",value:"#F1C40F"},{type:Mv,text:"Red",value:"#E03E2D"},{type:Mv,text:"Purple",value:"#B96AD9"},{type:Mv,text:"Blue",value:"#3598DB"},{type:Mv,text:"Dark Turquoise",value:"#169179"},{type:Mv,text:"Orange",value:"#E67E23"},{type:Mv,text:"Dark Red",value:"#BA372A"},{type:Mv,text:"Dark Purple",value:"#843FA1"},{type:Mv,text:"Dark Blue",value:"#236FA1"},{type:Mv,text:"Light Gray",value:"#ECF0F1"},{type:Mv,text:"Medium Gray",value:"#CED4D9"},{type:Mv,text:"Gray",value:"#95A5A6"},{type:Mv,text:"Dark Gray",value:"#7E8C8D"},{type:Mv,text:"Navy Blue",value:"#34495E"},{type:Mv,text:"Black",value:"#000000"},{type:Mv,text:"White",value:"#ffffff"}],Iv=function(n){void 0===n&&(n=10);var t,e=Dv.getItem(Av),o=S(e)?JSON.parse(e):[],r=n-(t=o).length<0?t.slice(0,n):t,i=function(n){r.splice(n,1)};return{add:function(t){R(r,t).each(i),r.unshift(t),r.length>n&&r.pop(),Dv.setItem(Av,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),Rv=function(n){return!1!==n.getParam("custom_colors")},Vv=function(t){var e=function(n){return n.getParam("color_map")}(t);return void 0!==e?function(t){var e=[],o=n.document.createElement("canvas");o.height=1,o.width=1;for(var r=o.getContext("2d"),i=function(n,t){var e=t/255;return("0"+Math.round(n*e+255*(1-e)).toString(16)).slice(-2).toUpperCase()},u=function(n){if(/^[0-9A-Fa-f]{6}$/.test(n))return"#"+n.toUpperCase();r.clearRect(0,0,o.width,o.height),r.fillStyle="#FFFFFF",r.fillStyle=n,r.fillRect(0,0,1,1);var t=r.getImageData(0,0,1,1).data,e=t[0],u=t[1],a=t[2],c=t[3];return"#"+i(e,c)+i(u,c)+i(a,c)},a=0;a<t.length;a+=2)e.push({text:t[a+1],value:u(t[a]),type:"choiceitem"});return e}(e):Fv},Pv=function(n){Iv.add(n)},Hv=function(n){return function(n,t){return n.getParam("color_cols",t,"number")}(n,function(n){return Math.max(5,Math.ceil(Math.sqrt(n)))}(Vv(n).length))},zv=function(n,t,e,o){"custom"===e?Gv(n)(function(e){e.each(function(e){Pv(e),n.execCommand("mceApplyTextcolor",t,e),o(e)})},"#000000"):"remove"===e?(o(""),n.execCommand("mceRemoveTextcolor",t)):(o(e),n.execCommand("mceApplyTextcolor",t,e))},Nv=function(n,t){return n.concat(N(Iv.state(),function(n){return{type:Mv,text:n,value:n}}).concat(function(n){var t={type:"choiceitem",text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return n?[t,{type:"choiceitem",text:"Custom color",icon:"color-picker",value:"custom"}]:[t]}(t)))},Lv=function(n,t){return function(e){e(Nv(n,t))}},jv=function(n,t,e){var o,r;o="forecolor"===t?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",r=e,n.setIconFill(o,r),n.setIconStroke(o,r)},Uv=function(n,t,e,o,r){n.ui.registry.addSplitButton(t,{tooltip:o,presets:"color",icon:"forecolor"===t?"text-color":"highlight-bg-color",select:function(t){return y.from(function(n,t){var e;return n.dom.getParents(n.selection.getStart(),function(n){var o;(o=n.style["forecolor"===t?"color":"background-color"])&&(e=e||o)}),e}(n,e)).bind(function(n){return function(n){if("transparent"===n)return y.some(Sv(0,0,0,0));var t=xv.exec(n);if(null!==t)return y.some(_v(t[1],t[2],t[3],"1"));var e=wv.exec(n);return null!==e?y.some(_v(e[1],e[2],e[3],e[4])):y.none()}(n).map(function(n){var e=hv(n).value;return be(t.toLowerCase(),e)})}).getOr(!1)},columns:Hv(n),fetch:Lv(Vv(n),Rv(n)),onAction:function(t){null!==r.get()&&zv(n,e,r.get(),function(){})},onItemAction:function(o,i){zv(n,e,i,function(e){r.set(e),function(n,t){n.fire("TextColorChange",t)}(n,{name:t,color:e})})},onSetup:function(e){null!==r.get()&&jv(e,t,r.get());var o=function(n){n.name===t&&jv(e,n.name,n.color)};return n.on("TextColorChange",o),function(){n.off("TextColorChange",o)}}})},Wv=function(n,e,o,r){n.ui.registry.addNestedMenuItem(e,{text:r,icon:"forecolor"===e?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(e){zv(n,o,e.value,t)}}]}})},Gv=function(n){return function(t,e){var o={colorpicker:e},r=function(n){return function(t){var e=t.getData();n(y.from(e.colorpicker)),t.close()}}(t);n.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(n,t){"hex-valid"===t.name&&(t.value?n.enable("ok"):n.disable("ok"))},onSubmit:r,onClose:function(){},onCancel:function(){t(y.none())}})}},Xv=function(n,t,e,o,r,i,u,a){var c=Sp(t),s=Yv(t,e,o,"color"!==r?"normal":"color",i,u,a);return Op(n,c,s,o,r)},Yv=function(n,t,e,o,r,i,u){return Cl(N(n,function(a){return"choiceitem"===a.type?(c=a,wt("choicemenuitem",Tp,c)).fold(kp,function(c){return y.some(function(n,t,e,o,r,i,u,a){void 0===a&&(a=!0);var c=tv({presets:e,textContent:t?n.text:y.none(),htmlContent:y.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:t?n.shortcut:y.none(),checkMark:t?y.some($h(u.icons)):y.none(),caret:y.none(),value:n.value},u,a);return Rn(Uh({data:Wh(n),disabled:n.disabled,getApi:function(n){return{setActive:function(t){qm.set(n,t)},isActive:function(){return qm.isOn(n)},isDisabled:function(){return rh.isDisabled(n)},setDisabled:function(t){return rh.set(n,t)}}},onAction:function(t){return o(n.value)},onSetup:function(n){return n.setActive(r),function(){}},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:"tox-collection__item--enabled",toggleOnExecute:!1,selected:n.active}})}(c,1===e,o,t,i(a.value),r,u,Sp(n)))}):y.none();var c}))},qv=function(n,t){var e=pp(t);return 1===n?{mode:"menu",moveOnTab:!0}:"auto"===n?{mode:"grid",selector:"."+e.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===t?"tox-swatches__row":"tox-collection__group")}};var Kv,Jv={inserttable:function(n){var t=Fr("size-label"),e=function(n,t,e){for(var o=[],r=0;r<t;r++){for(var i=[],u=0;u<e;u++)i.push(av(r,u,n));o.push(i)}return o}(t,10,10),o=Dg({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:t}},components:[Ki("0x0")],behaviours:Pa([Dm.config({})])});return{type:"widget",data:{value:Fr("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[rv().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:cv(e).concat(o.asSpec()),behaviours:Pa([Am("insert-table-picker",[Wo(iv,function(n,t,r){var i=r.event().row(),u=r.event().col();!function(n,t,e,o,r){for(var i=0;i<o;i++)for(var u=0;u<r;u++)qm.set(n[i][u],i<=t&&u<=e)}(e,i,u,10,10),Dm.set(o.get(n),[sv(i,u)])}),Wo(uv,function(t,e,o){n.onAction({numRows:o.event().row()+1,numColumns:o.event().col()+1}),Ao(t,go())})]),Om.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(n,t){var e=Nv(t.colorinput.getColors(),t.colorinput.hasCustomColors()),o=t.colorinput.getColorCols(),r=Xv(Fr("menu-value"),e,function(t){n.onAction({value:t})},o,"color",up.CLOSE_ON_EXECUTE,function(){return!1},t.shared.providers),i=d(d({},r),{markers:pp("color"),movement:qv(o,"color")});return{type:"widget",data:{value:Fr("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[rv().widget(sg.sketch(i))]}}},$v=function(n,t,e,o,r,i,u,a){void 0===a&&(a=!0);var c=tv({presets:o,textContent:y.none(),htmlContent:e?n.text.map(function(n){return ov(n,t)}):y.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:y.none(),checkMark:y.none(),caret:y.none(),value:n.value},u.providers,a,n.icon);return Uh({data:Wh(n),disabled:n.disabled,getApi:function(){return{}},onAction:function(t){return r(n.value,n.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:ev(n.meta,u)},c,i,u.providers)},Qv=function(n){var t=n.text.fold(function(){return{}},function(n){return{innerHtml:n}});return{type:"separator",dom:d({tag:"div",classes:[cp,"tox-collection__group-heading"]},t),components:[]}},Zv=function(n,t,e,o){void 0===o&&(o=!0);var r=tv({presets:"normal",iconContent:n.icon,textContent:n.text,htmlContent:y.none(),ariaLabel:n.text,caret:y.none(),checkMark:y.none(),shortcutContent:n.shortcut},e,o);return Uh({data:Wh(n),getApi:function(n){return{isDisabled:function(){return rh.isDisabled(n)},setDisabled:function(t){return rh.set(n,t)}}},disabled:n.disabled,onAction:n.onAction,onSetup:n.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,t,e)},nb=function(n,e,o,r,i){void 0===r&&(r=!0),void 0===i&&(i=!1);var u,a=i?(u=o.icons,{dom:{tag:"div",classes:["tox-collection__item-caret"],innerHtml:Mg("chevron-down",u)}}):function(n){return{dom:{tag:"div",classes:["tox-collection__item-caret"],innerHtml:Mg("chevron-right",n)}}}(o.icons),c=tv({presets:"normal",iconContent:n.icon,textContent:n.text,htmlContent:y.none(),ariaLabel:n.text,caret:y.some(a),checkMark:y.none(),shortcutContent:n.shortcut},o,r);return Uh({data:Wh(n),getApi:function(n){return{isDisabled:function(){return rh.isDisabled(n)},setDisabled:function(t){return rh.set(n,t)}}},disabled:n.disabled,onAction:t,onSetup:n.onSetup,triggersSubmenu:!0,itemBehaviours:[]},c,e,o)},tb=function(n,t,e,o){void 0===o&&(o=!0);var r=tv({iconContent:n.icon,textContent:n.text,htmlContent:y.none(),ariaLabel:n.text,checkMark:y.some($h(e.icons)),caret:y.none(),shortcutContent:n.shortcut,presets:"normal",meta:n.meta},e,o);return Rn(Uh({data:Wh(n),disabled:n.disabled,getApi:function(n){return{setActive:function(t){qm.set(n,t)},isActive:function(){return qm.isOn(n)},isDisabled:function(){return rh.isDisabled(n)},setDisabled:function(t){return rh.set(n,t)}}},onAction:n.onAction,onSetup:n.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,t,e),{toggling:{toggleClass:"tox-collection__item--enabled",toggleOnExecute:!1,selected:n.active}})},eb=function(n,t){return(e=Jv,o=n.fancytype,Object.prototype.hasOwnProperty.call(e,o)?y.some(e[o]):y.none()).map(function(e){return e(n,t)});var e,o};!function(n){n[n.ContentFocus=0]="ContentFocus",n[n.UiFocus=1]="UiFocus"}(Kv||(Kv={}));var ob=function(t,e,o,r,i){var u,a=o.shared.providers,c=function(n){return i?d(d({},n),{shortcut:y.none(),icon:n.text.isSome()?y.none():n.icon}):n};switch(t.type){case"menuitem":return(u=t,wt("menuitem",Bp,u)).fold(kp,function(n){return y.some(Zv(c(n),e,a,r))});case"nestedmenuitem":return function(n){return wt("nestedmenuitem",Dp,n)}(t).fold(kp,function(n){return y.some(nb(c(n),e,a,r,i))});case"togglemenuitem":return function(n){return wt("togglemenuitem",Ap,n)}(t).fold(kp,function(n){return y.some(tb(c(n),e,a,r))});case"separator":return function(n){return wt("separatormenuitem",tp,n)}(t).fold(kp,function(n){return y.some(Qv(n))});case"fancymenuitem":return function(n){return wt("fancymenuitem",Ep,n)}(t).fold(kp,function(n){return eb(c(n),o)});default:return n.console.error("Unknown item in general menu",t),y.none()}},rb=function(n,t,e,o,r,i){var u=1===o,a=!u||Sp(n);return Cl(N(n,function(n){return"separator"===n.type?(o=n,wt("Autocompleter.Separator",tp,o)).fold(kp,function(n){return y.some(Qv(n))}):function(n){return wt("Autocompleter.Item",ep,n)}(n).fold(kp,function(n){return y.some($v(n,t,u,"normal",e,r,i,a))});var o}))},ib=function(n,t,e,o,r){var i=Sp(t),u=Cl(N(t,function(n){var t=function(n){return ob(n,e,o,function(n){return r?!n.hasOwnProperty("text"):i}(n),r)};return"nestedmenuitem"===n.type&&n.getSubmenuItems().length<=0?t(d(d({},n),{disabled:!0})):t(n)}));return(r?Cp:Op)(n,i,u,1,"normal")},ub=function(n){return pg.singleData(n.value,n)},ab={register:function(t,e){var o=ie(y.none()),r=ie(!1),i=Qi(hg.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:Pa([Am("dismissAutocompleter",[No(ko(),function(){return c()})])]),lazySink:e.getSink})),u=function(){return o.get().isSome()},a=function(){u()&&hg.hide(i)},c=function(){if(u()){var n=o.get().map(function(n){return n.element});Lg(n.getOr(ae.fromDom(t.selection.getNode()))).each(br),a(),o.set(y.none()),r.set(!1)}},s=Pn(function(){return rp(t)}),f=function(n,e,o,r){n.matchLength=e.text.length;var u=on(o,function(n){return y.from(n.columns)}).getOr(1);hg.showAt(i,{anchor:"node",root:ae.fromDom(t.getBody()),node:y.from(n.element)},sg.sketch(function(n,t,e,o){var r=e===Kv.ContentFocus?Ql():$l(),i=qv(t,o),u=pp(o);return{dom:n.dom,components:n.components,items:n.items,value:n.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:e===Kv.ContentFocus,focusManager:r,menuBehaviours:Ip("auto"!==t?[]:[Yo(function(n,t){Mp(n,4,u.item).each(function(t){var e=t.numColumns,o=t.numRows;Om.setGridSize(n,o,e)})})])}}(Op("autocompleter-value",!0,r,u,"normal"),u,Kv.ContentFocus,"normal"))),hg.getContent(i).each(zl.highlightFirst)},l=function(i){(function(n){return o.get().map(function(e){return Xg(t.dom,t.selection.getRng(),e.triggerChar).bind(function(e){return np(t,s,e,n)})}).getOrThunk(function(){return Zg(t,s)})})(i).fold(c,function(i){!function(n){if(!u()){var e=Ng(t,n.range);o.set(y.some({triggerChar:n.triggerChar,element:e,matchLength:n.text.length})),r.set(!1)}}(i.context),i.lookupData.then(function(u){o.get().map(function(o){var s,d,m,g=i.context;if(o.triggerChar===g.triggerChar){var p=(s=g.triggerChar,m=on(d=u,function(n){return y.from(n.columns)}).getOr(1),K(d,function(o){var i=o.items;return rb(i,o.matchText,function(e,i){var u=t.selection.getRng();Xg(t.dom,u,s).fold(function(){return n.console.error("Lost context. Cursor probably moved")},function(n){var t=n.range,u={hide:function(){c()},reload:function(n){a(),l(n)}};r.set(!0),o.onAction(u,t,e,i),r.set(!1)})},m,up.BUBBLE_TO_SANDBOX,e)}));p.length>0?f(o,g,u,p):g.text.length-o.matchLength>=10?c():a()}})})})},d={onKeypress:Pg(function(n){27!==n.which&&l()},50),cancelIfNecessary:c,isMenuOpen:function(){return hg.isOpen(i)},isActive:u,isProcessingAction:r.get,getView:function(){return hg.getContent(i)}};Yg(d,t)}},cb=r(!0),sb=function(n,t,e){return function(n,t,e,o){return mu(n,t,e,o,!1)}(n,t,cb,e)},fb=function(n,t,e){return function(n,t,e,o){return mu(n,t,e,o,!0)}(n,t,cb,e)},lb=du,db=function(n,t,e){return Fu(n,t,e).isSome()};function mb(t,e){var o=null;return{cancel:function(){null!==o&&(n.clearTimeout(o),o=null)},schedule:function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];o=n.setTimeout(function(){t.apply(null,r),o=null},e)}}}var gb=function(n){var t=n.raw();return void 0===t.touches||1!==t.touches.length?y.none():y.some(t.touches[0])},pb=function(n){var t=ie(y.none()),e=ie(!1),o=mb(function(t){n.triggerEvent(mo(),t),e.set(!0)},400),r=Yn([{key:Ne(),value:function(n){return gb(n).each(function(r){o.cancel();var i={x:r.clientX,y:r.clientY,target:n.target()};o.schedule(n),e.set(!1),t.set(y.some(i))}),y.none()}},{key:Le(),value:function(n){return o.cancel(),gb(n).each(function(n){t.get().each(function(e){(function(n,t){var e=Math.abs(n.clientX-t.x),o=Math.abs(n.clientY-t.y);return e>5||o>5})(n,e)&&t.set(y.none())})}),y.none()}},{key:je(),value:function(r){o.cancel();return t.get().filter(function(n){return Ae(n.target,r.target())}).map(function(t){return e.get()?(r.prevent(),!1):n.triggerEvent(lo(),r)})}}]);return{fireIfReady:function(n,t){return Bn(r,t).bind(function(t){return t(n)})}}},hb=function(){return Ee().browser.isFirefox()},vb=ut([Nt("triggerEvent"),Jt("stopBackspace",!0)]),bb=function(t,e){var o=kt("Getting GUI events settings",vb,e),r=pb(o),i=N(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(n){return sb(t,n,function(t){r.fireIfReady(t,n).each(function(n){n&&t.kill()}),o.triggerEvent(n,t)&&t.kill()})}),u=ie(y.none()),a=sb(t,"paste",function(t){r.fireIfReady(t,"paste").each(function(n){n&&t.kill()}),o.triggerEvent("paste",t)&&t.kill(),u.set(y.some(n.setTimeout(function(){o.triggerEvent(ao(),t)},0)))}),c=sb(t,"keydown",function(n){o.triggerEvent("keydown",n)?n.kill():!0===o.stopBackspace&&function(n){return 8===n.raw().which&&!V(["input","textarea"],$o(n.target()))&&!db(n.target(),'[contenteditable="true"]')}(n)&&n.prevent()}),s=function(n,t){return hb()?fb(n,"focus",t):sb(n,"focusin",t)}(t,function(n){o.triggerEvent("focusin",n)&&n.kill()}),f=ie(y.none()),l=function(n,t){return hb()?fb(n,"blur",t):sb(n,"focusout",t)}(t,function(t){o.triggerEvent("focusout",t)&&t.kill(),f.set(y.some(n.setTimeout(function(){o.triggerEvent(uo(),t)},0)))});return{unbind:function(){L(i,function(n){n.unbind()}),c.unbind(),s.unbind(),l.unbind(),a.unbind(),u.get().each(n.clearTimeout),f.get().each(n.clearTimeout)}}},yb=function(n,t){var e=Bn(n,"target").map(function(n){return n()}).getOr(t);return ie(e)},xb=Mn([{stopped:[]},{resume:["element"]},{complete:[]}]),wb=function(n,t,e,o,i,u){var a=n(t,o),c=function(n,t){var e=ie(!1),o=ie(!1);return{stop:function(){e.set(!0)},cut:function(){o.set(!0)},isStopped:e.get,isCut:o.get,event:r(n),setSource:t.set,getSource:t.get}}(e,i);return a.fold(function(){return u.logEventNoHandlers(t,o),xb.complete()},function(n){var e=n.descHandler;return ti(e)(c),c.isStopped()?(u.logEventStopped(t,n.element,e.purpose()),xb.stopped()):c.isCut()?(u.logEventCut(t,n.element,e.purpose()),xb.complete()):ar(n.element).fold(function(){return u.logNoParent(t,n.element,e.purpose()),xb.complete()},function(o){return u.logEventResponse(t,n.element,e.purpose()),xb.resume(o)})})},Sb=function(n,t,e,o,r,i){return wb(n,t,e,o,r,i).fold(function(){return!0},function(o){return Sb(n,t,e,o,r,i)},function(){return!1})},kb=function(n,e,o){var i,u,a=(i=e,u=ie(!1),{stop:function(){u.set(!0)},cut:t,isStopped:u.get,isCut:r(!1),event:r(i),setSource:c("Cannot set source of a broadcasted event"),getSource:c("Cannot get source of a broadcasted event")});return L(n,function(n){var t=n.descHandler();ti(t)(a)}),a.isStopped()},Cb=function(n,t,e,o,r){var i=yb(e,o);return Sb(n,t,e,o,i,r)},Ob=function(n,t){return{element:n,descHandler:t}},_b=function(n,t){return{id:r(n),descHandler:r(t)}};function Tb(){var n={};return{registerId:function(t,e,o){Sn(o,function(o,r){var i=void 0!==n[r]?n[r]:{};i[e]=ni(o,t),n[r]=i})},unregisterId:function(t){Sn(n,function(n,e){n.hasOwnProperty(t)&&delete n[t]})},filterByType:function(t){return Bn(n,t).map(function(n){return _n(n,function(n,t){return _b(t,n)})}).getOr([])},find:function(t,e,o){var r=Bn(n,e);return Ve(o,function(n){return function(n,t){return Nr(t).fold(function(){return y.none()},function(e){return n.bind(function(n){return Bn(n,e)}).map(function(n){return Ob(t,n)})})}(r,n)},t)}}}function Eb(){var n=Tb(),t={},e=function(e){Nr(e.element()).each(function(e){delete t[e],n.unregisterId(e)})};return{find:function(t,e,o){return n.find(t,e,o)},filter:function(t){return n.filterByType(t)},register:function(o){var r=function(n){var t=n.element();return Nr(t).fold(function(){return Hr("uid-",n.element())},function(n){return n})}(o);An(t,r)&&function(n,o){var r=t[o];if(r!==n)throw new Error('The tagId "'+o+'" is already used by: '+Br(r.element())+"\nCannot use it for: "+Br(n.element())+"\nThe conflicting element is"+(Oi(r.element())?" ":" not ")+"already in the DOM");e(n)}(o,r);var i=[o];n.registerId(i,r,o.events()),t[r]=o},unregister:e,getById:function(n){return Bn(t,n)}}}var Bb=Sl({name:"Container",factory:function(n){var t=n.dom,e=t.attributes,o=m(t,["attributes"]);return{uid:n.uid,dom:d({tag:"div",attributes:d({role:"presentation"},e)},o),components:n.components,behaviours:xf(n.containerBehaviours),events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},configFields:[Jt("components",[]),yf("containerBehaviours",[]),Jt("events",{}),Jt("domModification",{}),Jt("eventOrder",{})]}),Db=function(n){var e=function(t){return ar(n.element()).fold(function(){return!0},function(n){return Ae(t,n)})},o=Eb(),i=function(n,t){return o.find(e,n,t)},u=bb(n.element(),{triggerEvent:function(n,t){return Lu(n,t.target(),function(e){return function(n,t,e,o){var r=e.target();return Cb(n,t,e,r,o)}(i,n,t,e)})}}),a={debugInfo:r("real"),triggerEvent:function(n,t,e){Lu(n,t,function(o){return Cb(i,n,e,t,o)})},triggerFocus:function(n,e){Nr(n).fold(function(){Ya(n)},function(o){Lu(io(),n,function(o){return function(n,t,e,o,r){var i=yb(e,o);wb(n,t,e,o,i,r)}(i,io(),{originator:r(e),kill:t,prevent:t,target:r(n)},n,o),!1})})},triggerEscape:function(n,t){a.triggerEvent("keydown",n.element(),t.event())},getByUid:function(n){return h(n)},getByDom:function(n){return v(n)},build:Qi,addToGui:function(n){f(n)},removeFromGui:function(n){l(n)},addToWorld:function(n){c(n)},removeFromWorld:function(n){s(n)},broadcast:function(n){m(n)},broadcastOn:function(n,t){g(n,t)},broadcastEvent:function(n,t){p(n,t)},isConnected:r(!0)},c=function(n){n.connect(a),nr(n.element())||(o.register(n),L(n.components(),c),a.triggerEvent(ho(),n.element(),{target:r(n.element())}))},s=function(n){nr(n.element())||(L(n.components(),s),o.unregister(n)),n.disconnect()},f=function(t){Is(n,t)},l=function(n){Ps(n)},d=function(n){var t=o.filter(co());L(t,function(t){var e=t.descHandler();ti(e)(n)})},m=function(n){d({universal:r(!0),data:r(n)})},g=function(n,t){d({universal:r(!1),channels:r(n),data:r(t)})},p=function(n,t){var e=o.filter(n);return kb(e,t)},h=function(n){return o.getById(n).fold(function(){return an.error(new Error('Could not find component with uid: "'+n+'" in system.'))},an.value)},v=function(n){var t=Nr(n).getOr("not found");return h(t)};return c(n),{root:r(n),element:n.element,destroy:function(){u.unbind(),vr(n.element())},add:f,remove:l,getByUid:h,getByDom:v,addToWorld:c,removeFromWorld:s,broadcast:m,broadcastOn:g,broadcastEvent:p}},Ab=r([Jt("prefix","form-field"),yf("fieldBehaviours",[El,bf])]),Mb=r([Kf({schema:[Vt("dom")],name:"label"}),Kf({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:n.text}}}},schema:[Vt("text")],name:"aria-descriptor"}),Yf({factory:{sketch:function(n){var t=Gn(n,["factory"]);return n.factory.sketch(t)}},schema:[Vt("factory")],name:"field"})]),Fb=kl({name:"FormField",configFields:Ab(),partFields:Mb(),factory:function(n,t,e,o){var r=wf(n.fieldBehaviours,[El.config({find:function(t){return al(t,n,"field")}}),bf.config({store:{mode:"manual",getValue:function(n){return El.getCurrent(n).bind(bf.getValue)},setValue:function(n,t){El.getCurrent(n).each(function(n){bf.setValue(n,t)})}}})]),i=Po([Yo(function(t,e){var o=sl(t,n,["label","field","aria-descriptor"]);o.field().each(function(t){var e=Fr(n.prefix);o.label().each(function(n){Sr(n.element(),"for",e),Sr(t.element(),"id",e)}),o["aria-descriptor"]().each(function(e){var o=Fr(n.prefix);Sr(e.element(),"id",o),Sr(t.element(),"aria-describedby",o)})})})]),u={getField:function(t){return al(t,n,"field")},getLabel:function(t){return al(t,n,"label")}};return{uid:n.uid,dom:n.dom,components:t,behaviours:r,events:i,apis:u}},apis:{getField:function(n,t){return n.getField(t)},getLabel:function(n,t){return n.getLabel(t)}}}),Ib=Object.freeze({__proto__:null,exhibit:function(n,t){return Zr({attributes:Yn([{key:t.tabAttr,value:"true"}])})}}),Rb=[Jt("tabAttr","data-alloy-tabstop")],Vb=za({fields:Rb,name:"tabstopping",active:Ib}),Pb=function(n,t,e,o){var r=Hb(n,t,e,o);return Fb.sketch(r)},Hb=function(n,t,e,o){return{dom:zb(e),components:n.toArray().concat([t]),fieldBehaviours:Pa(o)}},zb=function(n){return{tag:"div",classes:["tox-form__group"].concat(n)}},Nb=function(n,t){return Fb.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(n)}})},Lb=Fr("form-component-change"),jb=Fr("form-close"),Ub=Fr("form-cancel"),Wb=Fr("form-action"),Gb=Fr("form-submit"),Xb=Fr("form-block"),Yb=Fr("form-unblock"),qb=Fr("form-tabchange"),Kb=Fr("form-resize"),Jb=function(n,t){var e,o,r=n.label.map(function(n){return Nb(n,t)}),u=function(n){return function(t,e){Fu(e.event().target(),"[data-collection-item-value]").each(function(o){n(t,e,o,kr(o,"data-collection-item-value"))})}},a=u(function(e,o,r,i){o.stop(),t.isReadOnly()||Mo(e,Wb,{name:n.name,value:i})}),c=[No(qe(),u(function(n,t,e){Ya(e)})),No(to(),a),No(lo(),a),No(Ke(),u(function(n,t,e){Mu(n.element(),"."+lp).each(function(n){gi(n,lp)}),di(e,lp)})),No(Je(),u(function(n){Mu(n.element(),"."+lp).each(function(n){gi(n,lp)})})),Jo(u(function(t,e,o,r){Mo(t,Wb,{name:n.name,value:r})}))],s=function(n,t){return N(Xc(n.element(),".tox-collection__item"),t)},f=Fb.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==n.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:i},behaviours:Pa([rh.config({disabled:t.isReadOnly,onDisabled:function(n){s(n,function(n){di(n,"tox-collection__item--state-disabled"),Sr(n,"aria-disabled",!0)})},onEnabled:function(n){s(n,function(n){gi(n,"tox-collection__item--state-disabled"),_r(n,"aria-disabled")})}}),Mh(),Dm.config({}),bf.config({store:{mode:"memory",initialValue:[]},onSetValue:function(e,o){!function(e,o){var r=N(o,function(e){var o,r=Wp.translate(e.text),i=1===n.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",u='<div class="tox-collection__item-icon">'+e.icon+"</div>",a={_:" "," - ":" ","-":" "},c=r.replace(/\_| \- |\-/g,function(n){return a[n]});return'<div class="tox-collection__item'+(t.isReadOnly()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+('"'===(o=e.value)?""":o)+'" title="'+c+'" aria-label="'+c+'">'+u+i+"</div>"}),i=n.columns>1&&"auto"!==n.columns?z(r,n.columns):[r],u=N(i,function(n){return'<div class="tox-collection__group">'+n.join("")+"</div>"});xr(e.element(),u.join(""))}(e,o),"auto"===n.columns&&Mp(e,5,"tox-collection__item").each(function(n){var t=n.numRows,o=n.numColumns;Om.setGridSize(e,t,o)}),Ao(e,Kb)}}),Vb.config({}),Om.config((e=n.columns,o="normal",1===e?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===e?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===o?".tox-swatches__row":".tox-collection__group",cell:"color"===o?".tox-swatch":"."+cp}})),Am("collection-events",c)]),eventOrder:{"alloy.execute":["disabling","alloy.base.behaviour","collection-events"]}});return Pb(r,f,["tox-form__group--collection"],[])},$b=r([Wt("data"),Jt("inputAttributes",{}),Jt("inputStyles",{}),Jt("tag","input"),Jt("inputClasses",[]),Ju("onSetValue"),Jt("styles",{}),Jt("eventOrder",{}),yf("inputBehaviours",[bf,Vm]),Jt("selectOnFocus",!0)]),Qb=function(n){return Pa([Vm.config({onFocus:n.selectOnFocus?function(n){var t=n.element(),e=Ni(t);t.dom().setSelectionRange(0,e.length)}:t})])},Zb=function(n){return d(d({},Qb(n)),wf(n.inputBehaviours,[bf.config({store:d(d({mode:"manual"},n.data.map(function(n){return{initialValue:n}}).getOr({})),{getValue:function(n){return Ni(n.element())},setValue:function(n,t){Ni(n.element())!==t&&Li(n.element(),t)}}),onSetValue:n.onSetValue})]))},ny=function(n){return{tag:n.tag,attributes:d({type:"text"},n.inputAttributes),styles:n.inputStyles,classes:n.inputClasses}},ty=Sl({name:"Input",configFields:$b(),factory:function(n,t){return{uid:n.uid,dom:ny(n),components:[],behaviours:Zb(n),eventOrder:n.eventOrder}}}),ey={},oy={exports:ey};!function(n,t,o,r){!function(r){if("object"==typeof t&&void 0!==o)o.exports=r();else if("function"==typeof n&&n.amd)n([],r);else{("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).EphoxContactWrapper=r()}}(function(){return function(){return function n(t,e,o){function i(a,c){if(!e[a]){if(!t[a]){var s="function"==typeof r&&r;if(!c&&s)return s(a,!0);if(u)return u(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var l=e[a]={exports:{}};t[a][0].call(l.exports,function(n){return i(t[a][1][n]||n)},l,l.exports,n,t,e,o)}return e[a].exports}for(var u="function"==typeof r&&r,a=0;a<o.length;a++)i(o[a]);return i}}()({1:[function(n,t,e){var o,r,i=t.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(n){if(o===setTimeout)return setTimeout(n,0);if((o===u||!o)&&setTimeout)return o=setTimeout,setTimeout(n,0);try{return o(n,0)}catch(t){try{return o.call(null,n,0)}catch(t){return o.call(this,n,0)}}}!function(){try{o="function"==typeof setTimeout?setTimeout:u}catch(n){o=u}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(n){r=a}}();var s,f=[],l=!1,d=-1;function m(){l&&s&&(l=!1,s.length?f=s.concat(f):d=-1,f.length&&g())}function g(){if(!l){var n=c(m);l=!0;for(var t=f.length;t;){for(s=f,f=[];++d<t;)s&&s[d].run();d=-1,t=f.length}s=null,l=!1,function(n){if(r===clearTimeout)return clearTimeout(n);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(n);try{r(n)}catch(t){try{return r.call(null,n)}catch(t){return r.call(this,n)}}}(n)}}function p(n,t){this.fun=n,this.array=t}function h(){}i.nextTick=function(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];f.push(new p(n,t)),1!==f.length||l||c(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(n){return[]},i.binding=function(n){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(n){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(n,t,e){(function(n){!function(e){var o=setTimeout;function r(){}function i(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(n,this)}function u(n,t){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,i._immediateFn(function(){var e=1===n._state?t.onFulfilled:t.onRejected;if(null!==e){var o;try{o=e(n._value)}catch(r){return void c(t.promise,r)}a(t.promise,o)}else(1===n._state?a:c)(t.promise,n._value)})):n._deferreds.push(t)}function a(n,t){try{if(t===n)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if(t instanceof i)return n._state=3,n._value=t,void s(n);if("function"==typeof e)return void l((o=e,r=t,function(){o.apply(r,arguments)}),n)}n._state=1,n._value=t,s(n)}catch(u){c(n,u)}var o,r}function c(n,t){n._state=2,n._value=t,s(n)}function s(n){2===n._state&&0===n._deferreds.length&&i._immediateFn(function(){n._handled||i._unhandledRejectionFn(n._value)});for(var t=0,e=n._deferreds.length;t<e;t++)u(n,n._deferreds[t]);n._deferreds=null}function f(n,t,e){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.promise=e}function l(n,t){var e=!1;try{n(function(n){e||(e=!0,a(t,n))},function(n){e||(e=!0,c(t,n))})}catch(o){if(e)return;e=!0,c(t,o)}}i.prototype.catch=function(n){return this.then(null,n)},i.prototype.then=function(n,t){var e=new this.constructor(r);return u(this,new f(n,t,e)),e},i.all=function(n){var t=Array.prototype.slice.call(n);return new i(function(n,e){if(0===t.length)return n([]);var o=t.length;function r(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,function(n){r(i,n)},e)}t[i]=u,0==--o&&n(t)}catch(c){e(c)}}for(var i=0;i<t.length;i++)r(i,t[i])})},i.resolve=function(n){return n&&"object"==typeof n&&n.constructor===i?n:new i(function(t){t(n)})},i.reject=function(n){return new i(function(t,e){e(n)})},i.race=function(n){return new i(function(t,e){for(var o=0,r=n.length;o<r;o++)n[o].then(t,e)})},i._immediateFn="function"==typeof n?function(t){n(t)}:function(n){o(n,0)},i._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},i._setImmediateFn=function(n){i._immediateFn=n},i._setUnhandledRejectionFn=function(n){i._unhandledRejectionFn=n},void 0!==t&&t.exports?t.exports=i:e.Promise||(e.Promise=i)}(this)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(n,t,e){(function(t,o){var r=n("process/browser.js").nextTick,i=Function.prototype.apply,u=Array.prototype.slice,a={},c=0;function s(n,t){this._id=n,this._clearFn=t}e.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(n){n.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(n,t){clearTimeout(n._idleTimeoutId),n._idleTimeout=t},e.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},e._unrefActive=e.active=function(n){clearTimeout(n._idleTimeoutId);var t=n._idleTimeout;t>=0&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},t))},e.setImmediate="function"==typeof t?t:function(n){var t=c++,o=!(arguments.length<2)&&u.call(arguments,1);return a[t]=!0,r(function(){a[t]&&(o?n.apply(null,o):n.call(null),e.clearImmediate(t))}),t},e.clearImmediate="function"==typeof o?o:function(n){delete a[n]}}).call(this,n("timers").setImmediate,n("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(n,t,e){var o=n("promise-polyfill"),r="undefined"!=typeof window?window:Function("return this;")();t.exports={boltExport:r.Promise||o}},{"promise-polyfill":2}]},{},[4])(4)})}(void 0,ey,oy,void 0);var ry,iy=oy.exports.boltExport,uy=function(t){var e=y.none(),o=[],r=function(n){i()?a(n):o.push(n)},i=function(){return e.isSome()},u=function(n){L(n,a)},a=function(t){e.each(function(e){n.setTimeout(function(){t(e)},0)})};return t(function(n){i()||(e=y.some(n),u(o),o=[])}),{get:r,map:function(n){return uy(function(t){r(function(e){t(n(e))})})},isReady:i}},ay={nu:uy,pure:function(n){return uy(function(t){t(n)})}},cy=function(t){n.setTimeout(function(){throw t},0)},sy=function(n){var t=function(t){n().then(t,cy)};return{map:function(t){return sy(function(){return n().then(t)})},bind:function(t){return sy(function(){return n().then(function(n){return t(n).toPromise()})})},anonBind:function(t){return sy(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return ay.nu(t)},toCached:function(){var t=null;return sy(function(){return null===t&&(t=n()),t})},toPromise:n,get:t}},fy=function(n){return sy(function(){return new iy(n)})},ly=function(n){return sy(function(){return iy.resolve(n)})},dy=["input","textarea"],my=function(n){var t=$o(n);return V(dy,t)},gy=function(n,t){var e=t.getRoot(n).getOr(n.element());gi(e,t.invalidClass),t.notify.each(function(t){my(n.element())&&Sr(n.element(),"aria-invalid",!1),t.getContainer(n).each(function(n){xr(n,t.validHtml)}),t.onValid(n)})},py=function(n,t,e,o){var r=t.getRoot(n).getOr(n.element());di(r,t.invalidClass),t.notify.each(function(t){my(n.element())&&Sr(n.element(),"aria-invalid",!0),t.getContainer(n).each(function(n){xr(n,o)}),t.onInvalid(n,o)})},hy=function(n,t,e){return t.validator.fold(function(){return ly(an.value(!0))},function(t){return t.validate(n)})},vy=function(n,t,e){return t.notify.each(function(t){t.onValidate(n)}),hy(n,t).map(function(e){return n.getSystem().isConnected()?e.fold(function(e){return py(n,t,0,e),an.error(e)},function(e){return gy(n,t),an.value(e)}):an.error("No longer in system")})},by=Object.freeze({__proto__:null,markValid:gy,markInvalid:py,query:hy,run:vy,isInvalid:function(n,t){var e=t.getRoot(n).getOr(n.element());return pi(e,t.invalidClass)}}),yy=Object.freeze({__proto__:null,events:function(n,e){return n.validator.map(function(e){return Po([No(e.onEvent,function(t){vy(t,n).get(i)})].concat(e.validateOnLoad?[Yo(function(e){vy(e,n).get(t)})]:[]))}).getOr({})}}),xy=[Vt("invalidClass"),Jt("getRoot",y.none),Kt("notify",[Jt("aria","alert"),Jt("getContainer",y.none),Jt("validHtml",""),Ju("onValid"),Ju("onInvalid"),Ju("onValidate")]),Kt("validator",[Vt("validate"),Jt("onEvent","input"),Jt("validateOnLoad",!0)])],wy=za({fields:xy,name:"invalidating",active:yy,apis:by,extra:{validation:function(n){return function(t){var e=bf.getValue(t);return ly(n(e))}}}}),Sy=Object.freeze({__proto__:null,getCoupled:function(n,t,e,o){return e.getOrCreate(n,t,o)}}),ky=[Pt("others",xt(an.value,Tt()))],Cy=za({fields:ky,name:"coupling",apis:Sy,state:Object.freeze({__proto__:null,init:function(){var n={},t=r({});return $r({readState:t,getOrCreate:function(t,e,o){var r=xn(e.others);if(r)return Bn(n,o).getOrThunk(function(){var r=Bn(e.others,o).getOrDie("No information found for coupled component: "+o)(t),i=t.getSystem().build(r);return n[o]=i,i});throw new Error("Cannot find coupled component: "+o+". Known coupled components: "+JSON.stringify(r,null,2))}})}})}),Oy=r("sink"),_y=r(Kf({name:Oy(),overrides:r({dom:{tag:"div"},behaviours:Pa([Bs.config({useFixed:f})]),events:Po([Go($e()),Go(We()),Go(to())])})}));!function(n){n[n.HighlightFirst=0]="HighlightFirst",n[n.HighlightNone=1]="HighlightNone"}(ry||(ry={}));var Ty=function(n,t){var e=n.getHotspot(t).getOr(t),o=n.getAnchorOverrides();return n.layouts.fold(function(){return{anchor:"hotspot",hotspot:e,overrides:o}},function(n){return{anchor:"hotspot",hotspot:e,overrides:o,layouts:n}})},Ey=function(n,t,e,o,r,i,u){return function(n,t,e,o,r,i,u){var a=function(n,t,e){return(0,n.fetch)(e).map(t)}(n,t,o),c=My(o,n);return a.map(function(n){return n.bind(function(n){return y.from(pg.sketch(d(d({},i.menu()),{uid:Lr(""),data:n,highlightImmediately:u===ry.HighlightFirst,onOpenMenu:function(n,t){var o=c().getOrDie();Bs.position(o,e,t),$s.decloak(r)},onOpenSubmenu:function(n,t,e){var o=c().getOrDie();Bs.position(o,{anchor:"submenu",item:t},e),$s.decloak(r)},onRepositionMenu:function(n,t,o){var r=c().getOrDie();Bs.position(r,e,t),L(o,function(n){Bs.position(r,{anchor:"submenu",item:n.triggeringItem},n.triggeredMenu)})},onEscape:function(){return Vm.focus(o),$s.close(r),y.some(!0)}})))})})}(n,t,Ty(n,e),e,o,r,u).map(function(n){return n.fold(function(){$s.isOpen(o)&&$s.close(o)},function(n){$s.cloak(o),$s.open(o,n),i(o)}),o})},By=function(n,t,e,o,r,i,u){return $s.close(o),ly(o)},Dy=function(n,t,e,o,r,i){var u=Cy.getCoupled(e,"sandbox");return($s.isOpen(u)?By:Ey)(n,t,e,u,o,r,i)},Ay=function(n,t,e){var o,r,i=El.getCurrent(t).getOr(t),u=fu(n.element());e?Di(i.element(),"min-width",u+"px"):(o=i.element(),r=u,su.set(o,r))},My=function(n,t){return n.getSystem().getByUid(t.uid+"-"+Oy()).map(function(n){return function(){return an.value(n)}}).getOrThunk(function(){return t.lazySink.fold(function(){return function(){return an.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(t){return function(){return t(n)}})})},Fy=function(n){$s.getState(n).each(function(n){pg.repositionMenus(n)})},Iy=function(n,t,e){var o=Iu(),r=My(t,n);return{dom:{tag:"div",classes:n.sandboxClasses,attributes:{id:o.id,role:"listbox"}},behaviours:kf(n.sandboxBehaviours,[bf.config({store:{mode:"memory",initialValue:t}}),$s.config({onOpen:function(r,i){var u=Ty(n,t);o.link(t.element()),n.matchWidth&&Ay(u.hotspot,i,n.useMinWidth),n.onOpen(u,r,i),void 0!==e&&void 0!==e.onOpen&&e.onOpen(r,i)},onClose:function(n,r){o.unlink(t.element()),void 0!==e&&void 0!==e.onClose&&e.onClose(n,r)},isPartOf:function(n,e,o){return Vu(e,o)||Vu(t,o)},getAttachPoint:function(){return r().getOrDie()}}),El.config({find:function(n){return $s.getState(n).bind(function(n){return El.getCurrent(n)})}}),Ga.config({channels:d(d({},ef({isExtraPart:s})),rf({doReposition:Fy}))})])}},Ry=function(n){var t=Cy.getCoupled(n,"sandbox");Fy(t)},Vy=function(){return[Jt("sandboxClasses",[]),Sf("sandboxBehaviours",[El,Ga,$s,bf])]},Py=r([Vt("dom"),Vt("fetch"),Ju("onOpen"),$u("onExecute"),Jt("getHotspot",y.some),Jt("getAnchorOverrides",r({})),_c(),yf("dropdownBehaviours",[qm,Cy,Om,Vm]),Vt("toggleClass"),Jt("eventOrder",{}),Wt("lazySink"),Jt("matchWidth",!1),Jt("useMinWidth",!1),Wt("role")].concat(Vy())),Hy=r([qf({schema:[Yu()],name:"menu",defaults:function(n){return{onExecute:n.onExecute}}}),_y()]),zy=kl({name:"Dropdown",configFields:Py(),partFields:Hy(),factory:function(n,e,o,r){var i,u,a=function(n){$s.getState(n).each(function(n){pg.highlightPrimary(n)})},c={expand:function(e){qm.isOn(e)||Dy(n,function(n){return n},e,r,t,ry.HighlightNone).get(t)},open:function(e){qm.isOn(e)||Dy(n,function(n){return n},e,r,t,ry.HighlightFirst).get(t)},isOpen:qm.isOn,close:function(e){qm.isOn(e)&&Dy(n,function(n){return n},e,r,t,ry.HighlightFirst).get(t)},repositionMenus:function(n){qm.isOn(n)&&Ry(n)}},s=function(n,t){return Fo(n),y.some(!0)};return{uid:n.uid,dom:n.dom,components:e,behaviours:wf(n.dropdownBehaviours,[qm.config({toggleClass:n.toggleClass,aria:{mode:"expanded"}}),Cy.config({others:{sandbox:function(t){return Iy(n,t,{onOpen:function(){qm.on(t)},onClose:function(){qm.off(t)}})}}}),Om.config({mode:"special",onSpace:s,onEnter:s,onDown:function(n,t){if(zy.isOpen(n)){var e=Cy.getCoupled(n,"sandbox");a(e)}else zy.open(n);return y.some(!0)},onEscape:function(n,t){return zy.isOpen(n)?(zy.close(n),y.some(!0)):y.none()}}),Vm.config({})]),events:Jm(y.some(function(e){Dy(n,function(n){return n},e,r,a,ry.HighlightFirst).get(t)})),eventOrder:d(d({},n.eventOrder),(i={},i[so()]=["disabling","toggling","alloy.base.behaviour"],i)),apis:c,domModification:{attributes:d(d({"aria-haspopup":"true"},n.role.fold(function(){return{}},function(n){return{role:n}})),"button"===n.dom.tag?{type:(u="type",Bn(n.dom,"attributes").bind(function(n){return Bn(n,u)})).getOr("button")}:{})}}},apis:{open:function(n,t){return n.open(t)},expand:function(n,t){return n.expand(t)},close:function(n,t){return n.close(t)},isOpen:function(n,t){return n.isOpen(t)},repositionMenus:function(n,t){return n.repositionMenus(t)}}}),Ny=Object.freeze({__proto__:null,events:function(){return Po([Ho(oo(),r(!0))])},exhibit:function(){return Zr({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),Ly=za({fields:[],name:"unselecting",active:Ny}),jy=Fr("color-input-change"),Uy=Fr("color-swatch-change"),Wy=Fr("color-picker-cancel"),Gy=function(n,t,e){var o=Fb.parts().field({factory:ty,inputClasses:["tox-textfield"],onSetValue:function(n){return wy.run(n).get(function(){})},inputBehaviours:Pa([rh.config({disabled:t.providers.isReadOnly}),Mh(),Vb.config({}),wy.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(n){return ar(n.element())},notify:{onValid:function(n){var t=bf.getValue(n);Mo(n,jy,{color:t})}},validator:{validateOnLoad:!1,validate:function(n){var t=bf.getValue(n);if(0===t.length)return ly(an.value(!0));var e=ae.fromTag("span");Di(e,"background-color",t);var o=Ri(e,"background-color").fold(function(){return an.error("blah")},function(n){return an.value(t)});return ly(o)}}})]),selectOnFocus:!1}),r=n.label.map(function(n){return Nb(n,t.providers)}),i=function(n,t){Mo(n,Uy,{value:t})},u=Dg(function(n,t){return zy.sketch({dom:n.dom,components:n.components,toggleClass:"mce-active",dropdownBehaviours:Pa([Ih(t.providers.isReadOnly),Mh(),Ly.config({}),Vb.config({})]),layouts:n.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:t.getSink,fetch:function(e){return fy(function(t){return n.fetch(t)}).map(function(o){return y.from(ub(Rn(Xv(Fr("menu-value"),o,function(t){n.onItemAction(e,t)},n.columns,n.presets,up.CLOSE_ON_EXECUTE,function(){return!1},t.providers),{movement:qv(n.columns,n.presets)})))})},parts:{menu:bp(0,0,n.presets)}})}({dom:{tag:"span",attributes:{"aria-label":t.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[wa,xa,Oa]},onLtr:function(){return[xa,wa,Oa]}},components:[],fetch:Lv(e.getColors(),e.hasCustomColors()),columns:e.getColorCols(),presets:"color",onItemAction:function(n,t){u.getOpt(n).each(function(n){"custom"===t?e.colorPicker(function(t){t.fold(function(){return Ao(n,Wy)},function(t){i(n,t),Pv(t)})},"#ffffff"):i(n,"remove"===t?"":t)})}},t));return Fb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:r.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[o,u.asSpec()]}]),fieldBehaviours:Pa([Am("form-field-events",[No(jy,function(t,e){u.getOpt(t).each(function(n){Di(n.element(),"background-color",e.event().color())}),Mo(t,Lb,{name:n.name})}),No(Uy,function(n,t){Fb.getField(n).each(function(e){bf.setValue(e,t.event().value()),El.getCurrent(n).each(Vm.focus)})}),No(Wy,function(n,t){Fb.getField(n).each(function(t){El.getCurrent(n).each(Vm.focus)})})])])})},Xy=function(n,t,e){return{hue:n,saturation:t,value:e}},Yy=Fr("rgb-hex-update"),qy=Fr("slider-update"),Ky=Fr("palette-update"),Jy=Kf({schema:[Vt("dom")],name:"label"}),$y=function(n){return Kf({name:n+"-edge",overrides:function(t){return t.model.manager.edgeActions[n].fold(function(){return{}},function(n){return{events:Po([Lo(Ne(),function(t,e,o){return n(t,o)},[t]),Lo(We(),function(t,e,o){return n(t,o)},[t]),Lo(Ge(),function(t,e,o){o.mouseIsDown.get()&&n(t,o)},[t])])}})}})},Qy=$y("top-left"),Zy=$y("top"),nx=$y("top-right"),tx=$y("right"),ex=$y("bottom-right"),ox=$y("bottom"),rx=$y("bottom-left"),ix=[Jy,$y("left"),tx,Zy,ox,Qy,nx,rx,ex,Yf({name:"thumb",defaults:r({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:Po([Uo(Ne(),n,"spectrum"),Uo(Le(),n,"spectrum"),Uo(je(),n,"spectrum"),Uo(We(),n,"spectrum"),Uo(Ge(),n,"spectrum"),Uo(Ye(),n,"spectrum")])}}}),Yf({schema:[re("mouseIsDown",function(){return ie(!1)})],name:"spectrum",overrides:function(n){var t=n.model.manager,e=function(e,o){return t.getValueFromEvent(o).map(function(o){return t.setValueFrom(e,n,o)})};return{behaviours:Pa([Om.config({mode:"special",onLeft:function(e){return t.onLeft(e,n)},onRight:function(e){return t.onRight(e,n)},onUp:function(e){return t.onUp(e,n)},onDown:function(e){return t.onDown(e,n)}}),Vm.config({})]),events:Po([No(Ne(),e),No(Le(),e),No(We(),e),No(Ge(),function(t,o){n.mouseIsDown.get()&&e(t,o)})])}}})],ux=r("slider.change.value"),ax=function(n){var t=n.event().raw();if(function(n){return-1!==n.type.indexOf("touch")}(t)){var e=t;return void 0!==e.touches&&1===e.touches.length?y.some(e.touches[0]).map(function(n){return iu(n.clientX,n.clientY)}):y.none()}var o=t;return void 0!==o.clientX?y.some(o).map(function(n){return iu(n.clientX,n.clientY)}):y.none()},cx=function(n){return n.model.minX},sx=function(n){return n.model.minY},fx=function(n){return n.model.minX-1},lx=function(n){return n.model.minY-1},dx=function(n){return n.model.maxX},mx=function(n){return n.model.maxY},gx=function(n){return n.model.maxX+1},px=function(n){return n.model.maxY+1},hx=function(n,t,e){return t(n)-e(n)},vx=function(n){return hx(n,dx,cx)},bx=function(n){return hx(n,mx,sx)},yx=function(n){return vx(n)/2},xx=function(n){return bx(n)/2},wx=function(n){return n.stepSize},Sx=function(n){return n.snapToGrid},kx=function(n){return n.snapStart},Cx=function(n){return n.rounded},Ox=function(n,t){return void 0!==n[t+"-edge"]},_x=function(n){return Ox(n,"left")},Tx=function(n){return Ox(n,"right")},Ex=function(n){return Ox(n,"top")},Bx=function(n){return Ox(n,"bottom")},Dx=function(n){return n.model.value.get()},Ax=function(n){return{x:r(n)}},Mx=function(n){return{y:r(n)}},Fx=function(n,t){return{x:r(n),y:r(t)}},Ix=function(n,t){Mo(n,ux(),{value:t})},Rx=function(n,t,e,o){return n<t?n:n>e?e:n===t?t-1:Math.max(t,n-o)},Vx=function(n,t,e,o){return n>e?n:n<t?t:n===e?e+1:Math.min(e,n+o)},Px=function(n,t,e){return Math.max(t,Math.min(e,n))},Hx=function(n){var t=n.min,e=n.max,o=n.range,r=n.value,i=n.step,u=n.snap,a=n.snapStart,c=n.rounded,s=n.hasMinEdge,f=n.hasMaxEdge,l=n.minBound,d=n.maxBound,m=n.screenRange,g=s?t-1:t,p=f?e+1:e;if(r<l)return g;if(r>d)return p;var h=function(n,t,e){return Math.min(e,Math.max(n,t))-t}(r,l,d),v=Px(h/m*o+t,g,p);return u&&v>=t&&v<=e?function(n,t,e,o,r){return r.fold(function(){var r=n-t,i=Math.round(r/o)*o;return Px(t+i,t-1,e+1)},function(t){var r=(n-t)%o,i=Math.round(r/o),u=Math.floor((n-t)/o),a=Math.floor((e-t)/o),c=t+Math.min(a,u+i)*o;return Math.max(t,c)})}(v,t,e,i,a):c?Math.round(v):v},zx=function(n){var t=n.min,e=n.max,o=n.range,r=n.value,i=n.hasMinEdge,u=n.hasMaxEdge,a=n.maxBound,c=n.maxOffset,s=n.centerMinEdge,f=n.centerMaxEdge;return r<t?i?0:s:r>e?u?a:f:(r-t)/o*c},Nx=function(n){return n.element().dom().getBoundingClientRect()},Lx=function(n,t){return n[t]},jx=function(n){var t=Nx(n);return Lx(t,"left")},Ux=function(n){var t=Nx(n);return Lx(t,"right")},Wx=function(n){var t=Nx(n);return Lx(t,"top")},Gx=function(n){var t=Nx(n);return Lx(t,"bottom")},Xx=function(n){var t=Nx(n);return Lx(t,"width")},Yx=function(n){var t=Nx(n);return Lx(t,"height")},qx=function(n,t,e){return(n+t)/2-e},Kx=function(n,t){var e=Nx(n),o=Nx(t),r=Lx(e,"left"),i=Lx(e,"right"),u=Lx(o,"left");return qx(r,i,u)},Jx=function(n,t){var e=Nx(n),o=Nx(t),r=Lx(e,"top"),i=Lx(e,"bottom"),u=Lx(o,"top");return qx(r,i,u)},$x=function(n,t){Mo(n,ux(),{value:t})},Qx=function(n){return{x:r(n)}},Zx=function(n,t,e){var o={min:cx(t),max:dx(t),range:vx(t),value:e,step:wx(t),snap:Sx(t),snapStart:kx(t),rounded:Cx(t),hasMinEdge:_x(t),hasMaxEdge:Tx(t),minBound:jx(n),maxBound:Ux(n),screenRange:Xx(n)};return Hx(o)},nw=function(n){return function(t,e){return function(n,t,e){var o=(n>0?Vx:Rx)(Dx(e).x(),cx(e),dx(e),wx(e));return $x(t,Qx(o)),y.some(o)}(n,t,e).map(function(){return!0})}},tw=function(n,t,e,o,r,i){var u=function(n,t,e,o,r){var i=Xx(n),u=o.bind(function(t){return y.some(Kx(t,n))}).getOr(0),a=r.bind(function(t){return y.some(Kx(t,n))}).getOr(i),c={min:cx(t),max:dx(t),range:vx(t),value:e,hasMinEdge:_x(t),hasMaxEdge:Tx(t),minBound:jx(n),minOffset:0,maxBound:Ux(n),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return zx(c)}(t,i,e,o,r);return jx(t)-jx(n)+u},ew=nw(-1),ow=nw(1),rw=y.none,iw=y.none,uw={"top-left":y.none(),top:y.none(),"top-right":y.none(),right:y.some(function(n,t){Ix(n,Ax(gx(t)))}),"bottom-right":y.none(),bottom:y.none(),"bottom-left":y.none(),left:y.some(function(n,t){Ix(n,Ax(fx(t)))})},aw=Object.freeze({__proto__:null,setValueFrom:function(n,t,e){var o=Zx(n,t,e),r=Qx(o);return $x(n,r),o},setToMin:function(n,t){var e=cx(t);$x(n,Qx(e))},setToMax:function(n,t){var e=dx(t);$x(n,Qx(e))},findValueOfOffset:Zx,getValueFromEvent:function(n){return ax(n).map(function(n){return n.left()})},findPositionOfValue:tw,setPositionFromValue:function(n,t,e,o){var r=Dx(e),i=tw(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=fu(t.element())/2;Di(t.element(),"left",i-u+"px")},onLeft:ew,onRight:ow,onUp:rw,onDown:iw,edgeActions:uw}),cw=function(n,t){Mo(n,ux(),{value:t})},sw=function(n){return{y:r(n)}},fw=function(n,t,e){var o={min:sx(t),max:mx(t),range:bx(t),value:e,step:wx(t),snap:Sx(t),snapStart:kx(t),rounded:Cx(t),hasMinEdge:Ex(t),hasMaxEdge:Bx(t),minBound:Wx(n),maxBound:Gx(n),screenRange:Yx(n)};return Hx(o)},lw=function(n){return function(t,e){return function(n,t,e){var o=(n>0?Vx:Rx)(Dx(e).y(),sx(e),mx(e),wx(e));return cw(t,sw(o)),y.some(o)}(n,t,e).map(function(){return!0})}},dw=function(n,t,e,o,r,i){var u=function(n,t,e,o,r){var i=Yx(n),u=o.bind(function(t){return y.some(Jx(t,n))}).getOr(0),a=r.bind(function(t){return y.some(Jx(t,n))}).getOr(i),c={min:sx(t),max:mx(t),range:bx(t),value:e,hasMinEdge:Ex(t),hasMaxEdge:Bx(t),minBound:Wx(n),minOffset:0,maxBound:Gx(n),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return zx(c)}(t,i,e,o,r);return Wx(t)-Wx(n)+u},mw=y.none,gw=y.none,pw=lw(-1),hw=lw(1),vw={"top-left":y.none(),top:y.some(function(n,t){Ix(n,Mx(lx(t)))}),"top-right":y.none(),right:y.none(),"bottom-right":y.none(),bottom:y.some(function(n,t){Ix(n,Mx(px(t)))}),"bottom-left":y.none(),left:y.none()},bw=Object.freeze({__proto__:null,setValueFrom:function(n,t,e){var o=fw(n,t,e),r=sw(o);return cw(n,r),o},setToMin:function(n,t){var e=sx(t);cw(n,sw(e))},setToMax:function(n,t){var e=mx(t);cw(n,sw(e))},findValueOfOffset:fw,getValueFromEvent:function(n){return ax(n).map(function(n){return n.top()})},findPositionOfValue:dw,setPositionFromValue:function(n,t,e,o){var r=Dx(e),i=dw(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),u=eu(t.element())/2;Di(t.element(),"top",i-u+"px")},onLeft:mw,onRight:gw,onUp:pw,onDown:hw,edgeActions:vw}),yw=function(n,t){Mo(n,ux(),{value:t})},xw=function(n,t){return{x:r(n),y:r(t)}},ww=function(n,t){return function(e,o){return function(n,t,e,o){var r=n>0?Vx:Rx,i=t?Dx(o).x():r(Dx(o).x(),cx(o),dx(o),wx(o)),u=t?r(Dx(o).y(),sx(o),mx(o),wx(o)):Dx(o).y();return yw(e,xw(i,u)),y.some(i)}(n,t,e,o).map(function(){return!0})}},Sw=ww(-1,!1),kw=ww(1,!1),Cw=ww(-1,!0),Ow=ww(1,!0),_w={"top-left":y.some(function(n,t){Ix(n,Fx(fx(t),lx(t)))}),top:y.some(function(n,t){Ix(n,Fx(yx(t),lx(t)))}),"top-right":y.some(function(n,t){Ix(n,Fx(gx(t),lx(t)))}),right:y.some(function(n,t){Ix(n,Fx(gx(t),xx(t)))}),"bottom-right":y.some(function(n,t){Ix(n,Fx(gx(t),px(t)))}),bottom:y.some(function(n,t){Ix(n,Fx(yx(t),px(t)))}),"bottom-left":y.some(function(n,t){Ix(n,Fx(fx(t),px(t)))}),left:y.some(function(n,t){Ix(n,Fx(fx(t),xx(t)))})},Tw=Object.freeze({__proto__:null,setValueFrom:function(n,t,e){var o=Zx(n,t,e.left()),r=fw(n,t,e.top()),i=xw(o,r);return yw(n,i),i},setToMin:function(n,t){var e=cx(t),o=sx(t);yw(n,xw(e,o))},setToMax:function(n,t){var e=dx(t),o=mx(t);yw(n,xw(e,o))},getValueFromEvent:function(n){return ax(n)},setPositionFromValue:function(n,t,e,o){var r=Dx(e),i=tw(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=dw(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),a=fu(t.element())/2,c=eu(t.element())/2;Di(t.element(),"left",i-a+"px"),Di(t.element(),"top",u-c+"px")},onLeft:Sw,onRight:kw,onUp:Cw,onDown:Ow,edgeActions:_w}),Ew=kl({name:"Slider",configFields:[Jt("stepSize",1),Jt("onChange",t),Jt("onChoose",t),Jt("onInit",t),Jt("onDragStart",t),Jt("onDragEnd",t),Jt("snapToGrid",!1),Jt("rounded",!0),Wt("snapStart"),Pt("model",_t("mode",{x:[Jt("minX",0),Jt("maxX",100),re("value",function(n){return ie(n.mode.minX)}),Vt("getInitialValue"),na("manager",aw)],y:[Jt("minY",0),Jt("maxY",100),re("value",function(n){return ie(n.mode.minY)}),Vt("getInitialValue"),na("manager",bw)],xy:[Jt("minX",0),Jt("maxX",100),Jt("minY",0),Jt("maxY",100),re("value",function(n){return ie({x:r(n.mode.minX),y:r(n.mode.minY)})}),Vt("getInitialValue"),na("manager",Tw)]})),yf("sliderBehaviours",[Om,bf]),re("mouseIsDown",function(){return ie(!1)})],partFields:ix,factory:function(n,t,e,o){var i,u=function(t){return cl(t,n,"thumb")},a=function(t){return cl(t,n,"spectrum")},c=function(t){return al(t,n,"left-edge")},s=function(t){return al(t,n,"right-edge")},f=function(t){return al(t,n,"top-edge")},l=function(t){return al(t,n,"bottom-edge")},d=n.model,m=d.manager,g=function(t,e){m.setPositionFromValue(t,e,n,{getLeftEdge:c,getRightEdge:s,getTopEdge:f,getBottomEdge:l,getSpectrum:a})},p=function(t,e){d.value.set(e);var o=u(t);return g(t,o),n.onChange(t,o,e),y.some(!0)},h=function(t){var e=n.mouseIsDown.get();n.mouseIsDown.set(!1),e&&al(t,n,"thumb").each(function(e){var o=d.value.get();n.onChoose(t,e,o)})},v=function(t,e){e.stop(),n.mouseIsDown.set(!0),n.onDragStart(t,u(t))},b=function(t,e){e.stop(),n.onDragEnd(t,u(t)),h(t)};return{uid:n.uid,dom:n.dom,components:t,behaviours:wf(n.sliderBehaviours,[Om.config({mode:"special",focusIn:function(t){return al(t,n,"spectrum").map(Om.focusIn).map(r(!0))}}),bf.config({store:{mode:"manual",getValue:function(n){return d.value.get()}}}),Ga.config({channels:(i={},i[nf()]={onReceive:h},i)})]),events:Po([No(ux(),function(n,t){p(n,t.event().value())}),Yo(function(t,e){var o=d.getInitialValue();d.value.set(o);var r=u(t);g(t,r);var i=a(t);n.onInit(t,r,i,d.value.get())}),No(Ne(),v),No(je(),b),No(We(),v),No(Ye(),b)]),apis:{resetToMin:function(t){m.setToMin(t,n)},resetToMax:function(t){m.setToMax(t,n)},changeValue:p,refresh:g},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,t){n.resetToMin(t)},resetToMax:function(n,t){n.resetToMax(t)},refresh:function(n,t){n.refresh(t)}}}),Bw=function(n,t){var e=Ew.parts().spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=Ew.parts().thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return Ew.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:r({y:r(0)})},components:[e,o],sliderBehaviours:Pa([Vm.config({})]),onChange:function(n,t,e){Mo(n,qy,{value:e})}})},Dw=[yf("formBehaviours",[bf])],Aw=function(n){return"<alloy.field."+n+">"},Mw=function(n,t){return{uid:n.uid,dom:n.dom,components:t,behaviours:wf(n.formBehaviours,[bf.config({store:{mode:"manual",getValue:function(t){var e=fl(t,n);return kn(e,function(n,t){return n().bind(function(n){var e,o,r=El.getCurrent(n);return e=r,o=new Error("Cannot find a current component to extract the value from for form part '"+t+"': "+Br(n.element())),e.fold(function(){return an.error(o)},an.value)}).map(bf.getValue)})},setValue:function(t,e){Sn(e,function(e,o){al(t,n,o).each(function(n){El.getCurrent(n).each(function(n){bf.setValue(n,e)})})})}}})]),apis:{getField:function(t,e){return al(t,n,e).bind(El.getCurrent)}}}},Fw={getField:Kr(function(n,t,e){return n.getField(t,e)}),sketch:function(n){var t,e=(t=[],{field:function(n,e){return t.push(n),el("form",Aw(n),e)},record:function(){return t}}),o=n(e),r=e.record(),i=N(r,function(n){return Yf({name:n,pname:Aw(n)})});return vl("form",Dw,i,Mw,o)}},Iw=Fr("valid-input"),Rw=Fr("invalid-input"),Vw=Fr("validating-input"),Pw=function(n,e,o,r){var i=function(t,o){return wy.config({invalidClass:e("invalid"),notify:{onValidate:function(n){Mo(n,Vw,{type:t})},onValid:function(n){Mo(n,Iw,{type:t,value:bf.getValue(n)})},onInvalid:function(n){Mo(n,Rw,{type:t,value:bf.getValue(n)})}},validator:{validate:function(t){var e=bf.getValue(t),r=o(e)?an.value(!0):an.error(n("aria.input.invalid"));return ly(r)},validateOnLoad:!1}})},u=function(o,r,u,a,c){var s=n("colorcustom.rgb.range"),f=[Fb.parts().label({dom:{tag:"label",innerHtml:u,attributes:{"aria-label":a}}}),Fb.parts().field({data:c,factory:ty,inputAttributes:d({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:Pa([i(r,o),Vb.config({})]),onSetValue:function(n){wy.isInvalid(n)&&wy.run(n).get(t)}})],l="hex"!==r?[Fb.parts()["aria-descriptor"]({text:s})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:f.concat(l)}},a=function(n,t){var e=t.red,o=t.green,r=t.blue;bf.setValue(n,{red:e,green:o,blue:r})},c=Dg({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),s=function(n,t){c.getOpt(n).each(function(n){Di(n.element(),"background-color","#"+t.value)})};return Sl({factory:function(){var t={red:ie(y.some(255)),green:ie(y.some(255)),blue:ie(y.some(255)),hex:ie(y.some("ffffff"))},i=function(n){return t[n].get()},f=function(n,e){t[n].set(e)},l=function(n){var t=n.red,e=n.green,o=n.blue;f("red",y.some(t)),f("green",y.some(e)),f("blue",y.some(o))},d=function(n,t){var e=t.event();"hex"!==e.type()?f(e.type(),y.none()):r(n)},m=function(n,t,e){var o=parseInt(e,10);f(t,y.some(o)),i("red").bind(function(n){return i("green").bind(function(t){return i("blue").map(function(e){return Sv(n,t,e,1)})})}).each(function(t){var e=function(n,t){var e=hv(t);return Fw.getField(n,"hex").each(function(t){Vm.isFocused(t)||bf.setValue(n,{hex:e.value})}),e}(n,t);s(n,e)})},g=function(n,t){var e=t.event();!function(n){return"hex"===n.type()}(e)?m(n,e.type(),e.value()):function(n,t){o(n);var e=fv(t);f("hex",y.some(t));var r=Ov(e);a(n,r),l(r),Mo(n,Yy,{hex:e}),s(n,e)}(n,e.value())},p=function(t){return{label:n("colorcustom.rgb."+t+".label"),description:n("colorcustom.rgb."+t+".description")}},h=p("red"),v=p("green"),b=p("blue"),x=p("hex");return Rn(Fw.sketch(function(t){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":n("aria.color.picker")}},components:[t.field("red",Fb.sketch(u(kv,"red",h.label,h.description,255))),t.field("green",Fb.sketch(u(kv,"green",v.label,v.description,255))),t.field("blue",Fb.sketch(u(kv,"blue",b.label,b.description,255))),t.field("hex",Fb.sketch(u(mv,"hex",x.label,x.description,"ffffff"))),c.asSpec()],formBehaviours:Pa([wy.config({invalidClass:e("form-invalid")}),Am("rgb-form-events",[No(Iw,g),No(Rw,d),No(Vw,d)])])}}),{apis:{updateHex:function(n,t){bf.setValue(n,{hex:t.value}),function(n,t){var e=Ov(t);a(n,e),l(e)}(n,t),s(n,t)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(n,t,e){n.updateHex(t,e)}},extraApis:{}})},Hw=function(n,t){var e=Ew.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[t("sv-palette-spectrum")]}}),o=Ew.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette-thumb")],innerHtml:"<div class="+t("sv-palette-inner-thumb")+' role="presentation"></div>'}}),i=function(n,t){var e=n.width,o=n.height,r=n.getContext("2d");if(null!==r){r.fillStyle=t,r.fillRect(0,0,e,o);var i=r.createLinearGradient(0,0,e,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,e,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,e,o)}};return Sl({factory:function(n){var u=r({x:r(0),y:r(0)}),a=Pa([El.config({find:y.some}),Vm.config({})]);return Ew.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette")]},model:{mode:"xy",getInitialValue:u},rounded:!1,components:[e,o],onChange:function(n,t,e){Mo(n,Ky,{value:e})},onInit:function(n,t,e,o){i(e.element().dom(),Tv(Ev))},sliderBehaviours:a})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(n,t,e){!function(n,t){var e=n.components()[0].element().dom();i(e,Tv(t))}(t,e)}},extraApis:{}})},zw=function(n,e){return Sl({name:"ColourPicker",configFields:[Vt("dom"),Jt("onValidHex",t),Jt("onInvalidHex",t)],factory:function(t){var o,r=Pw(n,e,t.onValidHex,t.onInvalidHex),i=Hw(0,e),u={paletteRgba:ie(Ev)},a=Dg(i.sketch({})),c=Dg(r.sketch({})),s=function(n,t){a.getOpt(n).each(function(n){var e=Ov(t);u.paletteRgba.set(e),i.setRgba(n,e)})},f=function(n,t){c.getOpt(n).each(function(n){r.updateHex(n,t)})},l=function(n,t,e){L(e,function(e){e(n,t)})};return{uid:t.uid,dom:t.dom,components:[a.asSpec(),Bw(0,e),c.asSpec()],behaviours:Pa([Am("colour-picker-events",[No(Ky,(o=[f],function(n,t){var e,r,i,a,c,s,f,d,m,g=t.event().value(),p=u.paletteRgba.get(),h=(i=0,a=0,c=(e=p).red/255,s=e.green/255,f=e.blue/255,d=Math.min(c,Math.min(s,f)),m=Math.max(c,Math.max(s,f)),d===m?Xy(0,0,100*(a=d)):(i=60*((i=c===d?3:f===d?1:5)-(c===d?s-f:f===d?c-s:f-c)/(m-d)),r=(m-d)/m,a=m,Xy(Math.round(i),Math.round(100*r),Math.round(100*a)))),v=Xy(h.hue,g.x(),100-g.y()),b=Cv(v),y=hv(b);l(n,y,o)})),No(qy,function(){var n=[s,f];return function(t,e){var o=function(n){var t=Xy((100-n)/100*360,100,100),e=Cv(t);return hv(e)}(e.event().value().y());l(t,o,n)}}())]),El.config({find:function(n){return c.getOpt(n)}}),Om.config({mode:"acyclic"})])}}})},Nw=function(){return El.config({find:y.some})},Lw=function(n){return El.config({find:n.getOpt})},jw=function(n){return El.config({find:function(t){return fr(t.element(),n).bind(function(n){return t.getSystem().getByDom(n).toOption()})}})},Uw={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},Ww=function(n){return function(n){return Uw[n]}(n)},Gw=tinymce.util.Tools.resolve("tinymce.Resource"),Xw=at([Jt("preprocess",i),Jt("postprocess",i)]),Yw=function(n,t,e){return bf.config(Rn({store:{mode:"manual",getValue:t,setValue:e}},n.map(function(n){return{store:{initialValue:n}}}).getOr({})))},qw=function(n,t,e){return Yw(n,function(n){return t(n.element())},function(n,t){return e(n.element(),t)})},Kw=function(n,t){var e=kt("RepresentingConfigs.memento processors",Xw,t);return bf.config({store:{mode:"manual",getValue:function(t){var o=n.get(t),r=bf.getValue(o);return e.postprocess(r)},setValue:function(t,o){var r=e.preprocess(o),i=n.get(t);bf.setValue(i,r)}}})},Jw=Yw,$w=function(n){return qw(n,yr,xr)},Qw=function(n){return bf.config({store:{mode:"memory",initialValue:n}})},Zw=function(n,t){var e=function(n,t){t.stop()},o=function(n){return function(t,e){L(n,function(n){n(t,e)})}},r=function(n,t){if(!rh.isDisabled(n)){var e=t.event().raw();u(n,e.dataTransfer.files)}},i=function(n,t){var e=t.event().raw().target.files;u(n,e)},u=function(t,e){bf.setValue(t,function(n){var t=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i");return U(en(n),function(n){return t.test(n.name)})}(e)),Mo(t,Lb,{name:n.name})},a=Dg({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Pa([Am("input-file-events",[Go(to()),Go(lo())])])}),c=n.label.map(function(n){return Nb(n,t)}),s=Fb.parts().field({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Pa([Qw([]),Nw(),rh.config({}),qm.config({toggleClass:"dragenter",toggleOnExecute:!1}),Am("dropzone-events",[No("dragenter",o([e,qm.toggle])),No("dragleave",o([e,qm.toggle])),No("dragover",e),No("drop",o([e,r])),No(no(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:t.translate("Drop an image here")}},Bg.sketch({dom:{tag:"button",innerHtml:t.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[a.asSpec()],action:function(n){a.get(n).element().dom().click()},buttonBehaviours:Pa([Vb.config({}),Ih(t.isReadOnly),Mh()])})]}]}}}});return Pb(c,s,["tox-form__group--stretched"],[])},nS=Fr("alloy-fake-before-tabstop"),tS=Fr("alloy-fake-after-tabstop"),eS=function(n){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:n},behaviours:Pa([Vm.config({ignore:!0}),Vb.config({})])}},oS=function(n){return{dom:{tag:"div",classes:["tox-navobj"]},components:[eS([nS]),n,eS([tS])],behaviours:Pa([jw(1)])}},rS=function(n,t){Mo(n,$e(),{raw:{which:9,shiftKey:t}})},iS=function(n,t){var e=t.element();pi(e,nS)?rS(n,!0):pi(e,tS)&&rS(n,!1)},uS=function(n){return db(n,["."+nS,"."+tS].join(","),r(!1))},aS=!(Ee().browser.isIE()||Ee().browser.isEdge()),cS=function(n,t){var e=aS&&n.sandboxed,o=d(d({},n.label.map(function(n){return{title:n}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),r=function(n){var t=ie("");return{getValue:function(n){return t.get()},setValue:function(e,o){if(n)Sr(e.element(),"srcdoc",o);else{Sr(e.element(),"src","javascript:''");var r=e.element().dom().contentWindow.document;r.open(),r.write(o),r.close()}t.set(o)}}}(e),i=n.label.map(function(n){return Nb(n,t)}),u=Fb.parts().field({factory:{sketch:function(n){return oS({uid:n.uid,dom:{tag:"iframe",attributes:o},behaviours:Pa([Vb.config({}),Vm.config({}),Jw(y.none(),r.getValue,r.setValue)])})}}});return Pb(i,u,["tox-form__group--stretched"],[])};function sS(t,e){return dS(n.document.createElement("canvas"),t,e)}function fS(n){var t=sS(n.width,n.height);return lS(t).drawImage(n,0,0),t}function lS(n){return n.getContext("2d")}function dS(n,t,e){return n.width=t,n.height=e,n}function mS(n){return n.naturalWidth||n.width}function gS(n){return n.naturalHeight||n.height}var pS=window.Promise?window.Promise:function(){var t=function(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(n,o(u,this),o(a,this))},e=t.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){n.setTimeout(t,1)};function o(n,t){return function(){return n.apply(t,arguments)}}var r=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};function i(n){var t=this;null!==this._state?e(function(){var e=t._state?n.onFulfilled:n.onRejected;if(null!==e){var o;try{o=e(t._value)}catch(r){return void n.reject(r)}n.resolve(o)}else(t._state?n.resolve:n.reject)(t._value)}):this._deferreds.push(n)}function u(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void f(o(t,n),o(u,this),o(a,this))}this._state=!0,this._value=n,c.call(this)}catch(e){a.call(this,e)}}function a(n){this._state=!1,this._value=n,c.call(this)}function c(){for(var n=0,t=this._deferreds;n<t.length;n++){var e=t[n];i.call(this,e)}this._deferreds=[]}function s(n,t,e,o){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.resolve=e,this.reject=o}function f(n,t,e){var o=!1;try{n(function(n){o||(o=!0,t(n))},function(n){o||(o=!0,e(n))})}catch(r){if(o)return;o=!0,e(r)}}return t.prototype.catch=function(n){return this.then(null,n)},t.prototype.then=function(n,e){var o=this;return new t(function(t,r){i.call(o,new s(n,e,t,r))})},t.all=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=Array.prototype.slice.call(1===n.length&&r(n[0])?n[0]:n);return new t(function(n,t){if(0===o.length)return n([]);var e=o.length;function r(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var a=u.then;if("function"==typeof a)return void a.call(u,function(n){r(i,n)},t)}o[i]=u,0==--e&&n(o)}catch(c){t(c)}}for(var i=0;i<o.length;i++)r(i,o[i])})},t.resolve=function(n){return n&&"object"==typeof n&&n.constructor===t?n:new t(function(t){t(n)})},t.reject=function(n){return new t(function(t,e){e(n)})},t.race=function(n){return new t(function(t,e){for(var o=0,r=n;o<r.length;o++)r[o].then(t,e)})},t}();function hS(t){return new pS(function(e,o){(function(t){var e=t.split(","),o=/data:([^;]+)/.exec(e[0]);if(!o)return y.none();for(var r=o[1],i=e[1],u=n.atob(i),a=u.length,c=Math.ceil(a/1024),s=new Array(c),f=0;f<c;++f){for(var l=1024*f,d=Math.min(l+1024,a),m=new Array(d-l),g=l,p=0;g<d;++p,++g)m[p]=u[g].charCodeAt(0);s[f]=new Uint8Array(m)}return y.some(new n.Blob(s,{type:r}))})(t).fold(function(){o("uri is not base64: "+t)},e)})}function vS(t,e,o){return e=e||"image/png",n.HTMLCanvasElement.prototype.toBlob?new pS(function(n,r){t.toBlob(function(t){t?n(t):r()},e,o)}):hS(t.toDataURL(e,o))}function bS(t){return function(t){return new pS(function(e,o){var r=n.URL.createObjectURL(t),i=new n.Image,u=function(){i.removeEventListener("load",a),i.removeEventListener("error",c)};function a(){u(),e(i)}function c(){u(),o("Unable to load data of type "+t.type+": "+r)}i.addEventListener("load",a),i.addEventListener("error",c),i.src=r,i.complete&&a()})}(t).then(function(t){!function(t){n.URL.revokeObjectURL(t.src)}(t);var e=sS(mS(t),gS(t));return lS(e).drawImage(t,0,0),e})}function yS(n,t,e){var o=t.type;function i(t,e){return n.then(function(n){return function(n,t,e){return t=t||"image/png",n.toDataURL(t,e)}(n,t,e)})}return{getType:r(o),toBlob:function(){return pS.resolve(t)},toDataURL:r(e),toBase64:function(){return e.split(",")[1]},toAdjustedBlob:function(t,e){return n.then(function(n){return vS(n,t,e)})},toAdjustedDataURL:i,toAdjustedBase64:function(n,t){return i(n,t).then(function(n){return n.split(",")[1]})},toCanvas:function(){return n.then(fS)}}}function xS(t){return function(t){return new pS(function(e){var o=new n.FileReader;o.onloadend=function(){e(o.result)},o.readAsDataURL(t)})}(t).then(function(n){return yS(bS(t),t,n)})}function wS(n,t){return vS(n,t).then(function(t){return yS(pS.resolve(n),t,n.toDataURL())})}function SS(n,t,e){var o="string"==typeof n?parseFloat(n):n;return o>e?o=e:o<t&&(o=t),o}var kS=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function CS(n,t){for(var e,o=[],r=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)o[u]=t[u+5*i];for(u=0;u<5;u++){e=0;for(var a=0;a<5;a++)e+=n[u+5*a]*o[a];r[u+5*i]=e}}return r}function OS(n,t){return n.toCanvas().then(function(e){return function(n,t,e){var o=lS(n);var r=function(n,t){for(var e,o,r,i,u=n.data,a=t[0],c=t[1],s=t[2],f=t[3],l=t[4],d=t[5],m=t[6],g=t[7],p=t[8],h=t[9],v=t[10],b=t[11],y=t[12],x=t[13],w=t[14],S=t[15],k=t[16],C=t[17],O=t[18],_=t[19],T=0;T<u.length;T+=4)e=u[T],o=u[T+1],r=u[T+2],i=u[T+3],u[T]=e*a+o*c+r*s+i*f+l,u[T+1]=e*d+o*m+r*g+i*p+h,u[T+2]=e*v+o*b+r*y+i*x+w,u[T+3]=e*S+o*k+r*C+i*O+_;return n}(o.getImageData(0,0,n.width,n.height),e);return o.putImageData(r,0,0),wS(n,t)}(e,n.getType(),t)})}function _S(n,t){return n.toCanvas().then(function(e){return function(n,t,e){var o=lS(n);var r=o.getImageData(0,0,n.width,n.height),i=o.getImageData(0,0,n.width,n.height);return i=function(n,t,e){function o(n,t,e){return n>e?n=e:n<t&&(n=t),n}for(var r=Math.round(Math.sqrt(e.length)),i=Math.floor(r/2),u=n.data,a=t.data,c=n.width,s=n.height,f=0;f<s;f++)for(var l=0;l<c;l++){for(var d=0,m=0,g=0,p=0;p<r;p++)for(var h=0;h<r;h++){var v=o(l+h-i,0,c-1),b=o(f+p-i,0,s-1),y=4*(b*c+v),x=e[p*r+h];d+=u[y]*x,m+=u[y+1]*x,g+=u[y+2]*x}var w=4*(f*c+l);a[w]=o(d,0,255),a[w+1]=o(m,0,255),a[w+2]=o(g,0,255)}return t}(r,i,e),o.putImageData(i,0,0),wS(n,t)}(e,n.getType(),t)})}function TS(n){return function(t,e){return OS(t,n([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],e))}}var ES,BS,DS=function(n){return function(t){return OS(t,n)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),AS=TS(function(n,t){return CS(n,[1,0,0,0,t=SS(255*t,-255,255),0,1,0,0,t,0,0,1,0,t,0,0,0,1,0,0,0,0,0,1])}),MS=TS(function(n,t){var e;return t=SS(t,-1,1),CS(n,[(e=(t*=100)<0?127+t/100*127:127*(e=0==(e=t%1)?kS[t]:kS[Math.floor(t)]*(1-e)+kS[Math.floor(t)+1]*e)+127)/127,0,0,0,.5*(127-e),0,e/127,0,0,.5*(127-e),0,0,e/127,0,.5*(127-e),0,0,0,1,0,0,0,0,0,1])}),FS=function(n,t,e,o){return OS(n,function(n,t,e,o){return CS(n,[t=SS(t,0,2),0,0,0,0,0,e=SS(e,0,2),0,0,0,0,0,o=SS(o,0,2),0,0,0,0,0,1,0,0,0,0,0,1])}([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],t,e,o))},IS=(ES=[0,-1,0,-1,5,-1,0,-1,0],function(n){return _S(n,ES)}),RS=(BS=function(n,t){return 255*Math.pow(n/255,1-t)},function(n,t){return n.toCanvas().then(function(e){return function(n,t,e){for(var o=lS(n),r=new Array(256),i=0;i<r.length;i++)r[i]=BS(i,e);var u=function(n,t){for(var e=n.data,o=0;o<e.length;o+=4)e[o]=t[e[o]],e[o+1]=t[e[o+1]],e[o+2]=t[e[o+2]];return n}(o.getImageData(0,0,n.width,n.height),r);return o.putImageData(u,0,0),wS(n,t)}(e,n.getType(),t)})});function VS(n,t,e){var o=mS(n),r=gS(n),i=t/o,u=e/r,a=!1;(i<.5||i>2)&&(i=i<.5?.5:2,a=!0),(u<.5||u>2)&&(u=u<.5?.5:2,a=!0);var c=function(n,t,e){return new pS(function(o){var r=mS(n),i=gS(n),u=Math.floor(r*t),a=Math.floor(i*e),c=sS(u,a),s=lS(c);s.drawImage(n,0,0,r,i,0,0,u,a),o(c)})}(n,i,u);return a?c.then(function(n){return VS(n,t,e)}):c}function PS(n,t){return n.toCanvas().then(function(e){return function(n,t,e){var o=sS(n.width,n.height),r=lS(o),i=0,u=0;90!==(e=e<0?360+e:e)&&270!==e||dS(o,o.height,o.width);90!==e&&180!==e||(i=o.width);270!==e&&180!==e||(u=o.height);return r.translate(i,u),r.rotate(e*Math.PI/180),r.drawImage(n,0,0),wS(o,t)}(e,n.getType(),t)})}function HS(n,t){return n.toCanvas().then(function(e){return function(n,t,e){var o=sS(n.width,n.height),r=lS(o);"v"===e?(r.scale(1,-1),r.drawImage(n,0,-o.height)):(r.scale(-1,1),r.drawImage(n,-o.width,0));return wS(o,t)}(e,n.getType(),t)})}function zS(n,t,e,o,r){return n.toCanvas().then(function(i){return function(n,t,e,o,r,i){var u=sS(r,i);return lS(u).drawImage(n,-e,-o),wS(u,t)}(i,n.getType(),t,e,o,r)})}var NS=function(n){return DS(n)},LS=function(n){return IS(n)},jS=function(n,t){return RS(n,t)},US=function(n,t){return AS(n,t)},WS=function(n,t){return MS(n,t)},GS=function(n,t){return HS(n,t)},XS=function(n,t,e){return function(n,t,e){return n.toCanvas().then(function(o){return VS(o,t,e).then(function(t){return wS(t,n.getType())})})}(n,t,e)},YS=function(n,t){return PS(n,t)},qS=function(n,t){return d({dom:{tag:"span",innerHtml:n,classes:["tox-icon","tox-tbtn__icon-wrap"]}},t)},KS=function(n,t){return qS(Mg(n,t),{})},JS=function(n,t){return qS(Mg(n,t),{behaviours:Pa([Dm.config({})])})},$S=function(n,t,e){return{dom:{tag:"span",innerHtml:e.translate(n),classes:[t+"__select-label"]},behaviours:Pa([Dm.config({})])}},QS=Fr("toolbar.button.execute"),ZS={"alloy.execute":["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},nk=Fr("update-menu-text"),tk=Fr("update-menu-icon"),ek=function(n,e,o){var r=ie(t),i=n.text.map(function(n){return Dg($S(n,e,o.providers))}),u=n.icon.map(function(n){return Dg(JS(n,o.providers.icons))}),a=function(n,t){var e=bf.getValue(n);return Vm.focus(e),Mo(e,"keydown",{raw:t.event().raw()}),zy.close(e),y.some(!0)},c=n.role.fold(function(){return{}},function(n){return{role:n}}),s=n.tooltip.fold(function(){return{}},function(n){var t=o.providers.translate(n);return{title:t,"aria-label":t}});return Dg(zy.sketch(d(d({},c),{dom:{tag:"button",classes:[e,e+"--select"].concat(N(n.classes,function(n){return e+"--"+n})),attributes:d({},s)},components:jh([u.map(function(n){return n.asSpec()}),i.map(function(n){return n.asSpec()}),y.some({dom:{tag:"div",classes:[e+"__select-chevron"],innerHtml:Mg("chevron-down",o.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:Pa(g(n.dropdownBehaviours,[Ih(function(){return n.disabled||o.providers.isReadOnly()}),Mh(),Ly.config({}),Dm.config({}),Am("dropdown-events",[Hh(n,r),zh(n,r)]),Am("menubutton-update-display-text",[No(nk,function(n,t){i.bind(function(t){return t.getOpt(n)}).each(function(n){Dm.set(n,[Ki(o.providers.translate(t.event().text()))])})}),No(tk,function(n,t){u.bind(function(t){return t.getOpt(n)}).each(function(n){Dm.set(n,[JS(t.event().icon(),o.providers.icons)])})})])])),eventOrder:Rn(ZS,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:Pa([Om.config({mode:"special",onLeft:a,onRight:a})]),lazySink:o.getSink,toggleClass:e+"--active",parts:{menu:bp(0,n.columns,n.presets)},fetch:function(){return fy(n.fetch)}}))).asSpec()},ok=function(n){return"separator"===n.type},rk={type:"separator"},ik=function(n,t){var e=G(n,function(n,e){return function(n){return S(n)}(e)?""===e?n:"|"===e?n.length>0&&!ok(n[n.length-1])?n.concat([rk]):n:Dn(t,e.toLowerCase())?n.concat([t[e.toLowerCase()]]):n:n.concat([e])},[]);return e.length>0&&ok(e[e.length-1])&&e.pop(),e},uk=function(n,t){return function(n){return Dn(n,"getSubmenuItems")}(n)?function(n,t){var e=n.getSubmenuItems(),o=ak(e,t);return{item:n,menus:Rn(o.menus,Xn(n.value,o.items)),expansions:Rn(o.expansions,Xn(n.value,n.value))}}(n,t):{item:n,menus:{},expansions:{}}},ak=function(n,t){var e=ik(S(n)?n.split(" "):n,t);return W(e,function(n,e){var o=function(n){if(ok(n))return n;var t=Bn(n,"value").getOrThunk(function(){return Fr("generated-menu-item")});return Rn({value:t},n)}(e),r=uk(o,t);return{menus:Rn(n.menus,r.menus),items:[r.item].concat(n.items),expansions:Rn(n.expansions,r.expansions)}},{menus:{},expansions:{},items:[]})},ck=function(n,t,e,o){var r=Fr("primary-menu"),i=ak(n,e.shared.providers.menuItems());if(0===i.items.length)return y.none();var u=ib(r,i.items,t,e,o),a=kn(i.menus,function(n,o){return ib(o,n,t,e,!1)}),c=Rn(a,Xn(r,u));return y.from(pg.tieredData(r,c,i.expansions))},sk=function(n){return{isDisabled:function(){return rh.isDisabled(n)},setDisabled:function(t){return rh.set(n,t)},setActive:function(t){var e=n.element();t?(di(e,"tox-tbtn--enabled"),Sr(e,"aria-pressed",!0)):(gi(e,"tox-tbtn--enabled"),_r(e,"aria-pressed"))},isActive:function(){return pi(n.element(),"tox-tbtn--enabled")}}},fk=function(n,t,e,o){return ek({text:n.text,icon:n.icon,tooltip:n.tooltip,role:o,fetch:function(t){n.fetch(function(n){t(ck(n,up.CLOSE_ON_EXECUTE,e,!1))})},onSetup:n.onSetup,getApi:sk,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Vb.config({})]},t,e.shared)},lk=function(n,t,e){var o=function(n){return function(o){var r=!o.isActive();o.setActive(r),n.storage.set(r),e.shared.getSink().each(function(e){t().getOpt(e).each(function(t){Ya(t.element()),Mo(t,Wb,{name:n.name,value:n.storage.get()})})})}},r=function(n){return function(t){t.setActive(n.storage.get())}};return function(t){t(N(n,function(n){var t=n.text.fold(function(){return{}},function(n){return{text:n}});return d(d({type:n.type,active:!1},t),{onAction:o(n),onSetup:r(n)})}))}},dk=function(n,t,e,o,r,i){void 0===e&&(e=[]);var u=t.fold(function(){return{}},function(n){return{action:n}}),a=d({buttonBehaviours:Pa([Ih(function(){return n.disabled||i.isReadOnly()}),Mh(),Vb.config({}),Am("button press",[zo("click"),zo("mousedown")])].concat(e)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Rn(a,{dom:o});return Rn(c,{components:r})},mk=function(n,t,e,o){void 0===o&&(o=[]);var r={tag:"button",classes:["tox-tbtn"],attributes:n.tooltip.map(function(n){return{"aria-label":e.translate(n),title:e.translate(n)}}).getOr({})},i=n.icon.map(function(n){return KS(n,e.icons)}),u=jh([i]);return dk(n,t,o,r,u,e)},gk=function(n,t,e,o){void 0===o&&(o=[]);var r=mk(n,y.some(t),e,o);return Bg.sketch(r)},pk=function(n,t,e,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=e.translate(n.text),u=n.icon?n.icon.map(function(n){return KS(n,e.icons)}):y.none(),a=u.isSome()?jh([u]):[],c=u.isSome()?{}:{innerHtml:i},s=g(n.primary||n.borderless?["tox-button"]:["tox-button","tox-button--secondary"],u.isSome()?["tox-button--icon"]:[],n.borderless?["tox-button--naked"]:[],r),f=d(d({tag:"button",classes:s},c),{attributes:{title:i}});return dk(n,t,o,f,a,e)},hk=function(n,t,e,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=pk(n,y.some(t),e,o,r);return Bg.sketch(i)},vk=function(t,e){return function(o){"custom"===e?Mo(o,Wb,{name:t,value:{}}):"submit"===e?Ao(o,Gb):"cancel"===e?Ao(o,Ub):n.console.error("Unknown button type: ",e)}},bk=function(e,o,r){if(function(n,t){return"menu"===t}(0,o)){var i=e,u=d(d({},e),{onSetup:function(n){return n.setDisabled(e.disabled),t},fetch:lk(i.items,function(){return a},r)}),a=Dg(fk(u,"tox-tbtn",r,y.none()));return a.asSpec()}if(function(n,t){return"custom"===t||"cancel"===t||"submit"===t}(0,o)){var c=vk(e.name,o),s=d(d({},e),{borderless:!1});return hk(s,c,r.shared.providers,[])}n.console.error("Unknown footer button type: ",o)},yk=function(n,t){var e,o,r=vk(n.name,"custom");return e=y.none(),o=Fb.parts().field(d({factory:Bg},pk(n,y.some(r),t,[Qw(""),Nw()]))),Pb(e,o,[],[])},xk=r([Jt("field1Name","field1"),Jt("field2Name","field2"),Qu("onLockedChange"),qu(["lockClass"]),Jt("locked",!1),Sf("coupledFieldBehaviours",[El,bf])]),wk=function(n,t){return Yf({factory:Fb,name:n,overrides:function(n){return{fieldBehaviours:Pa([Am("coupled-input-behaviour",[No(Ze(),function(e){(function(n,t,e){return al(n,t,e).bind(El.getCurrent)})(e,n,t).each(function(t){al(e,n,"lock").each(function(o){qm.isOn(o)&&n.onLockedChange(e,t,o)})})})])])}}})},Sk=r([wk("field1","field2"),wk("field2","field1"),Yf({factory:Bg,schema:[Vt("dom")],name:"lock",overrides:function(n){return{buttonBehaviours:Pa([qm.config({selected:n.locked,toggleClass:n.markers.lockClass,aria:{mode:"pressed"}})])}}})]),kk=kl({name:"FormCoupledInputs",configFields:xk(),partFields:Sk(),factory:function(n,t,e,o){return{uid:n.uid,dom:n.dom,components:t,behaviours:kf(n.coupledFieldBehaviours,[El.config({find:y.some}),bf.config({store:{mode:"manual",getValue:function(t){var e,o=dl(t,n,["field1","field2"]);return(e={})[n.field1Name]=bf.getValue(o.field1()),e[n.field2Name]=bf.getValue(o.field2()),e},setValue:function(t,e){var o=dl(t,n,["field1","field2"]);An(e,n.field1Name)&&bf.setValue(o.field1(),e[n.field1Name]),An(e,n.field2Name)&&bf.setValue(o.field2(),e[n.field2Name])}}})]),apis:{getField1:function(t){return al(t,n,"field1")},getField2:function(t){return al(t,n,"field2")},getLock:function(t){return al(t,n,"lock")}}}},apis:{getField1:function(n,t){return n.getField1(t)},getField2:function(n,t){return n.getField2(t)},getLock:function(n,t){return n.getLock(t)}}}),Ck=function(n){var t=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(n);if(null!==t){var e=parseFloat(t[1]),o=t[2];return an.value({value:e,unit:o})}return an.error(n)},Ok=function(n,t){var e={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},o=function(n){return Object.prototype.hasOwnProperty.call(e,n)};return n.unit===t?y.some(n.value):o(n.unit)&&o(t)?e[n.unit]===e[t]?y.some(n.value):y.some(n.value/e[n.unit]*e[t]):y.none()},_k=function(n){return y.none()},Tk=function(n,t){var e,o,r,i=Ck(n).toOption(),u=Ck(t).toOption();return(e=i,o=u,r=function(n,t){return Ok(n,t.unit).map(function(n){return t.value/n}).map(function(n){return e=n,o=t.unit,function(n){return Ok(n,o).map(function(n){return{value:n*e,unit:o}})};var e,o}).getOr(_k)},e.isSome()&&o.isSome()?y.some(r(e.getOrDie(),o.getOrDie())):y.none()).getOr(_k)},Ek=function(n,t){var e=_k,o=Fr("ratio-event"),r=kk.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:t.translate(n.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:Mg("lock",t.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:Mg("unlock",t.icons)}}],buttonBehaviours:Pa([rh.config({disabled:function(){return n.disabled||t.isReadOnly()}}),Mh(),Vb.config({})])}),i=function(n){return{dom:{tag:"div",classes:["tox-form__group"]},components:n}},u=function(e){return Fb.parts().field({factory:ty,inputClasses:["tox-textfield"],inputBehaviours:Pa([rh.config({disabled:function(){return n.disabled||t.isReadOnly()}}),Mh(),Vb.config({}),Am("size-input-events",[No(Ke(),function(n,t){Mo(n,o,{isField1:e})}),No(no(),function(t,e){Mo(t,Lb,{name:n.name})})])]),selectOnFocus:!1})},a=function(n){return{dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(n)}}},c=kk.parts().field1(i([Fb.parts().label(a("Width")),u(!0)])),s=kk.parts().field2(i([Fb.parts().label(a("Height")),u(!1)]));return kk.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,i([a(" "),r])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(n,t,o){Ck(bf.getValue(n)).each(function(n){e(n).each(function(n){var e,o,r,i;bf.setValue(t,(r={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},-1!==(i=(e=n).value.toFixed((o=e.unit)in r?r[o]:1)).indexOf(".")&&(i=i.replace(/\.?0*$/,"")),i+e.unit))})})},coupledFieldBehaviours:Pa([rh.config({disabled:function(){return n.disabled||t.isReadOnly()},onDisabled:function(n){kk.getField1(n).bind(Fb.getField).each(rh.disable),kk.getField2(n).bind(Fb.getField).each(rh.disable),kk.getLock(n).each(rh.disable)},onEnabled:function(n){kk.getField1(n).bind(Fb.getField).each(rh.enable),kk.getField2(n).bind(Fb.getField).each(rh.enable),kk.getLock(n).each(rh.enable)}}),Mh(),Am("size-input-events2",[No(o,function(n,t){var o=t.event().isField1(),r=o?kk.getField1(n):kk.getField2(n),i=o?kk.getField2(n):kk.getField1(n),u=r.map(bf.getValue).getOr(""),a=i.map(bf.getValue).getOr("");e=Tk(u,a)})])])})},Bk={undo:r(Fr("undo")),redo:r(Fr("redo")),zoom:r(Fr("zoom")),back:r(Fr("back")),apply:r(Fr("apply")),swap:r(Fr("swap")),transform:r(Fr("transform")),tempTransform:r(Fr("temp-transform")),transformApply:r(Fr("transform-apply"))},Dk=r("save-state"),Ak=r("disable"),Mk=r("enable"),Fk={formActionEvent:Wb,saveState:Dk,disable:Ak,enable:Mk},Ik=function(n,e){var o=function(n,t,o,r){return Dg(hk({name:n,text:n,disabled:o,primary:r,icon:y.none(),borderless:!1},t,e))},i=function(n,t,o,r){return Dg(gk({name:n,icon:y.some(n),tooltip:y.some(t),disabled:r,primary:!1,borderless:!1},o,e))},u=function(n,t){n.map(function(n){var e=n.get(t);e.hasConfigured(rh)&&rh.disable(e)})},a=function(n,t){n.map(function(n){var e=n.get(t);e.hasConfigured(rh)&&rh.enable(e)})},c={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},s=t,f=function(n,t,e){Mo(n,t,e)},l=function(n){return Ao(n,Fk.disable())},d=function(n){return Ao(n,Fk.enable())},m=function(n,t){l(n),f(n,Bk.transform(),{transform:t}),d(n)},g=function(n){return function(){tn.getOpt(n).each(function(n){Dm.set(n,[Z])})}},p=function(n,t){l(n),f(n,Bk.transformApply(),{transform:t,swap:g(n)}),d(n)},h=function(){return o("Back",function(n){return f(n,Bk.back(),{swap:g(n)})},!1,!1)},v=function(){return Dg({dom:{tag:"div",classes:["tox-spacer"]},behaviours:Pa([rh.config({})])})},b=function(){return o("Apply",function(n){return f(n,Bk.apply(),{swap:g(n)})},!0,!0)},x=function(){return function(t){var e=n.getRect();return function(n,t,e,o,r){return zS(n,t,e,o,r)}(t,e.x,e.y,e.w,e.h)}},w=[h(),v(),o("Apply",function(t){var e=x();p(t,e),n.hideCrop()},!1,!0)],S=Bb.sketch({dom:c,components:w.map(function(n){return n.asSpec()}),containerBehaviours:Pa([Am("image-tools-crop-buttons-events",[No(Fk.disable(),function(n,t){u(w,n)}),No(Fk.enable(),function(n,t){a(w,n)})])])}),k=Dg(Ek({name:"size",label:y.none(),constrain:!0,disabled:!1},e)),C=[h(),v(),k,v(),o("Apply",function(n){k.getOpt(n).each(function(t){var e=bf.getValue(t),o=function(n,t){return function(e){return XS(e,n,t)}}(parseInt(e.width,10),parseInt(e.height,10));p(n,o)})},!1,!0)],O=Bb.sketch({dom:c,components:C.map(function(n){return n.asSpec()}),containerBehaviours:Pa([Am("image-tools-resize-buttons-events",[No(Fk.disable(),function(n,t){u(C,n)}),No(Fk.enable(),function(n,t){a(C,n)})])])}),_=function(n,t){return function(e){return n(e,t)}},T=_(GS,"h"),E=_(GS,"v"),B=_(YS,-90),D=_(YS,90),A=function(n,t){!function(n,t){l(n),f(n,Bk.tempTransform(),{transform:t}),d(n)}(n,t)},M=[h(),v(),i("flip-horizontally","Flip horizontally",function(n){A(n,T)},!1),i("flip-vertically","Flip vertically",function(n){A(n,E)},!1),i("rotate-left","Rotate counterclockwise",function(n){A(n,B)},!1),i("rotate-right","Rotate clockwise",function(n){A(n,D)},!1),v(),b()],F=Bb.sketch({dom:c,components:M.map(function(n){return n.asSpec()}),containerBehaviours:Pa([Am("image-tools-fliprotate-buttons-events",[No(Fk.disable(),function(n,t){u(M,n)}),No(Fk.enable(),function(n,t){a(M,n)})])])}),I=function(n,t,o,i,u){var a=Ew.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(n)}}),c=Ew.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),s=Ew.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Dg(Ew.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:o,maxX:u,getInitialValue:r({x:r(i)})},components:[a,c,s],sliderBehaviours:Pa([Vm.config({})]),onChoose:t}))},R=function(n,t,e,o,r){return I(n,function(n,e,o){var r=_(t,o.x()/100);m(n,r)},e,o,r)},V=function(n,t,e,o,r){var i=function(n,t,e,o,r){return[h(),R(n,t,e,o,r),b()]}(n,t,e,o,r);return Bb.sketch({dom:c,components:i.map(function(n){return n.asSpec()}),containerBehaviours:Pa([Am("image-tools-filter-panel-buttons-events",[No(Fk.disable(),function(n,t){u(i,n)}),No(Fk.enable(),function(n,t){a(i,n)})])])})},P=[h(),v(),b()],H=Bb.sketch({dom:c,components:P.map(function(n){return n.asSpec()})}),z=V("Brightness",US,-100,0,100),N=V("Contrast",WS,-100,0,100),L=V("Gamma",jS,-100,0,100),j=function(n,t,e){return function(o){return function(n,t,e,o){return FS(n,t,e,o)}(o,n,t,e)}},U=function(n){return I(n,function(n,t,e){var o=W.getOpt(n),r=X.getOpt(n),i=G.getOpt(n);o.each(function(t){r.each(function(e){i.each(function(o){var r=bf.getValue(t).x()/100,i=bf.getValue(o).x()/100,u=bf.getValue(e).x()/100,a=j(r,i,u);m(n,a)})})})},0,100,200)},W=U("R"),G=U("G"),X=U("B"),Y=[h(),W,G,X,b()],q=Bb.sketch({dom:c,components:Y.map(function(n){return n.asSpec()})}),K=function(n,t,e){return function(o){f(o,Bk.swap(),{transform:t,swap:function(){tn.getOpt(o).each(function(t){Dm.set(t,[n]),e(t)})}})}},J=y.some(LS),$=y.some(NS),Q=[i("crop","Crop",K(S,y.none(),function(t){n.showCrop()}),!1),i("resize","Resize",K(O,y.none(),function(t){k.getOpt(t).each(function(t){var e=n.getMeasurements(),o=e.width,r=e.height;bf.setValue(t,{width:o,height:r})})}),!1),i("orientation","Orientation",K(F,y.none(),s),!1),i("brightness","Brightness",K(z,y.none(),s),!1),i("sharpen","Sharpen",K(H,J,s),!1),i("contrast","Contrast",K(N,y.none(),s),!1),i("color-levels","Color levels",K(q,y.none(),s),!1),i("gamma","Gamma",K(L,y.none(),s),!1),i("invert","Invert",K(H,$,s),!1)],Z=Bb.sketch({dom:c,components:Q.map(function(n){return n.asSpec()})}),nn=Bb.sketch({dom:{tag:"div"},components:[Z],containerBehaviours:Pa([Dm.config({})])}),tn=Dg(nn);return{memContainer:tn,getApplyButton:function(n){return tn.getOpt(n).map(function(n){var t=n.components()[0];return t.components()[t.components().length-1]})}}},Rk=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),Vk=tinymce.util.Tools.resolve("tinymce.geom.Rect"),Pk=tinymce.util.Tools.resolve("tinymce.util.Observable"),Hk=tinymce.util.Tools.resolve("tinymce.util.Tools"),zk=tinymce.util.Tools.resolve("tinymce.util.VK");function Nk(n){var t,e;if(n.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),e=0;e<t.length;e++)n[t[e]]=n.changedTouches[0][t[e]]}function Lk(t,e){var o,r,i,u,a=e.document||n.document;e=e||{};var c=a.getElementById(e.handle||t),s=function(n){if(Nk(n),n.button!==r)return f(n);n.deltaX=n.screenX-i,n.deltaY=n.screenY-u,n.preventDefault(),e.drag(n)},f=function(n){Nk(n),Rk(a).off("mousemove touchmove",s).off("mouseup touchend",f),o.remove(),e.stop&&e.stop(n)};this.destroy=function(){Rk(c).off()},Rk(c).on("mousedown touchstart",function(t){var l,d=function(n){var t=Math.max,e=n.documentElement,o=n.body,r=t(e.scrollWidth,o.scrollWidth),i=t(e.clientWidth,o.clientWidth),u=t(e.offsetWidth,o.offsetWidth),a=t(e.scrollHeight,o.scrollHeight),c=t(e.clientHeight,o.clientHeight);return{width:r<u?i:r,height:a<t(e.offsetHeight,o.offsetHeight)?c:a}}(a);Nk(t),t.preventDefault(),r=t.button;var m=c;i=t.screenX,u=t.screenY,l=n.window.getComputedStyle?n.window.getComputedStyle(m,null).getPropertyValue("cursor"):m.runtimeStyle.cursor,o=Rk("<div></div>").css({position:"absolute",top:0,left:0,width:d.width,height:d.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(a.body),Rk(a).on("mousemove touchmove",s).on("mouseup touchend",f),e.start(t)})}var jk=0,Uk=function(n,t,e,o,r){var i,u="tox-",a=u+"crid-"+jk++,c=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],s=["top","right","bottom","left"],f=function(n,t){return{x:t.x+n.x,y:t.y+n.y,w:t.w,h:t.h}},l=function(n,t){return{x:t.x-n.x,y:t.y-n.y,w:t.w,h:t.h}};function d(t,o,r,i){var u,a,c,s,f;u=o.x,a=o.y,c=o.w,s=o.h,u+=r*t.deltaX,a+=i*t.deltaY,(c+=r*t.deltaW)<20&&(c=20),(s+=i*t.deltaH)<20&&(s=20),f=n=Vk.clamp({x:u,y:a,w:c,h:s},e,"move"===t.name),f=l(e,f),h.fire("updateRect",{rect:f}),p(f)}function m(n){function e(n,t){t.h<0&&(t.h=0),t.w<0&&(t.w=0),Rk("#"+a+"-"+n,o).css({left:t.x,top:t.y,width:t.w,height:t.h})}Hk.each(c,function(t){Rk("#"+a+"-"+t.name,o).css({left:n.w*t.xMul+n.x,top:n.h*t.yMul+n.y})}),e("top",{x:t.x,y:t.y,w:t.w,h:n.y-t.y}),e("right",{x:n.x+n.w,y:n.y,w:t.w-n.x-n.w+t.x,h:n.h}),e("bottom",{x:t.x,y:n.y+n.h,w:t.w,h:t.h-n.y-n.h+t.y}),e("left",{x:t.x,y:n.y,w:n.x-t.x,h:n.h}),e("move",n)}function g(t){m(n=t)}function p(n){g(f(e,n))}Rk('<div id="'+a+'" class="'+u+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(o),Hk.each(s,function(n){Rk("#"+a,o).append('<div id="'+a+"-"+n+'"class="'+u+'croprect-block" style="display: none" data-mce-bogus="all">')}),Hk.each(c,function(n){Rk("#"+a,o).append('<div id="'+a+"-"+n.name+'" class="'+u+"croprect-handle "+u+"croprect-handle-"+n.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+n.label+'" aria-grabbed="false" title="'+n.label+'">')}),i=Hk.map(c,function(t){var e;return new Lk(a,{document:o.ownerDocument,handle:a+"-"+t.name,start:function(){e=n},drag:function(n){d(t,e,n.deltaX,n.deltaY)}})}),m(n),Rk(o).on("focusin focusout",function(n){Rk(n.target).attr("aria-grabbed","focus"===n.type?"true":"false")}),Rk(o).on("keydown",function(t){var e;function o(n,t,o,r,i){n.stopPropagation(),n.preventDefault(),d(e,o,r,i)}switch(Hk.each(c,function(n){if(t.target.id===a+"-"+n.name)return e=n,!1}),t.keyCode){case zk.LEFT:o(t,0,n,-10,0);break;case zk.RIGHT:o(t,0,n,10,0);break;case zk.UP:o(t,0,n,0,-10);break;case zk.DOWN:o(t,0,n,0,10);break;case zk.ENTER:case zk.SPACEBAR:t.preventDefault(),r()}});var h=Hk.extend({toggleVisibility:function(n){var t=Hk.map(c,function(n){return"#"+a+"-"+n.name}).concat(Hk.map(s,function(n){return"#"+a+"-"+n})).join(",");n?Rk(t,o).show():Rk(t,o).hide()},setClampRect:function(t){e=t,m(n)},setRect:g,getInnerRect:function(){return l(e,n)},setInnerRect:p,setViewPortRect:function(e){t=e,m(n)},destroy:function(){Hk.each(i,function(n){n.destroy()}),i=[]}},Pk);return h},Wk=function(n){var t=Dg({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),e=ie(1),o=ie(y.none()),r=ie({x:0,y:0,w:1,h:1}),i=ie({x:0,y:0,w:1,h:1}),u=function(n,i){s.getOpt(n).each(function(n){var u=e.get(),a=fu(n.element()),c=eu(n.element()),s=i.dom().naturalWidth*u,f=i.dom().naturalHeight*u,l=Math.max(0,a/2-s/2),d=Math.max(0,c/2-f/2),m={left:l.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:f.toString()+"px",position:"absolute"};Ai(i,m),t.getOpt(n).each(function(n){Ai(n.element(),m)}),o.get().each(function(n){var t=r.get();n.setRect({x:t.x*u+l,y:t.y*u+d,w:t.w*u,h:t.h*u}),n.setClampRect({x:l,y:d,w:s,h:f}),n.setViewPortRect({x:0,y:0,w:a,h:c})})})},a=function(n,t){var o,a=ae.fromTag("img");return Sr(a,"src",t),(o=a.dom(),new qg(function(n){var t=function(){o.removeEventListener("load",t),n(o)};o.complete?n(o):o.addEventListener("load",t)})).then(function(){return s.getOpt(n).map(function(n){var t=Ji({element:a});Dm.replaceAt(n,1,y.some(t));var o=i.get(),c={x:0,y:0,w:a.dom().naturalWidth,h:a.dom().naturalHeight};i.set(c);var f=Vk.inflate(c,-20,-20);return r.set(f),o.w===c.w&&o.h===c.h||function(n,t){s.getOpt(n).each(function(n){var o=fu(n.element()),r=eu(n.element()),i=t.dom().naturalWidth,u=t.dom().naturalHeight,a=Math.min(o/i,r/u);a>=1?e.set(1):e.set(a)})}(n,a),u(n,a),a})})},c=Bb.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[t.asSpec(),{dom:{tag:"img",attributes:{src:n}}},{dom:{tag:"div"},behaviours:Pa([Am("image-panel-crop-events",[Yo(function(n){s.getOpt(n).each(function(n){var t=n.element().dom(),i=Uk({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t,function(){});i.toggleVisibility(!1),i.on("updateRect",function(n){var t=n.rect,o=e.get(),i={x:Math.round(t.x/o),y:Math.round(t.y/o),w:Math.round(t.w/o),h:Math.round(t.h/o)};r.set(i)}),o.set(y.some(i))})})])])}],containerBehaviours:Pa([Dm.config({}),Am("image-panel-events",[Yo(function(t){a(t,n)})])])}),s=Dg(c);return{memContainer:s,updateSrc:a,zoom:function(n,t){var o=e.get(),r=t>0?Math.min(2,o+.1):Math.max(.1,o-.1);e.set(r),s.getOpt(n).each(function(n){var t=n.components()[1].element();u(n,t)})},showCrop:function(){o.get().each(function(n){n.toggleVisibility(!0)})},hideCrop:function(){o.get().each(function(n){n.toggleVisibility(!1)})},getRect:function(){return r.get()},getMeasurements:function(){var n=i.get();return{width:n.w,height:n.h}}}},Gk=function(n,t,e,o,r){return gk({name:n,icon:y.some(t),disabled:e,tooltip:y.some(n),primary:!1,borderless:!1},o,r)},Xk=function(n,t){t?rh.enable(n):rh.disable(n)};var Yk,qk,Kk=function(t){var e=ie(t),o=ie(y.none()),r=function(){var n=[],t=-1;function e(){return t>0}function o(){return-1!==t&&t<n.length-1}return{data:n,add:function(e){var o=n.splice(++t);return n.push(e),{state:e,removed:o}},undo:function(){if(e())return n[--t]},redo:function(){if(o())return n[++t]},canUndo:e,canRedo:o}}();r.add(t);var i=function(n){e.set(n)},u=function(t){return{blob:t,url:n.URL.createObjectURL(t)}},a=function(t){n.URL.revokeObjectURL(t.url)},c=function(){o.get().each(a),o.set(y.none())},s=function(n){var t=u(n);i(t);var e,o=r.add(t).removed;return e=o,Hk.each(e,a),t.url};return{getBlobState:function(){return e.get()},setBlobState:i,addBlobState:s,getTempState:function(){return o.get().fold(function(){return e.get()},function(n){return n})},updateTempState:function(n){var t=u(n);return c(),o.set(y.some(t)),t.url},addTempState:function(n){var t=u(n);return o.set(y.some(t)),t.url},applyTempState:function(n){return o.get().fold(function(){},function(t){s(t.blob),n()})},destroyTempState:c,undo:function(){var n=r.undo();return i(n),n.url},redo:function(){var n=r.redo();return i(n),n.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}},Jk=function(e,o){var r=Kk(e.currentState),i=function(n){var t=r.getHistoryStates();g.updateButtonUndoStates(n,t.undoEnabled,t.redoEnabled),Mo(n,Fk.formActionEvent,{name:Fk.saveState(),value:t.undoEnabled})},u=function(n){return n.toBlob()},a=function(n){Mo(n,Fk.formActionEvent,{name:Fk.disable(),value:{}})},c=function(n){p.getApplyButton(n).each(function(n){rh.enable(n)}),Mo(n,Fk.formActionEvent,{name:Fk.enable(),value:{}})},s=function(n,t){return a(n),m.updateSrc(n,t)},f=function(t,e,o,r,f){return a(t),function(n){return xS(n)}(e).then(o).then(u).then(r).then(function(n){return s(t,n).then(function(n){return i(t),f(),c(t),n})}).catch(function(e){return n.console.log(e),c(t),e})},l=function(n,t,e){var o=r.getBlobState().blob;f(n,o,t,function(n){return r.updateTempState(n)},e)},d=function(n){var t=r.getBlobState().url;return r.destroyTempState(),i(n),t},m=Wk(e.currentState.url),g=function(n){var t=Dg(Gk("Undo","undo",!0,function(n){Mo(n,Bk.undo(),{direction:1})},n)),e=Dg(Gk("Redo","redo",!0,function(n){Mo(n,Bk.redo(),{direction:1})},n));return{container:Bb.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[t.asSpec(),e.asSpec(),Gk("Zoom in","zoom-in",!1,function(n){Mo(n,Bk.zoom(),{direction:1})},n),Gk("Zoom out","zoom-out",!1,function(n){Mo(n,Bk.zoom(),{direction:-1})},n)]}),updateButtonUndoStates:function(n,o,r){t.getOpt(n).each(function(n){Xk(n,o)}),e.getOpt(n).each(function(n){Xk(n,r)})}}}(o),p=Ik(m,o);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[p.memContainer.asSpec(),m.memContainer.asSpec(),g.container],behaviours:Pa([bf.config({store:{mode:"manual",getValue:function(){return r.getBlobState()}}}),Am("image-tools-events",[No(Bk.undo(),function(n,t){var e=r.undo();s(n,e).then(function(t){c(n),i(n)})}),No(Bk.redo(),function(n,t){var e=r.redo();s(n,e).then(function(t){c(n),i(n)})}),No(Bk.zoom(),function(n,t){var e=t.event().direction();m.zoom(n,e)}),No(Bk.back(),function(n,t){!function(n){var t=d(n);s(n,t).then(function(t){c(n)})}(n),t.event().swap()(),m.hideCrop()}),No(Bk.apply(),function(n,t){r.applyTempState(function(){d(n),t.event().swap()()})}),No(Bk.transform(),function(n,e){return l(n,e.event().transform(),t)}),No(Bk.tempTransform(),function(n,e){return function(n,e){var o=r.getTempState().blob;f(n,o,e,function(n){return r.addTempState(n)},t)}(n,e.event().transform())}),No(Bk.transformApply(),function(n,t){return function(n,t,e){var o=r.getBlobState().blob;f(n,o,t,function(t){var e=r.addBlobState(t);return d(n),e},e)}(n,t.event().transform(),t.event().swap())}),No(Bk.swap(),function(n,t){!function(n){g.updateButtonUndoStates(n,!1,!1)}(n);var e=t.event().transform(),o=t.event().swap();e.fold(function(){o()},function(t){l(n,t,o)})})]),Nw()])}},$k=Sl({name:"HtmlSelect",configFields:[Vt("options"),yf("selectBehaviours",[Vm,bf]),Jt("selectClasses",[]),Jt("selectAttributes",{}),Wt("data")],factory:function(n,t){var e=N(n.options,function(n){return{dom:{tag:"option",value:n.value,innerHtml:n.text}}}),o=n.data.map(function(n){return Xn("initialValue",n)}).getOr({});return{uid:n.uid,dom:{tag:"select",classes:n.selectClasses,attributes:n.selectAttributes},components:e,behaviours:wf(n.selectBehaviours,[Vm.config({}),bf.config({store:d({mode:"manual",getValue:function(n){return Ni(n.element())},setValue:function(t,e){X(n.options,function(n){return n.value===e}).isSome()&&Li(t.element(),e)}},o)})])}}}),Qk=function(n,t){var e=n.label.map(function(n){return Nb(n,t)}),o=[rh.config({disabled:function(){return n.disabled||t.isReadOnly()}}),Mh(),Om.config({mode:"execution",useEnter:!0!==n.multiline,useControlEnter:!0===n.multiline,execute:function(n){return Ao(n,Gb),y.some(!0)}}),Am("textfield-change",[No(Ze(),function(t,e){Mo(t,Lb,{name:n.name})}),No(ao(),function(t,e){Mo(t,Lb,{name:n.name})})]),Vb.config({})],i=n.validation.map(function(n){return wy.config({getRoot:function(n){return ar(n.element())},invalidClass:"tox-invalid",validator:{validate:function(t){var e=bf.getValue(t),o=n.validator(e);return ly(!0===o?an.value(e):an.error(o))},validateOnLoad:n.validateOnLoad}})}).toArray(),u=n.placeholder.fold(r({}),function(n){return{placeholder:t.translate(n)}}),a=n.inputMode.fold(r({}),function(n){return{inputmode:n}}),c=d(d({},u),a),s=Fb.parts().field({tag:!0===n.multiline?"textarea":"input",inputAttributes:c,inputClasses:[n.classname],inputBehaviours:Pa(q([o,i])),selectOnFocus:!1,factory:ty}),f=(n.flex?["tox-form__group--stretched"]:[]).concat(n.maximized?["tox-form-group--maximize"]:[]),l=[rh.config({disabled:function(){return n.disabled||t.isReadOnly()},onDisabled:function(n){Fb.getField(n).each(rh.disable)},onEnabled:function(n){Fb.getField(n).each(rh.enable)}}),Mh()];return Pb(e,s,f,l)},Zk=Object.freeze({__proto__:null,events:function(n,t){var e=n.stream.streams.setup(n,t);return Po([No(n.event,e),qo(function(){return t.cancel()})].concat(n.cancelEvent.map(function(n){return[No(n,function(){return t.cancel()})]}).getOr([])))}}),nC=function(n){var t=ie(null);return $r({readState:function(){return{timer:null!==t.get()?"set":"unset"}},setTimer:function(n){t.set(n)},cancel:function(){var n=t.get();null!==n&&n.cancel()}})},tC=Object.freeze({__proto__:null,throttle:nC,init:function(n){return n.stream.streams.state(n)}}),eC=[Pt("stream",_t("mode",{throttle:[Vt("delay"),Jt("stopEvent",!0),na("streams",{setup:function(n,t){var e=n.stream,o=Pg(n.onStream,e.delay);return t.setTimer(o),function(n,t){o.throttle(n,t),e.stopEvent&&t.stop()}},state:nC})]})),Jt("event","input"),Wt("cancelEvent"),Qu("onStream")],oC=za({fields:eC,name:"streaming",active:Zk,state:tC}),rC=function(n,t,e){var o=bf.getValue(e);bf.setValue(t,o),uC(t)},iC=function(n,t){var e=n.element(),o=Ni(e),r=e.dom();"number"!==kr(e,"type")&&t(r,o)},uC=function(n){iC(n,function(n,t){return n.setSelectionRange(t.length,t.length)})},aC=function(n,t,e){if(n.selectsOver){var o=bf.getValue(t),r=n.getDisplayText(o),i=bf.getValue(e);return 0===n.getDisplayText(i).indexOf(r)?y.some(function(){rC(0,t,e),function(n,t){iC(n,function(n,e){return n.setSelectionRange(t,e.length)})}(t,r.length)}):y.none()}return y.none()},cC=r("alloy.typeahead.itemexecute"),sC=r([Wt("lazySink"),Vt("fetch"),Jt("minChars",5),Jt("responseTime",1e3),Ju("onOpen"),Jt("getHotspot",y.some),Jt("getAnchorOverrides",r({})),Jt("layouts",y.none()),Jt("eventOrder",{}),oe("model",{},[Jt("getDisplayText",function(n){return void 0!==n.meta&&void 0!==n.meta.text?n.meta.text:n.value}),Jt("selectsOver",!0),Jt("populateFromBrowse",!0)]),Ju("onSetValue"),$u("onExecute"),Ju("onItemExecute"),Jt("inputClasses",[]),Jt("inputAttributes",{}),Jt("inputStyles",{}),Jt("matchWidth",!0),Jt("useMinWidth",!1),Jt("dismissOnBlur",!0),qu(["openClass"]),Wt("initialData"),yf("typeaheadBehaviours",[Vm,bf,oC,Om,qm,Cy]),re("previewing",function(){return ie(!0)})].concat($b()).concat(Vy())),fC=r([qf({schema:[Yu()],name:"menu",overrides:function(n){return{fakeFocus:!0,onHighlight:function(t,e){n.previewing.get()?t.getSystem().getByUid(n.uid).each(function(o){aC(n.model,o,e).fold(function(){return zl.dehighlight(t,e)},function(n){return n()})}):t.getSystem().getByUid(n.uid).each(function(t){n.model.populateFromBrowse&&rC(n.model,t,e)}),n.previewing.set(!1)},onExecute:function(t,e){return t.getSystem().getByUid(n.uid).toOption().map(function(n){return Mo(n,cC(),{item:e}),!0})},onHover:function(t,e){n.previewing.set(!1),t.getSystem().getByUid(n.uid).each(function(t){n.model.populateFromBrowse&&rC(n.model,t,e)})}}}})]),lC=kl({name:"Typeahead",configFields:sC(),partFields:fC(),factory:function(n,e,o,r){var i=function(e,o,i){n.previewing.set(!1);var u=Cy.getCoupled(e,"sandbox");$s.isOpen(u)?El.getCurrent(u).each(function(n){zl.getHighlighted(n).fold(function(){i(n)},function(){Vo(u,n.element(),"keydown",o)})}):Ey(n,a(e),e,u,r,function(n){El.getCurrent(n).each(i)},ry.HighlightFirst).get(t)},u=Qb(n),a=function(n){return function(t){return t.map(function(t){var e=En(t.menus),o=K(e,function(n){return U(n.items,function(n){return"item"===n.type})});return bf.getState(n).update(N(o,function(n){return n.data})),t})}},c=[Vm.config({}),bf.config({onSetValue:n.onSetValue,store:d({mode:"dataset",getDataKey:function(n){return Ni(n.element())},getFallbackEntry:function(n){return{value:n,meta:{}}},setValue:function(t,e){Li(t.element(),n.model.getDisplayText(e))}},n.initialData.map(function(n){return Xn("initialValue",n)}).getOr({}))}),oC.config({stream:{mode:"throttle",delay:n.responseTime,stopEvent:!1},onStream:function(e,o){var i=Cy.getCoupled(e,"sandbox");if(Vm.isFocused(e)&&Ni(e.element()).length>=n.minChars){var u=El.getCurrent(i).bind(function(n){return zl.getHighlighted(n).map(bf.getValue)});n.previewing.set(!0),Ey(n,a(e),e,i,r,function(t){El.getCurrent(i).each(function(t){u.fold(function(){n.model.selectsOver&&zl.highlightFirst(t)},function(n){zl.highlightBy(t,function(t){return bf.getValue(t).value===n.value}),zl.getHighlighted(t).orThunk(function(){return zl.highlightFirst(t),y.none()})})})},ry.HighlightFirst).get(t)}},cancelEvent:po()}),Om.config({mode:"special",onDown:function(n,t){return i(n,t,zl.highlightFirst),y.some(!0)},onEscape:function(n){var t=Cy.getCoupled(n,"sandbox");return $s.isOpen(t)?($s.close(t),y.some(!0)):y.none()},onUp:function(n,t){return i(n,t,zl.highlightLast),y.some(!0)},onEnter:function(t){var e=Cy.getCoupled(t,"sandbox"),o=$s.isOpen(e);if(o&&!n.previewing.get())return El.getCurrent(e).bind(function(n){return zl.getHighlighted(n)}).map(function(n){return Mo(t,cC(),{item:n}),!0});var r=bf.getValue(t);return Ao(t,po()),n.onExecute(e,t,r),o&&$s.close(e),y.some(!0)}}),qm.config({toggleClass:n.markers.openClass,aria:{mode:"expanded"}}),Cy.config({others:{sandbox:function(t){return Iy(n,t,{onOpen:function(){return qm.on(t)},onClose:function(){return qm.off(t)}})}}}),Am("typeaheadevents",[Jo(function(e){var o=t;Dy(n,a(e),e,r,o,ry.HighlightFirst).get(t)}),No(cC(),function(t,e){var o=Cy.getCoupled(t,"sandbox");rC(n.model,t,e.event().item()),Ao(t,po()),n.onItemExecute(t,o,e.event().item(),bf.getValue(t)),$s.close(o),uC(t)})].concat(n.dismissOnBlur?[No(uo(),function(n){var t=Cy.getCoupled(n,"sandbox");Ka(t.element()).isNone()&&$s.close(t)})]:[]))];return{uid:n.uid,dom:ny(Rn(n,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:d(d({},u),wf(n.typeaheadBehaviours,c)),eventOrder:n.eventOrder}}}),dC=function(t){return d(d({},t),{toCached:function(){return dC(t.toCached())},bindFuture:function(n){return dC(t.bind(function(t){return t.fold(function(n){return ly(an.error(n))},function(t){return n(t)})}))},bindResult:function(n){return dC(t.map(function(t){return t.bind(n)}))},mapResult:function(n){return dC(t.map(function(t){return t.map(n)}))},mapError:function(n){return dC(t.map(function(t){return t.mapError(n)}))},foldResult:function(n,e){return t.map(function(t){return t.fold(n,e)})},withTimeout:function(e,o){return dC(fy(function(r){var i=!1,u=n.setTimeout(function(){i=!0,r(an.error(o()))},e);t.get(function(t){i||(n.clearTimeout(u),r(t))})}))}})},mC=function(n){return dC(fy(n))},gC=mC,pC={type:"separator"},hC=function(n){return{type:"menuitem",value:n.url,text:n.title,meta:{attach:n.attach},onAction:function(){}}},vC=function(n,t){return{type:"menuitem",value:t,text:n,meta:{attach:void 0},onAction:function(){}}},bC=function(n,t){return function(n){return N(n,hC)}(function(n,t){return U(t,function(t){return t.type===n})}(n,t))},yC=function(n){return bC("header",n.targets)},xC=function(n){return bC("anchor",n.targets)},wC=function(n){return y.from(n.anchorTop).map(function(n){return vC("<top>",n)}).toArray()},SC=function(n){return y.from(n.anchorBottom).map(function(n){return vC("<bottom>",n)}).toArray()},kC=function(n,t){var e=n.toLowerCase();return U(t,function(n){var t=void 0!==n.meta&&void 0!==n.meta.text?n.meta.text:n.text;return be(t.toLowerCase(),e)||be(n.value.toLowerCase(),e)})},CC=function(n,t,e){var o=bf.getValue(t),r=void 0!==o.meta.text?o.meta.text:o.value;return e.getLinkInformation().fold(function(){return[]},function(t){var o,i=kC(r,function(n){return N(n,function(n){return vC(n,n)})}(e.getHistory(n)));return"file"===n?(o=[i,kC(r,yC(t)),kC(r,q([wC(t),xC(t),SC(t)]))],G(o,function(n,t){return 0===n.length||0===t.length?n.concat(t):n.concat(pC,t)},[])):i})},OC=Fr("aria-invalid"),_C=function(n){return function(t,e,o){return Bn(e,"name").fold(function(){return n(e,o)},function(r){return t.field(r,n(e,o))})}},TC={bar:_C(function(n,t){return function(n,t){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:N(n.items,t.interpreter)}}(n,t.shared)}),collection:_C(function(n,t){return Jb(n,t.shared.providers)}),alertbanner:_C(function(n,t){return function(n,t){return Bb.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+n.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Bg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Mg(n.icon,t.icons),attributes:{title:t.translate(n.iconTooltip)}},action:function(t){Mo(t,Wb,{name:"alert-banner",value:n.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:t.translate(n.text)}}]})}(n,t.shared.providers)}),input:_C(function(n,t){return function(n,t){return Qk({name:n.name,multiline:!1,label:n.label,inputMode:n.inputMode,placeholder:n.placeholder,flex:!1,disabled:n.disabled,classname:"tox-textfield",validation:y.none(),maximized:n.maximized},t)}(n,t.shared.providers)}),textarea:_C(function(n,t){return function(n,t){return Qk({name:n.name,multiline:!0,label:n.label,inputMode:y.none(),placeholder:n.placeholder,flex:!0,disabled:n.disabled,classname:"tox-textarea",validation:y.none(),maximized:n.maximized},t)}(n,t.shared.providers)}),label:_C(function(n,t){return function(n,t){var e={dom:{tag:"label",innerHtml:t.providers.translate(n.label),classes:["tox-label"]}},o=N(n.items,t.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[e].concat(o),behaviours:Pa([Nw(),Dm.config({}),$w(y.none()),Om.config({mode:"acyclic"})])}}(n,t.shared)}),iframe:function(n){return function(t,e,o){var r=Rn(e,{source:"dynamic"});return _C(n)(t,r,o)}}(function(n,t){return cS(n,t.shared.providers)}),button:_C(function(n,t){return yk(n,t.shared.providers)}),checkbox:_C(function(n,t){return function(n,t){var e=bf.config({store:{mode:"manual",getValue:function(n){return n.element().dom().checked},setValue:function(n,t){n.element().dom().checked=t}}}),o=function(n){return n.element().dom().click(),y.some(!0)},r=Fb.parts().field({factory:{sketch:i},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:Pa([Nw(),rh.config({disabled:function(){return n.disabled||t.isReadOnly()}}),Vb.config({}),Vm.config({}),e,Om.config({mode:"special",onEnter:o,onSpace:o,stopSpaceKeyup:!0}),Am("checkbox-events",[No(no(),function(t,e){Mo(t,Lb,{name:n.name})})])])}),u=Fb.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:t.translate(n.label)},behaviours:Pa([Ly.config({})])}),a=function(n){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+n],innerHtml:Mg("checked"===n?"selected":"unselected",t.icons)}}},c=Dg({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return Fb.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[r,c.asSpec(),u],fieldBehaviours:Pa([rh.config({disabled:function(){return n.disabled||t.isReadOnly()},disableClass:"tox-checkbox--disabled",onDisabled:function(n){Fb.getField(n).each(rh.disable)},onEnabled:function(n){Fb.getField(n).each(rh.enable)}}),Mh()])})}(n,t.shared.providers)}),colorinput:_C(function(n,t){return Gy(n,t.shared,t.colorinput)}),colorpicker:_C(function(t){var e=function(n){return"tox-"+n},o=zw(Ww,e),r=Dg(o.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(n){Mo(n,Wb,{name:"hex-valid",value:!0})},onInvalidHex:function(n){Mo(n,Wb,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:Pa([bf.config({store:{mode:"manual",getValue:function(n){var t=r.get(n);return El.getCurrent(t).bind(function(n){return bf.getValue(n).hex}).map(function(n){return"#"+n}).getOr("")},setValue:function(t,e){var o=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),i=r.get(t);El.getCurrent(i).fold(function(){n.console.log("Can not find form")},function(n){bf.setValue(n,{hex:y.from(o[1]).getOr("")}),Fw.getField(n,"hex").each(function(n){Ao(n,Ze())})})}}}),Nw()])}}),dropzone:_C(function(n,t){return Zw(n,t.shared.providers)}),grid:_C(function(n,t){return function(n,t){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+n.columns+"col"]},components:N(n.items,t.interpreter)}}(n,t.shared)}),selectbox:_C(function(n,t){return function(n,t){var e=N(n.items,function(n){return{text:t.translate(n.text),value:n.value}}),o=n.label.map(function(n){return Nb(n,t)}),r=Fb.parts().field({dom:{},selectAttributes:{size:n.size},options:e,factory:$k,selectBehaviours:Pa([rh.config({disabled:function(){return n.disabled||t.isReadOnly()}}),Vb.config({}),Am("selectbox-change",[No(no(),function(t,e){Mo(t,Lb,{name:n.name})})])])}),i=n.size>1?y.none():y.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:Mg("chevron-down",t.icons)}}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:q([[r],i.toArray()])};return Fb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:q([o.toArray(),[u]]),fieldBehaviours:Pa([rh.config({disabled:function(){return n.disabled||t.isReadOnly()},onDisabled:function(n){Fb.getField(n).each(rh.disable)},onEnabled:function(n){Fb.getField(n).each(rh.enable)}}),Mh()])})}(n,t.shared.providers)}),sizeinput:_C(function(n,t){return Ek(n,t.shared.providers)}),urlinput:_C(function(n,e){return function(n,e,o){var r,i,u,a,c,s=e.shared.providers,f=function(t){var e=bf.getValue(t);o.addToHistory(e.value,n.filetype)},l=Fb.parts().field({factory:lC,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":OC,type:"url"},minChars:0,responseTime:0,fetch:function(t){var r=CC(n.filetype,t,o),i=ck(r,up.BUBBLE_TO_SANDBOX,e,!1);return ly(i)},getHotspot:function(n){return b.getOpt(n)},onSetValue:function(n,e){n.hasConfigured(wy)&&wy.run(n).get(t)},typeaheadBehaviours:Pa(q([o.getValidationHandler().map(function(t){return wy.config({getRoot:function(n){return ar(n.element())},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(n,t){g.getOpt(n).each(function(n){Sr(n.element(),"title",s.translate(t))})}},validator:{validate:function(e){var o=bf.getValue(e);return gC(function(e){t({type:n.filetype,url:o.value},function(n){if("invalid"===n.status){var t=an.error(n.message);e(t)}else{var o=an.value(n.message);e(o)}})})},validateOnLoad:!1}})}).toArray(),[rh.config({disabled:function(){return n.disabled||s.isReadOnly()}}),Vb.config({}),Am("urlinput-events",q(["file"===n.filetype?[No(Ze(),function(t){Mo(t,Lb,{name:n.name})})]:[],[No(no(),function(t){Mo(t,Lb,{name:n.name}),f(t)}),No(ao(),function(t){Mo(t,Lb,{name:n.name}),f(t)})]]))]])),eventOrder:(r={},r[Ze()]=["streaming","urlinput-events","invalidating"],r),model:{getDisplayText:function(n){return n.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:bp(0,0,"normal")},onExecute:function(n,t,e){Mo(t,Gb,{})},onItemExecute:function(t,e,o,r){f(t),Mo(t,Lb,{name:n.name})}}),m=n.label.map(function(n){return Nb(n,s)}),g=Dg((i="invalid",u=y.some(OC),void 0===(a="warning")&&(a=i),void 0===c&&(c=i),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+i],innerHtml:Mg(a,s.icons),attributes:d({title:s.translate(c),"aria-live":"polite"},u.fold(function(){return{}},function(n){return{id:n}}))}})),p=Dg({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[g.asSpec()]}),h=o.getUrlPicker(n.filetype),v=Fr("browser.url.event"),b=Dg({dom:{tag:"div",classes:["tox-control-wrap"]},components:[l,p.asSpec()],behaviours:Pa([rh.config({disabled:function(){return n.disabled||s.isReadOnly()}})])}),x=Dg(hk({name:n.name,icon:y.some("browse"),text:n.label.getOr(""),disabled:n.disabled,primary:!1,borderless:!0},function(n){return Ao(n,v)},s,[],["tox-browse-url"]));return Fb.sketch({dom:zb([]),components:m.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:q([[b.asSpec()],h.map(function(){return x.asSpec()}).toArray()])}]),fieldBehaviours:Pa([rh.config({disabled:function(){return n.disabled||s.isReadOnly()},onDisabled:function(n){Fb.getField(n).each(rh.disable),x.getOpt(n).each(rh.disable)},onEnabled:function(n){Fb.getField(n).each(rh.enable),x.getOpt(n).each(rh.enable)}}),Mh(),Am("url-input-events",[No(v,function(t){El.getCurrent(t).each(function(e){var o=bf.getValue(e),r=d({fieldname:n.name},o);h.each(function(o){o(r).get(function(o){bf.setValue(e,o),Mo(t,Lb,{name:n.name})})})})})])])})}(n,e,e.urlinput)}),customeditor:_C(function(n){var t=ie(y.none()),e=Dg({dom:{tag:n.tag}}),o=ie(y.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Pa([Am("editor-foo-events",[Yo(function(r){e.getOpt(r).each(function(e){(!function(n){return Object.prototype.hasOwnProperty.call(n,"init")}(n)?Gw.load(n.scriptId,n.scriptUrl).then(function(t){return t(e.element().dom(),n.settings)}):n.init(e.element().dom())).then(function(n){o.get().each(function(t){n.setValue(t)}),o.set(y.none()),t.set(y.some(n))})})})]),bf.config({store:{mode:"manual",getValue:function(){return t.get().fold(function(){return o.get().getOr("")},function(n){return n.getValue()})},setValue:function(n,e){t.get().fold(function(){o.set(y.some(e))},function(n){return n.setValue(e)})}}}),Nw()]),components:[e.asSpec()]}}),htmlpanel:_C(function(n){return"presentation"===n.presets?Bb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:n.html}}):Bb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:n.html,attributes:{role:"document"}},containerBehaviours:Pa([Vb.config({}),Vm.config({})])})}),imagetools:_C(function(n,t){return Jk(n,t.shared.providers)}),table:_C(function(n,t){return function(n,t){var e,o,r=function(n){return{dom:{tag:"th",innerHtml:t.translate(n)}}},i=function(n){return{dom:{tag:"td",innerHtml:t.translate(n)}}},u=function(n){return{dom:{tag:"tr"},components:N(n,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(o=n.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:N(o,r)}]}),(e=n.cells,{dom:{tag:"tbody"},components:N(e,u)})],behaviours:Pa([Vb.config({}),Vm.config({})])}}(n,t.shared.providers)}),panel:_C(function(n,t){return function(n,t){return{dom:{tag:"div",classes:n.classes},components:N(n.items,t.shared.interpreter)}}(n,t)})},EC={field:function(n,t){return t}},BC=function(n,t,e){var o=Rn(e,{shared:{interpreter:function(t){return DC(n,t,o)}}});return DC(n,t,o)},DC=function(t,e,o){return Bn(TC,e.type).fold(function(){return n.console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e},function(n){return n(t,e,o)})},AC={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},MC=function(n,t,e){var o=yc(-12,12,AC),r={maxHeightFunction:pc()};return function(){return e()?{anchor:"node",root:Ti(or(n())),node:y.from(n()),bubble:o,layouts:{onRtl:function(){return[Og]},onLtr:function(){return[Cg]}},overrides:r}:{anchor:"hotspot",hotspot:t(),bubble:o,layouts:{onRtl:function(){return[xa]},onLtr:function(){return[wa]}},overrides:r}}},FC=function(n,t,e){return function(){return e()?{anchor:"node",root:Ti(or(n())),node:y.from(n()),layouts:{onRtl:function(){return[_g]},onLtr:function(){return[_g]}}}:{anchor:"hotspot",hotspot:t(),layouts:{onRtl:function(){return[Oa]},onLtr:function(){return[Oa]}}}}},IC=function(n,t){return function(){return{anchor:"selection",root:t(),getSelection:function(){var t=n.selection.getRng();return y.some(Ic.range(ae.fromDom(t.startContainer),t.startOffset,ae.fromDom(t.endContainer),t.endOffset))}}}},RC=function(n){return function(t){return{anchor:"node",root:n(),node:t}}},VC=function(n,t,e){var o=Sh(n),r=function(){return ae.fromDom(n.getBody())},i=function(){return ae.fromDom(n.getContentAreaContainer())},u=function(){return o||!e()};return{inlineDialog:MC(i,t,u),banner:FC(i,t,u),cursor:IC(n,r),node:RC(r)}},PC=function(n){return function(t,e){Gv(n)(t,e)}},HC=function(n){return function(){return Rv(n)}},zC=function(n){return function(){return Vv(n)}},NC=function(n){return function(){return Hv(n)}},LC=function(n){return{colorPicker:PC(n),hasCustomColors:HC(n),getColors:zC(n),getColorCols:NC(n)}},jC=function(n){return function(){return function(n){return n.getParam("draggable_modal",!1,"boolean")}(n)}},UC=function(n){return{isDraggableModal:jC(n)}},WC=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],GC=function(n){return G(n,function(n,t){if(Dn(t,"items")){var e=GC(t.items);return{customFormats:n.customFormats.concat(e.customFormats),formats:n.formats.concat([{title:t.title,items:e.formats}])}}if(function(n){return Dn(n,"inline")}(t)||function(n){return Dn(n,"block")}(t)||function(n){return Dn(n,"selector")}(t)){var o="custom-"+t.title.toLowerCase();return{customFormats:n.customFormats.concat([{name:o,format:t}]),formats:n.formats.concat([{title:t.title,format:o,icon:t.icon}])}}return d(d({},n),{formats:n.formats.concat(t)})},{customFormats:[],formats:[]})},XC=function(n){return function(n){return y.from(n.getParam("style_formats")).filter(C)}(n).map(function(t){var e=function(n,t){var e=GC(t),o=function(t){L(t,function(t){n.formatter.has(t.name)||n.formatter.register(t.name,t.format)})};return n.formatter?o(e.customFormats):n.on("init",function(){o(e.customFormats)}),e.formats}(n,t);return function(n){return n.getParam("style_formats_merge",!1,"boolean")}(n)?WC.concat(e):e}).getOr(WC)},YC=function(n,t,e){var o={type:"formatter",isSelected:t(n.format),getStylePreview:e(n.format)};return Rn(n,o)},qC=function(n,t,e,o){var r=function(t){return N(t,function(t){var i=xn(t);if(An(t,"items")){var u=r(t.items);return Rn(function(n){return Rn(n,{type:"submenu"})}(t),{getStyleItems:function(){return u}})}return An(t,"format")?function(n){return YC(n,e,o)}(t):1===i.length&&V(i,"title")?Rn(t,{type:"separator"}):function(t){var r=Fr(t.title),i={type:"formatter",format:r,isSelected:e(r),getStylePreview:o(r)},u=Rn(t,i);return n.formatter.register(r,u),u}(t)})};return r(t)},KC=function(n){var t=function(t){return function(){return n.formatter.match(t)}},e=function(t){return function(){var e=n.formatter.get(t);return void 0!==e?y.some({tag:e.length>0&&(e[0].inline||e[0].block)||"div",styles:n.dom.parseStyle(n.formatter.getCssText(t))}):y.none()}},o=function(n){var t=n.items;return void 0!==t&&t.length>0?K(t,o):[n.format]},r=ie([]),i=ie([]),u=ie([]),a=ie([]),c=ie(!1);n.on("PreInit",function(u){var a=XC(n),c=qC(n,a,t,e);r.set(c),i.set(K(c,o))}),n.on("addStyleModifications",function(r){var i=qC(n,r.items,t,e);u.set(i),c.set(r.replace),a.set(K(i,o))});return{getData:function(){var n=c.get()?[]:r.get(),t=u.get();return n.concat(t)},getFlattenedKeys:function(){var n=c.get()?[]:i.get(),t=a.get();return n.concat(t)}}},JC=Hk.trim,$C=function(n){return function(t){if(t&&1===t.nodeType){if(t.contentEditable===n)return!0;if(t.getAttribute("data-mce-contenteditable")===n)return!0}return!1}},QC=$C("true"),ZC=$C("false"),nO=function(n,t,e,o,r){return{type:n,title:t,url:e,level:o,attach:r}},tO=function(n){return n.innerText||n.textContent},eO=function(n){return function(n){return n&&"A"===n.nodeName&&void 0!==(n.id||n.name)}(n)&&rO(n)},oO=function(n){return n&&/^(H[1-6])$/.test(n.nodeName)},rO=function(n){return function(n){for(;n=n.parentNode;){var t=n.contentEditable;if(t&&"inherit"!==t)return QC(n)}return!1}(n)&&!ZC(n)},iO=function(n){return oO(n)&&rO(n)},uO=function(n){var t=function(n){return n.id?n.id:Fr("h")}(n);return nO("header",tO(n),"#"+t,function(n){return oO(n)?parseInt(n.nodeName.substr(1),10):0}(n),function(){n.id=t})},aO=function(n){var e=n.id||n.name,o=tO(n);return nO("anchor",o||"#"+e,"#"+e,0,t)},cO=function(n){var t,e;return t="h1,h2,h3,h4,h5,h6,a:not([href])",e=n,N(Xc(ae.fromDom(e),t),function(n){return n.dom()})},sO=function(n){return JC(n.title).length>0},fO=function(n){var t=cO(n);return U(function(n){return N(U(n,iO),uO)}(t).concat(function(n){return N(U(n,eO),aO)}(t)),sO)},lO="tinymce-url-history",dO=function(n){return S(n)&&/^https?/.test(n)},mO=function(n){return k(n)&&Tn(n,function(n){return!(C(t=n)&&t.length<=5&&J(t,dO));var t}).isNone()},gO=function(){var t,e=Dv.getItem(lO);if(null===e)return{};try{t=JSON.parse(e)}catch(o){if(o instanceof SyntaxError)return n.console.log("Local storage "+lO+" was not valid JSON",o),{};throw o}return mO(t)?t:(n.console.log("Local storage "+lO+" was not valid format",t),{})},pO=function(n){var t=gO();return Object.prototype.hasOwnProperty.call(t,n)?t[n]:[]},hO=function(n,t){if(dO(n)){var e=gO(),o=Object.prototype.hasOwnProperty.call(e,t)?e[t]:[],r=U(o,function(t){return t!==n});e[t]=[n].concat(r).slice(0,5),function(n){if(!mO(n))throw new Error("Bad format for history:\n"+JSON.stringify(n));Dv.setItem(lO,JSON.stringify(n))}(e)}},vO=function(n){return!!n},bO=function(n){return kn(Hk.makeMap(n,/[, ]/),vO)},yO=function(n){return y.from(function(n){return n.getParam("file_picker_callback")}(n)).filter(E)},xO=function(n,t){var e=function(n){var t=y.some(function(n){return n.getParam("file_picker_types")}(n)).filter(vO),e=y.some(function(n){return n.getParam("file_browser_callback_types")}(n)).filter(vO),o=t.or(e).map(bO);return yO(n).fold(function(){return!1},function(n){return o.fold(function(){return!0},function(n){return xn(n).length>0&&n})})}(n);return O(e)?e?yO(n):y.none():e[t]?yO(n):y.none()},wO=function(n){return y.from(n).filter(S).getOrUndefined()},SO=function(n){return{getHistory:pO,addToHistory:hO,getLinkInformation:function(){return function(n){return function(n){return!1===n.getParam("typeahead_urls")}(n)?y.none():y.some({targets:fO(n.getBody()),anchorTop:wO(Th(n)),anchorBottom:wO(Eh(n))})}(n)},getValidationHandler:function(){return function(n){return y.from(function(n){var t=n.getParam("file_picker_validator_handler",void 0,"function");return void 0===t?n.getParam("filepicker_validator_handler",void 0,"function"):t}(n))}(n)},getUrlPicker:function(t){return function(n,t){return xO(n,t).map(function(e){return function(o){return fy(function(r){var i=d({filetype:t,fieldname:o.fieldname},y.from(o.meta).getOr({}));e.call(n,function(n,t){if(!S(n))throw new Error("Expected value to be string");if(void 0!==t&&!k(t))throw new Error("Expected meta to be a object");r({value:n,meta:t})},o.value,i)})}})}(n,t)}}},kO=function(n,t,e){var o=ie(!1),r=function(n){var t=ie(xh(n)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===t.get()},getDockingMode:t.get,setDockingMode:t.set}}(t),i={shared:{providers:{icons:function(){return t.ui.registry.getAll().icons},menuItems:function(){return t.ui.registry.getAll().menuItems},translate:Wp.translate,isReadOnly:function(){return t.mode.isReadOnly()}},interpreter:function(n){return function(n,t){return DC(EC,n,t)}(n,i)},anchors:VC(t,e,r.isPositionedAtTop),header:r,getSink:function(){return an.value(n)}},urlinput:SO(t),styleselect:KC(t),colorinput:LC(t),dialog:UC(t),isContextMenuOpen:function(){return o.get()},setContextMenuState:function(n){return o.set(n)}};return i},CO=r(function(n,t){!function(n,t){var e=su.max(n,t,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Di(n,"max-width",e+"px")}(n,Math.floor(t))}),OO=r([Vt("items"),qu(["itemSelector"]),yf("tgroupBehaviours",[Om])]),_O=r([Jf({name:"items",unit:"item"})]),TO=kl({name:"ToolbarGroup",configFields:OO(),partFields:_O(),factory:function(n,t,e,o){return{uid:n.uid,dom:n.dom,components:t,behaviours:wf(n.tgroupBehaviours,[Om.config({mode:"flow",selector:n.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),EO=r([Vt("dom"),Jt("shell",!0),yf("toolbarBehaviours",[Dm])]),BO=r([Kf({name:"groups",overrides:function(){return{behaviours:Pa([Dm.config({})])}}})]),DO=kl({name:"Toolbar",configFields:EO(),partFields:BO(),factory:function(t,e,o,r){var i=function(n){return t.shell?y.some(n):al(n,t,"groups")},u=t.shell?{behaviours:[Dm.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:u.components,behaviours:wf(t.toolbarBehaviours,u.behaviours),apis:{setGroups:function(t,e){i(t).fold(function(){throw n.console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(n){Dm.set(n,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,t,e){n.setGroups(t,e)}}}),AO=function(n,t,e){return{within:r(n),extra:r(t),withinWidth:r(e)}},MO=function(n,t,e){var o,i=(o=function(n,t){var o=e(n);return y.some({element:r(n),start:r(t),finish:r(t+o),width:r(o)})},G(n,function(n,t){return o(t,n.len).fold(r(n),function(t){return{len:t.finish(),list:n.list.concat([t])}})},{len:0,list:[]}).list),u=U(i,function(n){return n.finish()<=t}),a=W(u,function(n,t){return n+t.width()},0),c=i.slice(u.length);return{within:r(u),extra:r(c),withinWidth:r(a)}},FO=function(n){return N(n,function(n){return n.element()})},IO=function(n,t,e,o){var r=function(n,t,e){var o=MO(t,n,e);return 0===o.extra().length?y.some(o):y.none()}(n,t,e).getOrThunk(function(){return MO(t,n-e(o),e)}),i=r.within(),u=r.extra(),a=r.withinWidth();return 1===u.length&&u[0].width()<=e(o)?function(n,t,e){var o=FO(n.concat(t));return AO(o,[],e)}(i,u,a):u.length>=1?function(n,t,e,o){var r=FO(n).concat([e]);return AO(r,FO(t),o)}(i,u,o,a):function(n,t,e){return AO(FO(n),[],e)}(i,0,a)},RO=function(n,t){var e=N(t,function(n){return Zi(n)});DO.setGroups(n,e)},VO=function(n,t,e){var o=cl(n,t,"primary"),r=Cy.getCoupled(n,"overflowGroup");Di(o.element(),"visibility","hidden");var i=t.builtGroups.get().concat([r]),u=on(i,function(n){return Ka(n.element()).bind(function(t){return n.getSystem().getByDom(t).toOption()})});e([]),RO(o,i);var a=fu(o.element()),c=IO(a,t.builtGroups.get(),function(n){return fu(n.element())},r);0===c.extra().length?(Dm.remove(o,r),e([])):(RO(o,c.within()),e(c.extra())),Hi(o.element(),"visibility"),zi(o.element()),u.each(Vm.focus)},PO=r([yf("splitToolbarBehaviours",[Cy]),re("builtGroups",function(){return ie([])})]),HO=r([qu(["overflowToggledClass"]),qt("getOverflowBounds"),Vt("lazySink"),re("overflowGroups",function(){return ie([])})].concat(PO())),zO=r([Yf({factory:DO,schema:EO(),name:"primary"}),qf({schema:EO(),name:"overflow"}),qf({name:"overflow-button"}),qf({name:"overflow-group"})]),NO=r([qu(["toggledClass"]),Vt("lazySink"),Nt("fetch"),qt("getBounds"),Kt("fireDismissalEventInstead",[Jt("event",ko())]),_c()]),LO=r([qf({name:"button",overrides:function(n){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:Pa([qm.config({toggleClass:n.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),qf({factory:DO,schema:EO(),name:"toolbar",overrides:function(n){return{toolbarBehaviours:Pa([Om.config({mode:"cyclic",onEscape:function(t){return al(t,n,"button").each(Vm.focus),y.none()}})])}}})]),jO=function(n,t){var e=Cy.getCoupled(n,"toolbarSandbox");$s.isOpen(e)?$s.close(e):$s.open(e,t.toolbar())},UO=function(n,t,e,o){var r=e.getBounds.map(function(n){return n()}),i=e.lazySink(n).getOrDie();Bs.positionWithinBounds(i,{anchor:"hotspot",hotspot:n,layouts:o,overrides:{maxWidthFunction:CO()}},t,r)},WO=function(n,t,e,o,r){DO.setGroups(t,r),UO(n,t,e,o),qm.on(n)},GO=kl({name:"FloatingToolbarButton",factory:function(n,t,e,o){return d(d({},Bg.sketch(d(d({},o.button()),{action:function(n){jO(n,o)},buttonBehaviours:kf({dump:o.button().buttonBehaviours},[Cy.config({others:{toolbarSandbox:function(t){return function(n,t,e){var o=Iu();return{dom:{tag:"div",attributes:{id:o.id}},behaviours:Pa([Om.config({mode:"special",onEscape:function(n){return $s.close(n),y.some(!0)}}),$s.config({onOpen:function(r,i){e.fetch().get(function(r){WO(n,i,e,t.layouts,r),o.link(n.element()),Om.focusIn(i)})},onClose:function(){qm.off(n),Vm.focus(n),o.unlink(n.element())},isPartOf:function(t,e,o){return Vu(e,o)||Vu(n,o)},getAttachPoint:function(){return e.lazySink(n).getOrDie()}}),Ga.config({channels:d(d({},ef(d({isExtraPart:s},e.fireDismissalEventInstead.map(function(n){return{fireEventInstead:{event:n.event}}}).getOr({})))),rf({doReposition:function(){$s.getState(Cy.getCoupled(n,"toolbarSandbox")).each(function(o){UO(n,o,e,t.layouts)})}}))})])}}(t,e,n)}}})])}))),{apis:{setGroups:function(t,o){$s.getState(Cy.getCoupled(t,"toolbarSandbox")).each(function(r){WO(t,r,n,e.layouts,o)})},reposition:function(t){$s.getState(Cy.getCoupled(t,"toolbarSandbox")).each(function(o){UO(t,o,n,e.layouts)})},toggle:function(n){jO(n,o)},getToolbar:function(n){return $s.getState(Cy.getCoupled(n,"toolbarSandbox"))}}})},configFields:NO(),partFields:LO(),apis:{setGroups:function(n,t,e){n.setGroups(t,e)},reposition:function(n,t){n.reposition(t)},toggle:function(n,t){n.toggle(t)},getToolbar:function(n,t){return n.getToolbar(t)}}}),XO=function(n){return N(n,function(n){return Zi(n)})},YO=function(n,t,e){VO(n,e,function(o){e.overflowGroups.set(o),t.getOpt(n).each(function(n){GO.setGroups(n,XO(o))})})},qO=kl({name:"SplitFloatingToolbar",configFields:HO(),partFields:zO(),factory:function(n,t,e,o){var r=Dg(GO.sketch({fetch:function(){return fy(function(t){t(XO(n.overflowGroups.get()))})},layouts:{onLtr:function(){return[wa,xa]},onRtl:function(){return[xa,wa]},onBottomLtr:function(){return[ka,Sa]},onBottomRtl:function(){return[Sa,ka]}},getBounds:e.getOverflowBounds,lazySink:n.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:n.markers.overflowToggledClass},parts:{button:o["overflow-button"](),toolbar:o.overflow()}}));return{uid:n.uid,dom:n.dom,components:t,behaviours:wf(n.splitToolbarBehaviours,[Cy.config({others:{overflowGroup:function(){return TO.sketch(d(d({},o["overflow-group"]()),{items:[r.asSpec()]}))}}})]),apis:{setGroups:function(t,e){n.builtGroups.set(N(e,t.getSystem().build)),YO(t,r,n)},refresh:function(t){return YO(t,r,n)},toggle:function(n){r.getOpt(n).each(function(n){GO.toggle(n)})},reposition:function(n){r.getOpt(n).each(function(n){GO.reposition(n)})},getOverflow:function(n){return r.getOpt(n).bind(function(n){return GO.getToolbar(n)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,t,e){n.setGroups(t,e)},refresh:function(n,t){n.refresh(t)},reposition:function(n,t){n.reposition(t)},toggle:function(n,t){n.toggle(t)},getOverflow:function(n,t){return n.getOverflow(t)}}}),KO=function(n,t){return t.getAnimationRoot.fold(function(){return n.element()},function(t){return t(n)})},JO=function(n){return n.dimension.property},$O=function(n,t){return n.dimension.getDimension(t)},QO=function(n,t){var e=KO(n,t);vi(e,[t.shrinkingClass,t.growingClass])},ZO=function(n,t){gi(n.element(),t.openClass),di(n.element(),t.closedClass),Di(n.element(),JO(t),"0px"),zi(n.element())},n_=function(n,t){gi(n.element(),t.closedClass),di(n.element(),t.openClass),Hi(n.element(),JO(t))},t_=function(n,t,e,o){e.setCollapsed(),Di(n.element(),JO(t),$O(t,n.element())),zi(n.element()),QO(n,t),ZO(n,t),t.onStartShrink(n),t.onShrunk(n)},e_=function(n,t,e,o){var r=o.getOrThunk(function(){return $O(t,n.element())});e.setCollapsed(),Di(n.element(),JO(t),r),zi(n.element());var i=KO(n,t);gi(i,t.growingClass),di(i,t.shrinkingClass),ZO(n,t),t.onStartShrink(n)},o_=function(n,t,e){var o=$O(t,n.element());("0px"===o?t_:e_)(n,t,e,y.some(o))},r_=function(n,t,e){var o=KO(n,t),r=pi(o,t.shrinkingClass),i=$O(t,n.element());n_(n,t);var u=$O(t,n.element());(r?function(){Di(n.element(),JO(t),i),zi(n.element())}:function(){ZO(n,t)})(),gi(o,t.shrinkingClass),di(o,t.growingClass),n_(n,t),Di(n.element(),JO(t),u),e.setExpanded(),t.onStartGrow(n)},i_=function(n,t,e){var o=KO(n,t);return!0===pi(o,t.growingClass)},u_=function(n,t,e){var o=KO(n,t);return!0===pi(o,t.shrinkingClass)},a_=Object.freeze({__proto__:null,refresh:function(n,t,e){if(e.isExpanded()){Hi(n.element(),JO(t));var o=$O(t,n.element());Di(n.element(),JO(t),o)}},grow:function(n,t,e){e.isExpanded()||r_(n,t,e)},shrink:function(n,t,e){e.isExpanded()&&o_(n,t,e)},immediateShrink:function(n,t,e){e.isExpanded()&&t_(n,t,e,y.none())},hasGrown:function(n,t,e){return e.isExpanded()},hasShrunk:function(n,t,e){return e.isCollapsed()},isGrowing:i_,isShrinking:u_,isTransitioning:function(n,t,e){return!0===i_(n,t)||!0===u_(n,t)},toggleGrow:function(n,t,e){(e.isExpanded()?o_:r_)(n,t,e)},disableTransitions:QO}),c_=Object.freeze({__proto__:null,exhibit:function(n,t,e){var o=t.expanded;return Zr(o?{classes:[t.openClass],styles:{}}:{classes:[t.closedClass],styles:Xn(t.dimension.property,"0px")})},events:function(n,t){return Po([Xo(eo(),function(e,o){o.event().raw().propertyName===n.dimension.property&&(QO(e,n),t.isExpanded()&&Hi(e.element(),n.dimension.property),(t.isExpanded()?n.onGrown:n.onShrunk)(e))})])}}),s_=[Vt("closedClass"),Vt("openClass"),Vt("shrinkingClass"),Vt("growingClass"),Wt("getAnimationRoot"),Ju("onShrunk"),Ju("onStartShrink"),Ju("onGrown"),Ju("onStartGrow"),Jt("expanded",!1),Pt("dimension",_t("property",{width:[na("property","width"),na("getDimension",function(n){return fu(n)+"px"})],height:[na("property","height"),na("getDimension",function(n){return eu(n)+"px"})]}))],f_=za({fields:s_,name:"sliding",active:c_,apis:a_,state:Object.freeze({__proto__:null,init:function(n){var t=ie(n.expanded);return $r({isExpanded:function(){return!0===t.get()},isCollapsed:function(){return!1===t.get()},setCollapsed:u(t.set,!1),setExpanded:u(t.set,!0),readState:function(){return"expanded: "+t.get()}})}})}),l_=r([qu(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ju("onOpened"),Ju("onClosed")].concat(PO())),d_=r([Yf({factory:DO,schema:EO(),name:"primary"}),Yf({factory:DO,schema:EO(),name:"overflow",overrides:function(n){return{toolbarBehaviours:Pa([f_.config({dimension:{property:"height"},closedClass:n.markers.closedClass,openClass:n.markers.openClass,shrinkingClass:n.markers.shrinkingClass,growingClass:n.markers.growingClass,onShrunk:function(t){al(t,n,"overflow-button").each(function(n){qm.off(n),Vm.focus(n)}),n.onClosed(t)},onGrown:function(t){Om.focusIn(t),n.onOpened(t)},onStartGrow:function(t){al(t,n,"overflow-button").each(qm.on)}}),Om.config({mode:"acyclic",onEscape:function(t){return al(t,n,"overflow-button").each(Vm.focus),y.some(!0)}})])}}}),qf({name:"overflow-button",overrides:function(n){return{buttonBehaviours:Pa([qm.config({toggleClass:n.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),qf({name:"overflow-group"})]),m_=function(n,t){al(n,t,"overflow").each(function(e){VO(n,t,function(n){var t=N(n,function(n){return Zi(n)});DO.setGroups(e,t)}),al(n,t,"overflow-button").each(function(n){f_.hasGrown(e)&&qm.on(n)}),f_.refresh(e)})},g_=kl({name:"SplitSlidingToolbar",configFields:l_(),partFields:d_(),factory:function(n,t,e,o){return{uid:n.uid,dom:n.dom,components:t,behaviours:wf(n.splitToolbarBehaviours,[Cy.config({others:{overflowGroup:function(n){return TO.sketch(d(d({},o["overflow-group"]()),{items:[Bg.sketch(d(d({},o["overflow-button"]()),{action:function(t){Ao(n,"alloy.toolbar.toggle")}}))]}))}}}),Am("toolbar-toggle-events",[No("alloy.toolbar.toggle",function(t){al(t,n,"overflow").each(function(e){m_(t,n),f_.toggleGrow(e)})})])]),apis:{setGroups:function(t,e){!function(t,e){var o=N(e,t.getSystem().build);n.builtGroups.set(o)}(t,e),m_(t,n)},refresh:function(t){return m_(t,n)},toggle:function(t){return function(n,t){al(n,t,"overflow").each(function(e){m_(n,t),f_.toggleGrow(e)})}(t,n)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,t,e){n.setGroups(t,e)},refresh:function(n,t){n.refresh(t)},toggle:function(n,t){n.toggle(t)}}}),p_=r(Fr("toolbar-height-change")),h_=function(n){var t=n.title.fold(function(){return{}},function(n){return{attributes:{title:n}}});return{dom:d({tag:"div",classes:["tox-toolbar__group"]},t),components:[TO.parts().items({})],items:n.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:Pa([Vb.config({}),Vm.config({})])}},v_=function(n){return TO.sketch(h_(n))},b_=function(n,t){var e=Yo(function(t){var e=N(n.initGroups,v_);DO.setGroups(t,e)});return Pa([Vh(n.providers.isReadOnly),Mh(),Om.config({mode:t,onEscape:n.onEscape,selector:".tox-toolbar__group"}),Am("toolbar-events",[e])])},y_=function(n){var t=n.cyclicKeying?"cyclic":"acyclic";return{uid:n.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":h_({title:y.none(),items:[]}),"overflow-button":mk({name:"more",icon:y.some("more-drawer"),disabled:!1,tooltip:y.some("More..."),primary:!1,borderless:!1},y.none(),n.providers)},splitToolbarBehaviours:b_(n,t)}},x_=function(n){var t=y_(n),e=qO.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return qO.sketch(d(d({},t),{lazySink:n.getSink,getOverflowBounds:function(){var t=n.moreDrawerData.lazyHeader().element(),e=Cu(t),o=ir(t),r=Cu(o),i=Math.max(o.dom().scrollHeight,r.height);return Su(e.x+4,r.y,e.width-8,i)},parts:d(d({},t.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:n.attributes}}}),components:[e],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},w_=function(n){var t=g_.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),e=g_.parts().overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),o=y_(n);return g_.sketch(d(d({},o),{components:[t,e],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(n){n.getSystem().broadcastOn([p_()],{type:"opened"})},onClosed:function(n){n.getSystem().broadcastOn([p_()],{type:"closed"})}}))},S_=function(n){var t=n.cyclicKeying?"cyclic":"acyclic";return DO.sketch({uid:n.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(n.type===ip.scrolling?["tox-toolbar--scrolling"]:[])},components:[DO.parts().groups({})],toolbarBehaviours:b_(n,t)})},k_=[te("disabled",!1),Yt("tooltip"),Yt("icon"),Yt("text"),ee("onSetup",function(){return t})],C_=at([Ht("type"),Nt("onAction")].concat(k_)),O_=function(n){return wt("toolbarbutton",C_,n)},__=[Yt("text"),Yt("tooltip"),Yt("icon"),Nt("fetch"),ee("onSetup",function(){return t})],T_=at(g([Ht("type")],__)),E_=function(n){return wt("menubutton",T_,n)},B_=at([Ht("type"),Yt("tooltip"),Yt("icon"),Yt("text"),qt("select"),Nt("fetch"),ee("onSetup",function(){return t}),ne("presets","normal",["normal","color","listpreview"]),Jt("columns",1),Nt("onAction"),Nt("onItemAction")]),D_=[te("active",!1)].concat(k_),A_=at(D_.concat([Ht("type"),Nt("onAction")])),M_=function(n){return wt("ToggleButton",A_,n)},F_=at([Ht("type"),Pt("items",(Yk=[vt([Ht("name"),Ut("items",Dt)]),Dt],{extract:function(n,t,e){for(var o=[],r=0,i=Yk;r<i.length;r++){var u=i[r].extract(n,t,e);if(u.stype===p.Value)return u;o.push(u)}return $n(o)},toString:function(){return"oneOf("+N(Yk,function(n){return n.toString()}).join(", ")+")"}}))].concat(k_)),I_=[ee("predicate",function(){return!1}),ne("scope","node",["node","editor"]),ne("position","selection",["node","selection","line"])],R_=k_.concat([Jt("type","contextformbutton"),Jt("primary",!1),Nt("onAction"),re("original",i)]),V_=D_.concat([Jt("type","contextformbutton"),Jt("primary",!1),Nt("onAction"),re("original",i)]),P_=k_.concat([Jt("type","contextformbutton")]),H_=D_.concat([Jt("type","contextformtogglebutton")]),z_=_t("type",{contextformbutton:R_,contextformtogglebutton:V_}),N_=at([Jt("type","contextform"),ee("initValue",function(){return""}),Yt("label"),Ut("commands",z_),Gt("launch",_t("type",{contextformbutton:P_,contextformtogglebutton:H_}))].concat(I_)),L_=at([Jt("type","contexttoolbar"),Ht("items")].concat(I_)),j_=Object.freeze({__proto__:null,getState:function(n,t,e){return e}}),U_=Object.freeze({__proto__:null,events:function(n,t){var e=function(e,o){n.updateState.each(function(n){var r=n(e,o);t.set(r)}),n.renderComponents.each(function(n){var r=n(o,t.get()),i=N(r,e.getSystem().build);Fs(e,i)})};return Po([No(co(),function(t,o){var r=o,i=n.channel;V(r.channels(),i)&&e(t,r.data())}),Yo(function(t,o){n.initialData.each(function(n){e(t,n)})})])}}),W_=Object.freeze({__proto__:null,init:function(){var n=ie(y.none());return{readState:function(){return n.get().fold(function(){return"none"},function(n){return n})},get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(y.none())}}}}),G_=[Vt("channel"),Wt("renderComponents"),Wt("updateState"),Wt("initialData")],X_=za({fields:G_,name:"reflecting",active:U_,apis:j_,state:W_}),Y_=r([Vt("toggleClass"),Vt("fetch"),Qu("onExecute"),Jt("getHotspot",y.some),Jt("getAnchorOverrides",r({})),_c(),Qu("onItemExecute"),Wt("lazySink"),Vt("dom"),Ju("onOpen"),yf("splitDropdownBehaviours",[Cy,Om,Vm]),Jt("matchWidth",!1),Jt("useMinWidth",!1),Jt("eventOrder",{}),Wt("role")].concat(Vy())),q_=Yf({factory:Bg,schema:[Vt("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:Pa([Vm.revoke()])}},overrides:function(n){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(n.uid).each(Fo)},buttonBehaviours:Pa([qm.config({toggleOnExecute:!1,toggleClass:n.toggleClass})])}}}),K_=Yf({factory:Bg,schema:[Vt("dom")],name:"button",defaults:function(){return{buttonBehaviours:Pa([Vm.revoke()])}},overrides:function(n){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(n.uid).each(function(e){n.onExecute(e,t)})}}}}),J_=r([q_,K_,Kf({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:n.text}}}},schema:[Vt("text")],name:"aria-descriptor"}),qf({schema:[Yu()],name:"menu",defaults:function(n){return{onExecute:function(t,e){t.getSystem().getByUid(n.uid).each(function(o){n.onItemExecute(o,t,e)})}}}}),_y()]),$_=kl({name:"SplitDropdown",configFields:Y_(),partFields:J_(),factory:function(n,e,o,r){var i=function(n){El.getCurrent(n).each(function(n){zl.highlightFirst(n),Om.focusIn(n)})},u=function(e){Dy(n,function(n){return n},e,r,i,ry.HighlightFirst).get(t)},a=function(t){var e=cl(t,n,"button");return Fo(e),y.some(!0)},c=d(d({},Po([Yo(function(t,e){al(t,n,"aria-descriptor").each(function(n){var e=Fr("aria");Sr(n.element(),"id",e),Sr(t.element(),"aria-describedby",e)})})])),Jm(y.some(u))),s={repositionMenus:function(n){qm.isOn(n)&&Ry(n)}};return{uid:n.uid,dom:n.dom,components:e,apis:s,eventOrder:d(d({},n.eventOrder),{"alloy.execute":["disabling","toggling","alloy.base.behaviour"]}),events:c,behaviours:wf(n.splitDropdownBehaviours,[Cy.config({others:{sandbox:function(t){var e=cl(t,n,"arrow");return Iy(n,t,{onOpen:function(){qm.on(e),qm.on(t)},onClose:function(){qm.off(e),qm.off(t)}})}}}),Om.config({mode:"special",onSpace:a,onEnter:a,onDown:function(n){return u(n),y.some(!0)}}),Vm.config({}),qm.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:n.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(n,t){return n.repositionMenus(t)}}}),Q_=function(n){return{isDisabled:function(){return rh.isDisabled(n)},setDisabled:function(t){return rh.set(n,t)}}},Z_=function(n){return{setActive:function(t){qm.set(n,t)},isActive:function(){return qm.isOn(n)},isDisabled:function(){return rh.isDisabled(n)},setDisabled:function(t){return rh.set(n,t)}}},nT=function(n,t){return n.map(function(n){return{"aria-label":t.translate(n),title:t.translate(n)}}).getOr({})},tT=Fr("focus-button"),eT=["checklist","ordered-list"],oT=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],rT=function(n,t,e,o,r,i){var u,a=function(n){return Wp.isRtl()&&V(eT,n)?n+"-rtl":n},c=Wp.isRtl()&&n.exists(function(n){return V(oT,n)});return{dom:{tag:"button",classes:["tox-tbtn"].concat(t.isSome()?["tox-tbtn--select"]:[]).concat(c?["tox-tbtn__icon-rtl"]:[]),attributes:nT(e,i)},components:jh([n.map(function(n){return KS(a(n),i.icons)}),t.map(function(n){return $S(n,"tox-tbtn",i)})]),eventOrder:(u={},u[We()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:Pa([Vh(i.isReadOnly),Mh(),Am("common-button-display-events",[No(We(),function(n,t){t.event().prevent(),Ao(n,tT)})])].concat(o.map(function(e){return X_.config({channel:e,initialData:{icon:n,text:t},renderComponents:function(n,t){return jh([n.icon.map(function(n){return KS(a(n),i.icons)}),n.text.map(function(n){return $S(n,"tox-tbtn",i)})])}})}).toArray()).concat(r.getOr([])))}},iT=function(n,e,o){var r,i=ie(t),u=rT(n.icon,n.text,n.tooltip,y.none(),y.none(),o);return Bg.sketch({dom:u.dom,components:u.components,eventOrder:ZS,buttonBehaviours:Pa([Am("toolbar-button-events",[(r={onAction:n.onAction,getApi:e.getApi},Jo(function(n,t){Ph(r,n)(function(t){Mo(n,QS,{buttonApi:t}),r.onAction(t)})})),Hh(e,i),zh(e,i)]),Vh(function(){return n.disabled||o.isReadOnly()}),Mh()].concat(e.toolbarButtonBehaviours))})},uT=function(n,t,e){return iT(n,{toolbarButtonBehaviours:[].concat(e.length>0?[Am("toolbarButtonWith",e)]:[]),getApi:Q_,onSetup:n.onSetup},t)},aT=function(n,t,e){return Rn(iT(n,{toolbarButtonBehaviours:[Dm.config({}),qm.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(e.length>0?[Am("toolbarToggleButtonWith",e)]:[]),getApi:Z_,onSetup:n.onSetup},t))},cT=function(n,t,e){return function(o){return fy(function(n){return t.fetch(n)}).map(function(r){return y.from(ub(Rn(Xv(Fr("menu-value"),r,function(e){t.onItemAction(n(o),e)},t.columns,t.presets,up.CLOSE_ON_EXECUTE,t.select.getOr(function(){return!1}),e),{movement:qv(t.columns,t.presets),menuBehaviours:Ip("auto"!==t.columns?[]:[Yo(function(n,e){Mp(n,4,dp(t.presets)).each(function(t){var e=t.numRows,o=t.numColumns;Om.setGridSize(n,e,o)})})])})))})}},sT=function(n,t){return No(QS,function(e,o){var r=function(n){return{hide:function(){return Ao(n,go())},getValue:function(){return bf.getValue(n)}}}(n.get(e));t.onAction(r,o.event().buttonApi())})},fT=function(n,t,e){var o={backstage:{shared:{providers:e}}};return"contextformtogglebutton"===t.type?function(n,t,e){var o=t.original,r=(o.primary,m(o,["primary"])),i=St(M_(d(d({},r),{type:"togglebutton",onAction:function(){}})));return aT(i,e.backstage.shared.providers,[sT(n,t)])}(n,t,o):function(n,t,e){var o=t.original,r=(o.primary,m(o,["primary"])),i=St(O_(d(d({},r),{type:"button",onAction:function(){}})));return uT(i,e.backstage.shared.providers,[sT(n,t)])}(n,t,o)},lT=function(n,t){var e=n.label.fold(function(){return{}},function(n){return{"aria-label":n}}),o=Dg(ty.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:n.initValue(),inputAttributes:e,selectOnFocus:!0,inputBehaviours:Pa([Om.config({mode:"special",onEnter:function(n){return r.findPrimary(n).map(function(n){return Fo(n),!0})},onLeft:function(n,t){return t.cut(),y.none()},onRight:function(n,t){return t.cut(),y.none()}})])})),r=function(n,t,e){var o=N(t,function(t){return Dg(fT(n,t,e))});return{asSpecs:function(){return N(o,function(n){return n.asSpec()})},findPrimary:function(n){return on(t,function(t,e){return t.primary?y.from(o[e]).bind(function(t){return t.getOpt(n)}).filter(a(rh.isDisabled)):y.none()})}}}(o,n.commands,t);return[{title:y.none(),items:[o.asSpec()]},{title:y.none(),items:r.asSpecs()}]},dT=lT,mT=function(t,e){var o=bu(n.window),r=ku(ae.fromDom(t.getContentAreaContainer())),i=dh(t)||mh(t)||ph(t),u=function(n,t){var e=Math.max(t.x,n.x),o=n.right-e,r=t.width-(e-t.x);return{x:e,width:Math.min(o,r)}}(r,o),a=u.x,c=u.width;if(t.inline&&!i)return Su(a,o.y,c,o.height);var s=function(n,t,e,o){var r=ae.fromDom(n.getContainer()),i=Mu(r,".tox-editor-header").getOr(r),u=ku(i),a=u.y>=t.bottom,c=o&&!a;if(n.inline&&c)return{y:Math.max(u.bottom,e.y),bottom:e.bottom};if(n.inline&&!c)return{y:e.y,bottom:Math.min(u.y,e.bottom)};var s=ku(r);return c?{y:Math.max(u.bottom,e.y),bottom:Math.min(s.bottom,e.bottom)}:{y:Math.max(s.y,e.y),bottom:Math.min(u.y,e.bottom)}}(t,r,o,e.header.isPositionedAtTop()),f=s.y,l=s.bottom;return Su(a,f,c,l-f)},gT=function(n,t){var e=U(t,function(t){return t.predicate(n.dom())}),o=j(e,function(n){return"contexttoolbar"===n.type});return{contextToolbars:o.pass,contextForms:o.fail}},pT=function(n,t,e){var o=gT(n,t);if(o.contextForms.length>0)return y.some({elem:n,toolbars:[o.contextForms[0]]});var r=gT(n,e);if(r.contextForms.length>0)return y.some({elem:n,toolbars:[r.contextForms[0]]});if(o.contextToolbars.length>0||r.contextToolbars.length>0){var i=function(n){if(n.length<=1)return n;var t=function(t){return P(n,function(n){return n.position===t})},e=function(t){return U(n,function(n){return n.position===t})},o=t("selection"),r=t("node");if(o||r){if(r&&o){var i=e("node"),u=N(e("selection"),function(n){return d(d({},n),{position:"node"})});return i.concat(u)}return e(o?"selection":"node")}return e("line")}(o.contextToolbars.concat(r.contextToolbars));return y.some({elem:n,toolbars:i})}return y.none()},hT=function(n,t,e){return n(t)?y.none():Re(t,function(n){var t=gT(n,e.inNodeScope),o=t.contextToolbars,r=t.contextForms,i=r.length>0?r:function(n){if(n.length<=1)return n;var t=function(t){return X(n,function(n){return n.position===t})};return t("selection").orThunk(function(){return t("node")}).orThunk(function(){return t("line")}).map(function(n){return n.position}).fold(function(){return[]},function(t){return U(n,function(n){return n.position===t})})}(o);return i.length>0?y.some({elem:n,toolbars:i}):y.none()},n)},vT=function(n,t){var e={},o=[],r=[],i={},u={},a=function(n,a){var c=St(wt("ContextForm",N_,a));e[n]=c,c.launch.map(function(e){i["form:"+n]=d(d({},a.launch),{type:"contextformtogglebutton"===e.type?"togglebutton":"button",onAction:function(){t(c)}})}),"editor"===c.scope?r.push(c):o.push(c),u[n]=c},c=function(n,t){var e;(e=t,wt("ContextToolbar",L_,e)).each(function(e){"editor"===t.scope?r.push(e):o.push(e),u[n]=e})},s=xn(n);return L(s,function(t){var e=n[t];"contextform"===e.type?a(t,e):"contexttoolbar"===e.type&&c(t,e)}),{forms:e,inNodeScope:o,inEditorScope:r,lookupTable:u,formNavigators:i}},bT=Fr("forward-slide"),yT=Fr("backward-slide"),xT=Fr("change-slide-event"),wT=function(n,t,e){var o=function(n,o,i,u){var a=t.shared.providers.translate(n.title);if("separator"===n.type)return y.some({type:"separator",text:a});if("submenu"===n.type){var c=K(n.getStyleItems(),function(n){return r(n,o,u)});return 0===o&&c.length<=0?y.none():y.some({type:"nestedmenuitem",text:a,disabled:c.length<=0,getSubmenuItems:function(){return K(n.getStyleItems(),function(n){return r(n,o,u)})}})}return y.some(d({type:"togglemenuitem",text:a,icon:n.icon,active:n.isSelected(u),disabled:i,onAction:e.onAction(n)},n.getStylePreview().fold(function(){return{}},function(n){return{meta:{style:n}}})))},r=function(n,t,r){var i="formatter"===n.type&&e.isInvalid(n);return 0===t?i?[]:o(n,t,!1,r).toArray():o(n,t,i,r).toArray()},i=function(n){var t=e.getCurrentValue(),o=e.shouldHide?0:1;return K(n,function(n){return r(n,o,t)})};return{validateItems:i,getFetch:function(n,t){return function(e){var o=t(),r=i(o);e(ck(r,up.CLOSE_ON_EXECUTE,n,!1))}}}},ST=function(n,t,e){var o=e.dataset,r="basic"===o.type?function(){return N(o.data,function(n){return YC(n,e.isSelectedFor,e.getPreviewFor)})}:o.getData;return{items:wT(0,t,e),getStyleItems:r}},kT=function(n,e,o){var r=ST(0,e,o),i=r.items,u=r.getStyleItems;return ek({text:o.icon.isSome()?y.none():y.some(""),icon:o.icon,tooltip:y.from(o.tooltip),role:y.none(),fetch:i.getFetch(e,u),onSetup:function(e){return o.setInitialValue.each(function(n){return n(e.getComponent())}),o.nodeChangeHandler.map(function(t){var o=t(e.getComponent());return n.on("NodeChange",o),function(){n.off("NodeChange",o)}}).getOr(t)},getApi:function(n){return{getComponent:function(){return n}}},columns:1,presets:"normal",classes:o.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)};!function(n){n[n.SemiColon=0]="SemiColon",n[n.Space=1]="Space"}(qk||(qk={}));var CT,OT=function(n,t,e,o){return{type:"basic",data:function(n){return N(n,function(n){var t=n,e=n,o=n.split("=");return o.length>1&&(t=o[0],e=o[1]),{title:t,format:e}})}(function(n,t){return t===qk.SemiColon?n.replace(/;$/,"").split(";"):n.split(" ")}(n.getParam(t,e,"string"),o))}},_T=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],TT=function(n){var t=function(t){var e=X(_T,function(t){return n.formatter.match(t.format)}).fold(function(){return"left"},function(n){return n.title.toLowerCase()});Mo(t,tk,{icon:"align-"+e})},e=y.some(function(n){return function(){return t(n)}}),o=y.some(function(n){return t(n)}),i={type:"basic",data:_T};return{tooltip:"Align",icon:y.some("align-left"),isSelectedFor:function(t){return function(){return n.formatter.match(t)}},getCurrentValue:r(y.none()),getPreviewFor:function(n){return function(){return y.none()}},onAction:function(t){return function(){return X(_T,function(n){return n.format===t.format}).each(function(t){return n.execCommand(t.command)})}},setInitialValue:o,nodeChangeHandler:e,dataset:i,shouldHide:!1,isInvalid:function(t){return!n.formatter.canApply(t.format)}}},ET=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],BT=function(n){var t=n.split(/\s*,\s*/);return N(t,function(n){return n.replace(/^['"]+|['"]+$/g,"")})},DT=function(n){var t=function(){var t=function(n){return n?BT(n)[0]:""},e=n.queryCommandValue("FontName"),o=i.data,r=e?e.toLowerCase():"";return{matchOpt:X(o,function(n){var e=n.format;return e.toLowerCase()===r||t(e).toLowerCase()===t(r).toLowerCase()}).orThunk(function(){return 0===(n=r).indexOf("-apple-system")&&(t=BT(n.toLowerCase()),J(ET,function(n){return t.indexOf(n.toLowerCase())>-1}))?y.from({title:"System Font",format:r}):y.none();var n,t}),font:e}},e=function(n){var e=t(),o=e.matchOpt,r=e.font,i=o.fold(function(){return r},function(n){return n.title});Mo(n,nk,{text:i})},o=y.some(function(n){return function(){return e(n)}}),r=y.some(function(n){return e(n)}),i=OT(n,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",qk.SemiColon);return{tooltip:"Fonts",icon:y.none(),isSelectedFor:function(n){return function(t){return t.exists(function(t){return t.format===n})}},getCurrentValue:function(){return t().matchOpt},getPreviewFor:function(n){return function(){return y.some({tag:"div",styles:-1===n.indexOf("dings")?{"font-family":n}:{}})}},onAction:function(t){return function(){n.undoManager.transact(function(){n.focus(),n.execCommand("FontName",!1,t.format)})}},setInitialValue:r,nodeChangeHandler:o,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},AT={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},MT=function(n,t){return/[0-9.]+px$/.test(n)?function(n,t){var e=Math.pow(10,t);return Math.round(n*e)/e}(72*parseInt(n,10)/96,t||0)+"pt":n},FT=function(n){var t=function(){var t=y.none(),e=a.data,o=n.queryCommandValue("FontSize");if(o)for(var r=function(n){var r=MT(o,n),i=function(n){return Bn(AT,n).getOr("")}(r);t=X(e,function(n){return n.format===o||n.format===r||n.format===i})},i=3;t.isNone()&&i>=0;i--)r(i);return{matchOpt:t,size:o}},e=r(r(y.none())),o=function(n){var e=t(),o=e.matchOpt,r=e.size,i=o.fold(function(){return r},function(n){return n.title});Mo(n,nk,{text:i})},i=y.some(function(n){return function(){return o(n)}}),u=y.some(function(n){return o(n)}),a=OT(n,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",qk.Space);return{tooltip:"Font sizes",icon:y.none(),isSelectedFor:function(n){return function(t){return t.exists(function(t){return t.format===n})}},getPreviewFor:e,getCurrentValue:function(){return t().matchOpt},onAction:function(t){return function(){n.undoManager.transact(function(){n.focus(),n.execCommand("FontSize",!1,t.format)})}},setInitialValue:u,nodeChangeHandler:i,dataset:a,shouldHide:!1,isInvalid:function(){return!1}}},IT=function(n,t,e){var o=t();return on(e,function(t){return X(o,function(e){return n.formatter.matchNode(t,e.format)})}).orThunk(function(){return n.formatter.match("p")?y.some({title:"Paragraph",format:"p"}):y.none()})},RT=function(n){var t=n.selection.getStart(!0)||n.getBody();return n.dom.getParents(t,function(){return!0},n.getBody())},VT=function(n,t){return function(e){var o=ie(y.none()),r=function(){e.setActive(n.formatter.match(t));var r=n.formatter.formatChanged(t,e.setActive).unbind;o.set(y.some(r))};return n.initialized?r():n.on("init",r),function(){return o.get().each(function(n){return n()})}}},PT=function(n){return function(t){return function(){n.undoManager.transact(function(){n.focus(),n.execCommand("mceToggleFormat",!1,t.format)})}}},HT=function(n){var t=function(t,e){var o=IT(n,function(){return i.data},t).fold(function(){return"Paragraph"},function(n){return n.title});Mo(e,nk,{text:o})},e=y.some(function(n){return function(e){return t(e.parents,n)}}),o=y.some(function(e){var o=RT(n);t(o,e)}),i=OT(n,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",qk.SemiColon);return{tooltip:"Blocks",icon:y.none(),isSelectedFor:function(t){return function(){return n.formatter.match(t)}},getCurrentValue:r(y.none()),getPreviewFor:function(t){return function(){var e=n.formatter.get(t);return y.some({tag:e.length>0&&(e[0].inline||e[0].block)||"div",styles:n.dom.parseStyle(n.formatter.getCssText(t))})}},onAction:PT(n),setInitialValue:o,nodeChangeHandler:e,dataset:i,shouldHide:!1,isInvalid:function(t){return!n.formatter.canApply(t.format)}}},zT=function(n,t){var e=function(t,e){var o=function(n){var t=n.items;return void 0!==t&&t.length>0?K(t,o):[{title:n.title,format:n.format}]},r=K(XC(n),o),i=IT(n,function(){return r},t).fold(function(){return"Paragraph"},function(n){return n.title});Mo(e,nk,{text:i})},o=y.some(function(n){return function(t){return e(t.parents,n)}}),i=y.some(function(t){var o=RT(n);e(o,t)});return{tooltip:"Formats",icon:y.none(),isSelectedFor:function(t){return function(){return n.formatter.match(t)}},getCurrentValue:r(y.none()),getPreviewFor:function(t){return function(){var e=n.formatter.get(t);return void 0!==e?y.some({tag:e.length>0&&(e[0].inline||e[0].block)||"div",styles:n.dom.parseStyle(n.formatter.getCssText(t))}):y.none()}},onAction:PT(n),setInitialValue:i,nodeChangeHandler:o,shouldHide:n.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!n.formatter.canApply(t.format)},dataset:t}},NT=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],LT=function(n,t){return function(e,o,r){var i=n(e).mapError(function(n){return Ct(n)}).getOrDie();return t(i,o,r)}},jT={button:LT(O_,function(n,t){return e=n,o=t.backstage.shared.providers,uT(e,o,[]);var e,o}),togglebutton:LT(M_,function(n,t){return e=n,o=t.backstage.shared.providers,aT(e,o,[]);var e,o}),menubutton:LT(E_,function(n,t){return fk(n,"tox-tbtn",t.backstage,y.none())}),splitbutton:LT(function(n){return wt("SplitButton",B_,n)},function(n,e){return o=n,r=e.backstage.shared,u=Fr("channel-update-split-dropdown-display"),a=function(n){return{isDisabled:function(){return rh.isDisabled(n)},setDisabled:function(t){return rh.set(n,t)},setIconFill:function(t,e){Mu(n.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(n){Sr(n,"fill",e)})},setIconStroke:function(t,e){Mu(n.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(n){Sr(n,"stroke",e)})},setActive:function(t){Sr(n.element(),"aria-pressed",t),Mu(n.element(),"span").each(function(e){n.getSystem().getByDom(e).each(function(n){return qm.set(n,t)})})},isActive:function(){return Mu(n.element(),"span").exists(function(t){return n.getSystem().getByDom(t).exists(qm.isOn)})}}},c=ie(t),s={getApi:a,onSetup:o.onSetup},$_.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:d({"aria-pressed":!1},nT(o.tooltip,r.providers))},onExecute:function(n){o.onAction(a(n))},onItemExecute:function(n,t,e){},splitDropdownBehaviours:Pa([Rh(r.providers.isReadOnly),Mh(),Am("split-dropdown-events",[No(tT,Vm.focus),Hh(s,c),zh(s,c)]),Ly.config({})]),eventOrder:(i={},i[wo()]=["alloy.base.behaviour","split-dropdown-events"],i),toggleClass:"tox-tbtn--enabled",lazySink:r.getSink,fetch:cT(a,o,r.providers),parts:{menu:bp(0,o.columns,o.presets)},components:[$_.parts().button(rT(o.icon,o.text,y.none(),y.some(u),y.some([qm.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),r.providers)),$_.parts().arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Mg("chevron-down",r.providers.icons)},buttonBehaviours:Pa([Rh(r.providers.isReadOnly),Mh()])}),$_.parts()["aria-descriptor"]({text:r.providers.translate("To open the popup, press Shift+Enter")})]});var o,r,i,u,a,c,s}),grouptoolbarbutton:LT(function(n){return wt("GroupToolbarButton",F_,n)},function(n,t,e){var o,r=e.ui.registry.getAll().buttons,i=((o={})[Cc]=t.backstage.shared.header.isPositionedAtTop()?Pu.TopToBottom:Pu.BottomToTop,o);switch(vh(e)){case ip.floating:return function(n,t,e,o){var r=t.shared;return GO.sketch({lazySink:r.getSink,fetch:function(){return fy(function(t){t(N(e(n.items),v_))})},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:rT(n.icon,n.text,n.tooltip,y.none(),y.none(),r.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:o}}}})}(n,t.backstage,function(n){return XT(e,{buttons:r,toolbar:n,allowToolbarGroups:!1},t,y.none())},i);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}}),styleSelectButton:function(n,t){return function(n,t){var e=d({type:"advanced"},t.styleselect);return kT(n,t,zT(n,e))}(n,t.backstage)},fontsizeSelectButton:function(n,t){return function(n,t){return kT(n,t,FT(n))}(n,t.backstage)},fontSelectButton:function(n,t){return function(n,t){return kT(n,t,DT(n))}(n,t.backstage)},formatButton:function(n,t){return function(n,t){return kT(n,t,HT(n))}(n,t.backstage)},alignMenuButton:function(n,t){return function(n,t){return kT(n,t,TT(n))}(n,t.backstage)}},UT={styleselect:jT.styleSelectButton,fontsizeselect:jT.fontsizeSelectButton,fontselect:jT.fontSelectButton,formatselect:jT.formatButton,align:jT.alignMenuButton},WT=function(t){var e,o=t.toolbar,r=t.buttons;return!1===o?[]:void 0===o||!0===o?function(n){var t=N(NT,function(t){var e=U(t.items,function(t){return Dn(n,t)||Dn(UT,t)});return{name:t.name,items:e}});return U(t,function(n){return n.items.length>0})}(r):S(o)?(e=o.split("|"),N(e,function(n){return{items:n.trim().split(" ")}})):function(n){return D(n,function(n){return Dn(n,"name")&&Dn(n,"items")})}(o)?o:(n.console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},GT=function(t,e,o,r,i,u){return Bn(e,o.toLowerCase()).orThunk(function(){return u.bind(function(n){return on(n,function(n){return Bn(e,n+o.toLowerCase())})})}).fold(function(){return Bn(UT,o.toLowerCase()).map(function(n){return n(t,i)}).orThunk(function(){return y.none()})},function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,o){return Bn(jT,t.type).fold(function(){return n.console.error("skipping button defined by",t),y.none()},function(n){return y.some(n(t,e,o))})}(e,i,t):(n.console.warn("Ignoring the '"+o+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),y.none())})},XT=function(n,t,e,o){var r=WT(t),i=N(r,function(r){var i=K(r.items,function(r){return 0===r.trim().length?[]:GT(n,t.buttons,r,t.allowToolbarGroups,e,o).toArray()});return{title:y.from(n.translate(r.name)),items:i}});return U(i,function(n){return n.items.length>0})},YT={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},qT={maxHeightFunction:pc(),maxWidthFunction:CO()},KT={onLtr:function(){return[Ca,Oa,Sa,xa,ka,wa,_g,Tg,Cg,Sg,Og,kg]},onRtl:function(){return[Ca,Oa,ka,wa,Sa,xa,_g,Tg,Og,kg,Cg,Sg]}},JT={onLtr:function(){return[Oa,xa,wa,Sa,ka,Ca,_g,Tg,Cg,Sg,Og,kg]},onRtl:function(){return[Oa,wa,xa,ka,Sa,Ca,_g,Tg,Og,kg,Cg,Sg]}},$T=function(n,t,e,o){var r,i,u=Ee().deviceType.isTouch,a=Qi((r={sink:e,onEscape:function(){return n.focus(),y.some(!0)}},i=ie([]),hg.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(n){i.set([]),hg.getContent(n).each(function(n){Hi(n.element(),"visibility")}),gi(n.element(),"tox-pop--resizing"),Hi(n.element(),"width")},inlineBehaviours:Pa([Am("context-toolbar-events",[Xo(eo(),function(n,t){gi(n.element(),"tox-pop--resizing"),Hi(n.element(),"width")}),No(xT,function(n,t){Hi(n.element(),"width");var e=fu(n.element());hg.setContent(n,t.event().contents()),di(n.element(),"tox-pop--resizing");var o=fu(n.element());Di(n.element(),"width",e+"px"),hg.getContent(n).each(function(e){t.event().focus().bind(function(t){return Ya(t),Ka(n.element())}).orThunk(function(){return Om.focusIn(e),qa()})}),Eg.setTimeout(function(){Di(n.element(),"width",o+"px")},0)}),No(bT,function(n,t){hg.getContent(n).each(function(n){i.set(i.get().concat([{bar:n,focus:qa()}]))}),Mo(n,xT,{contents:t.event().forwardContents(),focus:y.none()})}),No(yT,function(n,t){tn(i.get()).each(function(t){i.set(i.get().slice(0,i.get().length-1)),Mo(n,xT,{contents:Zi(t.bar),focus:t.focus})})})]),Om.config({mode:"special",onEscape:function(n){return tn(i.get()).fold(function(){return r.onEscape()},function(t){return Ao(n,yT),y.some(!0)})}})]),lazySink:function(){return an.value(r.sink)}}))),c=function(){return mT(n,o.backstage.shared)},s=function(){if(u()&&o.backstage.isContextMenuOpen())return!0;var t,e,r,i,a,s,f=(t=g.get().filter(function(n){return Oi(ae.fromDom(n))}).map(function(n){return n.getBoundingClientRect()}).getOrThunk(function(){return n.selection.getRng().getBoundingClientRect()}),e=n.inline?pu().top():Cu(ae.fromDom(n.getBody())).y,{y:t.top+e,bottom:t.bottom+e}),l=c();return r=f.y,i=f.bottom,a=l.y,s=l.bottom,!(Math.max(r,a)<=Math.min(i,s))},f=function(){hg.hide(a)},l=function(){m.get().each(function(n){var t=a.element();Hi(t,"display"),s()?Di(t,"display","none"):Bs.positionWithinBounds(e,n,a,y.some(c()))})},m=ie(y.none()),g=ie(y.none()),p=ie(null),h=function(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:Pa([Om.config({mode:"acyclic"}),Am("pop-dialog-wrap-events",[Yo(function(t){n.shortcuts.add("ctrl+F9","focus statusbar",function(){return Om.focusIn(t)})}),qo(function(t){n.shortcuts.remove("ctrl+F9")})])])}},v=Pn(function(){return vT(t,function(n){var t=b([n]);Mo(a,bT,{forwardContents:h(t)})})}),b=function(t){var e=n.ui.registry.getAll().buttons,r=v(),i=d(d({},e),r.formNavigators),u=vh(n)===ip.scrolling?ip.scrolling:ip.default,a=q(N(t,function(t){return"contexttoolbar"===t.type?function(t,e){return XT(n,{buttons:t,toolbar:e.items,allowToolbarGroups:!1},o,y.some(["form:"]))}(i,t):function(n,t){return dT(n,t)}(t,o.backstage.shared.providers)}));return S_({type:u,uid:Fr("context-toolbar"),initGroups:a,onEscape:y.none,cyclicKeying:!0,providers:o.backstage.shared.providers})};n.on("contexttoolbar-show",function(t){var e=v();Bn(e.lookupTable,t.toolbarKey).each(function(e){w([e],t.target===n?y.none():y.some(t)),hg.getContent(a).each(Om.focusIn)})});var x=function(n,t){var e="node"===n?o.backstage.shared.anchors.node(t):o.backstage.shared.anchors.cursor();return Rn(e,function(n,t){return"line"===n?{bubble:yc(12,0,YT),layouts:{onLtr:function(){return[_a]},onRtl:function(){return[Ta]}},overrides:qT}:{bubble:yc(0,12,YT),layouts:t?JT:KT,overrides:qT}}(n,u()))},w=function(n,t){if(k(),!u()||!o.backstage.isContextMenuOpen()){var e=b(n),r=t.map(ae.fromDom),i=x(n[0].position,r);m.set(y.some(i)),g.set(t);var f=a.element();Hi(f,"display"),hg.showWithinBounds(a,i,h(e),function(){return y.some(c())}),s()&&Di(f,"display","none")}},S=function(){n.hasFocus()&&function(n,t){var e=ae.fromDom(t.getBody()),o=function(n){return Ae(n,e)},r=ae.fromDom(t.selection.getNode());return function(n){return!o(n)&&!Fe(e,n)}(r)?y.none():pT(r,n.inNodeScope,n.inEditorScope).orThunk(function(){return hT(o,r,n)})}(v(),n).fold(function(){m.set(y.none()),hg.hide(a)},function(n){w(n.toolbars,y.some(n.elem.dom()))})},k=function(){var n=p.get();null!==n&&(Eg.clearTimeout(n),p.set(null))},C=function(n){k(),p.set(n)};n.on("init",function(){n.on("contexttoolbar-hide",f),n.on("ScrollContent ScrollWindow longpress",l),n.on("click keyup focus SetContent ObjectResized ResizeEditor",function(){C(Eg.setEditorTimeout(n,S,0))}),n.on("focusout",function(t){Eg.setEditorTimeout(n,function(){Ka(e.element()).isNone()&&Ka(a.element()).isNone()&&(m.set(y.none()),hg.hide(a))},0)}),n.on("SwitchMode",function(){n.mode.isReadOnly()&&(m.set(y.none()),hg.hide(a))}),n.on("NodeChange",function(t){Ka(a.element()).fold(function(){C(Eg.setEditorTimeout(n,S,0))},function(n){})})})},QT=pl,ZT=Qf,nE=r([Jt("shell",!1),Vt("makeItem"),Jt("setupItem",t),Sf("listBehaviours",[Dm])]),tE=Kf({name:"items",overrides:function(){return{behaviours:Pa([Dm.config({})])}}}),eE=r([tE]),oE=r("CustomList"),rE=kl({name:oE(),configFields:nE(),partFields:eE(),factory:function(t,e,o,r){var i=t.shell?{behaviours:[Dm.config({})],components:[]}:{behaviours:[],components:e},u=function(n){return t.shell?y.some(n):al(n,t,"items")};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:wf(t.listBehaviours,i.behaviours),apis:{setItems:function(e,o){u(e).fold(function(){throw n.console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},function(n){var r=Dm.contents(n),i=o.length,u=i-r.length,a=u>0?H(u,function(){return t.makeItem()}):[],c=r.slice(i);L(c,function(t){return Dm.remove(n,t)}),L(a,function(t){return Dm.append(n,t)});var s=Dm.contents(n);L(s,function(n,r){t.setupItem(e,n,o[r],r)})})}}}},apis:{setItems:function(n,t,e){n.setItems(t,e)}}}),iE=function(n){return(Ri(n,"position").is("fixed")?y.none():cr(n)).orThunk(function(){var t=ae.fromTag("span");return ar(n).bind(function(n){gr(n,t);var e=cr(t);return vr(t),e})})},uE=function(n){return iE(n).map(au).getOrThunk(function(){return iu(0,0)})},aE=Mn([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),cE=function(n,t){var e=n.element();di(e,t.transitionClass),gi(e,t.fadeOutClass),di(e,t.fadeInClass),t.onShow(n)},sE=function(n,t){var e=n.element();di(e,t.transitionClass),gi(e,t.fadeInClass),di(e,t.fadeOutClass),t.onHide(n)},fE=function(n,t,e){return J(n,function(n){switch(n){case"bottom":return function(n,t){return n.bottom<=t.bottom}(t,e);case"top":return function(n,t){return n.y>=t.y}(t,e)}})},lE=function(n,t){return t.getInitialPosition().map(function(t){return Su(t.bounds.x,t.bounds.y,fu(n),eu(n))})},dE=function(n,t,e){return e.getInitialPosition().bind(function(o){switch(e.setInitialPosition(y.none()),o.position){case"static":return y.some(aE.static());case"absolute":var r=iE(n).map(ku).getOrThunk(function(){return ku(_i())});return y.some(aE.absolute($a("absolute",Bn(o.style,"left").map(function(n){return t.x-r.x}),Bn(o.style,"top").map(function(n){return t.y-r.y}),Bn(o.style,"right").map(function(n){return r.right-t.right}),Bn(o.style,"bottom").map(function(n){return r.bottom-t.bottom}))));default:return y.none()}})},mE=function(n,t,e){var o=ku(n);if(fE(e.getModes(),o,t))return y.none();!function(n,t,e){e.setInitialPosition(y.some({style:Vi(n),position:Fi(n,"position")||"static",bounds:t}))}(n,o,e);var r=Ou(),i=o.x-r.x,u=t.y-r.y,a=r.bottom-t.bottom,c=o.y<=t.y;return y.some(aE.fixed($a("fixed",y.some(i),c?y.some(u):y.none(),y.none(),c?y.none():y.some(a))))},gE=function(n,t,e){var o=n.element();return Ri(o,"position").is("fixed")?function(n,t,e){return lE(n,e).filter(function(n){return fE(e.getModes(),n,t)}).bind(function(t){return dE(n,t,e)})}(o,t,e):mE(o,t,e)},pE=function(n,t){L(["left","right","top","bottom","position"],function(t){return Hi(n.element(),t)}),t.onUndocked(n)},hE=function(n,t,e){Qa(n.element(),e),("fixed"===e.position()?t.onDocked:t.onUndocked)(n)},vE=function(n,t,e,o,r){void 0===r&&(r=!1),t.contextual.each(function(t){t.lazyContext(n).each(function(i){var u=function(n,t){return n.y<t.bottom&&n.bottom>t.y}(i,o);u!==e.isVisible()&&(e.setVisible(u),r&&!u?(hi(n.element(),[t.fadeOutClass]),t.onHide(n)):(u?cE:sE)(n,t))})})},bE=function(n,e,o){var r=n.element();o.setDocked(!1),function(n,t){var e=n.element();return lE(e,t).bind(function(n){return dE(e,n,t)})}(n,o).each(function(o){o.fold(function(){return pE(n,e)},function(t){return hE(n,e,t)},t)}),o.setVisible(!0),e.contextual.each(function(t){vi(r,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(n)}),yE(n,e,o)},yE=function(n,t,e){n.getSystem().isConnected()&&function(n,t,e){var o=t.lazyViewport(n),r=e.isDocked();r&&vE(n,t,e,o),gE(n,o,e).each(function(i){e.setDocked(!r),i.fold(function(){return pE(n,t)},function(e){return hE(n,t,e)},function(r){vE(n,t,e,o,!0),hE(n,t,r)})})}(n,t,e)},xE=function(n,t,e){e.isDocked()&&bE(n,t,e)},wE=Object.freeze({__proto__:null,refresh:yE,reset:xE,isDocked:function(n,t,e){return e.isDocked()},getModes:function(n,t,e){return e.getModes()},setModes:function(n,t,e,o){return e.setModes(o)}}),SE=Object.freeze({__proto__:null,events:function(n,t){return Po([Xo(eo(),function(e,o){n.contextual.each(function(n){pi(e.element(),n.transitionClass)&&(vi(e.element(),[n.transitionClass,n.fadeInClass]),(t.isVisible()?n.onShown:n.onHidden)(e)),o.stop()})}),No(yo(),function(e,o){yE(e,n,t)}),No(xo(),function(e,o){xE(e,n,t)})])}}),kE=[Kt("contextual",[Ht("fadeInClass"),Ht("fadeOutClass"),Ht("transitionClass"),Nt("lazyContext"),Ju("onShow"),Ju("onShown"),Ju("onHide"),Ju("onHidden")]),ee("lazyViewport",Ou),function(n,t,e){return $t(n,t,ct(e))}("modes",["top","bottom"],Dt),Ju("onDocked"),Ju("onUndocked")],CE=Object.freeze({__proto__:null,init:function(n){var t=ie(!1),e=ie(!0),o=ie(y.none()),r=ie(n.modes);return $r({isDocked:t.get,setDocked:t.set,getInitialPosition:o.get,setInitialPosition:o.set,isVisible:e.get,setVisible:e.set,getModes:r.get,setModes:r.set,readState:function(){return"docked: "+t.get()+", visible: "+e.get()+", modes: "+r.get().join(",")}})}}),OE=za({fields:kE,name:"docking",active:SE,apis:wE,state:CE}),_E={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},TE=function(n){var t=n.element();ar(t).each(function(e){var o="padding-"+OE.getModes(n)[0];if(OE.isDocked(n)){var r=fu(e);Di(t,"width",r+"px"),Di(e,o,function(n){return ou(n)+(parseInt(Fi(n,"margin-top"),10)||0)+(parseInt(Fi(n,"margin-bottom"),10)||0)}(t)+"px")}else Hi(t,"width"),Hi(e,o)})},EE=function(n,t){t?(gi(n,_E.fadeOutClass),hi(n,[_E.transitionClass,_E.fadeInClass])):(gi(n,_E.fadeInClass),hi(n,[_E.fadeOutClass,_E.transitionClass]))},BE=function(n,t){var e=ae.fromDom(n.getContainer());t?(di(e,"tox-tinymce--toolbar-sticky-on"),gi(e,"tox-tinymce--toolbar-sticky-off")):(di(e,"tox-tinymce--toolbar-sticky-off"),gi(e,"tox-tinymce--toolbar-sticky-on"))},DE=function(n,t){var e,o=ie(y.none()),r=t.getSink,i=function(n){r().each(function(t){return n(t.element())})},u=function(t){n.inline||TE(t),BE(n,OE.isDocked(t)),t.getSystem().broadcastOn([Zs()],{}),r().each(function(n){return n.getSystem().broadcastOn([Zs()],{})})},a=n.inline?[]:[Ga.config({channels:(e={},e[p_()]={onReceive:TE},e)})];return g([Vm.config({}),OE.config({contextual:d({lazyContext:function(t){var e,o,r=ou(t.element()),i=n.inline?n.getContentAreaContainer():n.getContainer(),u=ku(ae.fromDom(i)),a=u.height-r,c=u.y+(e=t,o="top",V(OE.getModes(e),o)?0:r);return y.some(Su(u.x,c,u.width,a))},onShow:function(){i(function(n){return EE(n,!0)})},onShown:function(n){i(function(n){return vi(n,[_E.transitionClass,_E.fadeInClass])}),o.get().each(function(t){var e,r,i;e=n.element(),i=or(r=t),qa(i).filter(function(n){return!Ae(r,n)}).filter(function(n){return Ae(n,ae.fromDom(i.dom().body))||Fe(e,n)}).each(function(){return Ya(r)}),o.set(y.none())})},onHide:function(n){o.set(function(n,t){return Ka(n).orThunk(function(){return t().toOption().bind(function(n){return Ka(n.element())})})}(n.element(),r)),i(function(n){return EE(n,!1)})},onHidden:function(){i(function(n){return vi(n,[_E.transitionClass])})}},_E),modes:[t.header.getDockingMode()],onDocked:u,onUndocked:u})],a)},AE=Object.freeze({__proto__:null,setup:function(n,t,e){n.inline||(t.header.isPositionedAtTop()||n.on("ResizeEditor",function(){e().each(OE.reset)}),n.on("ResizeWindow ResizeEditor",function(){e().each(TE)}),n.on("SkinLoaded",function(){e().each(function(n){OE.isDocked(n)?OE.reset(n):OE.refresh(n)})}),n.on("FullscreenStateChanged",function(){e().each(OE.reset)})),n.on("AfterScrollIntoView",function(n){e().each(function(t){OE.refresh(t);var e=t.element();yd(e)&&function(n,t){var e=or(t),o=e.dom().defaultView.innerHeight,r=pu(e),i=ae.fromDom(n.elm),u=Cu(i),a=eu(i),c=u.y,s=c+a,f=au(t),l=eu(t),d=f.top(),m=d+l,g=Math.abs(d-r.top())<2,p=Math.abs(m-(r.top()+o))<2;if(g&&c<m)hu(r.left(),c-l,e);else if(p&&s>d){var h=c-o+a+l;hu(r.left(),h,e)}}(n,e)})}),n.on("PostRender",function(){BE(n,!1)})},isDocked:function(n){return n().map(OE.isDocked).getOr(!1)},getBehaviours:DE}),ME=t,FE=s,IE=r([]),RE=Object.freeze({__proto__:null,setup:ME,isDocked:FE,getBehaviours:IE}),VE=Sl({factory:function(n,t){var e={focus:Om.focusIn,setMenus:function(n,e){var o=N(e,function(n){var e={type:"menubutton",text:n.text,fetch:function(t){t(n.getItems())}},o=E_(e).mapError(function(n){return Ct(n)}).getOrDie();return fk(o,"tox-mbtn",t.backstage,y.some("menuitem"))});Dm.set(n,o)}};return{uid:n.uid,dom:n.dom,components:[],behaviours:Pa([Dm.config({}),Am("menubar-events",[Yo(function(t){n.onSetup(t)}),No(qe(),function(n,t){Mu(n.element(),".tox-mbtn--active").each(function(e){Fu(t.event().target(),".tox-mbtn").each(function(t){Ae(e,t)||n.getSystem().getByDom(e).each(function(e){n.getSystem().getByDom(t).each(function(n){zy.expand(n),zy.close(e),Vm.focus(n)})})})})}),No(Oo(),function(n,t){t.event().prevFocus().bind(function(t){return n.getSystem().getByDom(t).toOption()}).each(function(e){t.event().newFocus().bind(function(t){return n.getSystem().getByDom(t).toOption()}).each(function(n){zy.isOpen(e)&&(zy.expand(n),zy.close(e))})})})]),Om.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return n.onEscape(t),y.some(!0)}}),Vb.config({})]),apis:e,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Vt("dom"),Vt("uid"),Vt("onEscape"),Vt("backstage"),Jt("onSetup",t)],apis:{focus:function(n,t){n.focus(t)},setMenus:function(n,t,e){n.setMenus(t,e)}}}),PE=[yf("slotBehaviours",[])],HE=function(n){return"<alloy.field."+n+">"},zE=function(n,t){var e,o=function(t){return ll(n)},r=function(t,e){return function(o,r){return al(o,n,r).map(function(n){return t(n,r)}).getOr(e)}},i=function(n,t){return"true"!==kr(n.element(),"aria-hidden")},u=r(i,!1),a=r(function(n,t){if(i(n)){var e=n.element();Di(e,"display","none"),Sr(e,"aria-hidden","true"),Mo(n,_o(),{name:t,visible:!1})}}),c=(e=a,function(n,t){L(t,function(t){return e(n,t)})}),s=r(function(n,t){if(!i(n)){var e=n.element();Hi(e,"display"),_r(e,"aria-hidden"),Mo(n,_o(),{name:t,visible:!0})}}),f={getSlotNames:o,getSlot:function(t,e){return al(t,n,e)},isShowing:u,hideSlot:a,hideAllSlots:function(n){return c(n,o())},showSlot:s};return{uid:n.uid,dom:n.dom,components:t,behaviours:xf(n.slotBehaviours),apis:f}},NE=kn({getSlotNames:function(n,t){return n.getSlotNames(t)},getSlot:function(n,t,e){return n.getSlot(t,e)},isShowing:function(n,t,e){return n.isShowing(t,e)},hideSlot:function(n,t,e){return n.hideSlot(t,e)},hideAllSlots:function(n,t){return n.hideAllSlots(t)},showSlot:function(n,t,e){return n.showSlot(t,e)}},function(n){return Kr(n)}),LE=d(d({},NE),{sketch:function(n){var t,e=(t=[],{slot:function(n,e){return t.push(n),el("container",HE(n),e)},record:function(){return t}}),o=n(e),r=e.record(),i=N(r,function(n){return Yf({name:n,pname:HE(n)})});return vl("container",PE,i,zE,o)}}),jE=at([Yt("icon"),Yt("tooltip"),ee("onShow",t),ee("onHide",t),ee("onSetup",function(){return t})]),UE=function(n){return{element:function(){return n.element().dom()}}},WE=function(n,e){var o=N(xn(e),function(n){var t=e[n],o=St(function(n){return wt("sidebar",jE,n)}(t));return{name:n,getApi:UE,onSetup:o.onSetup,onShow:o.onShow,onHide:o.onHide}});return N(o,function(e){var r=ie(t);return n.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Ip([Hh(e,r),zh(e,r),No(_o(),function(n,t){var e=t.event();X(o,function(n){return n.name===e.name()}).each(function(t){(e.visible()?t.onShow:t.onHide)(t.getApi(n))})})])})})},GE=function(n){return LE.sketch(function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:WE(t,n),slotBehaviours:Ip([Yo(function(n){return LE.hideAllSlots(n)})])}})},XE=function(n){return El.getCurrent(n).bind(function(n){return f_.isGrowing(n)||f_.hasGrown(n)?El.getCurrent(n).bind(function(n){return X(LE.getSlotNames(n),function(t){return LE.isShowing(n,t)})}):y.none()})},YE=Fr("FixSizeEvent"),qE=Fr("AutoSizeEvent"),KE=function(n){var t=ae.fromHtml(n),e=sr(t),o=function(n){var t=void 0!==n.dom().attributes?n.dom().attributes:[];return G(t,function(n,t){var e;return"class"===t.name?n:d(d({},n),((e={})[t.name]=t.value,e))},{})}(t),r=function(n){return Array.prototype.slice.call(n.dom().classList,0)}(t),i=0===e.length?{}:{innerHtml:yr(t)};return d({tag:$o(t),classes:r,attributes:o},i)},JE=function(n){return{dom:{tag:"div",attributes:{"aria-label":n.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:KE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:Pa([Om.config({mode:"special",onTab:function(){return y.some(!0)},onShiftTab:function(){return y.some(!0)}}),Vm.config({})])}},$E=function(n,t,e){var o=ie(!1),r=ie(y.none()),i=function(n){n!==o.get()&&(!function(n,t,e){var o=n.element();!0===t?(Dm.set(n,[JE(e)]),Hi(o,"display"),_r(o,"aria-hidden")):(Dm.set(n,[]),Di(o,"display","none"),Sr(o,"aria-hidden","true"))}(t(),n,e.providers),o.set(n))};n.on("ProgressState",function(t){if(r.get().each(Eg.clearTimeout),B(t.time)){var e=Eg.setEditorTimeout(n,function(){return i(t.state)},t.time);r.set(y.some(e))}else i(t.state),r.set(y.none())})},QE=ZT.optional({factory:VE,name:"menubar",schema:[Vt("backstage")]}),ZE=ZT.optional({factory:{sketch:function(n){return rE.sketch({uid:n.uid,dom:n.dom,listBehaviours:Pa([Om.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return S_({type:n.type,uid:Fr("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:n.providers,onEscape:function(){return y.none()}})},setupItem:function(n,t,e,o){DO.setGroups(t,e)},shell:!0})}},name:"multiple-toolbar",schema:[Vt("dom"),Vt("onEscape")]}),nB=ZT.optional({factory:{sketch:function(n){return function(n){return n.type===ip.sliding?w_:n.type===ip.floating?x_:S_}(n)({type:n.type,uid:n.uid,onEscape:function(){return n.onEscape(),y.some(!0)},cyclicKeying:!1,initGroups:[],getSink:n.getSink,providers:n.providers,moreDrawerData:{lazyToolbar:n.lazyToolbar,lazyMoreButton:n.lazyMoreButton,lazyHeader:n.lazyHeader},attributes:n.attributes})}},name:"toolbar",schema:[Vt("dom"),Vt("onEscape"),Vt("getSink")]}),tB=ZT.optional({factory:{sketch:function(n){var t=n.editor,e=n.sticky?DE:IE;return{uid:n.uid,dom:n.dom,components:n.components,behaviours:Pa(e(t,n.sharedBackstage))}}},name:"header",schema:[Vt("dom")]}),eB=ZT.optional({name:"socket",schema:[Vt("dom")]}),oB=ZT.optional({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:Pa([Vb.config({}),Vm.config({}),f_.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(n){El.getCurrent(n).each(LE.hideAllSlots),Ao(n,qE)},onGrown:function(n){Ao(n,qE)},onStartGrow:function(n){Mo(n,YE,{width:Ri(n.element(),"width").getOr("")})},onStartShrink:function(n){Mo(n,YE,{width:fu(n.element())+"px"})}}),Dm.config({}),El.config({find:function(n){var t=Dm.contents(n);return nn(t)}})])}],behaviours:Pa([jw(0),Am("sidebar-sliding-events",[No(YE,function(n,t){Di(n.element(),"width",t.event().width())}),No(qE,function(n,t){Hi(n.element(),"width")})])])}}},name:"sidebar",schema:[Vt("dom")]}),rB=ZT.optional({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:Pa([Dm.config({})]),components:[]}}},name:"throbber",schema:[Vt("dom")]}),iB=kl({name:"OuterContainer",factory:function(n,t,e){var o={getSocket:function(t){return QT.getPart(t,n,"socket")},setSidebar:function(t,e){QT.getPart(t,n,"sidebar").each(function(n){return function(n,t){El.getCurrent(n).each(function(n){return Dm.set(n,[GE(t)])})}(n,e)})},toggleSidebar:function(t,e){QT.getPart(t,n,"sidebar").each(function(n){return function(n,t){El.getCurrent(n).each(function(n){El.getCurrent(n).each(function(e){f_.hasGrown(n)?LE.isShowing(e,t)?f_.shrink(n):(LE.hideAllSlots(e),LE.showSlot(e,t)):(LE.hideAllSlots(e),LE.showSlot(e,t),f_.grow(n))})})}(n,e)})},whichSidebar:function(t){return QT.getPart(t,n,"sidebar").bind(XE).getOrNull()},getHeader:function(t){return QT.getPart(t,n,"header")},getToolbar:function(t){return QT.getPart(t,n,"toolbar")},setToolbar:function(t,e){QT.getPart(t,n,"toolbar").each(function(n){n.getApis().setGroups(n,e)})},setToolbars:function(t,e){QT.getPart(t,n,"multiple-toolbar").each(function(n){rE.setItems(n,e)})},refreshToolbar:function(t){QT.getPart(t,n,"toolbar").each(function(n){return n.getApis().refresh(n)})},getThrobber:function(t){return QT.getPart(t,n,"throbber")},focusToolbar:function(t){QT.getPart(t,n,"toolbar").orThunk(function(){return QT.getPart(t,n,"multiple-toolbar")}).each(function(n){Om.focusIn(n)})},setMenubar:function(t,e){QT.getPart(t,n,"menubar").each(function(n){VE.setMenus(n,e)})},focusMenubar:function(t){QT.getPart(t,n,"menubar").each(function(n){VE.focus(n)})}};return{uid:n.uid,dom:n.dom,components:t,apis:o,behaviours:n.behaviours}},configFields:[Vt("dom"),Vt("behaviours")],partFields:[tB,QE,nB,ZE,eB,oB,rB],apis:{getSocket:function(n,t){return n.getSocket(t)},setSidebar:function(n,t,e){n.setSidebar(t,e)},toggleSidebar:function(n,t,e){n.toggleSidebar(t,e)},whichSidebar:function(n,t){return n.whichSidebar(t)},getHeader:function(n,t){return n.getHeader(t)},getToolbar:function(n,t){return n.getToolbar(t)},setToolbar:function(n,t,e){var o=N(e,function(n){return v_(n)});n.setToolbar(t,o)},setToolbars:function(n,t,e){var o=N(e,function(n){return N(n,v_)});n.setToolbars(t,o)},refreshToolbar:function(n,t){return n.refreshToolbar(t)},getThrobber:function(n,t){return n.getThrobber(t)},setMenubar:function(n,t,e){n.setMenubar(t,e)},focusMenubar:function(n,t){n.focusMenubar(t)},focusToolbar:function(n,t){n.focusToolbar(t)}}}),uB={file:{title:"File",items:"newdocument restoredraft | preview | print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},aB=function(n){return"string"==typeof n?n.split(" "):n},cB=function(n,t){var e=d(d({},uB),t.menus),o=xn(t.menus).length>0,r=void 0===t.menubar||!0===t.menubar?aB("file edit view insert format tools table help"):aB(!1===t.menubar?"":t.menubar),i=U(r,function(n){return o&&t.menus.hasOwnProperty(n)&&t.menus[n].hasOwnProperty("items")||uB.hasOwnProperty(n)}),u=N(i,function(o){var r=e[o];return function(n,t,e){var o=function(n){return n.getParam("removed_menuitems","")}(e).split(/[ ,]/);return{text:n.title,getItems:function(){return K(n.items,function(n){var e=n.toLowerCase();return 0===e.trim().length?[]:P(o,function(n){return n===e})?[]:"separator"===e||"|"===e?[{type:"separator"}]:t.menuItems[e]?[t.menuItems[e]]:[]})}}}({title:r.title,items:aB(r.items)},t,n)});return U(u,function(n){return n.getItems().length>0&&P(n.getItems(),function(n){return"separator"!==n.type})})},sB=function(n){var t=function(){n._skinLoaded=!0,function(n){n.fire("SkinLoaded")}(n)};return function(){n.initialized?t():n.on("init",t)}},fB=function(n,t){var e,o=function(n){var t=n.getParam("skin"),e=n.getParam("skin_url");if(!1!==t){var o=t||"oxide";e=e?n.documentBaseURI.toAbsolute(e):ih.baseURL+"/skins/ui/"+o}return e}(t);o&&(e=o+"/skin.min.css",t.contentCSS.push(o+(n?"/content.inline":"/content")+".min.css")),!1===function(n){return!1===n.getParam("skin")}(t)&&e?t.ui.styleSheetLoader.load(e,sB(t),function(n,t){return function(){return function(n,t){return n.fire("SkinLoadError",t)}(n,{message:t})}}(t,"Skin could not be loaded")):sB(t)()},lB=u(fB,!1),dB=u(fB,!0),mB=function(n,t,e,o){var r=t.outerContainer,i=e.toolbar,u=e.buttons;if(D(i,S)){var a=i.map(function(t){var r={toolbar:t,buttons:u,allowToolbarGroups:e.allowToolbarGroups};return XT(n,r,{backstage:o},y.none())});iB.setToolbars(r,a)}else iB.setToolbar(r,XT(n,e,{backstage:o},y.none()))},gB=Up.DOM,pB=Ee(),hB=pB.os.isiOS()&&pB.os.version.major<=12,vB=Object.freeze({__proto__:null,render:function(t,e,o,r,i){var u=ie(0);lB(t);var a,c,s,f=ae.fromDom(i.targetNode),l=(a=Si(f),yi(a)?a:ae.fromDom(rr(a).dom().body));c=f,s=e.mothership,Ns(c,s,dr),zs(l,e.uiMothership),t.on("PostRender",function(){mB(t,e,o,r),u.set(t.getWin().innerWidth),iB.setMenubar(e.outerContainer,cB(t,o)),iB.setSidebar(e.outerContainer,o.sidebar),function(n,t){var e=n.getWin(),o=n.getDoc().documentElement,r=ie(iu(e.innerWidth,e.innerHeight)),i=ie(iu(o.offsetWidth,o.offsetHeight)),u=function(){var t=r.get();t.left()===e.innerWidth&&t.top()===e.innerHeight||(r.set(iu(e.innerWidth,e.innerHeight)),Bv(n))},a=function(){var t=n.getDoc().documentElement,e=i.get();e.left()===t.offsetWidth&&e.top()===t.offsetHeight||(i.set(iu(t.offsetWidth,t.offsetHeight)),Bv(n))},c=function(t){return function(n,t){return n.fire("ScrollContent",t)}(n,t)};gB.bind(e,"resize",u),gB.bind(e,"scroll",c);var s=fb(ae.fromDom(n.getBody()),"load",a),f=t.uiMothership.element();n.on("hide",function(){Di(f,"display","none")}),n.on("show",function(){Hi(f,"display")}),n.on("NodeChange",a),n.on("remove",function(){s.unbind(),gB.unbind(e,"resize",u),gB.unbind(e,"scroll",c)})}(t,e)});var d,m,g,p=iB.getSocket(e.outerContainer).getOrDie("Could not find expected socket element");if(hB){Ai(p.element(),{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var h=(d=function(){t.fire("ScrollContent")},m=20,g=null,{cancel:function(){null!==g&&(n.clearTimeout(g),g=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];null===g&&(g=n.setTimeout(function(){d.apply(null,t),g=null},m))}});sb(p.element(),"scroll",h.throttle)}Ah(t,e),t.addCommand("ToggleSidebar",function(n,o){iB.toggleSidebar(e.outerContainer,o),t.fire("ToggleSidebar")}),t.addQueryValueHandler("ToggleSidebar",function(){return iB.whichSidebar(e.outerContainer)});var v=vh(t);return v!==ip.sliding&&v!==ip.floating||t.on("ResizeWindow ResizeEditor ResizeContent",function(){var n=t.getWin().innerWidth;n!==u.get()&&(iB.refreshToolbar(e.outerContainer),u.set(n))}),{iframeContainer:p.element().dom(),editorContainer:e.outerContainer.element().dom()}}}),bB=function(){return n=function(n){n.unbind()},t=ie(y.none()),e=function(){t.get().each(n)},{clear:function(){e(),t.set(y.none())},isSet:function(){return t.get().isSome()},set:function(n){e(),t.set(y.some(n))}};var n,t,e},yB=function(n){return/^[0-9\.]+(|px)$/i.test(""+n)?y.some(parseInt(""+n,10)):y.none()},xB=function(n){return B(n)?n+"px":n},wB=function(n,t,e){var o=t.filter(function(t){return n<t}),r=e.filter(function(t){return n>t});return o.or(r).getOr(n)},SB=function(n){return function(n){var t=uh(n),e=sh(n),o=lh(n);return yB(t).map(function(n){return wB(n,e,o)})}(n).getOr(uh(n))},kB=function(n){var t=ah(n),e=ch(n),o=fh(n);return yB(t).map(function(n){return wB(n,e,o)})},CB=function(n,t,e,o,r){var i=e.uiMothership,u=e.outerContainer,a=Up.DOM,c=Sh(n),s=Ch(n),f=fh(n).or(kB(n)),l=o.shared.header,d=l.isPositionedAtTop,m=vh(n),g=m===ip.sliding||m===ip.floating,p=ie(!1),h=function(){return p.get()&&!n.removed},v=function(n){return g?n.fold(function(){return 0},function(n){return n.components().length>1?eu(n.components()[1].element()):0}):0},b=function(){i.broadcastOn([Zs()],{})},y=function(n){if(void 0===n&&(n=!1),h()){var e,o,i,a,l;if(c||(e=f.getOrThunk(function(){var n=yB(Fi(_i(),"margin-left")).getOr(0);return fu(_i())-au(t).left()+n}),Di(r.get().element(),"max-width",e+"px")),g&&iB.refreshToolbar(u),c||(o=iB.getToolbar(u),i=v(o),a=ku(t),l=d()?Math.max(a.y-eu(r.get().element())+i,0):a.bottom,Ai(u.element(),{position:"absolute",top:Math.round(l)+"px",left:Math.round(a.x)+"px"})),s){var m=r.get();n?OE.reset(m):OE.refresh(m)}b()}},x=function(e){if(void 0===e&&(e=!0),!c&&s&&h()){var o=l.getDockingMode(),i=function(e){switch(yh(n)){case hh.auto:var o=iB.getToolbar(u),r=v(o),i=eu(e.element())-r,a=ku(t);if(a.y>i)return"top";var c=ir(t),s=Math.max(c.dom().scrollHeight,eu(c));return a.bottom<s-i?"bottom":Ou().bottom<a.bottom-i?"bottom":"top";case hh.bottom:return"bottom";case hh.top:default:return"top"}}(r.get());i!==o&&(!function(n){var t=r.get();OE.setModes(t,[n]),l.setDockingMode(n);var e=d()?Pu.TopToBottom:Pu.BottomToTop;Sr(t.element(),Cc,e)}(i),e&&y(!0))}};return{isVisible:h,isPositionedAtTop:d,show:function(){p.set(!0),Di(u.element(),"display","flex"),a.addClass(n.getBody(),"mce-edit-focus"),Hi(i.element(),"display"),x(!1),y()},hide:function(){p.set(!1),e.outerContainer&&(Di(u.element(),"display","none"),a.removeClass(n.getBody(),"mce-edit-focus")),Di(i.element(),"display","none")},update:y,updateMode:x,repositionPopups:b}},OB=function(n,t){var e=ku(n);return{pos:t?e.y:e.bottom,bounds:e}},_B=Object.freeze({__proto__:null,render:function(n,t,e,o,r){var i=t.mothership,u=t.uiMothership,a=t.outerContainer,c=ie(null),s=ae.fromDom(r.targetNode),f=CB(n,s,t,o,c);dB(n);var l=function(){if(c.get())f.show();else{c.set(iB.getHeader(a).getOrDie());var r=function(n){return wh(n).getOr(_i())}(n);zs(r,i),zs(r,u),mB(n,t,e,o),iB.setMenubar(a,cB(n,e)),f.show(),function(n,t,e){var o=ie(OB(t,e.isPositionedAtTop())),r=function(r){var i=OB(t,e.isPositionedAtTop()),u=i.pos,a=i.bounds,c=o.get(),s=c.pos,f=c.bounds,l=a.height!==f.height||a.width!==f.width;o.set({pos:u,bounds:a}),l&&Bv(n,r),e.isVisible()&&(s!==u?e.update(!0):l&&(e.updateMode(),e.repositionPopups()))};n.on("activate",e.show),n.on("deactivate",e.hide),n.on("SkinLoaded ResizeWindow",function(){return e.update(!0)}),n.on("NodeChange keydown",function(n){Eg.requestAnimationFrame(function(){return r(n)})}),n.on("ScrollWindow",function(){return e.updateMode()});var i=bB();i.set(fb(ae.fromDom(n.getBody()),"load",r)),n.on("remove",function(){i.clear()})}(n,s,f),n.nodeChanged()}};return n.on("focus show",l),n.on("blur hide",f.hide),n.on("init",function(){n.hasFocus()&&l()}),Ah(n,t),{editorContainer:a.element().dom()}}}),TB=function(n,t){return function(){n.execCommand("mceToggleFormat",!1,t)}},EB=function(n){!function(n){Hk.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],function(t,e){n.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:VT(n,t.name),onAction:TB(n,t.name)})});for(var t=1;t<=6;t++){var e="h"+t;n.ui.registry.addToggleButton(e,{text:e.toUpperCase(),tooltip:"Heading "+t,onSetup:VT(n,e),onAction:TB(n,e)})}}(n),function(n){Hk.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],function(t){n.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return n.execCommand(t.action)}})})}(n),function(n){Hk.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(t){n.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return n.execCommand(t.action)},onSetup:VT(n,t.name)})})}(n)},BB=function(n){EB(n),function(n){Hk.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],function(t){n.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:function(){return n.execCommand(t.action)}})}),n.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:TB(n,"code")})}(n)},DB=function(n,t,e){var o=function(){return!!t.undoManager&&t.undoManager[e]()},r=function(){n.setDisabled(t.mode.isReadOnly()||!o())};return n.setDisabled(!o()),t.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r),function(){return t.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r)}},AB=function(n){!function(n){n.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(t){return DB(t,n,"hasUndo")},onAction:function(){return n.execCommand("undo")}}),n.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(t){return DB(t,n,"hasRedo")},onAction:function(){return n.execCommand("redo")}})}(n),function(n){n.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(t){return DB(t,n,"hasUndo")},onAction:function(){return n.execCommand("undo")}}),n.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(t){return DB(t,n,"hasRedo")},onAction:function(){return n.execCommand("redo")}})}(n)},MB=function(n,t){!function(n,t){var e=ST(0,t,TT(n));n.ui.registry.addNestedMenuItem("align",{text:t.shared.providers.translate("Align"),getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(n,t),function(n,t){var e=ST(0,t,DT(n));n.ui.registry.addNestedMenuItem("fontformats",{text:t.shared.providers.translate("Fonts"),getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(n,t),function(n,t){var e=d({type:"advanced"},t.styleselect),o=ST(0,t,zT(n,e));n.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}})}(n,t),function(n,t){var e=ST(0,t,HT(n));n.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(n,t),function(n,t){var e=ST(0,t,FT(n));n.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(n,t)},FB=function(n,t){!function(n){Hk.each([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],function(t){n.ui.registry.addToggleButton(t.name,{tooltip:t.text,onAction:function(){return n.execCommand(t.cmd)},icon:t.icon,onSetup:VT(n,t.name)})});var t="alignnone",e="No alignment",o="JustifyNone",r="align-none";n.ui.registry.addButton(t,{tooltip:e,onAction:function(){return n.execCommand(o)},icon:r})}(n),BB(n),MB(n,t),AB(n),function(n){!function(n){n.addCommand("mceApplyTextcolor",function(t,e){!function(n,t,e){n.undoManager.transact(function(){n.focus(),n.formatter.apply(t,{value:e}),n.nodeChanged()})}(n,t,e)}),n.addCommand("mceRemoveTextcolor",function(t){!function(n,t){n.undoManager.transact(function(){n.focus(),n.formatter.remove(t,{value:null},null,!0),n.nodeChanged()})}(n,t)})}(n);var t=ie(null),e=ie(null);Uv(n,"forecolor","forecolor","Text color",t),Uv(n,"backcolor","hilitecolor","Background color",e),Wv(n,"forecolor","forecolor","Text color"),Wv(n,"backcolor","hilitecolor","Background color")}(n),function(n){!function(n){n.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return n.execCommand("mceToggleVisualAid")}})}(n),function(n){n.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(t){return function(n,t){n.setActive(t.hasVisual);var e=function(t){n.setActive(t.hasVisual)};return t.on("VisualAid",e),function(){return t.off("VisualAid",e)}}(t,n)},onAction:function(){n.execCommand("mceToggleVisualAid")}})}(n)}(n),function(n){!function(n){n.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(t){return function(n,t){n.setDisabled(!t.queryCommandState("outdent"));var e=function(){n.setDisabled(!t.queryCommandState("outdent"))};return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}}(t,n)},onAction:function(){return n.execCommand("outdent")}}),n.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return n.execCommand("indent")}})}(n)}(n)},IB=function(n,t){return{anchor:"makeshift",x:n,y:t}},RB=function(n){return"longpress"===n.type||0===n.type.indexOf("touch")},VB=function(n,t){var e=Up.DOM.getPos(n);return function(n,t,e){return IB(n.x+t,n.y+e)}(t,e.x,e.y)},PB=function(n,t){return"contextmenu"===t.type||"longpress"===t.type?n.inline?function(n){if(RB(n)){var t=n.touches[0];return IB(t.pageX,t.pageY)}return IB(n.pageX,n.pageY)}(t):VB(n.getContentAreaContainer(),function(n){if(RB(n)){var t=n.touches[0];return IB(t.clientX,t.clientY)}return IB(n.clientX,n.clientY)}(t)):HB(n)},HB=function(n){return{anchor:"selection",root:ae.fromDom(n.selection.getNode())}},zB=function(n){return{anchor:"node",node:y.some(ae.fromDom(n.selection.getNode())),root:ae.fromDom(n.getBody())}},NB=function(n,t,e,o,r,i){var u=e(),a=function(n,t,e){return e?zB(n):PB(n,t)}(n,t,i);ck(u,up.CLOSE_ON_EXECUTE,o,!1).map(function(n){t.preventDefault(),hg.showMenuAt(r,a,{menu:{markers:pp("normal")},data:n})})},LB={onLtr:function(){return[Oa,xa,wa,Sa,ka,Ca,_g,Tg,Cg,Sg,Og,kg]},onRtl:function(){return[Oa,wa,xa,ka,Sa,Ca,_g,Tg,Og,kg,Cg,Sg]}},jB={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},UB=function(n,t,e,o,r,i,u){var a=function(n,t,e){var o=t?zB(n):PB(n,e);return d({bubble:yc(0,12,jB),layouts:LB,overrides:{maxWidthFunction:CO(),maxHeightFunction:pc()}},o)}(n,i,t);ck(e,up.CLOSE_ON_EXECUTE,o,!0).map(function(e){t.preventDefault(),hg.showMenuWithinBounds(r,a,{menu:{markers:pp("normal"),highlightImmediately:u},data:e,type:"horizontal"},function(){return y.some(mT(n,o.shared))}),n.fire("contexttoolbar-hide")})},WB=function(n,t,e,o,r,i){var u=Ee(),a=u.os.isiOS(),c=u.os.isOSX(),s=u.os.isAndroid(),f=u.deviceType.isTouch(),l=function(){var u=e();UB(n,t,u,o,r,i,!(s||a||c&&f))};if(!c&&!a||i)s&&!i&&n.selection.setCursorLocation(t.target,0),l();else{var d=function(){!function(n){var t=n.selection.getRng(),e=function(){Eg.setEditorTimeout(n,function(){n.selection.setRng(t)},10),i()};n.once("touchend",e);var o=function(n){n.preventDefault(),n.stopImmediatePropagation()};n.on("mousedown",o,!0);var r=function(){return i()};n.once("longpresscancel",r);var i=function(){n.off("touchend",e),n.off("longpresscancel",r),n.off("mousedown",o)}}(n),l()};!function(n,t){var e=n.selection;if(e.isCollapsed()||t.touches.length<1)return!1;var o=t.touches[0],r=e.getRng();return Kc(n.getWin(),Ic.domRange(r)).exists(function(n){return n.left()<=o.clientX&&n.right()>=o.clientX&&n.top()<=o.clientY&&n.bottom()>=o.clientY})}(n,t)?(n.once("selectionchange",d),n.once("touchend",function(){return n.off("selectionchange",d)})):d()}},GB=function(n){return"string"==typeof n?n.split(/[ ,]/):n},XB=function(n){return n.getParam("contextmenu_never_use_native",!1,"boolean")},YB=function(n){return function(n,t,e){var o=n.ui.registry.getAll().contextMenus;return y.from(n.getParam(t)).map(GB).getOrThunk(function(){return U(GB(e),function(n){return Dn(o,n)})})}(n,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},qB=function(n){return S(n)?"|"===n:"separator"===n.type},KB={type:"separator"},JB=function(n){if(S(n))return n;switch(n.type){case"separator":return KB;case"submenu":return{type:"nestedmenuitem",text:n.text,icon:n.icon,getSubmenuItems:function(){var t=n.getSubmenuItems();return S(t)?t:N(t,JB)}};default:return{type:"menuitem",text:n.text,icon:n.icon,onAction:(t=n.onAction,function(){return t()})}}var t},$B=function(n,t){if(0===t.length)return n;var e=tn(n).filter(function(n){return!qB(n)}).fold(function(){return[]},function(n){return[KB]});return n.concat(e).concat(t).concat([KB])},QB=function(n,t,e){var o=Ee().deviceType.isTouch,r=Qi(hg.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return n.focus()},onShow:function(){return e.setContextMenuState(!0)},onHide:function(){return e.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:Pa([Am("dismissContextMenu",[No(ko(),function(t,e){$s.close(t),n.focus()})])])})),i=function(n){return hg.hide(r)},u=function(t){if(XB(n)&&t.preventDefault(),!function(n,t){return t.ctrlKey&&!XB(n)}(n,t)&&!function(n){return!1===n.getParam("contextmenu")}(n)){var i=function(n,t){return"longpress"!==t.type&&(2!==t.button||t.target===n.getBody()&&""===t.pointerType)}(n,t);(o()?WB:NB)(n,t,function(){var e=i?n.selection.getStart(!0):t.target,o=n.ui.registry.getAll(),r=YB(n);return function(n,t,e){var o=G(t,function(t,o){if(Dn(n,o)){var r=n[o].update(e);if(S(r))return $B(t,r.split(" "));if(r.length>0){var i=N(r,JB);return $B(t,i)}return t}return t.concat([o])},[]);return o.length>0&&qB(o[o.length-1])&&o.pop(),o}(o.contextMenus,r,e)},e,r,i)}};n.on("init",function(){var t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(o()?"":" ResizeWindow");n.on(t,i),n.on("longpress contextmenu",u)})},ZB=Mn([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),nD=function(n){return function(t){return t.translate(-n.left(),-n.top())}},tD=function(n){return function(t){return t.translate(n.left(),n.top())}},eD=function(n){return function(t,e){return G(n,function(n,t){return t(n)},iu(t,e))}},oD=function(n,t,e){return n.fold(eD([tD(e),nD(t)]),eD([nD(t)]),eD([]))},rD=function(n,t,e){return n.fold(eD([tD(e)]),eD([]),eD([tD(t)]))},iD=function(n,t,e){return n.fold(eD([]),eD([nD(e)]),eD([tD(t),nD(e)]))},uD=function(n,t,e){var o=n.fold(function(n,t){return{position:y.some("absolute"),left:y.some(n+"px"),top:y.some(t+"px")}},function(n,t){return{position:y.some("absolute"),left:y.some(n-e.left()+"px"),top:y.some(t-e.top()+"px")}},function(n,t){return{position:y.some("fixed"),left:y.some(n+"px"),top:y.some(t+"px")}});return d({right:y.none(),bottom:y.none()},o)},aD=function(n,t,e,o){var r=function(n,r){return function(i,u){var a=n(t,e,o);return r(i.getOr(a.left()),u.getOr(a.top()))}};return n.fold(r(iD,cD),r(rD,sD),r(oD,fD))},cD=ZB.offset,sD=ZB.absolute,fD=ZB.fixed,lD=function(n,t){var e=kr(n,t);return _(e)?NaN:parseInt(e,10)},dD=function(n,t,e,o){return function(n,t){var e=n.element(),o=lD(e,t.leftAttr),r=lD(e,t.topAttr);return isNaN(o)||isNaN(r)?y.none():y.some(iu(o,r))}(n,t).fold(function(){return e},function(n){return fD(n.left()+o.left(),n.top()+o.top())})},mD=function(n,t,e,o,r,i){var u=dD(n,t,e,o),a=t.mustSnap?hD(n,t,u,r,i):vD(n,t,u,r,i),c=oD(u,r,i);return function(n,t,e){var o=n.element();Sr(o,t.leftAttr,e.left()+"px"),Sr(o,t.topAttr,e.top()+"px")}(n,t,c),a.fold(function(){return{coord:fD(c.left(),c.top()),extra:y.none()}},function(n){return{coord:n.output,extra:n.extra}})},gD=function(n,t){!function(n,t){var e=n.element();_r(e,t.leftAttr),_r(e,t.topAttr)}(n,t)},pD=function(n,t,e,o){return on(n,function(n){var r=n.sensor;return function(n,t,e,o,r,i){var u=rD(n,r,i),a=rD(t,r,i);return Math.abs(u.left()-a.left())<=e&&Math.abs(u.top()-a.top())<=o}(t,r,n.range.left(),n.range.top(),e,o)?y.some({output:aD(n.output,t,e,o),extra:n.extra}):y.none()})},hD=function(n,t,e,o,r){var i=t.getSnapPoints(n);return pD(i,e,o,r).orThunk(function(){return G(i,function(n,t){var i=t.sensor,u=function(n,t,e,o,r,i){var u=rD(n,r,i),a=rD(t,r,i),c=Math.abs(u.left()-a.left()),s=Math.abs(u.top()-a.top());return iu(c,s)}(e,i,t.range.left(),t.range.top(),o,r);return n.deltas.fold(function(){return{deltas:y.some(u),snap:y.some(t)}},function(e){return(u.left()+u.top())/2<=(e.left()+e.top())/2?{deltas:y.some(u),snap:y.some(t)}:n})},{deltas:y.none(),snap:y.none()}).snap.map(function(n){return{output:aD(n.output,e,o,r),extra:n.extra}})})},vD=function(n,t,e,o,r){var i=t.getSnapPoints(n);return pD(i,e,o,r)},bD=Object.freeze({__proto__:null,snapTo:function(n,t,e,o){var r=t.getTarget(n.element());if(t.repositionTarget){var i=or(n.element()),u=pu(i),a=uE(r),c=function(n,t,e){return{coord:aD(n.output,n.output,t,e),extra:n.extra}}(o,u,a),s=uD(c.coord,0,a);Mi(r,s)}}}),yD=function(n,t){n.getSystem().addToGui(t),function(n){ar(n.element()).filter(Zo).each(function(t){Ri(t,"z-index").each(function(n){Sr(t,"data-initial-z-index",n)}),Di(t,"z-index",Fi(n.element(),"z-index"))})}(t)},xD=function(n){!function(n){ar(n.element()).filter(Zo).each(function(n){Cr(n,"data-initial-z-index").fold(function(){return Hi(n,"z-index")},function(t){return Di(n,"z-index",t)}),_r(n,"data-initial-z-index")})}(n),n.getSystem().removeFromGui(n)},wD=function(n,t,e){return n.getSystem().build(Bb.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[t]},events:e}))},SD=Kt("snaps",[Vt("getSnapPoints"),Ju("onSensor"),Vt("leftAttr"),Vt("topAttr"),Jt("lazyViewport",Ou),Jt("mustSnap",!1)]),kD=[Jt("useFixed",s),Vt("blockerClass"),Jt("getTarget",i),Jt("onDrag",t),Jt("repositionTarget",!0),Jt("onDrop",t),ee("getBounds",Ou),SD],CD=function(n){return(t=Ri(n,"left"),e=Ri(n,"top"),o=Ri(n,"position"),r=function(n,t,e){return("fixed"===e?fD:cD)(parseInt(n,10),parseInt(t,10))},t.isSome()&&e.isSome()&&o.isSome()?y.some(r(t.getOrDie(),e.getOrDie(),o.getOrDie())):y.none()).getOrThunk(function(){var t=au(n);return sD(t.left(),t.top())});var t,e,o,r},OD=function(n,t,e,o,r,i,u){return function(n,t,e,o,r){var i=r.bounds,u=rD(t,e,o),a=cc(u.left(),i.x,i.x+i.width-r.width),c=cc(u.top(),i.y,i.y+i.height-r.height),s=sD(a,c);return t.fold(function(){var n=iD(s,e,o);return cD(n.left(),n.top())},function(){return s},function(){var n=oD(s,e,o);return fD(n.left(),n.top())})}(0,t.fold(function(){var n,t,u,a=(n=e,t=i.left(),u=i.top(),n.fold(function(n,e){return cD(n+t,e+u)},function(n,e){return sD(n+t,e+u)},function(n,e){return fD(n+t,e+u)})),c=oD(a,o,r);return fD(c.left(),c.top())},function(t){var u=mD(n,t,e,i,o,r);return u.extra.each(function(e){t.onSensor(n,e)}),u.coord}),o,r,u)},_D=function(n,t){return{bounds:n.getBounds(),height:ou(t.element()),width:lu(t.element())}},TD=function(n,t,e,o,r){var i=e.update(o,r),u=e.getStartData().getOrThunk(function(){return _D(t,n)});i.each(function(e){!function(n,t,e,o){var r=t.getTarget(n.element());if(t.repositionTarget){var i=or(n.element()),u=pu(i),a=uE(r),c=CD(r),s=OD(n,t.snaps,c,u,a,o,e),f=uD(s,0,a);Mi(r,f)}t.onDrag(n,r,o)}(n,t,u,e)})},ED=function(n,t,e,o){t.each(xD),e.snaps.each(function(t){gD(n,t)});var r=e.getTarget(n.element());o.reset(),e.onDrop(n,r)},BD=function(n){return function(t,e){var o=function(n){e.setStartData(_D(t,n))};return Po(g([No(yo(),function(n){e.getStartData().each(function(){return o(n)})})],n(t,e,o)))}},DD=Object.freeze({__proto__:null,getData:function(n){return y.from(iu(n.x(),n.y()))},getDelta:function(n,t){return iu(t.left()-n.left(),t.top()-n.top())}}),AD=function(n,t,e){return[No(We(),function(o,r){if(0===r.event().raw().button){r.stop();var i=function(){return ED(o,y.some(c),n,t)},u=mb(i,200),a={drop:i,delayDrop:u.schedule,forceDrop:i,move:function(e){u.cancel(),TD(o,n,t,DD,e)}},c=wD(o,n.blockerClass,function(n){return Po([No(We(),n.forceDrop),No(Ye(),n.drop),No(Ge(),function(t,e){n.move(e.event())}),No(Xe(),n.delayDrop)])}(a));e(o),yD(o,c)}})]},MD=g(kD,[na("dragger",{handlers:BD(AD)})]),FD=Object.freeze({__proto__:null,getData:function(n){var t=n.raw().touches;return 1===t.length?function(n){var t=n[0];return y.some(iu(t.clientX,t.clientY))}(t):y.none()},getDelta:function(n,t){return iu(t.left()-n.left(),t.top()-n.top())}}),ID=function(n,t,e){var o=ie(y.none());return[No(Ne(),function(r,i){i.stop();var u=function(){ED(r,o.get(),n,t),o.set(y.none())},a={drop:u,delayDrop:function(){},forceDrop:u,move:function(e){TD(r,n,t,FD,e)}},c=wD(r,n.blockerClass,function(n){return Po([No(Ne(),n.forceDrop),No(je(),n.drop),No(Ue(),n.drop),No(Le(),function(t,e){n.move(e.event())})])}(a));o.set(y.some(c));e(r),yD(r,c)}),No(Le(),function(e,o){o.stop(),TD(e,n,t,FD,o.event())}),No(je(),function(e,r){r.stop(),ED(e,o.get(),n,t),o.set(y.none())}),No(Ue(),function(e){ED(e,o.get(),n,t),o.set(y.none())})]},RD=MD,VD=g(kD,[na("dragger",{handlers:BD(ID)})]),PD=g(kD,[na("dragger",{handlers:BD(function(n,t,e){return g(AD(n,t,e),ID(n,t,e))})})]),HD=La({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:RD,touch:VD,mouseOrTouch:PD}),name:"dragging",active:{events:function(n,t){return n.dragger.handlers(n,t)}},extra:{snap:function(n){return{sensor:n.sensor,range:n.range,output:n.output,extra:y.from(n.extra)}}},state:Object.freeze({__proto__:null,init:function(){var n=y.none(),t=y.none(),e=r({});return $r({readState:e,reset:function(){n=y.none(),t=y.none()},update:function(t,e){return t.getData(e).bind(function(e){return function(t,e){var o=n.map(function(n){return t.getDelta(n,e)});return n=y.some(e),o}(t,e)})},getStartData:function(){return t},setStartData:function(n){t=y.some(n)}})}}),apis:bD}),zD=function(n,t,e,o,r,i){return n.fold(function(){return HD.snap({sensor:sD(e-20,o-20),range:iu(r,i),output:sD(y.some(e),y.some(o)),extra:{td:t}})},function(n){var r=e-20,i=o-20,u=n.element().dom().getBoundingClientRect();return HD.snap({sensor:sD(r,i),range:iu(40,40),output:sD(y.some(e-u.width/2),y.some(o-u.height/2)),extra:{td:t}})})},ND=function(n,t,e){return{getSnapPoints:n,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(n,o){var r=o.td;(function(n,t){return n.exists(function(n){return Ae(n,t)})})(t.get(),r)||(t.set(y.some(r)),e(r))},mustSnap:!0}},LD=function(n){return Dg(Bg.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:Pa([HD.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:n}),Ly.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},jD=function(n,t){var e=ie([]),o=ie([]),r=ie(!1),i=ie(y.none()),u=ie(y.none()),a=function(n){var e=Cu(n);return zD(l.getOpt(t),n,e.x,e.y,e.width,e.height)},c=function(n){var e=Cu(n);return zD(d.getOpt(t),n,e.right,e.bottom,e.width,e.height)},s=ND(function(){return N(e.get(),function(n){return a(n)})},i,function(t){u.get().each(function(e){n.fire("TableSelectorChange",{start:t,finish:e})})}),f=ND(function(){return N(o.get(),function(n){return c(n)})},u,function(t){i.get().each(function(e){n.fire("TableSelectorChange",{start:e,finish:t})})}),l=LD(s),d=LD(f),m=Qi(l.asSpec()),g=Qi(d.asSpec()),p=function(t,e,o,r){var i=o(e);HD.snapTo(t,i);!function(t,e,o,r){var i=e.dom().getBoundingClientRect();Hi(t.element(),"display");var u=ur(ae.fromDom(n.getBody())).dom().innerHeight,a=o(i),c=r(i,u);(a||c)&&Di(t.element(),"display","none")}(t,e,function(n){return n[r]<0},function(n,t){return n[r]>t})},h=function(n){return p(m,n,a,"top")},v=function(n){return p(g,n,c,"bottom")};Ee().deviceType.isTouch()&&(n.on("TableSelectionChange",function(n){r.get()||(Is(t,m),Is(t,g),r.set(!0)),i.set(y.some(n.start)),u.set(y.some(n.finish)),n.otherCells.each(function(t){e.set(t.upOrLeftCells),o.set(t.downOrRightCells),h(n.start),v(n.finish)})}),n.on("ResizeEditor ResizeWindow ScrollContent",function(){i.get().each(h),u.get().each(v)}),n.on("TableSelectionClear",function(){r.get()&&(Ps(m),Ps(g),r.set(!1)),i.set(y.none()),u.set(y.none())}))};!function(n){n[n.None=0]="None",n[n.Both=1]="Both",n[n.Vertical=2]="Vertical"}(CT||(CT={}));var UD=function(n,t,e){var o=ae.fromDom(n.getContainer()),r=function(n,t,e,o,r){var i={};return i.height=wB(o+t.top(),sh(n),lh(n)),e===CT.Both&&(i.width=wB(r+t.left(),ch(n),fh(n))),i}(n,t,e,eu(o),fu(o));Sn(r,function(n,t){return Di(o,t,xB(n))}),function(n){n.fire("ResizeEditor")}(n)},WD=function(n){if(1===n.nodeType){if("BR"===n.nodeName||n.getAttribute("data-mce-bogus"))return!0;if("bookmark"===n.getAttribute("data-mce-type"))return!0}return!1},GD=function(n,t,e){t.delimiter||(t.delimiter="»");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Pa([Om.config({mode:"flow",selector:"div[role=button]"}),rh.config({disabled:e.isReadOnly}),Mh(),Vb.config({}),Dm.config({}),Am("elementPathEvents",[Yo(function(o,r){n.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return Om.focusIn(o)}),n.on("NodeChange",function(r){var i,u,a=function(t){for(var e=[],o=t.length;o-- >0;){var r=t[o];if(1===r.nodeType&&!WD(r)){var i=n.fire("ResolveName",{name:r.nodeName.toLowerCase(),target:r});if(i.isDefaultPrevented()||e.push({name:i.name,element:r}),i.isPropagationStopped())break}}return e}(r.parents);a.length>0?Dm.set(o,(i=N(a||[],function(t,o){return Bg.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":o,"tab-index":-1,"aria-level":o+1},innerHtml:t.name},action:function(e){n.focus(),n.selection.select(t.element),n.nodeChanged()},buttonBehaviours:Pa([Ih(e.isReadOnly),Mh()])})}),u={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+t.delimiter+" "}},G(i.slice(1),function(n,t){var e=n;return e.push(u),e.push(t),e},[i[0]]))):Dm.set(o,[])})})])]),components:[]}},XD=function(n,t){var e,o,r=function(){var e,o=[];return n.getParam("elementpath",!0,"boolean")&&o.push(GD(n,{},t)),be(n.getParam("plugins","","string"),"wordcount")&&o.push(function(n,t){var e=function(n,e,o){return Dm.set(n,[Ki(t.translate(["{0} "+o,e[o]]))])};return Bg.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Pa([Ih(t.isReadOnly),Mh(),Vb.config({}),Dm.config({}),bf.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Am("wordcount-events",[Jo(function(n){var t=bf.getValue(n),o="words"===t.mode?"characters":"words";bf.setValue(n,{mode:o,count:t.count}),e(n,t.count,o)}),Yo(function(t){n.on("wordCountUpdate",function(n){var o=bf.getValue(t).mode;bf.setValue(t,{mode:o,count:n.wordCount}),e(t,n.wordCount,o)})})])]),eventOrder:{"alloy.execute":["disabling","alloy.base.behaviour","wordcount-events"]}})}(n,t)),n.getParam("branding",!0,"boolean")&&o.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(e=Wp.translate(["Powered by {0}","Tiny"]))+'">'+e+"</a>"}}),o.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:o}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(e=r(),o=function(n){var t=!be(n.getParam("plugins","","string"),"autoresize"),e=n.getParam("resize",t);return!1===e?CT.None:"both"===e?CT.Both:CT.Vertical}(n),o!==CT.None&&e.push(function(e){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:t.translate("Resize"),"aria-hidden":"true"},innerHtml:Mg("resize-handle",t.icons)},behaviours:Pa([HD.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,o,r){UD(n,r,e)},blockerClass:"tox-blocker"})])}}(o)),e)}},YD=function(t){var e,o=t.inline,r=o?_B:vB,i=Ch(t)?AE:RE,u=y.none(),a=Ee(),c=a.browser.isIE()?["tox-platform-ie"]:[],s=a.deviceType.isTouch()?["tox-platform-touch"]:[],f=xh(t),l=Wp.isRtl()?{attributes:{dir:"rtl"}}:{},m={attributes:(e={},e[Cc]=f?Pu.BottomToTop:Pu.TopToBottom,e)},g=function(){return u.bind(iB.getHeader)},p=Qi({dom:d({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(c).concat(s)},l),behaviours:Pa([Bs.config({useFixed:function(){return i.isDocked(g)}})])}),h=function(){return an.value(p)},v=Dg({dom:{tag:"div",classes:["tox-anchorbar"]}}),b=function(){return u.bind(function(n){return iB.getThrobber(n)}).getOrDie("Could not find throbber element")},x=kO(p,t,function(){return u.bind(function(n){return v.getOpt(n)}).getOrDie("Could not find a anchor bar element")}),w=iB.parts().menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:x,onEscape:function(){t.focus()}}),S=vh(t),k=iB.parts().toolbar(d({dom:{tag:"div",classes:["tox-toolbar"]},getSink:h,providers:x.shared.providers,onEscape:function(){t.focus()},type:S,lazyToolbar:function(){return u.bind(function(n){return iB.getToolbar(n)}).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return g().getOrDie("Could not find header element")}},m)),C=iB.parts()["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:x.shared.providers,onEscape:function(){},type:S}),O=iB.parts().socket({dom:{tag:"div",classes:["tox-edit-area"]}}),_=iB.parts().sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),T=iB.parts().throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:x}),E=t.getParam("statusbar",!0,"boolean")&&!o?y.some(XD(t,x.shared.providers)):y.none(),B={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[O,_]},D=ph(t),A=mh(t),M=dh(t),F=iB.parts().header({dom:d({tag:"div",classes:["tox-editor-header"]},m),components:q([M?[w]:[],D?[C]:A?[k]:[],Sh(t)?[]:[v.asSpec()]]),sticky:Ch(t),editor:t,sharedBackstage:x.shared}),I=q([f?[]:[F],o?[]:[B],f?[F]:[]]),R=q([[{dom:{tag:"div",classes:["tox-editor-container"]},components:I}],o?[]:E.toArray(),[T]]),V=kh(t),P=d(d({role:"application"},Wp.isRtl()?{dir:"rtl"}:{}),V?{"aria-hidden":"true"}:{}),H=Qi(iB.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(o?["tox-tinymce-inline"]:[]).concat(f?["tox-tinymce--toolbar-bottom"]:[]).concat(s).concat(c),styles:d({visibility:"hidden"},V?{opacity:"0",border:"0"}:{}),attributes:P},components:R,behaviours:Pa([Om.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a"})])}));u=y.some(H),t.shortcuts.add("alt+F9","focus menubar",function(){iB.focusMenubar(H)}),t.shortcuts.add("alt+F10","focus toolbar",function(){iB.focusToolbar(H)});var z=Db(H),N=Db(p);!function(t,e,o){var r=function(n,t){L([e,o],function(e){e.broadcastEvent(n,t)})},i=function(n,t){L([e,o],function(e){e.broadcastOn([n],t)})},u=function(n){return i(Qs(),{target:n.target()})},a=sb(ae.fromDom(n.document),"touchstart",u),c=sb(ae.fromDom(n.document),"touchmove",function(n){return r(vo(),n)}),s=sb(ae.fromDom(n.document),"touchend",function(n){return r(bo(),n)}),f=sb(ae.fromDom(n.document),"mousedown",u),l=sb(ae.fromDom(n.document),"mouseup",function(n){0===n.raw().button&&i(nf(),{target:n.target()})}),d=function(n){return i(Qs(),{target:ae.fromDom(n.target)})},m=function(n){0===n.button&&i(nf(),{target:ae.fromDom(n.target)})},g=function(n){return r(yo(),lb(n))},p=function(n){i(Zs(),{}),r(xo(),lb(n))},h=function(){return i(Zs(),{})};t.on("PostRender",function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("ScrollWindow",g),t.on("ResizeWindow",p),t.on("ResizeEditor",h)}),t.on("remove",function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("ScrollWindow",g),t.off("ResizeWindow",p),t.off("ResizeEditor",h),f.unbind(),a.unbind(),c.unbind(),s.unbind(),l.unbind()}),t.on("detach",function(){Ls(e),Ls(o),e.destroy(),o.destroy()})}(t,z,N);var j=function(){var n=xB(SB(t)),e=xB(function(n){return kB(n).getOr(ah(n))}(t));return t.inline||(Pi("div","width",e)&&Di(H.element(),"width",e),Pi("div","height",n)?Di(H.element(),"height",n):Di(H.element(),"height","200px")),n};return{mothership:z,uiMothership:N,backstage:x,renderUI:function(){i.setup(t,x.shared,g),FB(t,x),QB(t,h,x),function(n){var t=n.ui.registry.getAll().sidebars;L(xn(t),function(e){var o=t[e],r=function(){return y.from(n.queryCommandValue("ToggleSidebar")).is(e)};n.ui.registry.addToggleButton(e,{icon:o.icon,tooltip:o.tooltip,onAction:function(t){n.execCommand("ToggleSidebar",!1,e),t.setActive(r())},onSetup:function(t){var e=function(){return t.setActive(r())};return n.on("ToggleSidebar",e),function(){n.off("ToggleSidebar",e)}}})})}(t),$E(t,b,x.shared),kn(function(n){return n.getParam("toolbar_groups",{},"object")}(t),function(n,e){t.ui.registry.addGroupToolbarButton(e,n)});var n=t.ui.registry.getAll(),e=n.buttons,o=n.menuItems,u=n.contextToolbars,a=n.sidebars,c=gh(t),s={menuItems:o,menus:Oh(t),menubar:_h(t),toolbar:c.getOrThunk(function(){return function(n){return n.getParam("toolbar",!0)}(t)}),allowToolbarGroups:S===ip.floating,buttons:e,sidebar:a};$T(t,u,p,{backstage:x}),jD(t,p);var f=t.getElement(),l=j(),d={mothership:z,uiMothership:N,outerContainer:H},m={targetNode:f,height:l};return r.render(t,d,s,x,m)},getUi:function(){return{channels:{broadcastAll:N.broadcast,broadcastOn:N.broadcastOn,register:function(){}}}}}},qD=r([Vt("lazySink"),Wt("dragBlockClass"),ee("getBounds",Ou),Jt("useTabstopAt",r(!0)),Jt("eventOrder",{}),yf("modalBehaviours",[Om]),$u("onExecute"),Zu("onEscape")]),KD={sketch:i},JD=r([Kf({name:"draghandle",overrides:function(n,t){return{behaviours:Pa([HD.config({mode:"mouse",getTarget:function(n){return Au(n,'[role="dialog"]').getOr(n)},blockerClass:n.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(t,null,2)).message),getBounds:n.getDragBounds})])}}}),Yf({schema:[Vt("dom")],name:"title"}),Yf({factory:KD,schema:[Vt("dom")],name:"close"}),Yf({factory:KD,schema:[Vt("dom")],name:"body"}),Kf({factory:KD,schema:[Vt("dom")],name:"footer"}),qf({factory:{sketch:function(n,t){return d(d({},n),{dom:t.dom,components:t.components})}},schema:[Jt("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Jt("components",[])],name:"blocker"})]),$D=kl({name:"ModalDialog",configFields:qD(),partFields:JD(),factory:function(n,t,e,o){var r=Fr("alloy.dialog.busy"),u=Fr("alloy.dialog.idle"),a=Pa([Om.config({mode:"special",onTab:function(){return y.some(!0)},onShiftTab:function(){return y.some(!0)}}),Vm.config({})]),c=Fr("modal-events"),s=d(d({},n.eventOrder),{"alloy.system.attached":[c].concat(n.eventOrder["alloy.system.attached"]||[])});return{uid:n.uid,dom:n.dom,components:t,apis:{show:function(t){var e=n.lazySink(t).getOrDie(),i=ie(y.none()),c=o.blocker(),s=e.getSystem().build(d(d({},c),{components:c.components.concat([Zi(t)]),behaviours:Pa([Vm.config({}),Am("dialog-blocker-events",[Xo(Ke(),function(){Om.focusIn(t)}),No(u,function(n,e){Or(t.element(),"aria-busy")&&(_r(t.element(),"aria-busy"),i.get().each(function(n){return Dm.remove(t,n)}))}),No(r,function(n,e){Sr(t.element(),"aria-busy","true");var o=e.event().getBusySpec();i.get().each(function(n){Dm.remove(t,n)});var r=o(t,a),u=n.getSystem().build(r);i.set(y.some(u)),Dm.append(t,Zi(u)),u.hasConfigured(Om)&&Om.focusIn(u)})])])}));Is(e,s),Om.focusIn(t)},hide:function(n){ar(n.element()).each(function(t){n.getSystem().getByDom(t).each(function(n){Ps(n)})})},getBody:function(t){return cl(t,n,"body")},getFooter:function(t){return cl(t,n,"footer")},setIdle:function(n){Ao(n,u)},setBusy:function(n,t){Mo(n,r,{getBusySpec:t})}},eventOrder:s,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:wf(n.modalBehaviours,[Dm.config({}),Om.config({mode:"cyclic",onEnter:n.onExecute,onEscape:n.onEscape,useTabstopAt:n.useTabstopAt}),Am(c,[Yo(function(t){var e,o,r,u,a,c;e=t.element(),o=cl(t,n,"title").element(),r=y.from(kr(e,"id")).fold(function(){var n=Fr("dialog-label");return Sr(o,"id",n),n},i),Sr(e,"aria-labelledby",r),u=t.element(),a=cl(t,n,"body").element(),c=y.from(kr(u,"id")).fold(function(){var n=Fr("dialog-describe");return Sr(a,"id",n),n},i),Sr(u,"aria-describedby",c)})])])}},apis:{show:function(n,t){n.show(t)},hide:function(n,t){n.hide(t)},getBody:function(n,t){return n.getBody(t)},getFooter:function(n,t){return n.getFooter(t)},setBusy:function(n,t,e){n.setBusy(t,e)},setIdle:function(n,t){n.setIdle(t)}}}),QD=at([Ht("type"),Ht("name")].concat(_p)),ZD=At,nA=[mt("name","name",jn(function(){return Fr("button-name")}),Dt),Yt("icon"),ne("align","end",["start","end"]),te("primary",!1),te("disabled",!1)],tA=g(nA,[Ht("text")]),eA=g([zt("type",["submit","cancel","custom"])],tA),oA=g([zt("type",["menu"]),Yt("text"),Yt("tooltip"),Yt("icon"),Ut("items",QD)],nA),rA=_t("type",{submit:eA,cancel:eA,custom:eA,menu:oA}),iA=[Ht("type"),Ht("text"),zt("level",["info","warn","error","success"]),Ht("icon"),Jt("url","")],uA=at(iA),aA=[Ht("type"),Ht("text"),te("disabled",!1),te("primary",!1),mt("name","name",jn(function(){return Fr("button-name")}),Dt),Yt("icon"),te("borderless",!1)],cA=at(aA),sA=[Ht("type"),Ht("name"),Ht("label"),te("disabled",!1)],fA=at(sA),lA=At,dA=[Ht("type"),Ht("name")],mA=dA.concat([Yt("label")]),gA=at(mA),pA=Dt,hA=at(mA),vA=Dt,bA=at(mA),yA=ct(ht),xA=function(n){return[Ht("type"),(t="columns",Pt(t,Bt)),n];var t},wA=mA.concat([te("sandboxed",!0)]),SA=at(wA),kA=Dt,CA=mA.concat([Yt("inputMode"),Yt("placeholder"),te("maximized",!1),te("disabled",!1)]),OA=at(CA),_A=Dt,TA=mA.concat([jt("items",[Ht("text"),Ht("value")]),Qt("size",1),te("disabled",!1)]),EA=at(TA),BA=Dt,DA=mA.concat([te("constrain",!0),te("disabled",!1)]),AA=at(DA),MA=at([Ht("width"),Ht("height")]),FA=mA.concat([Yt("placeholder"),te("maximized",!1),te("disabled",!1)]),IA=at(FA),RA=Dt,VA=mA.concat([ne("filetype","file",["image","media","file"]),Jt("disabled",!1)]),PA=at(VA),HA=at([Ht("value"),Jt("meta",{})]),zA=dA.concat([Zt("tag","textarea"),Ht("scriptId"),Ht("scriptUrl"),function(n,t){return $t(n,t,It)}("settings",void 0)]),NA=dA.concat([Zt("tag","textarea"),Nt("init")]),LA=yt(function(n){return wt("customeditor.old",ut(NA),n).orThunk(function(){return wt("customeditor.new",ut(zA),n)})}),jA=Dt,UA=[Ht("type"),Ht("html"),ne("presets","presentation",["presentation","document"])],WA=at(UA),GA=mA.concat([Pt("currentState",at([Vt("blob"),Ht("url")]))]),XA=at(GA),YA=mA.concat([Jt("columns","auto")]),qA=at(YA),KA=vt([Ht("value"),Ht("text"),Ht("icon")]),JA=function(n){return[Ht("type"),Ht("label"),n]},$A=[Ht("type"),Ut("header",Dt),Ut("cells",ct(Dt))],QA=at($A),ZA=function(n){return mt("items","items",Nn(),ct(yt(function(t){return wt("Checking item of "+n,nM,t).fold(function(n){return an.error(Ct(n))},function(n){return an.value(n)})})))},nM=bt(function(){return Ot("type",{alertbanner:uA,bar:at((n=ZA("bar"),[Ht("type"),n])),button:cA,checkbox:fA,colorinput:gA,colorpicker:hA,dropzone:bA,grid:at(xA(ZA("grid"))),iframe:SA,input:OA,selectbox:EA,sizeinput:AA,textarea:IA,urlinput:PA,customeditor:LA,htmlpanel:WA,imagetools:XA,collection:qA,label:at(JA(ZA("label"))),table:QA,panel:eM});var n}),tM=[Ht("type"),Jt("classes",[]),Ut("items",nM)],eM=at(tM),oM=[mt("name","name",jn(function(){return Fr("tab-name")}),Dt),Ht("title"),Ut("items",nM)],rM=[Ht("type"),jt("tabs",oM)],iM=at(rM),uM=tA,aM=rA,cM=at([Ht("title"),Pt("body",Ot("type",{panel:eM,tabpanel:iM})),Zt("size","normal"),Ut("buttons",aM),Jt("initialData",{}),ee("onAction",t),ee("onChange",t),ee("onSubmit",t),ee("onClose",t),ee("onCancel",t),Jt("onTabChange",t)]),sM=function(n){return k(n)?[n].concat(K(En(n),sM)):C(n)?K(n,sM):[]},fM=function(n){return S(n.type)&&S(n.name)},lM={checkbox:lA,colorinput:pA,colorpicker:vA,dropzone:yA,input:_A,iframe:kA,sizeinput:MA,selectbox:BA,size:MA,textarea:RA,urlinput:HA,customeditor:jA,collection:KA,togglemenuitem:ZD},dM=function(n){var t=function(n){return U(sM(n),fM)}(n),e=K(t,function(n){return function(n){return y.from(lM[n.type])}(n).fold(function(){return[]},function(t){return[Pt(n.name,t)]})});return at(e)},mM=at(g([zt("type",["cancel","custom"])],uM)),gM=at([Ht("title"),Ht("url"),Xt("height"),Xt("width"),function(n,t){return Gt(n,ct(t))}("buttons",mM),ee("onAction",t),ee("onCancel",t),ee("onClose",t),ee("onMessage",t)]),pM=function(n){return{internalDialog:St(wt("dialog",cM,n)),dataValidator:dM(n),initialData:n.initialData}},hM={open:function(n,t){var e=pM(t);return n(e.internalDialog,e.initialData,e.dataValidator)},openUrl:function(n,t){return n(St(wt("dialog",gM,t)))},redial:function(n){return pM(n)}},vM=function(n){var t=[],e={};return Sn(n,function(n,o){n.fold(function(){t.push(o)},function(n){e[o]=n})}),t.length>0?an.error(t):an.value(e)},bM=function(t,e){var o=Dg(Fw.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:N(t.items,function(t){return BC(n,t,e)})}}));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[o.asSpec()]}],behaviours:Pa([Om.config({mode:"acyclic",useTabstopAt:a(uS)}),Lw(o),Kw(o,{postprocess:function(t){return vM(t).fold(function(t){return n.console.error(t),{}},function(n){return n})}})])}},yM=Sl({name:"TabButton",configFields:[Jt("uid",void 0),Vt("value"),mt("dom","dom",Un(function(){return{attributes:{role:"tab",id:Fr("aria"),"aria-selected":"false"}}}),Tt()),Wt("action"),Jt("domModification",{}),yf("tabButtonBehaviours",[Vm,Om,bf]),Vt("view")],factory:function(n,t){return{uid:n.uid,dom:n.dom,components:n.components,events:Jm(n.action),behaviours:wf(n.tabButtonBehaviours,[Vm.config({}),Om.config({mode:"execution",useSpace:!0,useEnter:!0}),bf.config({store:{mode:"memory",initialValue:n.value}})]),domModification:n.domModification}}}),xM=r([Vt("tabs"),Vt("dom"),Jt("clickToDismiss",!1),yf("tabbarBehaviours",[zl,Om]),qu(["tabClass","selectedClass"])]),wM=Jf({factory:yM,name:"tabs",unit:"tab",overrides:function(n){var e=function(n,t){zl.dehighlight(n,t),Mo(n,Eo(),{tabbar:n,button:t})},o=function(n,t){zl.highlight(n,t),Mo(n,To(),{tabbar:n,button:t})};return{action:function(r){var i=r.getSystem().getByUid(n.uid).getOrDie(),u=zl.isHighlighted(i,r);(u&&n.clickToDismiss?e:u?t:o)(i,r)},domModification:{classes:[n.markers.tabClass]}}}}),SM=r([wM]),kM=kl({name:"Tabbar",configFields:xM(),partFields:SM(),factory:function(n,t,e,o){return{uid:n.uid,dom:n.dom,components:t,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:wf(n.tabbarBehaviours,[zl.config({highlightClass:n.markers.selectedClass,itemClass:n.markers.tabClass,onHighlight:function(n,t){Sr(t.element(),"aria-selected","true")},onDehighlight:function(n,t){Sr(t.element(),"aria-selected","false")}}),Om.config({mode:"flow",getInitial:function(n){return zl.getHighlighted(n).map(function(n){return n.element()})},selector:"."+n.markers.tabClass,executeOnMove:!0})])}}}),CM=Sl({name:"Tabview",configFields:[yf("tabviewBehaviours",[Dm])],factory:function(n,t){return{uid:n.uid,dom:n.dom,behaviours:wf(n.tabviewBehaviours,[Dm.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),OM=r([Jt("selectFirst",!0),Ju("onChangeTab"),Ju("onDismissTab"),Jt("tabs",[]),yf("tabSectionBehaviours",[])]),_M=Yf({factory:kM,schema:[Vt("dom"),Lt("markers",[Vt("tabClass"),Vt("selectedClass")])],name:"tabbar",defaults:function(n){return{tabs:n.tabs}}}),TM=Yf({factory:CM,name:"tabview"}),EM=r([_M,TM]),BM=kl({name:"TabSection",configFields:OM(),partFields:EM(),factory:function(n,t,e,o){var r=function(t,e){al(t,n,"tabbar").each(function(n){e(n).each(Fo)})};return{uid:n.uid,dom:n.dom,components:t,behaviours:xf(n.tabSectionBehaviours),events:Po(q([n.selectFirst?[Yo(function(n,t){r(n,zl.getFirst)})]:[],[No(To(),function(t,e){!function(t){var e=bf.getValue(t);al(t,n,"tabview").each(function(o){X(n.tabs,function(n){return n.value===e}).each(function(e){var r=e.view();Cr(t.element(),"id").each(function(n){Sr(o.element(),"aria-labelledby",n)}),Dm.set(o,r),n.onChangeTab(o,t,r)})})}(e.event().button())}),No(Eo(),function(t,e){var o=e.event().button();n.onDismissTab(t,o)})]])),apis:{getViewItems:function(t){return al(t,n,"tabview").map(function(n){return Dm.contents(n)}).getOr([])},showTab:function(n,t){r(n,function(n){var e=zl.getCandidates(n);return X(e,function(n){return bf.getValue(n)===t}).filter(function(t){return!zl.isHighlighted(n,t)})})}}}},apis:{getViewItems:function(n,t){return n.getViewItems(t)},showTab:function(n,t,e){n.showTab(t,e)}}}),DM=function(n,t){Di(n,"height",t+"px"),Ee().browser.isIE()?Hi(n,"flex-basis"):Di(n,"flex-basis",t+"px")},AM=function(t,e,o){Au(t,'[role="dialog"]').each(function(t){Mu(t,'[role="tablist"]').each(function(r){o.get().map(function(o){return Di(e,"height","0"),Di(e,"flex-basis","0"),Math.min(o,function(t,e,o){var r,i=ir(t).dom(),u=Au(t,".tox-dialog-wrap").getOr(t);r="fixed"===Fi(u,"position")?Math.max(i.clientHeight,n.window.innerHeight):Math.max(i.offsetHeight,i.scrollHeight);var a=eu(e),c=e.dom().offsetLeft>=o.dom().offsetLeft+fu(o)?Math.max(eu(o),a):a,s=parseInt(Fi(t,"margin-top"),10)||0,f=parseInt(Fi(t,"margin-bottom"),10)||0;return r-(eu(t)+s+f-c)}(t,e,r))}).each(function(n){DM(e,n)})})})},MM=function(n){return Mu(n,'[role="tabpanel"]')},FM=function(n){var t;return{smartTabHeight:(t=ie(y.none()),{extraEvents:[Yo(function(e){var o=e.element();MM(o).each(function(r){Di(r,"visibility","hidden"),e.getSystem().getByDom(r).toOption().each(function(e){var o=function(n){return nn(Z(n,function(n,t){return n>t?-1:n<t?1:0}))}(function(n,t,e){return N(n,function(o,r){Dm.set(e,n[r].view());var i=t.dom().getBoundingClientRect();return Dm.set(e,[]),i.height})}(n,r,e));t.set(o)}),AM(o,r,t),Hi(r,"visibility"),function(n,t){nn(n).each(function(n){return BM.showTab(t,n.value)})}(n,e),Eg.requestAnimationFrame(function(){AM(o,r,t)})})}),No(xo(),function(n){var e=n.element();MM(e).each(function(n){AM(e,n,t)})}),No(Kb,function(n,e){var o=n.element();MM(o).each(function(n){var e=qa();Di(n,"visibility","hidden");var r=Ri(n,"height").map(function(n){return parseInt(n,10)});Hi(n,"height"),Hi(n,"flex-basis");var i=n.dom().getBoundingClientRect().height;r.forall(function(n){return i>n})?(t.set(y.from(i)),AM(o,n,t)):r.each(function(t){DM(n,t)}),Hi(n,"visibility"),e.each(Ya)})})],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},IM=function(n,t){var e=ie({}),o=function(n){var t=bf.getValue(n),o=vM(t).getOr({}),r=e.get(),i=Rn(r,o);e.set(i)},r=function(n){var t=e.get();bf.setValue(n,t)},i=ie(null),u=N(n.tabs,function(n){return{value:n.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:t.shared.providers.translate(n.title)},view:function(){return[Fw.sketch(function(e){return{dom:{tag:"div",classes:["tox-form"]},components:N(n.items,function(n){return BC(e,n,t)}),formBehaviours:Pa([Om.config({mode:"acyclic",useTabstopAt:a(uS)}),Am("TabView.form.events",[Yo(r),qo(o)]),Ga.config({channels:Yn([{key:"send-data-to-section",value:{onReceive:o}},{key:"send-data-to-view",value:{onReceive:r}}])})])}})]}}}),c=FM(u).smartTabHeight;return BM.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(n,t,e){var o=bf.getValue(t);Mo(n,qb,{name:o,oldName:i.get()}),i.set(o)},tabs:u,components:[BM.parts().tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[kM.parts().tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:Pa([Vb.config({})])}),BM.parts().tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:c.selectFirst,tabSectionBehaviours:Pa([Am("tabpanel",c.extraEvents),Om.config({mode:"acyclic"}),El.config({find:function(n){return nn(BM.getViewItems(n))}}),bf.config({store:{mode:"manual",getValue:function(n){return n.getSystem().broadcastOn(["send-data-to-section"],{}),e.get()},setValue:function(n,t){e.set(t),n.getSystem().broadcastOn(["send-data-to-view"],{})}}})])})},RM=Fr("update-dialog"),VM=Fr("update-title"),PM=Fr("update-body"),HM=Fr("update-footer"),zM=Fr("body-send-message"),NM=function(n,t,e,o){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:d(d({},t.map(function(n){return{id:n}}).getOr({})),o?{"aria-live":"polite"}:{})},components:[],behaviours:Pa([jw(0),X_.config({channel:PM,updateState:function(n,t){return y.some({isTabPanel:function(){return"tabpanel"===t.body.type}})},renderComponents:function(n){switch(n.body.type){case"tabpanel":return[IM(n.body,e)];default:return[bM(n.body,e)]}},initialData:n})])}},LM=Gh.deviceType.isTouch(),jM=function(n,t){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[n,t]}},UM=function(n,t){return $D.parts().close(Bg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:n,buttonBehaviours:Pa([Vb.config({})])}))},WM=function(){return $D.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},GM=function(n,t){return $D.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:KE("<p>"+t.translate(n)+"</p>")}]}]})},XM=function(n){return $D.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:n})},YM=function(n,t){return[Bb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:n}),Bb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})]},qM=function(n){var t,e="tox-dialog",o=e+"-wrap",r=o+"__backdrop",i=e+"__disable-scroll";return $D.sketch({lazySink:n.lazySink,onEscape:function(t){return n.onEscape(t),y.some(!0)},useTabstopAt:function(n){return!uS(n)},dom:{tag:"div",classes:[e].concat(n.extraClasses),styles:d({position:"relative"},n.extraStyles)},components:g([n.header,n.body],n.footer.toArray()),parts:{blocker:{dom:KE('<div class="'+o+'"></div>'),components:[{dom:{tag:"div",classes:LM?[r,r+"--opaque"]:[r]}}]}},dragBlockClass:o,modalBehaviours:Pa(g([Vm.config({}),Am("dialog-events",n.dialogEvents.concat([Xo(Ke(),function(n,t){Om.focusIn(n)})])),Am("scroll-lock",[Yo(function(){di(_i(),i)}),qo(function(){gi(_i(),i)})])],n.extraBehaviours)),eventOrder:d((t={},t[so()]=["dialog-events"],t[wo()]=["scroll-lock","dialog-events","alloy.base.behaviour"],t[So()]=["alloy.base.behaviour","dialog-events","scroll-lock"],t),n.eventOrder)})},KM=function(n){return Bg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close"),title:n.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M17.953 7.453L13.422 12l4.531 4.547-1.406 1.406L12 13.422l-4.547 4.531-1.406-1.406L10.578 12 6.047 7.453l1.406-1.406L12 10.578l4.547-4.531z" fill-rule="evenodd"></path></svg>'}}],action:function(n){Ao(n,Ub)}})},JM=function(n,t,e){var o=function(n){return[Ki(e.translate(n.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:d({},t.map(function(n){return{id:n}}).getOr({}))},components:o(n),behaviours:Pa([X_.config({channel:VM,renderComponents:o})])}},$M=function(){return{dom:KE('<div class="tox-dialog__draghandle"></div>')}},QM=function(n,t){return e={title:t.shared.providers.translate(n),draggable:t.dialog.isDraggableModal()},o=t.shared.providers,r=$D.parts().title(JM(e,y.none(),o)),i=$D.parts().draghandle($M()),u=$D.parts().close(KM(o)),a=[r].concat(e.draggable?[i]:[]).concat([u]),Bb.sketch({dom:KE('<div class="tox-dialog__header"></div>'),components:a});var e,o,r,i,u,a},ZM=function(n,t){return{onClose:function(){return t.closeWindow()},onBlock:function(t){$D.setBusy(n(),function(n,e){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":t.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:KE('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}})},onUnblock:function(){$D.setIdle(n())}}},nF=function(n,t,e,o){var r;return Qi(qM(d(d({},n),{lazySink:o.shared.getSink,extraBehaviours:g([X_.config({channel:RM,updateState:function(n,t){return y.some(t)},initialData:t}),Qw({})],n.extraBehaviours),onEscape:function(n){Ao(n,Ub)},dialogEvents:e,eventOrder:(r={},r[co()]=["reflecting","receiving"],r[wo()]=["scroll-lock","reflecting","messages","dialog-events","alloy.base.behaviour"],r[So()]=["alloy.base.behaviour","dialog-events","messages","reflecting","scroll-lock"],r)})))},tF=function(n){return N(n,function(n){return"menu"===n.type?function(n){var t=N(n.items,function(n){var t=ie(!1);return d(d({},n),{storage:t})});return d(d({},n),{items:t})}(n):n})},eF=function(n){return G(n,function(n,t){return"menu"===t.type?G(t.items,function(n,t){return n[t.name]=t.storage,n},n):n},{})},oF=function(n,t){return[Wo(Ke(),iS),n(jb,function(n,e){t.onClose(),e.onClose()}),n(Ub,function(n,t,e,o){t.onCancel(n),Ao(o,jb)}),No(Yb,function(n,e){return t.onUnblock()}),No(Xb,function(n,e){return t.onBlock(e.event())})]},rF=function(n,t){var e=function(t,e){return No(t,function(t,r){o(t,function(o,i){e(n(),o,r.event(),t)})})},o=function(n,t){X_.getState(n).get().each(function(e){t(e,n)})};return g(oF(e,t),[e(Wb,function(n,t,e){t.onAction(n,{name:e.name()})})])},iF=function(n,t,e){var o=function(t,e){return No(t,function(t,o){r(t,function(r,i){e(n(),r,o.event(),t)})})},r=function(n,t){X_.getState(n).get().each(function(e){t(e.internalDialog,n)})};return g(oF(o,t),[o(Gb,function(n,t){return t.onSubmit(n)}),o(Lb,function(n,t,e){t.onChange(n,{name:e.name()})}),o(Wb,function(n,t,o,r){var i=function(){return Om.focusIn(r)},u=function(n){return Or(n,"disabled")||Cr(n,"aria-disabled").exists(function(n){return"true"===n})},a=qa();t.onAction(n,{name:o.name(),value:o.value()}),qa().fold(i,function(n){u(n)?i():a.exists(function(t){return Fe(n,t)&&u(t)})?i():e().toOption().filter(function(t){return!Fe(t.element(),n)}).each(i)})}),o(qb,function(n,t,e){t.onTabChange(n,{newTabName:e.name(),oldTabName:e.oldName()})}),qo(function(t){var e=n();bf.setValue(t,e.getData())})])},uF=function(n,t){var e=t.map(function(n){return n.footerButtons}).getOr([]),o=j(e,function(n){return"start"===n.align}),r=function(n,t){return Bb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+n]},components:N(t,function(n){return n.memento.asSpec()})})};return[r("start",o.pass),r("end",o.fail)]},aF=function(n,t){return{dom:KE('<div class="tox-dialog__footer"></div>'),components:[],behaviours:Pa([X_.config({channel:HM,initialData:n,updateState:function(n,e){var o=N(e.buttons,function(n){var e=Dg(function(n,t){return bk(n,n.type,t)}(n,t));return{name:n.name,align:n.align,memento:e}});return y.some({lookupByName:function(n,t){return function(n,t,e){return X(t,function(n){return n.name===e}).bind(function(t){return t.memento.getOpt(n)})}(n,o,t)},footerButtons:o})},renderComponents:uF})])}},cF=function(n,t){return $D.parts().footer(aF(n,t))},sF=function(n,t){if(n.getRoot().getSystem().isConnected()){var e=El.getCurrent(n.getFormWrapper()).getOr(n.getFormWrapper());return Fw.getField(e,t).fold(function(){var o=n.getFooter();return X_.getState(o).get().bind(function(n){return n.lookupByName(e,t)})},function(n){return y.some(n)})}return y.none()},fF=function(n,t,e){var o=function(t){var e=n.getRoot();e.getSystem().isConnected()&&t(e)},r={getData:function(){var t=n.getRoot(),o=t.getSystem().isConnected()?n.getFormWrapper():t,r=bf.getValue(o),i=kn(e,function(n){return n.get()});return d(d({},r),i)},setData:function(t){o(function(o){var i=r.getData(),u=d(d({},i),t),a=function(n,t){var e=n.getRoot();return X_.getState(e).get().map(function(n){return St(wt("data",n.dataValidator,t))}).getOr(t)}(n,u),c=n.getFormWrapper();bf.setValue(c,a),Sn(e,function(n,t){Dn(u,t)&&n.set(u[t])})})},disable:function(t){sF(n,t).each(rh.disable)},enable:function(t){sF(n,t).each(rh.enable)},focus:function(t){sF(n,t).each(Vm.focus)},block:function(n){if(!S(n))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");o(function(t){Mo(t,Xb,{message:n})})},unblock:function(){o(function(n){Ao(n,Yb)})},showTab:function(t){o(function(e){var o=n.getBody();X_.getState(o).get().exists(function(n){return n.isTabPanel()})&&El.getCurrent(o).each(function(n){BM.showTab(n,t)})})},redial:function(n){o(function(e){var o=t(n);e.getSystem().broadcastOn([RM],o),e.getSystem().broadcastOn([VM],o.internalDialog),e.getSystem().broadcastOn([PM],o.internalDialog),e.getSystem().broadcastOn([HM],o.internalDialog),r.setData(o.initialData)})},close:function(){o(function(n){Ao(n,jb)})}};return r},lF=function(n,t,e){var o=QM(n.internalDialog.title,e),r=function(n,t){var e=NM(n,y.none(),t,!1);return $D.parts().body(e)}({body:n.internalDialog.body},e),i=tF(n.internalDialog.buttons),u=eF(i),a=cF({buttons:i},e),c=iF(function(){return d},ZM(function(){return l},t),e.shared.getSink),s="normal"!==n.internalDialog.size?"large"===n.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],f={header:o,body:r,footer:y.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},l=nF(f,n,c,e),d=fF({getRoot:function(){return l},getBody:function(){return $D.getBody(l)},getFooter:function(){return $D.getFooter(l)},getFormWrapper:function(){var n=$D.getBody(l);return El.getCurrent(n).getOr(n)}},t.redial,u);return{dialog:l,instanceApi:d}},dF=function(n,t,e,o){var r,i,u,a,c,s=Fr("dialog-label"),f=Fr("dialog-content"),l=Dg((u={title:n.internalDialog.title,draggable:!0},a=s,c=e.shared.providers,Bb.sketch({dom:KE('<div class="tox-dialog__header"></div>'),components:[JM(u,y.some(a),c),$M(),KM(c)],containerBehaviours:Pa([HD.config({mode:"mouse",blockerClass:"blocker",getTarget:function(n){return Fu(n,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=Dg(function(n,t,e,o){return NM(n,y.some(t),e,o)}({body:n.internalDialog.body},f,e,o)),m=tF(n.internalDialog.buttons),g=eF(m),p=Dg(function(n,t){return aF(n,t)}({buttons:m},e)),h=iF(function(){return b},{onBlock:function(){},onUnblock:function(){},onClose:function(){return t.closeWindow()}},e.shared.getSink),v=Qi({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(r={role:"dialog"},r["aria-labelledby"]=s,r["aria-describedby"]=""+f,r)},eventOrder:(i={},i[co()]=[X_.name(),Ga.name()],i[so()]=["execute-on-form"],i[wo()]=["reflecting","execute-on-form"],i),behaviours:Pa([Om.config({mode:"cyclic",onEscape:function(n){return Ao(n,jb),y.some(!0)},useTabstopAt:function(n){return!uS(n)&&("button"!==$o(n)||"disabled"!==kr(n,"disabled"))}}),X_.config({channel:RM,updateState:function(n,t){return y.some(t)},initialData:n}),Vm.config({}),Am("execute-on-form",h.concat([Xo(Ke(),function(n,t){Om.focusIn(n)})])),Qw({})]),components:[l.asSpec(),d.asSpec(),p.asSpec()]}),b=fF({getRoot:function(){return v},getFooter:function(){return p.get(v)},getBody:function(){return d.get(v)},getFormWrapper:function(){var n=d.get(v);return El.getCurrent(n).getOr(n)}},t.redial,g);return{dialog:v,instanceApi:b}},mF=tinymce.util.Tools.resolve("tinymce.util.URI"),gF=["insertContent","setContent","execCommand","close","block","unblock"],pF=function(n){return k(n)&&-1!==gF.indexOf(n.mceAction)},hF=function(t,e,o,r){var i,u,c,s=QM(t.title,r),f=function(n){var t={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[oS({dom:{tag:"iframe",attributes:{src:n.url}},behaviours:Pa([Vb.config({}),Vm.config({})])})]}],behaviours:Pa([Om.config({mode:"acyclic",useTabstopAt:a(uS)})])};return $D.parts().body(t)}(t),l=t.buttons.bind(function(n){return 0===n.length?y.none():y.some(cF({buttons:n},r))}),m=rF(function(){return C},ZM(function(){return w},e)),g=d(d({},t.height.fold(function(){return{}},function(n){return{height:n+"px","max-height":n+"px"}})),t.width.fold(function(){return{}},function(n){return{width:n+"px","max-width":n+"px"}})),p=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],h=new mF(t.url,{base_uri:new mF(n.window.location.href)}),v=h.protocol+"://"+h.host+(h.port?":"+h.port:""),b=ie(y.none()),x=[Am("messages",[Yo(function(){var e=sb(ae.fromDom(n.window),"message",function(n){if(h.isSameOrigin(new mF(n.raw().origin))){var e=n.raw().data;pF(e)?function(n,t,e){switch(e.mceAction){case"insertContent":n.insertContent(e.content);break;case"setContent":n.setContent(e.content);break;case"execCommand":var o=!!O(e.ui)&&e.ui;n.execCommand(e.cmd,o,e.value);break;case"close":t.close();break;case"block":t.block(e.message);break;case"unblock":t.unblock()}}(o,C,e):function(n){return!pF(n)&&k(n)&&Dn(n,"mceAction")}(e)&&t.onMessage(C,e)}});b.set(y.some(e))}),qo(function(){b.get().each(function(n){return n.unbind()})})]),Ga.config({channels:(i={},i[zM]={onReceive:function(n,t){Mu(n.element(),"iframe").each(function(n){n.dom().contentWindow.postMessage(t,v)})}},i)})],w=nF({header:s,body:f,footer:l,extraClasses:p,extraBehaviours:x,extraStyles:g},t,m,r),C=(u=w,c=function(n){u.getSystem().isConnected()&&n(u)},{block:function(n){if(!S(n))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");c(function(t){Mo(t,Xb,{message:n})})},unblock:function(){c(function(n){Ao(n,Yb)})},close:function(){c(function(n){Ao(n,jb)})},sendMessage:function(n){c(function(t){t.getSystem().broadcastOn([zM],n)})}});return{dialog:w,instanceApi:C}},vF=function(n,t,e){return t&&e?[]:[OE.config({contextual:{lazyContext:function(){return y.some(ku(ae.fromDom(n.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},bF=function(n){var t=n.backstage,e=n.editor,o=Ch(e),r=function(n){var t=n.backstage.shared;return{open:function(e,o){var r=function(){$D.hide(c),o()},i=Dg(bk({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:y.none()},"cancel",n.backstage)),u=WM(),a=UM(r,t.providers),c=Qi(qM({lazySink:function(){return t.getSink()},header:jM(u,a),body:GM(e,t.providers),footer:y.some(XM(YM([],[i.asSpec()]))),onEscape:r,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[No(Ub,r)],eventOrder:{}}));$D.show(c);var s=i.get(c);Vm.focus(s)}}}(n),i=function(n){var t=n.backstage.shared;return{open:function(e,o){var r=function(n){$D.hide(s),o(n)},i=Dg(bk({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:y.none()},"submit",n.backstage)),u=bk({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:y.none()},"cancel",n.backstage),a=WM(),c=UM(function(){return r(!1)},t.providers),s=Qi(qM({lazySink:function(){return t.getSink()},header:jM(a,c),body:GM(e,t.providers),footer:y.some(XM(YM([],[u,i.asSpec()]))),onEscape:function(){return r(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[No(Ub,function(){return r(!1)}),No(Gb,function(){return r(!0)})],eventOrder:{}}));$D.show(s);var f=i.get(s);Vm.focus(f)}}}(n),u=function(n,o){return hM.openUrl(function(n){var r=hF(n,{closeWindow:function(){$D.hide(r.dialog),o(r.instanceApi)}},e,t);return $D.show(r.dialog),r.instanceApi},n)},a=function(n,e){return hM.open(function(n,o,r){var i=o,u=lF({dataValidator:r,initialData:i,internalDialog:n},{redial:hM.redial,closeWindow:function(){$D.hide(u.dialog),e(u.instanceApi)}},t);return $D.show(u.dialog),u.instanceApi.setData(i),u.instanceApi},n)},c=function(n,r,i,u){return hM.open(function(n,a,c){var s,f=St(wt("data",c,a)),l=(s=ie(y.none()),{clear:function(){s.set(y.none())},set:function(n){s.set(y.some(n))},isSet:function(){return s.get().isSome()},on:function(n){s.get().each(n)}}),m=t.shared.header.isPositionedAtTop(),p=function(){return l.on(function(n){hg.reposition(n),OE.refresh(n)})},h=dF({dataValidator:c,initialData:f,internalDialog:n},{redial:hM.redial,closeWindow:function(){l.on(hg.hide),e.off("ResizeEditor",p),l.clear(),i(h.instanceApi)}},t,u),v=Qi(hg.sketch(d(d({lazySink:t.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},m?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:Pa(g([Am("window-manager-inline-events",[No(ko(),function(n,t){Ao(h.dialog,Ub)})])],vF(e,o,m))),isExtraPart:function(n,t){return function(n){return db(n,".tox-alert-dialog")||db(n,".tox-confirm-dialog")}(t)}})));return l.set(v),hg.showWithin(v,r,Zi(h.dialog),y.some(_i())),o&&m||(OE.refresh(v),e.on("ResizeEditor",p)),h.instanceApi.setData(f),Om.focusIn(h.dialog),h.instanceApi},n)};return{open:function(n,e,o){return void 0!==e&&"toolbar"===e.inline?c(n,t.shared.anchors.inlineDialog(),o,e.ariaAttrs):void 0!==e&&"cursor"===e.inline?c(n,t.shared.anchors.cursor(),o,e.ariaAttrs):a(n,o)},openUrl:function(n,t){return u(n,t)},alert:function(n,t){r.open(n,function(){t()})},close:function(n){n.close()},confirm:function(n,t){i.open(n,function(n){t(n)})}}};l.add("silver",function(n){var t=YD(n),e=t.uiMothership,o=t.backstage,i=t.renderUI,u=t.getUi;ab.register(n,o.shared);var a=bF({editor:n,backstage:o});return{renderUI:i,getWindowManagerImpl:r(a),getNotificationManagerImpl:function(){return Rg(0,{backstage:o},e)},ui:u()}})}(window); },{"process":"g5IB"}],"wAqg":[function(require,module,exports) { require("./theme.js"); },{"./theme.js":"n3pW"}],"xPuB":[function(require,module,exports) { tinymce.addI18n("pl",{Redo:"Powtórz",Undo:"Cofnij",Cut:"Wytnij",Copy:"Kopiuj",Paste:"Wklej","Select all":"Zaznacz wszystko","New document":"Nowy dokument",Ok:"Ok",Cancel:"Anuluj","Visual aids":"Pomoce wizualne",Bold:"Pogrubienie",Italic:"Kursywa",Underline:"Podkreślenie",Strikethrough:"Przekreślenie",Superscript:"Indeks górny",Subscript:"Indeks dolny","Clear formatting":"Wyczyść formatowanie","Align left":"Wyrównaj do lewej","Align center":"Wyrównaj do środka","Align right":"Wyrównaj do prawej",Justify:"Wyjustuj","Bullet list":"Lista wypunktowana","Numbered list":"Lista numerowana","Decrease indent":"Zmniejsz wcięcie","Increase indent":"Zwiększ wcięcie",Close:"Zamknij",Formats:"Formaty","Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.":"Twoja przeglądarka nie obsługuje bezpośredniego dostępu do schowka. Użyj zamiast tego kombinacji klawiszy Ctrl+X/C/V.",Headers:"Nagłówki","Header 1":"Nagłówek 1","Header 2":"Nagłówek 2","Header 3":"Nagłówek 3","Header 4":"Nagłówek 4","Header 5":"Nagłówek 5","Header 6":"Nagłówek 6",Headings:"Nagłówki","Heading 1":"Nagłówek 1","Heading 2":"Nagłówek 2","Heading 3":"Nagłówek 3","Heading 4":"Nagłówek 4","Heading 5":"Nagłówek 5","Heading 6":"Nagłówek 6",Preformatted:"Wstępne formatowanie",Div:"Div",Pre:"Pre",Code:"Kod",Paragraph:"Akapit",Blockquote:"Blok cytatu",Inline:"W tekście",Blocks:"Bloki","Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.":"Wklejanie jest w trybie tekstowym. Zawartość zostanie wklejona jako zwykły tekst dopóki nie wyłączysz tej opcji.",Fonts:"Fonty","Font Sizes":"Rozmiar fontu",Class:"Klasa","Browse for an image":"Przeglądaj za zdjęciem",OR:"LUB","Drop an image here":"Upuść obraz tutaj",Upload:"Prześlij",Block:"Zablokuj",Align:"Wyrównaj",Default:"Domyślne",Circle:"Kółko",Disc:"Dysk",Square:"Kwadrat","Lower Alpha":"Małe litery","Lower Greek":"Małe greckie","Lower Roman":"Małe rzymskie","Upper Alpha":"Wielkie litery","Upper Roman":"Wielkie rzymskie","Anchor...":"Kotwica...",Name:"Nazwa",Id:"Identyfikator","Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.":"Identyfikator powinien zaczynać się literą, dozwolone są tylko litery, numery, ukośniki, kropki, dwukropki i podkreślniki - tzw. podłogi","You have unsaved changes are you sure you want to navigate away?":"Masz niezapisane zmiany. Czy na pewno chcesz opuścić stronę?","Restore last draft":"Przywróć ostatni szkic","Special character...":"Znak specjalny...","Source code":"Kod źródłowy","Insert/Edit code sample":"Dodaj/Edytuj przykładowy kod",Language:"Język","Code sample...":"Przykład kodu...","Color Picker":"Selektor kolorów",R:"R",G:"G",B:"B","Left to right":"Od lewej do prawej","Right to left":"Od prawej do lewej","Emoticons...":"Emotikony...","Metadata and Document Properties":"Metadane i właściwości dokumentu",Title:"Tytuł",Keywords:"Słowa kluczowe",Description:"Opis",Robots:"Roboty",Author:"Autor",Encoding:"Kodowanie",Fullscreen:"Pełny ekran",Action:"Akcja",Shortcut:"Skrót",Help:"Pomoc",Address:"Adres","Focus to menubar":"Skup się na pasku menu","Focus to toolbar":"Skupić się na pasku","Focus to element path":"Skup się na ścieżce elementu","Focus to contextual toolbar":"Skupić się na pasku narzędzi kontekstowych","Insert link (if link plugin activated)":"Wstaw łącze (jeśli włączysz wtyczkę linków)","Save (if save plugin activated)":"Zapisz (jeśli aktywowana jest wtyczka do zapisu)","Find (if searchreplace plugin activated)":"Znajdź (jeśli włączysz wtyczkę do wyszukiwania)","Plugins installed ({0}):":"Zainstalowane wtyczki ({0}):","Premium plugins:":"Wtyczki Premium:","Learn more...":"Dowiedz się więcej...","You are using {0}":"Używasz {0}",Plugins:"Pluginy","Handy Shortcuts":"Przydatne skróty","Horizontal line":"Pozioma linia","Insert/edit image":"Wstaw/edytuj obrazek","Image description":"Opis obrazka",Source:"Źródło",Dimensions:"Wymiary","Constrain proportions":"Zachowaj proporcje",General:"Ogólne",Advanced:"Zaawansowane",Style:"Styl","Vertical space":"Odstęp pionowy","Horizontal space":"Odstęp poziomy",Border:"Ramka","Insert image":"Wstaw obrazek","Image...":"Obraz...","Image list":"Lista obrazków","Rotate counterclockwise":"Obróć w lewo","Rotate clockwise":"Obróć w prawo","Flip vertically":"Przerzuć w pionie","Flip horizontally":"Przerzuć w poziomie","Edit image":"Edytuj obrazek","Image options":"Opcje obrazu","Zoom in":"Powiększ","Zoom out":"Pomniejsz",Crop:"Przytnij",Resize:"Zmiana rozmiaru",Orientation:"Orientacja",Brightness:"Jasność",Sharpen:"Wyostrz",Contrast:"Kontrast","Color levels":"Poziom koloru",Gamma:"Gamma",Invert:"Odwróć",Apply:"Zaakceptuj",Back:"Cofnij","Insert date/time":"Wstaw datę/czas","Date/time":"Data/Czas","Insert/Edit Link":"Wstaw/Edytuj łącze","Insert/edit link":"Wstaw/edytuj łącze","Text to display":"Tekst do wyświetlenia",Url:"URL","Open link in...":"Otwórz łącze w...","Current window":"Bieżące okno",None:"Żaden","New window":"Nowe okno","Remove link":"Usuń łącze",Anchors:"Kotwice","Link...":"Łącze...","Paste or type a link":"Wklej lub wpisz adres łącza","The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?":"URL, który wprowadziłeś wygląda na adres e-mail. Czy chcesz dodać mailto: jako prefiks?","The URL you entered seems to be an external link. Do you want to add the required http:// prefix?":"URL, który wprowadziłeś wygląda na link zewnętrzny. Czy chcesz dodać http:// jako prefiks?","Link list":"Lista linków","Insert video":"Wstaw wideo","Insert/edit video":"Wstaw/edytuj wideo","Insert/edit media":"Wstaw/Edytuj media","Alternative source":"Alternatywne źródło","Alternative source URL":"Alternatywny URL źródła","Media poster (Image URL)":"Plakat (URL obrazu)","Paste your embed code below:":"Wklej tutaj kod do osadzenia:",Embed:"Osadź","Media...":"Multimedia...","Nonbreaking space":"Niełamliwa spacja","Page break":"Podział strony","Paste as text":"Wklej jako zwykły tekst",Preview:"Podgląd","Print...":"Drukuj...",Save:"Zapisz",Find:"Znajdź","Replace with":"Zamień na",Replace:"Zamień","Replace all":"Zamień wszystko",Previous:"Poprzedni",Next:"Nast.","Find and replace...":"Znajdź i zamień...","Could not find the specified string.":"Nie znaleziono szukanego tekstu.","Match case":"Dopasuj wielkość liter","Find whole words only":"Znajdź tylko całe wyrazy","Spell check":"Sprawdź pisownię",Ignore:"Ignoruj","Ignore all":"Ignoruj wszystko",Finish:"Zakończ","Add to Dictionary":"Dodaj do słownika","Insert table":"Wstaw tabelę","Table properties":"Właściwości tabeli","Delete table":"Usuń tabelę",Cell:"Komórka",Row:"Wiersz",Column:"Kolumna","Cell properties":"Właściwości komórki","Merge cells":"Łącz komórki","Split cell":"Podziel komórkę","Insert row before":"Wstaw wiersz przed","Insert row after":"Wstaw wiersz po","Delete row":"Usuń wiersz","Row properties":"Właściwości wiersza","Cut row":"Wytnij wiersz","Copy row":"Kopiuj wiersz","Paste row before":"Wklej wiersz przed","Paste row after":"Wklej wiersz po","Insert column before":"Wstaw kolumnę przed","Insert column after":"Wstaw kolumnę po","Delete column":"Usuń kolumnę",Cols:"Kol.",Rows:"Wiersz.",Width:"Szerokość",Height:"Wysokość","Cell spacing":"Odstępy komórek","Cell padding":"Dopełnienie komórki","Show caption":"Pokaż podpis",Left:"Lewo",Center:"Środek",Right:"Prawo","Cell type":"Typ komórki",Scope:"Kontekst",Alignment:"Wyrównanie","H Align":"Wyrównanie w pionie","V Align":"Wyrównanie w poziomie",Top:"Góra",Middle:"Środek",Bottom:"Dół","Header cell":"Komórka nagłówka","Row group":"Grupa wierszy","Column group":"Grupa kolumn","Row type":"Typ wiersza",Header:"Nagłówek",Body:"Treść",Footer:"Stopka","Border color":"Kolor ramki","Insert template...":"Wstaw szablon...",Templates:"Szablony",Template:"Szablon","Text color":"Kolor tekstu","Background color":"Kolor tła","Custom...":"Niestandardowy...","Custom color":"Kolor niestandardowy","No color":"Bez koloru","Remove color":"Usuń kolor","Table of Contents":"Spis treści","Show blocks":"Pokaż bloki","Show invisible characters":"Pokaż niewidoczne znaki","Word count":"Liczba słów",Count:"Liczba",Document:"Dokument",Selection:"Zaznaczenie",Words:"Słowa","Words: {0}":"Słów: {0}","{0} words":"{0} słów",File:"Plik",Edit:"Edycja",Insert:"Wstaw",View:"Widok",Format:"Format",Table:"Tabela",Tools:"Narzędzia","Powered by {0}":"Powered by {0}","Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help":"Obszar Edycji. ALT-F9 - menu. ALT-F10 - pasek narzędzi. ALT-0 - pomoc","Image title":"Tytuł obrazu","Border width":"Grubość ramki","Border style":"Styl ramki",Error:"Błąd",Warn:"Ostrzeżenie",Valid:"Prawidłowe","To open the popup, press Shift+Enter":"Aby otworzyć okienko, naciśnij Shift+Enter","Rich Text Area. Press ALT-0 for help.":"Obszar tekstu sformatowanego. Naciśnij ALT-0, aby uzyskać pomoc.","System Font":"Font systemowy","Failed to upload image: {0}":"Nie udało się przesłać obrazu: {0}","Failed to load plugin: {0} from url {1}":"Nie udało się załadować dodatku: {0} spod adresu url {1}","Failed to load plugin url: {0}":"Nie udało się załadować adresu url dodatku: {0}","Failed to initialize plugin: {0}":"Nie można zainicjować dodatku: {0}",example:"przykład",Search:"Wyszukaj",All:"Wszystkie",Currency:"Waluta",Text:"Tekst",Quotations:"Cudzysłowy",Mathematical:"Matematyczne","Extended Latin":"Rozszerzony łaciński",Symbols:"Symbole",Arrows:"Strzałki","User Defined":"Własny","dollar sign":"znak dolara","currency sign":"znak waluty","euro-currency sign":"znak euro","colon sign":"znak colon","cruzeiro sign":"znak cruzeiro","french franc sign":"znak franka francuskiego","lira sign":"znak liry","mill sign":"znak mill","naira sign":"znak nairy","peseta sign":"znak pesety","rupee sign":"znak rupii","won sign":"znak wona","new sheqel sign":"znak nowego szekla","dong sign":"znak donga","kip sign":"znak kipa","tugrik sign":"znak tugrika","drachma sign":"znak drachmy","german penny symbol":"znak feniga","peso sign":"znak peso","guarani sign":"znak guarani","austral sign":"znak australa","hryvnia sign":"znak hrywny","cedi sign":"znak cedi","livre tournois sign":"znak livre tournois","spesmilo sign":"znak spesmilo","tenge sign":"znak tenge","indian rupee sign":"znak rupii indyjskiej","turkish lira sign":"znak liry tureckiej","nordic mark sign":"znak nordic mark","manat sign":"znak manata","ruble sign":"znak rubla","yen character":"znak jena","yuan character":"znak juana","yuan character, in hong kong and taiwan":"znak juana w Hongkongu i na Tajwanie","yen/yuan character variant one":"jen/juan, wariant pierwszy","Loading emoticons...":"Ładowanie emotikonów...","Could not load emoticons":"Nie można załadować emotikonów",People:"Ludzie","Animals and Nature":"Zwierzęta i natura","Food and Drink":"Jedzenie i picie",Activity:"Aktywność","Travel and Places":"Podróże i miejsca",Objects:"Obiekty",Flags:"Flagi",Characters:"Znaki","Characters (no spaces)":"Znaki (bez spacji)","{0} characters":"{0} znaków","Error: Form submit field collision.":"Błąd: kolizja pola przesyłania formularza.","Error: No form element found.":"Błąd: nie znaleziono elementu formularza.",Update:"Aktualizuj","Color swatch":"Próbka koloru",Turquoise:"Turkusowy",Green:"Zielony",Blue:"Niebieski",Purple:"Purpurowy","Navy Blue":"Ciemnoniebieski","Dark Turquoise":"Ciemnoturkusowy","Dark Green":"Ciemnozielony","Medium Blue":"Średnioniebieski","Medium Purple":"Średniopurpurowy","Midnight Blue":"Nocny błękit",Yellow:"Żółty",Orange:"Pomarańczowy",Red:"Czerwony","Light Gray":"Jasnoszary",Gray:"Szary","Dark Yellow":"Ciemnożółty","Dark Orange":"Ciemnopomarańczowy","Dark Red":"Ciemnoczerwony","Medium Gray":"Średnioszary","Dark Gray":"Ciemnoszary","Light Green":"Jasnozielony","Light Yellow":"Jasnożółty","Light Red":"Jasnoczerwony","Light Purple":"Jasnopurpurowy","Light Blue":"Jasnoniebieski","Dark Purple":"Ciemnopurpurowy","Dark Blue":"Ciemnoniebieski",Black:"Czarny",White:"Biały","Switch to or from fullscreen mode":"Włącz lub wyłącz tryb pełnoekranowy","Open help dialog":"Otwórz okno dialogowe pomocy",history:"historia",styles:"style",formatting:"formatowanie",alignment:"wyrównanie",indentation:"wcięcie","permanent pen":"marker",comments:"komentarze","Format Painter":"Malarz formatów","Insert/edit iframe":"Wstaw/edytuj iframe",Capitalization:"Jak w zdaniu",lowercase:"małe litery",UPPERCASE:"WIELKIE LITERY","Title Case":"Jak Nazwy Własne","Permanent Pen Properties":"Właściwości markera","Permanent pen properties...":"Właściwości markera...",Font:"Font",Size:"Rozmiar","More...":"Więcej...","Spellcheck Language":"Język sprawdzania pisowni","Select...":"Wybierz...",Preferences:"Ustawienia",Yes:"Tak",No:"Nie","Keyboard Navigation":"Nawigacja za pomocą klawiatury",Version:"Wersja",Anchor:"Kotwica","Special character":"Znak specjalny","Code sample":"Przykład kodu źródłowego",Color:"Kolor",Emoticons:"Ikony emocji","Document properties":"Właściwości dokumentu",Image:"Obraz","Insert link":"Wstaw łącze",Target:"Cel",Link:"Adres łącza",Poster:"Plakat",Media:"Media",Print:"Drukuj",Prev:"Poprz.","Find and replace":"Znajdź i zamień","Whole words":"Całe słowa",Spellcheck:"Sprawdzanie pisowni",Caption:"Tytuł","Insert template":"Wstaw szablon"}); },{}],"G1XN":[function(require,module,exports) { var define; var e;function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(i){"function"==typeof e&&e.amd?e(["jquery"],i):"object"===("undefined"==typeof exports?"undefined":t(exports))?i(require("jquery")):i(jQuery)}(function(e,i){function s(){return new Date(Date.UTC.apply(Date,arguments))}"indexOf"in Array.prototype||(Array.prototype.indexOf=function(e,t){t===i&&(t=0),t<0&&(t+=this.length),t<0&&(t=0);for(var s=this.length;t<s;t++)if(t in this&&this[t]===e)return t;return-1});var a=function(t,s){var a=this;this.element=e(t),this.container=s.container||"body",this.language=s.language||this.element.data("date-language")||"en",this.language=this.language in h?this.language:this.language.split("-")[0],this.language=this.language in h?this.language:"en",this.isRTL=h[this.language].rtl||!1,this.formatType=s.formatType||this.element.data("format-type")||"standard",this.format=o.parseFormat(s.format||this.element.data("date-format")||h[this.language].format||o.getDefaultFormat(this.formatType,"input"),this.formatType),this.isInline=!1,this.isVisible=!1,this.isInput=this.element.is("input"),this.fontAwesome=s.fontAwesome||this.element.data("font-awesome")||!1,this.bootcssVer=s.bootcssVer||(this.isInput?this.element.is(".form-control")?3:2:this.bootcssVer=this.element.is(".input-group")?3:2),this.component=!!this.element.is(".date")&&(3===this.bootcssVer?this.element.find(".input-group-addon .glyphicon-th, .input-group-addon .glyphicon-time, .input-group-addon .glyphicon-remove, .input-group-addon .glyphicon-calendar, .input-group-addon .fa-calendar, .input-group-addon .fa-clock-o").parent():this.element.find(".add-on .icon-th, .add-on .icon-time, .add-on .icon-calendar, .add-on .fa-calendar, .add-on .fa-clock-o").parent()),this.componentReset=!!this.element.is(".date")&&(3===this.bootcssVer?this.element.find(".input-group-addon .glyphicon-remove, .input-group-addon .fa-times").parent():this.element.find(".add-on .icon-remove, .add-on .fa-times").parent()),this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.linkField=s.linkField||this.element.data("link-field")||!1,this.linkFormat=o.parseFormat(s.linkFormat||this.element.data("link-format")||o.getDefaultFormat(this.formatType,"link"),this.formatType),this.minuteStep=s.minuteStep||this.element.data("minute-step")||5,this.pickerPosition=s.pickerPosition||this.element.data("picker-position")||"bottom-right",this.showMeridian=s.showMeridian||this.element.data("show-meridian")||!1,this.initialDate=s.initialDate||new Date,this.zIndex=s.zIndex||this.element.data("z-index")||i,this.title=void 0!==s.title&&s.title,this.timezone=s.timezone||function(){var e,t,i,s,a;if((i=(null!=(a=(t=(new Date).toString()).split("(")[1])?a.slice(0,-1):0)||t.split(" "))instanceof Array){s=[];for(var n=0,h=i.length;n<h;n++)(e=null!==(a=i[n].match(/\b[A-Z]+\b/)))&&a[0]&&s.push(e);i=s.pop()}return i}(),this.icons={leftArrow:this.fontAwesome?"fa-arrow-left":3===this.bootcssVer?"glyphicon-arrow-left":"icon-arrow-left",rightArrow:this.fontAwesome?"fa-arrow-right":3===this.bootcssVer?"glyphicon-arrow-right":"icon-arrow-right"},this.icontype=this.fontAwesome?"fa":"glyphicon",this._attachEvents(),this.clickedOutside=function(t){0===e(t.target).closest(".datetimepicker").length&&a.hide()},this.formatViewType="datetime","formatViewType"in s?this.formatViewType=s.formatViewType:"formatViewType"in this.element.data()&&(this.formatViewType=this.element.data("formatViewType")),this.minView=0,"minView"in s?this.minView=s.minView:"minView"in this.element.data()&&(this.minView=this.element.data("min-view")),this.minView=o.convertViewMode(this.minView),this.maxView=o.modes.length-1,"maxView"in s?this.maxView=s.maxView:"maxView"in this.element.data()&&(this.maxView=this.element.data("max-view")),this.maxView=o.convertViewMode(this.maxView),this.wheelViewModeNavigation=!1,"wheelViewModeNavigation"in s?this.wheelViewModeNavigation=s.wheelViewModeNavigation:"wheelViewModeNavigation"in this.element.data()&&(this.wheelViewModeNavigation=this.element.data("view-mode-wheel-navigation")),this.wheelViewModeNavigationInverseDirection=!1,"wheelViewModeNavigationInverseDirection"in s?this.wheelViewModeNavigationInverseDirection=s.wheelViewModeNavigationInverseDirection:"wheelViewModeNavigationInverseDirection"in this.element.data()&&(this.wheelViewModeNavigationInverseDirection=this.element.data("view-mode-wheel-navigation-inverse-dir")),this.wheelViewModeNavigationDelay=100,"wheelViewModeNavigationDelay"in s?this.wheelViewModeNavigationDelay=s.wheelViewModeNavigationDelay:"wheelViewModeNavigationDelay"in this.element.data()&&(this.wheelViewModeNavigationDelay=this.element.data("view-mode-wheel-navigation-delay")),this.startViewMode=2,"startView"in s?this.startViewMode=s.startView:"startView"in this.element.data()&&(this.startViewMode=this.element.data("start-view")),this.startViewMode=o.convertViewMode(this.startViewMode),this.viewMode=this.startViewMode,this.viewSelect=this.minView,"viewSelect"in s?this.viewSelect=s.viewSelect:"viewSelect"in this.element.data()&&(this.viewSelect=this.element.data("view-select")),this.viewSelect=o.convertViewMode(this.viewSelect),this.forceParse=!0,"forceParse"in s?this.forceParse=s.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse"));for(var n=3===this.bootcssVer?o.templateV3:o.template;-1!==n.indexOf("{iconType}");)n=n.replace("{iconType}",this.icontype);for(;-1!==n.indexOf("{leftArrow}");)n=n.replace("{leftArrow}",this.icons.leftArrow);for(;-1!==n.indexOf("{rightArrow}");)n=n.replace("{rightArrow}",this.icons.rightArrow);if(this.picker=e(n).appendTo(this.isInline?this.element:this.container).on({click:e.proxy(this.click,this),mousedown:e.proxy(this.mousedown,this)}),this.wheelViewModeNavigation&&(e.fn.mousewheel?this.picker.on({mousewheel:e.proxy(this.mousewheel,this)}):console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option")),this.isInline?this.picker.addClass("datetimepicker-inline"):this.picker.addClass("datetimepicker-dropdown-"+this.pickerPosition+" dropdown-menu"),this.isRTL){this.picker.addClass("datetimepicker-rtl");var r=3===this.bootcssVer?".prev span, .next span":".prev i, .next i";this.picker.find(r).toggleClass(this.icons.leftArrow+" "+this.icons.rightArrow)}e(document).on("mousedown touchend",this.clickedOutside),this.autoclose=!1,"autoclose"in s?this.autoclose=s.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in s?this.keyboardNavigation=s.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),this.todayBtn=s.todayBtn||this.element.data("date-today-btn")||!1,this.clearBtn=s.clearBtn||this.element.data("date-clear-btn")||!1,this.todayHighlight=s.todayHighlight||this.element.data("date-today-highlight")||!1,this.weekStart=0,void 0!==s.weekStart?this.weekStart=s.weekStart:void 0!==this.element.data("date-weekstart")?this.weekStart=this.element.data("date-weekstart"):void 0!==h[this.language].weekStart&&(this.weekStart=h[this.language].weekStart),this.weekStart=this.weekStart%7,this.weekEnd=(this.weekStart+6)%7,this.onRenderDay=function(e){var t=(s.onRenderDay||function(){return[]})(e);"string"==typeof t&&(t=[t]);return["day"].concat(t||[])},this.onRenderHour=function(e){var t=(s.onRenderHour||function(){return[]})(e);return"string"==typeof t&&(t=[t]),["hour"].concat(t||[])},this.onRenderMinute=function(e){var t=(s.onRenderMinute||function(){return[]})(e),i=["minute"];return"string"==typeof t&&(t=[t]),e<this.startDate||e>this.endDate?i.push("disabled"):Math.floor(this.date.getUTCMinutes()/this.minuteStep)===Math.floor(e.getUTCMinutes()/this.minuteStep)&&i.push("active"),i.concat(t||[])},this.onRenderYear=function(e){var t=(s.onRenderYear||function(){return[]})(e),i=["year"];"string"==typeof t&&(t=[t]),this.date.getUTCFullYear()===e.getUTCFullYear()&&i.push("active");var a=e.getUTCFullYear(),n=this.endDate.getUTCFullYear();return(e<this.startDate||a>n)&&i.push("disabled"),i.concat(t||[])},this.onRenderMonth=function(e){var t=(s.onRenderMonth||function(){return[]})(e);return"string"==typeof t&&(t=[t]),["month"].concat(t||[])},this.startDate=new Date(-8639968443048e3),this.endDate=new Date(8639968443048e3),this.datesDisabled=[],this.daysOfWeekDisabled=[],this.setStartDate(s.startDate||this.element.data("date-startdate")),this.setEndDate(s.endDate||this.element.data("date-enddate")),this.setDatesDisabled(s.datesDisabled||this.element.data("date-dates-disabled")),this.setDaysOfWeekDisabled(s.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.setMinutesDisabled(s.minutesDisabled||this.element.data("date-minute-disabled")),this.setHoursDisabled(s.hoursDisabled||this.element.data("date-hour-disabled")),this.fillDow(),this.fillMonths(),this.update(),this.showMode(),this.isInline&&this.show()};a.prototype={constructor:a,_events:[],_attachEvents:function(){this._detachEvents(),this.isInput?this._events=[[this.element,{focus:e.proxy(this.show,this),keyup:e.proxy(this.update,this),keydown:e.proxy(this.keydown,this)}]]:this.component&&this.hasInput?(this._events=[[this.element.find("input"),{focus:e.proxy(this.show,this),keyup:e.proxy(this.update,this),keydown:e.proxy(this.keydown,this)}],[this.component,{click:e.proxy(this.show,this)}]],this.componentReset&&this._events.push([this.componentReset,{click:e.proxy(this.reset,this)}])):this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:e.proxy(this.show,this)}]];for(var t,i,s=0;s<this._events.length;s++)t=this._events[s][0],i=this._events[s][1],t.on(i)},_detachEvents:function(){for(var e,t,i=0;i<this._events.length;i++)e=this._events[i][0],t=this._events[i][1],e.off(t);this._events=[]},show:function(t){this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.forceParse&&this.update(),this.place(),e(window).on("resize",e.proxy(this.place,this)),t&&(t.stopPropagation(),t.preventDefault()),this.isVisible=!0,this.element.trigger({type:"show",date:this.date})},hide:function(){this.isVisible&&(this.isInline||(this.picker.hide(),e(window).off("resize",this.place),this.viewMode=this.startViewMode,this.showMode(),this.isInput||e(document).off("mousedown",this.hide),this.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this.isVisible=!1,this.element.trigger({type:"hide",date:this.date})))},remove:function(){this._detachEvents(),e(document).off("mousedown",this.clickedOutside),this.picker.remove(),delete this.picker,delete this.element.data().datetimepicker},getDate:function(){var e=this.getUTCDate();return null===e?null:new Date(e.getTime()+6e4*e.getTimezoneOffset())},getUTCDate:function(){return this.date},getInitialDate:function(){return this.initialDate},setInitialDate:function(e){this.initialDate=e},setDate:function(e){this.setUTCDate(new Date(e.getTime()-6e4*e.getTimezoneOffset()))},setUTCDate:function(e){e>=this.startDate&&e<=this.endDate?(this.date=e,this.setValue(),this.viewDate=this.date,this.fill()):this.element.trigger({type:"outOfRange",date:e,startDate:this.startDate,endDate:this.endDate})},setFormat:function(e){var t;this.format=o.parseFormat(e,this.formatType),this.isInput?t=this.element:this.component&&(t=this.element.find("input")),t&&t.val()&&this.setValue()},setValue:function(){var t=this.getFormattedDate();this.isInput?this.element.val(t):(this.component&&this.element.find("input").val(t),this.element.data("date",t)),this.linkField&&e("#"+this.linkField).val(this.getFormattedDate(this.linkFormat))},getFormattedDate:function(e){return e=e||this.format,o.formatDate(this.date,e,this.language,this.formatType,this.timezone)},setStartDate:function(e){this.startDate=e||this.startDate,8639968443048e3!==this.startDate.valueOf()&&(this.startDate=o.parseDate(this.startDate,this.format,this.language,this.formatType,this.timezone)),this.update(),this.updateNavArrows()},setEndDate:function(e){this.endDate=e||this.endDate,8639968443048e3!==this.endDate.valueOf()&&(this.endDate=o.parseDate(this.endDate,this.format,this.language,this.formatType,this.timezone)),this.update(),this.updateNavArrows()},setDatesDisabled:function(t){this.datesDisabled=t||[],e.isArray(this.datesDisabled)||(this.datesDisabled=this.datesDisabled.split(/,\s*/));var i=this;this.datesDisabled=e.map(this.datesDisabled,function(e){return o.parseDate(e,i.format,i.language,i.formatType,i.timezone).toDateString()}),this.update(),this.updateNavArrows()},setTitle:function(e,t){return this.picker.find(e).find("th:eq(1)").text(!1===this.title?t:this.title)},setDaysOfWeekDisabled:function(t){this.daysOfWeekDisabled=t||[],e.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/)),this.daysOfWeekDisabled=e.map(this.daysOfWeekDisabled,function(e){return parseInt(e,10)}),this.update(),this.updateNavArrows()},setMinutesDisabled:function(t){this.minutesDisabled=t||[],e.isArray(this.minutesDisabled)||(this.minutesDisabled=this.minutesDisabled.split(/,\s*/)),this.minutesDisabled=e.map(this.minutesDisabled,function(e){return parseInt(e,10)}),this.update(),this.updateNavArrows()},setHoursDisabled:function(t){this.hoursDisabled=t||[],e.isArray(this.hoursDisabled)||(this.hoursDisabled=this.hoursDisabled.split(/,\s*/)),this.hoursDisabled=e.map(this.hoursDisabled,function(e){return parseInt(e,10)}),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){if(!this.zIndex){var t=0;e("div").each(function(){var i=parseInt(e(this).css("zIndex"),10);i>t&&(t=i)}),this.zIndex=t+10}var i,s,a,n;n=this.container instanceof e?this.container.offset():e(this.container).offset(),this.component?(a=(i=this.component.offset()).left,"bottom-left"!==this.pickerPosition&&"top-left"!==this.pickerPosition||(a+=this.component.outerWidth()-this.picker.outerWidth())):(a=(i=this.element.offset()).left,"bottom-left"!==this.pickerPosition&&"top-left"!==this.pickerPosition||(a+=this.element.outerWidth()-this.picker.outerWidth()));var h=document.body.clientWidth||window.innerWidth;a+220>h&&(a=h-220),s="top-left"===this.pickerPosition||"top-right"===this.pickerPosition?i.top-this.picker.outerHeight():i.top+this.height,s-=n.top,a-=n.left,this.picker.css({top:s,left:a,zIndex:this.zIndex})}},hour_minute:"^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]",update:function(){var e,t=!1;arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(e=arguments[0],t=!0):"string"==typeof(e=(this.isInput?this.element.val():this.element.find("input").val())||this.element.data("date")||this.initialDate)&&(e=e.replace(/^\s+|\s+$/g,"")),e||(e=new Date,t=!1),"string"==typeof e&&(new RegExp(this.hour_minute).test(e)||new RegExp(this.hour_minute+":[0-5][0-9]").test(e))&&(e=this.getDate()),this.date=o.parseDate(e,this.format,this.language,this.formatType,this.timezone),t&&this.setValue(),this.date<this.startDate?this.viewDate=new Date(this.startDate):this.date>this.endDate?this.viewDate=new Date(this.endDate):this.viewDate=new Date(this.date),this.fill()},fillDow:function(){for(var e=this.weekStart,t="<tr>";e<this.weekStart+7;)t+='<th class="dow">'+h[this.language].daysMin[e++%7]+"</th>";t+="</tr>",this.picker.find(".datetimepicker-days thead").append(t)},fillMonths:function(){for(var e="",t=new Date(this.viewDate),i=0;i<12;i++){t.setUTCMonth(i),e+='<span class="'+this.onRenderMonth(t).join(" ")+'">'+h[this.language].monthsShort[i]+"</span>"}this.picker.find(".datetimepicker-months td").html(e)},fill:function(){if(this.date&&this.viewDate){var t=new Date(this.viewDate),i=t.getUTCFullYear(),a=t.getUTCMonth(),r=t.getUTCDate(),d=t.getUTCHours(),l=this.startDate.getUTCFullYear(),c=this.startDate.getUTCMonth(),u=this.endDate.getUTCFullYear(),p=this.endDate.getUTCMonth()+1,m=new s(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate()).valueOf(),f=new Date;if(this.setTitle(".datetimepicker-days",h[this.language].months[a]+" "+i),"time"===this.formatViewType){var g=this.getFormattedDate();this.setTitle(".datetimepicker-hours",g),this.setTitle(".datetimepicker-minutes",g)}else this.setTitle(".datetimepicker-hours",r+" "+h[this.language].months[a]+" "+i),this.setTitle(".datetimepicker-minutes",r+" "+h[this.language].months[a]+" "+i);this.picker.find("tfoot th.today").text(h[this.language].today||h.en.today).toggle(!1!==this.todayBtn),this.picker.find("tfoot th.clear").text(h[this.language].clear||h.en.clear).toggle(!1!==this.clearBtn),this.updateNavArrows(),this.fillMonths();var v=s(i,a-1,28,0,0,0,0),w=o.getDaysInMonth(v.getUTCFullYear(),v.getUTCMonth());v.setUTCDate(w),v.setUTCDate(w-(v.getUTCDay()-this.weekStart+7)%7);var D=new Date(v);D.setUTCDate(D.getUTCDate()+42),D=D.valueOf();for(var y,T=[];v.valueOf()<D;)v.getUTCDay()===this.weekStart&&T.push("<tr>"),y=this.onRenderDay(v),v.getUTCFullYear()<i||v.getUTCFullYear()===i&&v.getUTCMonth()<a?y.push("old"):(v.getUTCFullYear()>i||v.getUTCFullYear()===i&&v.getUTCMonth()>a)&&y.push("new"),this.todayHighlight&&v.getUTCFullYear()===f.getFullYear()&&v.getUTCMonth()===f.getMonth()&&v.getUTCDate()===f.getDate()&&y.push("today"),v.valueOf()===m&&y.push("active"),(v.valueOf()+864e5<=this.startDate||v.valueOf()>this.endDate||-1!==e.inArray(v.getUTCDay(),this.daysOfWeekDisabled)||-1!==e.inArray(v.toDateString(),this.datesDisabled))&&y.push("disabled"),T.push('<td class="'+y.join(" ")+'">'+v.getUTCDate()+"</td>"),v.getUTCDay()===this.weekEnd&&T.push("</tr>"),v.setUTCDate(v.getUTCDate()+1);this.picker.find(".datetimepicker-days tbody").empty().append(T.join("")),T=[];var C="",k="",b="",M=this.hoursDisabled||[];t=new Date(this.viewDate);for(var U=0;U<24;U++){t.setUTCHours(U),y=this.onRenderHour(t),-1!==M.indexOf(U)&&y.push("disabled");var V=s(i,a,r,U);V.valueOf()+36e5<=this.startDate||V.valueOf()>this.endDate?y.push("disabled"):d===U&&y.push("active"),this.showMeridian&&2===h[this.language].meridiem.length?((k=U<12?h[this.language].meridiem[0]:h[this.language].meridiem[1])!==b&&(""!==b&&T.push("</fieldset>"),T.push('<fieldset class="hour"><legend>'+k.toUpperCase()+"</legend>")),b=k,C=U%12?U%12:12,U<12?y.push("hour_am"):y.push("hour_pm"),T.push('<span class="'+y.join(" ")+'">'+C+"</span>"),23===U&&T.push("</fieldset>")):(C=U+":00",T.push('<span class="'+y.join(" ")+'">'+C+"</span>"))}this.picker.find(".datetimepicker-hours td").html(T.join("")),T=[],C="",k="",b="";var S=this.minutesDisabled||[];t=new Date(this.viewDate);for(U=0;U<60;U+=this.minuteStep)-1===S.indexOf(U)&&(t.setUTCMinutes(U),t.setUTCSeconds(0),y=this.onRenderMinute(t),this.showMeridian&&2===h[this.language].meridiem.length?((k=d<12?h[this.language].meridiem[0]:h[this.language].meridiem[1])!==b&&(""!==b&&T.push("</fieldset>"),T.push('<fieldset class="minute"><legend>'+k.toUpperCase()+"</legend>")),b=k,C=d%12?d%12:12,T.push('<span class="'+y.join(" ")+'">'+C+":"+(U<10?"0"+U:U)+"</span>"),59===U&&T.push("</fieldset>")):(C=U+":00",T.push('<span class="'+y.join(" ")+'">'+d+":"+(U<10?"0"+U:U)+"</span>")));this.picker.find(".datetimepicker-minutes td").html(T.join(""));var F=this.date.getUTCFullYear(),x=this.setTitle(".datetimepicker-months",i).end().find(".month").removeClass("active");F===i&&x.eq(this.date.getUTCMonth()).addClass("active"),(i<l||i>u)&&x.addClass("disabled"),i===l&&x.slice(0,c).addClass("disabled"),i===u&&x.slice(p).addClass("disabled"),T="",i=10*parseInt(i/10,10);var H=this.setTitle(".datetimepicker-years",i+"-"+(i+9)).end().find("td");i-=1,t=new Date(this.viewDate);for(U=-1;U<11;U++)t.setUTCFullYear(i),y=this.onRenderYear(t),-1!==U&&10!==U||y.push(n),T+='<span class="'+y.join(" ")+'">'+i+"</span>",i+=1;H.html(T),this.place()}},updateNavArrows:function(){var e=new Date(this.viewDate),t=e.getUTCFullYear(),i=e.getUTCMonth(),s=e.getUTCDate(),a=e.getUTCHours();switch(this.viewMode){case 0:t<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&s<=this.startDate.getUTCDate()&&a<=this.startDate.getUTCHours()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),t>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&s>=this.endDate.getUTCDate()&&a>=this.endDate.getUTCHours()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:t<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&s<=this.startDate.getUTCDate()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),t>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&s>=this.endDate.getUTCDate()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 2:t<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),t>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 3:case 4:t<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),t>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},mousewheel:function(t){if(t.preventDefault(),t.stopPropagation(),!this.wheelPause){this.wheelPause=!0;var i=t.originalEvent.wheelDelta,s=i>0?1:0===i?0:-1;this.wheelViewModeNavigationInverseDirection&&(s=-s),this.showMode(s),setTimeout(e.proxy(function(){this.wheelPause=!1},this),this.wheelViewModeNavigationDelay)}},click:function(t){t.stopPropagation(),t.preventDefault();var i=e(t.target).closest("span, td, th, legend");if(i.is("."+this.icontype)&&(i=e(i).parent().closest("span, td, th, legend")),1===i.length){if(i.is(".disabled"))return void this.element.trigger({type:"outOfRange",date:this.viewDate,startDate:this.startDate,endDate:this.endDate});switch(i[0].nodeName.toLowerCase()){case"th":switch(i[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var a=o.modes[this.viewMode].navStep*("prev"===i[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveHour(this.viewDate,a);break;case 1:this.viewDate=this.moveDate(this.viewDate,a);break;case 2:this.viewDate=this.moveMonth(this.viewDate,a);break;case 3:case 4:this.viewDate=this.moveYear(this.viewDate,a)}this.fill(),this.element.trigger({type:i[0].className+":"+this.convertViewModeText(this.viewMode),date:this.viewDate,startDate:this.startDate,endDate:this.endDate});break;case"clear":this.reset(),this.autoclose&&this.hide();break;case"today":var n=new Date;(n=s(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),0))<this.startDate?n=this.startDate:n>this.endDate&&(n=this.endDate),this.viewMode=this.startViewMode,this.showMode(0),this._setDate(n),this.fill(),this.autoclose&&this.hide()}break;case"span":if(!i.is(".disabled")){var h=this.viewDate.getUTCFullYear(),r=this.viewDate.getUTCMonth(),d=this.viewDate.getUTCDate(),l=this.viewDate.getUTCHours(),c=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();if(i.is(".month")?(this.viewDate.setUTCDate(1),r=i.parent().find("span").index(i),d=this.viewDate.getUTCDate(),this.viewDate.setUTCMonth(r),this.element.trigger({type:"changeMonth",date:this.viewDate}),this.viewSelect>=3&&this._setDate(s(h,r,d,l,c,u,0))):i.is(".year")?(this.viewDate.setUTCDate(1),h=parseInt(i.text(),10)||0,this.viewDate.setUTCFullYear(h),this.element.trigger({type:"changeYear",date:this.viewDate}),this.viewSelect>=4&&this._setDate(s(h,r,d,l,c,u,0))):i.is(".hour")?(l=parseInt(i.text(),10)||0,(i.hasClass("hour_am")||i.hasClass("hour_pm"))&&(12===l&&i.hasClass("hour_am")?l=0:12!==l&&i.hasClass("hour_pm")&&(l+=12)),this.viewDate.setUTCHours(l),this.element.trigger({type:"changeHour",date:this.viewDate}),this.viewSelect>=1&&this._setDate(s(h,r,d,l,c,u,0))):i.is(".minute")&&(c=parseInt(i.text().substr(i.text().indexOf(":")+1),10)||0,this.viewDate.setUTCMinutes(c),this.element.trigger({type:"changeMinute",date:this.viewDate}),this.viewSelect>=0&&this._setDate(s(h,r,d,l,c,u,0))),0!==this.viewMode){var p=this.viewMode;this.showMode(-1),this.fill(),p===this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide()}break;case"td":if(i.is(".day")&&!i.is(".disabled")){d=parseInt(i.text(),10)||1,h=this.viewDate.getUTCFullYear(),r=this.viewDate.getUTCMonth(),l=this.viewDate.getUTCHours(),c=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();i.is(".old")?0===r?(r=11,h-=1):r-=1:i.is(".new")&&(11===r?(r=0,h+=1):r+=1),this.viewDate.setUTCFullYear(h),this.viewDate.setUTCMonth(r,d),this.element.trigger({type:"changeDay",date:this.viewDate}),this.viewSelect>=2&&this._setDate(s(h,r,d,l,c,u,0))}p=this.viewMode;this.showMode(-1),this.fill(),p===this.viewMode&&this.autoclose&&this.hide()}}},_setDate:function(e,t){var i;t&&"date"!==t||(this.date=e),t&&"view"!==t||(this.viewDate=e),this.fill(),this.setValue(),this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&i.change(),this.element.trigger({type:"changeDate",date:this.getDate()}),null===e&&(this.date=this.viewDate)},moveMinute:function(e,t){if(!t)return e;var i=new Date(e.valueOf());return i.setUTCMinutes(i.getUTCMinutes()+t*this.minuteStep),i},moveHour:function(e,t){if(!t)return e;var i=new Date(e.valueOf());return i.setUTCHours(i.getUTCHours()+t),i},moveDate:function(e,t){if(!t)return e;var i=new Date(e.valueOf());return i.setUTCDate(i.getUTCDate()+t),i},moveMonth:function(e,t){if(!t)return e;var i,s,a=new Date(e.valueOf()),n=a.getUTCDate(),h=a.getUTCMonth(),o=Math.abs(t);if(t=t>0?1:-1,1===o)s=-1===t?function(){return a.getUTCMonth()===h}:function(){return a.getUTCMonth()!==i},i=h+t,a.setUTCMonth(i),(i<0||i>11)&&(i=(i+12)%12);else{for(var r=0;r<o;r++)a=this.moveMonth(a,t);i=a.getUTCMonth(),a.setUTCDate(n),s=function(){return i!==a.getUTCMonth()}}for(;s();)a.setUTCDate(--n),a.setUTCMonth(i);return a},moveYear:function(e,t){return this.moveMonth(e,12*t)},dateWithinRange:function(e){return e>=this.startDate&&e<=this.endDate},keydown:function(e){if(this.picker.is(":not(:visible)"))27===e.keyCode&&this.show();else{var t,i,s,a,n=!1;switch(e.keyCode){case 27:this.hide(),e.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;t=37===e.keyCode?-1:1;var h=this.viewMode;e.ctrlKey?h+=2:e.shiftKey&&(h+=1),4===h?(i=this.moveYear(this.date,t),s=this.moveYear(this.viewDate,t)):3===h?(i=this.moveMonth(this.date,t),s=this.moveMonth(this.viewDate,t)):2===h?(i=this.moveDate(this.date,t),s=this.moveDate(this.viewDate,t)):1===h?(i=this.moveHour(this.date,t),s=this.moveHour(this.viewDate,t)):0===h&&(i=this.moveMinute(this.date,t),s=this.moveMinute(this.viewDate,t)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=s,this.setValue(),this.update(),e.preventDefault(),n=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;t=38===e.keyCode?-1:1,h=this.viewMode,e.ctrlKey?h+=2:e.shiftKey&&(h+=1),4===h?(i=this.moveYear(this.date,t),s=this.moveYear(this.viewDate,t)):3===h?(i=this.moveMonth(this.date,t),s=this.moveMonth(this.viewDate,t)):2===h?(i=this.moveDate(this.date,7*t),s=this.moveDate(this.viewDate,7*t)):1===h?this.showMeridian?(i=this.moveHour(this.date,6*t),s=this.moveHour(this.viewDate,6*t)):(i=this.moveHour(this.date,4*t),s=this.moveHour(this.viewDate,4*t)):0===h&&(i=this.moveMinute(this.date,4*t),s=this.moveMinute(this.viewDate,4*t)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=s,this.setValue(),this.update(),e.preventDefault(),n=!0);break;case 13:if(0!==this.viewMode){var o=this.viewMode;this.showMode(-1),this.fill(),o===this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide();e.preventDefault();break;case 9:this.hide()}if(n)this.isInput?a=this.element:this.component&&(a=this.element.find("input")),a&&a.change(),this.element.trigger({type:"changeDate",date:this.getDate()})}},showMode:function(e){if(e){var t=Math.max(0,Math.min(o.modes.length-1,this.viewMode+e));t>=this.minView&&t<=this.maxView&&(this.element.trigger({type:"changeMode",date:this.viewDate,oldViewMode:this.viewMode,newViewMode:t}),this.viewMode=t)}this.picker.find(">div").hide().filter(".datetimepicker-"+o.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()},reset:function(){this._setDate(null,"date")},convertViewModeText:function(e){switch(e){case 4:return"decade";case 3:return"year";case 2:return"month";case 1:return"day";case 0:return"hour"}}};var n=e.fn.datetimepicker;e.fn.datetimepicker=function(s){var n,h=Array.apply(null,arguments);return h.shift(),this.each(function(){var o=e(this),r=o.data("datetimepicker"),d="object"===t(s)&&s;if(r||o.data("datetimepicker",r=new a(this,e.extend({},e.fn.datetimepicker.defaults,d))),"string"==typeof s&&"function"==typeof r[s]&&(n=r[s].apply(r,h))!==i)return!1}),n!==i?n:this},e.fn.datetimepicker.defaults={},e.fn.datetimepicker.Constructor=a;var h=e.fn.datetimepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["am","pm"],suffix:["st","nd","rd","th"],today:"Today",clear:"Clear"},pl:{days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota","Niedziela"],daysShort:["Nie","Pn","Wt","Śr","Czw","Pt","So","Nie"],daysMin:["N","Pn","Wt","Śr","Cz","Pt","So","N"],months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthsShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],today:"Dzisiaj",suffix:[],meridiem:[],weekStart:1,clear:"Wyczyść"}},o={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(e){return e%4==0&&e%100!=0||e%400==0},getDaysInMonth:function(e,t){return[31,o.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},getDefaultFormat:function(e,t){if("standard"===e)return"input"===t?"yyyy-mm-dd hh:ii":"yyyy-mm-dd hh:ii:ss";if("php"===e)return"input"===t?"Y-m-d H:i":"Y-m-d H:i:s";throw new Error("Invalid format type.")},validParts:function(e){if("standard"===e)return/t|hh?|HH?|p|P|z|Z|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g;if("php"===e)return/[dDjlNwzFmMnStyYaABgGhHis]/g;throw new Error("Invalid format type.")},nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,parseFormat:function(e,t){var i=e.replace(this.validParts(t),"\0").split("\0"),s=e.match(this.validParts(t));if(!i||!i.length||!s||0===s.length)throw new Error("Invalid date format.");return{separators:i,parts:s}},parseDate:function(t,i,n,o,r){if(t instanceof Date){var d=new Date(t.valueOf()-6e4*t.getTimezoneOffset());return d.setMilliseconds(0),d}if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(t)&&(i=this.parseFormat("yyyy-mm-dd",o)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(t)&&(i=this.parseFormat("yyyy-mm-dd hh:ii",o)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(t)&&(i=this.parseFormat("yyyy-mm-dd hh:ii:ss",o)),/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(t)){var l,c=/([-+]\d+)([dmwy])/,u=t.match(/([-+]\d+)([dmwy])/g);t=new Date;for(var p=0;p<u.length;p++)switch(g=c.exec(u[p]),l=parseInt(g[1]),g[2]){case"d":t.setUTCDate(t.getUTCDate()+l);break;case"m":t=a.prototype.moveMonth.call(a.prototype,t,l);break;case"w":t.setUTCDate(t.getUTCDate()+7*l);break;case"y":t=a.prototype.moveYear.call(a.prototype,t,l)}return s(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),0)}u=t&&t.toString().match(this.nonpunctuation)||[],t=new Date(0,0,0,0,0,0,0);var m,f,g,v={},w=["hh","h","ii","i","ss","s","yyyy","yy","M","MM","m","mm","D","DD","d","dd","H","HH","p","P","z","Z"],D={hh:function(e,t){return e.setUTCHours(t)},h:function(e,t){return e.setUTCHours(t)},HH:function(e,t){return e.setUTCHours(12===t?0:t)},H:function(e,t){return e.setUTCHours(12===t?0:t)},ii:function(e,t){return e.setUTCMinutes(t)},i:function(e,t){return e.setUTCMinutes(t)},ss:function(e,t){return e.setUTCSeconds(t)},s:function(e,t){return e.setUTCSeconds(t)},yyyy:function(e,t){return e.setUTCFullYear(t)},yy:function(e,t){return e.setUTCFullYear(2e3+t)},m:function(e,t){for(t-=1;t<0;)t+=12;for(t%=12,e.setUTCMonth(t);e.getUTCMonth()!==t;){if(isNaN(e.getUTCMonth()))return e;e.setUTCDate(e.getUTCDate()-1)}return e},d:function(e,t){return e.setUTCDate(t)},p:function(e,t){return e.setUTCHours(1===t?e.getUTCHours()+12:e.getUTCHours())},z:function(){return r}};if(D.M=D.MM=D.mm=D.m,D.dd=D.d,D.P=D.p,D.Z=D.z,t=s(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds()),u.length===i.parts.length){p=0;for(var y=i.parts.length;p<y;p++){if(m=parseInt(u[p],10),g=i.parts[p],isNaN(m))switch(g){case"MM":f=e(h[n].months).filter(function(){var e=this.slice(0,u[p].length);return e===u[p].slice(0,e.length)}),m=e.inArray(f[0],h[n].months)+1;break;case"M":f=e(h[n].monthsShort).filter(function(){var e=this.slice(0,u[p].length),t=u[p].slice(0,e.length);return e.toLowerCase()===t.toLowerCase()}),m=e.inArray(f[0],h[n].monthsShort)+1;break;case"p":case"P":m=e.inArray(u[p].toLowerCase(),h[n].meridiem)}v[g]=m}var T;for(p=0;p<w.length;p++)(T=w[p])in v&&!isNaN(v[T])&&D[T](t,v[T])}return t},formatDate:function(t,i,s,a,n){if(null===t)return"";var r;if("standard"===a)r={t:t.getTime(),yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear(),m:t.getUTCMonth()+1,M:h[s].monthsShort[t.getUTCMonth()],MM:h[s].months[t.getUTCMonth()],d:t.getUTCDate(),D:h[s].daysShort[t.getUTCDay()],DD:h[s].days[t.getUTCDay()],p:2===h[s].meridiem.length?h[s].meridiem[t.getUTCHours()<12?0:1]:"",h:t.getUTCHours(),i:t.getUTCMinutes(),s:t.getUTCSeconds(),z:n},2===h[s].meridiem.length?r.H=r.h%12==0?12:r.h%12:r.H=r.h,r.HH=(r.H<10?"0":"")+r.H,r.P=r.p.toUpperCase(),r.Z=r.z,r.hh=(r.h<10?"0":"")+r.h,r.ii=(r.i<10?"0":"")+r.i,r.ss=(r.s<10?"0":"")+r.s,r.dd=(r.d<10?"0":"")+r.d,r.mm=(r.m<10?"0":"")+r.m;else{if("php"!==a)throw new Error("Invalid format type.");(r={y:t.getUTCFullYear().toString().substring(2),Y:t.getUTCFullYear(),F:h[s].months[t.getUTCMonth()],M:h[s].monthsShort[t.getUTCMonth()],n:t.getUTCMonth()+1,t:o.getDaysInMonth(t.getUTCFullYear(),t.getUTCMonth()),j:t.getUTCDate(),l:h[s].days[t.getUTCDay()],D:h[s].daysShort[t.getUTCDay()],w:t.getUTCDay(),N:0===t.getUTCDay()?7:t.getUTCDay(),S:t.getUTCDate()%10<=h[s].suffix.length?h[s].suffix[t.getUTCDate()%10-1]:"",a:2===h[s].meridiem.length?h[s].meridiem[t.getUTCHours()<12?0:1]:"",g:t.getUTCHours()%12==0?12:t.getUTCHours()%12,G:t.getUTCHours(),i:t.getUTCMinutes(),s:t.getUTCSeconds()}).m=(r.n<10?"0":"")+r.n,r.d=(r.j<10?"0":"")+r.j,r.A=r.a.toString().toUpperCase(),r.h=(r.g<10?"0":"")+r.g,r.H=(r.G<10?"0":"")+r.G,r.i=(r.i<10?"0":"")+r.i,r.s=(r.s<10?"0":"")+r.s}t=[];for(var d=e.extend([],i.separators),l=0,c=i.parts.length;l<c;l++)d.length&&t.push(d.shift()),t.push(r[i.parts[l]]);return d.length&&t.push(d.shift()),t.join("")},convertViewMode:function(e){switch(e){case 4:case"decade":e=4;break;case 3:case"year":e=3;break;case 2:case"month":e=2;break;case 1:case"day":e=1;break;case 0:case"hour":e=0}return e},headTemplate:'<thead><tr><th class="prev"><i class="{iconType} {leftArrow}"/></th><th colspan="5" class="switch"></th><th class="next"><i class="{iconType} {rightArrow}"/></th></tr></thead>',headTemplateV3:'<thead><tr><th class="prev"><span class="{iconType} {leftArrow}"></span> </th><th colspan="5" class="switch"></th><th class="next"><span class="{iconType} {rightArrow}"></span> </th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};o.template='<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">'+o.headTemplate+o.contTemplate+o.footTemplate+'</table></div><div class="datetimepicker-hours"><table class=" table-condensed">'+o.headTemplate+o.contTemplate+o.footTemplate+'</table></div><div class="datetimepicker-days"><table class=" table-condensed">'+o.headTemplate+"<tbody></tbody>"+o.footTemplate+'</table></div><div class="datetimepicker-months"><table class="table-condensed">'+o.headTemplate+o.contTemplate+o.footTemplate+'</table></div><div class="datetimepicker-years"><table class="table-condensed">'+o.headTemplate+o.contTemplate+o.footTemplate+"</table></div></div>",o.templateV3='<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">'+o.headTemplateV3+o.contTemplate+o.footTemplate+'</table></div><div class="datetimepicker-hours"><table class=" table-condensed">'+o.headTemplateV3+o.contTemplate+o.footTemplate+'</table></div><div class="datetimepicker-days"><table class=" table-condensed">'+o.headTemplateV3+"<tbody></tbody>"+o.footTemplate+'</table></div><div class="datetimepicker-months"><table class="table-condensed">'+o.headTemplateV3+o.contTemplate+o.footTemplate+'</table></div><div class="datetimepicker-years"><table class="table-condensed">'+o.headTemplateV3+o.contTemplate+o.footTemplate+"</table></div></div>",e.fn.datetimepicker.DPGlobal=o,e.fn.datetimepicker.noConflict=function(){return e.fn.datetimepicker=n,this},e(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api",'[data-provide="datetimepicker"]',function(t){var i=e(this);i.data("datetimepicker")||(t.preventDefault(),i.datetimepicker("show"))}),e(function(){e('[data-provide="datetimepicker-inline"]').datetimepicker()})}); },{"jquery":"HlZQ"}],"DDda":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=function(){function e(){this.disposed=!1}return e.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},e.prototype.disposeInternal=function(){},e}(),t=e;exports.default=t; },{}],"luEr":[function(require,module,exports) { "use strict";function r(r,n,t){for(var u,o,i=t||e,f=0,a=r.length,s=!1;f<a;)(o=+i(r[u=f+(a-f>>1)],n))<0?f=u+1:(a=u,s=!o);return s?f:~f}function e(r,e){return r>e?1:r<e?-1:0}function n(r,e){return r.indexOf(e)>=0}function t(r,e,n){var t=r.length;if(r[0]<=e)return 0;if(e<=r[t-1])return t-1;var u=void 0;if(n>0){for(u=1;u<t;++u)if(r[u]<e)return u-1}else if(n<0){for(u=1;u<t;++u)if(r[u]<=e)return u}else for(u=1;u<t;++u){if(r[u]==e)return u;if(r[u]<e)return r[u-1]-e<e-r[u]?u-1:u}return t-1}function u(r,e,n){for(;e<n;){var t=r[e];r[e]=r[n],r[n]=t,++e,--n}}function o(r,e){for(var n=Array.isArray(e)?e:[e],t=n.length,u=0;u<t;u++)r[r.length]=n[u]}function i(r,e){var n=r.indexOf(e),t=n>-1;return t&&r.splice(n,1),t}function f(r,e){for(var n,t=r.length>>>0,u=0;u<t;u++)if(e(n=r[u],u,r))return n;return null}function a(r,e){var n=r.length;if(n!==e.length)return!1;for(var t=0;t<n;t++)if(r[t]!==e[t])return!1;return!0}function s(r,e){var n,t=r.length,u=Array(r.length);for(n=0;n<t;n++)u[n]={index:n,value:r[n]};for(u.sort(function(r,n){return e(r.value,n.value)||r.index-n.index}),n=0;n<r.length;n++)r[n]=u[n].value}function l(r,e){var n;return!r.every(function(t,u){return n=u,!e(t,u,r)})?n:-1}function v(r,n,t){var u=n||e;return r.every(function(e,n){if(0===n)return!0;var o=u(r[n-1],e);return!(o>0||t&&0===o)})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.binarySearch=r,exports.numberSafeCompareFunction=e,exports.includes=n,exports.linearFindNearest=t,exports.reverseSubArray=u,exports.extend=o,exports.remove=i,exports.find=f,exports.equals=a,exports.stableSort=s,exports.findIndex=l,exports.isSorted=v; },{}],"RgA2":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TRUE=e,exports.FALSE=t,exports.VOID=n,exports.memoizeOne=o;var r=require("./array.js");function e(){return!0}function t(){return!1}function n(){}function o(e){var t,n,o,s=!1;return function(){var u=Array.prototype.slice.call(arguments);return s&&this===o&&(0,r.equals)(u,n)||(s=!0,o=this,n=u,t=e.apply(this,arguments)),t}} },{"./array.js":"luEr"}],"KniQ":[function(require,module,exports) { "use strict";function t(){return function(){throw new Error("Unimplemented abstract method.")}()}Object.defineProperty(exports,"__esModule",{value:!0}),exports.abstract=t,exports.getUid=r,exports.VERSION=void 0;var e=0;function r(t){return t.ol_uid||(t.ol_uid=String(++e))}var o="6.4.3";exports.VERSION=o; },{}],"ygGQ":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=require("./util.js"),r=function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),e=function(e){function o(r){var o=this,n="Assertion failed. See https://openlayers.org/en/"+("latest"===t.VERSION?t.VERSION:"v"+t.VERSION.split("-")[0])+"/doc/errors/#"+r+" for details.";return(o=e.call(this,n)||this).code=r,o.name="AssertionError",o.message=n,o}return r(o,e),o}(Error),o=e;exports.default=o; },{"./util.js":"KniQ"}],"fLG6":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.assert=t;var e=r(require("./AssertionError.js"));function r(e){return e&&e.__esModule?e:{default:e}}function t(r,t){if(!r)throw new e.default(t)} },{"./AssertionError.js":"ygGQ"}],"P4eA":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.create=e,exports.reset=n,exports.multiply=o,exports.set=s,exports.setFromArray=u,exports.apply=a,exports.rotate=i,exports.scale=c,exports.makeScale=p,exports.translate=f,exports.compose=x,exports.composeCssTransform=v,exports.invert=m,exports.makeInverse=l,exports.determinant=y,exports.toString=M;var r=require("./asserts.js"),t=new Array(6);function e(){return[1,0,0,1,0,0]}function n(r){return s(r,1,0,0,1,0,0)}function o(r,t){var e=r[0],n=r[1],o=r[2],s=r[3],u=r[4],a=r[5],i=t[0],c=t[1],p=t[2],f=t[3],x=t[4],v=t[5];return r[0]=e*i+o*c,r[1]=n*i+s*c,r[2]=e*p+o*f,r[3]=n*p+s*f,r[4]=e*x+o*v+u,r[5]=n*x+s*v+a,r}function s(r,t,e,n,o,s,u){return r[0]=t,r[1]=e,r[2]=n,r[3]=o,r[4]=s,r[5]=u,r}function u(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function a(r,t){var e=t[0],n=t[1];return t[0]=r[0]*e+r[2]*n+r[4],t[1]=r[1]*e+r[3]*n+r[5],t}function i(r,e){var n=Math.cos(e),u=Math.sin(e);return o(r,s(t,n,u,-u,n,0,0))}function c(r,e,n){return o(r,s(t,e,0,0,n,0,0))}function p(r,t,e){return s(r,t,0,0,e,0,0)}function f(r,e,n){return o(r,s(t,1,0,0,1,e,n))}function x(r,t,e,n,o,s,u,a){var i=Math.sin(s),c=Math.cos(s);return r[0]=n*c,r[1]=o*i,r[2]=-n*i,r[3]=o*c,r[4]=u*n*c-a*n*i+t,r[5]=u*o*i+a*o*c+e,r}function v(r,t,n,o,s,u,a){return M(x(e(),r,t,n,o,s,u,a))}function m(r){return l(r,r)}function l(t,e){var n=y(e);(0,r.assert)(0!==n,32);var o=e[0],s=e[1],u=e[2],a=e[3],i=e[4],c=e[5];return t[0]=a/n,t[1]=-s/n,t[2]=-u/n,t[3]=o/n,t[4]=(u*c-a*i)/n,t[5]=-(o*c-s*i)/n,t}function y(r){return r[0]*r[3]-r[1]*r[2]}function M(r){return"matrix("+r.join(", ")+")"} },{"./asserts.js":"fLG6"}],"urGY":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};exports.default=t; },{}],"bUAS":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};exports.default=e; },{}],"QDir":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.boundingExtent=o,exports.buffer=a,exports.clone=i,exports.closestSquaredDistanceXY=s,exports.containsCoordinate=f,exports.containsExtent=p,exports.containsXY=c,exports.coordinateRelationship=x,exports.createEmpty=l,exports.createOrUpdate=d,exports.createOrUpdateEmpty=h,exports.createOrUpdateFromCoordinate=g,exports.createOrUpdateFromCoordinates=m,exports.createOrUpdateFromFlatCoordinates=M,exports.createOrUpdateFromRings=E,exports.equals=T,exports.approximatelyEquals=v,exports.extend=O,exports.extendCoordinate=C,exports.extendCoordinates=R,exports.extendFlatCoordinates=F,exports.extendRings=I,exports.extendXY=N,exports.forEachCorner=y,exports.getArea=B,exports.getBottomLeft=L,exports.getBottomRight=U,exports.getCenter=G,exports.getCorner=_,exports.getEnlargedArea=b,exports.getForViewAndSize=A,exports.getHeight=S,exports.getIntersectionArea=W,exports.getIntersection=q,exports.getMargin=H,exports.getSize=X,exports.getTopLeft=j,exports.getTopRight=V,exports.getWidth=P,exports.intersects=Y,exports.isEmpty=w,exports.returnOrUpdate=z,exports.scaleFromCenter=K,exports.intersectsSegment=D,exports.applyTransform=k,exports.wrapX=J;var t=n(require("./extent/Corner.js")),e=n(require("./extent/Relationship.js")),r=require("./asserts.js");function n(t){return t&&t.__esModule?t:{default:t}}function o(t){for(var e=l(),r=0,n=t.length;r<n;++r)C(e,t[r]);return e}function u(t,e,r){return d(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}function a(t,e,r){return r?(r[0]=t[0]-e,r[1]=t[1]-e,r[2]=t[2]+e,r[3]=t[3]+e,r):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function i(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function s(t,e,r){var n,o;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(o=r<t[1]?t[1]-r:t[3]<r?r-t[3]:0)*o}function f(t,e){return c(t,e[0],e[1])}function p(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function c(t,e,r){return t[0]<=e&&e<=t[2]&&t[1]<=r&&r<=t[3]}function x(t,r){var n=t[0],o=t[1],u=t[2],a=t[3],i=r[0],s=r[1],f=e.default.UNKNOWN;return i<n?f|=e.default.LEFT:i>u&&(f|=e.default.RIGHT),s<o?f|=e.default.BELOW:s>a&&(f|=e.default.ABOVE),f===e.default.UNKNOWN&&(f=e.default.INTERSECTING),f}function l(){return[1/0,1/0,-1/0,-1/0]}function d(t,e,r,n,o){return o?(o[0]=t,o[1]=e,o[2]=r,o[3]=n,o):[t,e,r,n]}function h(t){return d(1/0,1/0,-1/0,-1/0,t)}function g(t,e){var r=t[0],n=t[1];return d(r,n,r,n,e)}function m(t,e){return R(h(e),t)}function M(t,e,r,n,o){return F(h(o),t,e,r,n)}function E(t,e){return I(h(e),t)}function T(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function v(t,e,r){return Math.abs(t[0]-e[0])<r&&Math.abs(t[2]-e[2])<r&&Math.abs(t[1]-e[1])<r&&Math.abs(t[3]-e[3])<r}function O(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function C(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function R(t,e){for(var r=0,n=e.length;r<n;++r)C(t,e[r]);return t}function F(t,e,r,n,o){for(;r<n;r+=o)N(t,e[r],e[r+1]);return t}function I(t,e){for(var r=0,n=e.length;r<n;++r)R(t,e[r]);return t}function N(t,e,r){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],r),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],r)}function y(t,e){var r;return(r=e(L(t)))?r:(r=e(U(t)))?r:(r=e(V(t)))?r:(r=e(j(t)))||!1}function B(t){var e=0;return w(t)||(e=P(t)*S(t)),e}function L(t){return[t[0],t[1]]}function U(t){return[t[2],t[1]]}function G(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function _(e,n){var o;return n===t.default.BOTTOM_LEFT?o=L(e):n===t.default.BOTTOM_RIGHT?o=U(e):n===t.default.TOP_LEFT?o=j(e):n===t.default.TOP_RIGHT?o=V(e):(0,r.assert)(!1,13),o}function b(t,e){var r=Math.min(t[0],e[0]),n=Math.min(t[1],e[1]);return(Math.max(t[2],e[2])-r)*(Math.max(t[3],e[3])-n)}function A(t,e,r,n,o){var u=e*n[0]/2,a=e*n[1]/2,i=Math.cos(r),s=Math.sin(r),f=u*i,p=u*s,c=a*i,x=a*s,l=t[0],h=t[1],g=l-f+x,m=l-f-x,M=l+f-x,E=l+f+x,T=h-p-c,v=h-p+c,O=h+p+c,C=h+p-c;return d(Math.min(g,m,M,E),Math.min(T,v,O,C),Math.max(g,m,M,E),Math.max(T,v,O,C),o)}function S(t){return t[3]-t[1]}function W(t,e){return B(q(t,e))}function q(t,e,r){var n=r||l();return Y(t,e)?(t[0]>e[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]<e[2]?n[2]=t[2]:n[2]=e[2],t[3]<e[3]?n[3]=t[3]:n[3]=e[3]):h(n),n}function H(t){return P(t)+S(t)}function X(t){return[t[2]-t[0],t[3]-t[1]]}function j(t){return[t[0],t[3]]}function V(t){return[t[2],t[3]]}function P(t){return t[2]-t[0]}function Y(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function w(t){return t[2]<t[0]||t[3]<t[1]}function z(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function K(t,e){var r=(t[2]-t[0])/2*(e-1),n=(t[3]-t[1])/2*(e-1);t[0]-=r,t[2]+=r,t[1]-=n,t[3]+=n}function D(t,r,n){var o=!1,u=x(t,r),a=x(t,n);if(u===e.default.INTERSECTING||a===e.default.INTERSECTING)o=!0;else{var i=t[0],s=t[1],f=t[2],p=t[3],c=r[0],l=r[1],d=n[0],h=n[1],g=(h-l)/(d-c),m=void 0,M=void 0;a&e.default.ABOVE&&!(u&e.default.ABOVE)&&(o=(m=d-(h-p)/g)>=i&&m<=f),o||!(a&e.default.RIGHT)||u&e.default.RIGHT||(o=(M=h-(d-f)*g)>=s&&M<=p),o||!(a&e.default.BELOW)||u&e.default.BELOW||(o=(m=d-(h-s)/g)>=i&&m<=f),o||!(a&e.default.LEFT)||u&e.default.LEFT||(o=(M=h-(d-i)*g)>=s&&M<=p)}return o}function k(t,e,r,n){var o=[];if(n>1)for(var a=t[2]-t[0],i=t[3]-t[1],s=0;s<n;++s)o.push(t[0]+a*s/n,t[1],t[2],t[1]+i*s/n,t[2]-a*s/n,t[3],t[0],t[3]-i*s/n);else o=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(o,o,2);for(var f=[],p=[],c=(s=0,o.length);s<c;s+=2)f.push(o[s]),p.push(o[s+1]);return u(f,p,r)}function J(t,e){var r=e.getExtent(),n=G(t);if(e.canWrapX()&&(n[0]<r[0]||n[0]>=r[2])){var o=P(r),u=Math.floor((n[0]-r[0])/o)*o;t[0]-=u,t[2]-=u}return t} },{"./extent/Corner.js":"urGY","./extent/Relationship.js":"bUAS","./asserts.js":"fLG6"}],"B96G":[function(require,module,exports) { "use strict";function r(r,t,e){return Math.min(Math.max(r,t),e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.clamp=r,exports.squaredSegmentDistance=o,exports.squaredDistance=n,exports.solveLinearSystem=a,exports.toDegrees=s,exports.toRadians=u,exports.modulo=i,exports.lerp=c,exports.log2=exports.cosh=void 0;var t="cosh"in Math?Math.cosh:function(r){var t=Math.exp(r);return(t+1/t)/2};exports.cosh=t;var e="log2"in Math?Math.log2:function(r){return Math.log(r)*Math.LOG2E};function o(r,t,e,o,a,s){var u=a-e,i=s-o;if(0!==u||0!==i){var c=((r-e)*u+(t-o)*i)/(u*u+i*i);c>1?(e=a,o=s):c>0&&(e+=u*c,o+=i*c)}return n(r,t,e,o)}function n(r,t,e,o){var n=e-r,a=o-t;return n*n+a*a}function a(r){for(var t=r.length,e=0;e<t;e++){for(var o=e,n=Math.abs(r[e][e]),a=e+1;a<t;a++){var s=Math.abs(r[a][e]);s>n&&(n=s,o=a)}if(0===n)return null;var u=r[o];r[o]=r[e],r[e]=u;for(var i=e+1;i<t;i++)for(var c=-r[i][e]/r[e][e],f=e;f<t+1;f++)e==f?r[i][f]=0:r[i][f]+=c*r[e][f]}for(var h=new Array(t),v=t-1;v>=0;v--){h[v]=r[v][t]/r[v][v];for(var p=v-1;p>=0;p--)r[p][t]-=r[p][v]*h[v]}return h}function s(r){return 180*r/Math.PI}function u(r){return r*Math.PI/180}function i(r,t){var e=r%t;return e*t<0?e+t:e}function c(r,t,e){return r+e*(t-r)}exports.log2=e; },{}],"eucy":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.asString=s,exports.asArray=i,exports.normalize=p,exports.toString=c,exports.isStringColor=l,exports.fromString=void 0;var r=require("./asserts.js"),e=require("./math.js"),t=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,n=/^([a-z]*)$|^hsla?\(.*\)$/i;function s(r){return"string"==typeof r?r:c(r)}function a(r){var e=document.createElement("div");if(e.style.color=r,""!==e.style.color){document.body.appendChild(e);var t=getComputedStyle(e).color;return document.body.removeChild(e),t}return""}var o=function(){var r={},e=0;return function(t){var n;if(r.hasOwnProperty(t))n=r[t];else{if(e>=1024){var s=0;for(var a in r)0==(3&s++)&&(delete r[a],--e)}n=u(t),r[t]=n,++e}return n}}();function i(r){return Array.isArray(r)?r:o(r)}function u(e){var s,o,i,u,c;if(n.exec(e)&&(e=a(e)),t.exec(e)){var l=e.length-1,f=void 0;f=l<=4?1:2;var d=4===l||8===l;s=parseInt(e.substr(1+0*f,f),16),o=parseInt(e.substr(1+1*f,f),16),i=parseInt(e.substr(1+2*f,f),16),u=d?parseInt(e.substr(1+3*f,f),16):255,1==f&&(s=(s<<4)+s,o=(o<<4)+o,i=(i<<4)+i,d&&(u=(u<<4)+u)),c=[s,o,i,u/255]}else 0==e.indexOf("rgba(")?p(c=e.slice(5,-1).split(",").map(Number)):0==e.indexOf("rgb(")?((c=e.slice(4,-1).split(",").map(Number)).push(1),p(c)):(0,r.assert)(!1,14);return c}function p(r){return r[0]=(0,e.clamp)(r[0]+.5|0,0,255),r[1]=(0,e.clamp)(r[1]+.5|0,0,255),r[2]=(0,e.clamp)(r[2]+.5|0,0,255),r[3]=(0,e.clamp)(r[3],0,1),r}function c(r){var e=r[0];e!=(0|e)&&(e=e+.5|0);var t=r[1];t!=(0|t)&&(t=t+.5|0);var n=r[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+t+","+n+","+(void 0===r[3]?1:r[3])+")"}function l(r){return n.test(r)&&(r=a(r)),t.test(r)||0===r.indexOf("rgba(")||0===r.indexOf("rgb(")}exports.fromString=o; },{"./asserts.js":"fLG6","./math.js":"B96G"}],"V0oB":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shared=exports.default=void 0;var e=require("../color.js"),t=function(){function e(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return e.prototype.clear=function(){this.cache_={},this.cacheSize_=0},e.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},e.prototype.expire=function(){if(this.canExpireCache()){var e=0;for(var t in this.cache_){var i=this.cache_[t];0!=(3&e++)||i.hasListener()||(delete this.cache_[t],--this.cacheSize_)}}},e.prototype.get=function(e,t,c){var r=i(e,t,c);return r in this.cache_?this.cache_[r]:null},e.prototype.set=function(e,t,c,r){var a=i(e,t,c);this.cache_[a]=r,++this.cacheSize_},e.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},e}();function i(t,i,c){return i+":"+t+":"+(c?(0,e.asString)(c):"null")}var c=t;exports.default=c;var r=new t;exports.shared=r; },{"../color.js":"eucy"}],"fKNg":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.stopPropagation=o,exports.preventDefault=e,exports.default=void 0;var t=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}();function o(t){t.stopPropagation()}function e(t){t.preventDefault()}var p=t;exports.default=p; },{}],"zehl":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={PROPERTYCHANGE:"propertychange"};exports.default=e; },{}],"mH6q":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.clear=r,exports.isEmpty=n,exports.getValues=exports.assign=void 0;var e="function"==typeof Object.assign?Object.assign:function(e,r){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1,o=arguments.length;n<o;++n){var s=arguments[n];if(null!=s)for(var u in s)s.hasOwnProperty(u)&&(t[u]=s[u])}return t};function r(e){for(var r in e)delete e[r]}exports.assign=e;var t="function"==typeof Object.values?Object.values:function(e){var r=[];for(var t in e)r.push(e[t]);return r};function n(e){var r;for(r in e)return!1;return!r}exports.getValues=t; },{}],"CR4Y":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=s(require("../Disposable.js")),t=s(require("./Event.js")),n=require("../functions.js"),i=require("../obj.js");function s(e){return e&&e.__esModule?e:{default:e}}var r=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=function(e){function s(t){var n=e.call(this)||this;return n.eventTarget_=t,n.pendingRemovals_=null,n.dispatching_=null,n.listeners_=null,n}return r(s,e),s.prototype.addEventListener=function(e,t){if(e&&t){var n=this.listeners_||(this.listeners_={}),i=n[e]||(n[e]=[]);-1===i.indexOf(t)&&i.push(t)}},s.prototype.dispatchEvent=function(e){var i="string"==typeof e?new t.default(e):e,s=i.type;i.target||(i.target=this.eventTarget_||this);var r,o=this.listeners_&&this.listeners_[s];if(o){var l=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});s in l||(l[s]=0,a[s]=0),++l[s];for(var p=0,u=o.length;p<u;++p)if(!1===(r="handleEvent"in o[p]?o[p].handleEvent(i):o[p].call(this,i))||i.propagationStopped){r=!1;break}if(--l[s],0===l[s]){var h=a[s];for(delete a[s];h--;)this.removeEventListener(s,n.VOID);delete l[s]}return r}},s.prototype.disposeInternal=function(){this.listeners_&&(0,i.clear)(this.listeners_)},s.prototype.getListeners=function(e){return this.listeners_&&this.listeners_[e]||void 0},s.prototype.hasListener=function(e){return!!this.listeners_&&(e?e in this.listeners_:Object.keys(this.listeners_).length>0)},s.prototype.removeEventListener=function(e,t){var i=this.listeners_&&this.listeners_[e];if(i){var s=i.indexOf(t);-1!==s&&(this.pendingRemovals_&&e in this.pendingRemovals_?(i[s]=n.VOID,++this.pendingRemovals_[e]):(i.splice(s,1),0===i.length&&delete this.listeners_[e]))}},s}(e.default),l=o;exports.default=l; },{"../Disposable.js":"DDda","./Event.js":"fKNg","../functions.js":"RgA2","../obj.js":"mH6q"}],"C8cu":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};exports.default=e; },{}],"UqnM":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.listen=t,exports.listenOnce=r,exports.unlistenByKey=n;var e=require("./obj.js");function t(e,t,r,n,i){if(n&&n!==e&&(r=r.bind(n)),i){var s=r;r=function(){e.removeEventListener(t,r),s.apply(this,arguments)}}var o={target:e,type:t,listener:r};return e.addEventListener(t,r),o}function r(e,r,n,i){return t(e,r,n,i,!0)}function n(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),(0,e.clear)(t))} },{"./obj.js":"mH6q"}],"IdSm":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.unByKey=s,exports.default=void 0;var e=n(require("./events/Target.js")),t=n(require("./events/EventType.js")),r=require("./events.js");function n(e){return e&&e.__esModule?e:{default:e}}var o=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=function(e){function n(){var t=e.call(this)||this;return t.revision_=0,t}return o(n,e),n.prototype.changed=function(){++this.revision_,this.dispatchEvent(t.default.CHANGE)},n.prototype.getRevision=function(){return this.revision_},n.prototype.on=function(e,t){if(Array.isArray(e)){for(var n=e.length,o=new Array(n),i=0;i<n;++i)o[i]=(0,r.listen)(this,e[i],t);return o}return(0,r.listen)(this,e,t)},n.prototype.once=function(e,t){var n;if(Array.isArray(e)){var o=e.length;n=new Array(o);for(var i=0;i<o;++i)n[i]=(0,r.listenOnce)(this,e[i],t)}else n=(0,r.listenOnce)(this,e,t);return t.ol_key=n,n},n.prototype.un=function(e,t){var r=t.ol_key;if(r)s(r);else if(Array.isArray(e))for(var n=0,o=e.length;n<o;++n)this.removeEventListener(e[n],t);else this.removeEventListener(e,t)},n}(e.default);function s(e){if(Array.isArray(e))for(var t=0,n=e.length;t<n;++t)(0,r.unlistenByKey)(e[t]);else(0,r.unlistenByKey)(e)}var u=i;exports.default=u; },{"./events/Target.js":"CR4Y","./events/EventType.js":"C8cu","./events.js":"UqnM"}],"PhPh":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getChangeEventType=v,exports.default=exports.ObjectEvent=void 0;var t=o(require("./events/Event.js")),e=o(require("./ObjectEventType.js")),r=o(require("./Observable.js")),s=require("./obj.js"),n=require("./util.js");function o(t){return t&&t.__esModule?t:{default:t}}var i=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function s(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(s.prototype=r.prototype,new s)}}(),u=function(t){function e(e,r,s){var n=t.call(this,e)||this;return n.key=r,n.oldValue=s,n}return i(e,t),e}(t.default);exports.ObjectEvent=u;var a=function(t){function r(e){var r=t.call(this)||this;return(0,n.getUid)(r),r.values_=null,void 0!==e&&r.setProperties(e),r}return i(r,t),r.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},r.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},r.prototype.getProperties=function(){return this.values_&&(0,s.assign)({},this.values_)||{}},r.prototype.hasProperties=function(){return!!this.values_},r.prototype.notify=function(t,r){var s;s=v(t),this.dispatchEvent(new u(s,t,r)),s=e.default.PROPERTYCHANGE,this.dispatchEvent(new u(s,t,r))},r.prototype.set=function(t,e,r){var s=this.values_||(this.values_={});if(r)s[t]=e;else{var n=s[t];s[t]=e,n!==e&&this.notify(t,n)}},r.prototype.setProperties=function(t,e){for(var r in t)this.set(r,t[r],e)},r.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var r=this.values_[t];delete this.values_[t],(0,s.isEmpty)(this.values_)&&(this.values_=null),e||this.notify(t,r)}},r}(r.default),p={};function v(t){return p.hasOwnProperty(t)?p[t]:p[t]="change:"+t}var l=a;exports.default=l; },{"./events/Event.js":"fKNg","./ObjectEventType.js":"zehl","./Observable.js":"IdSm","./obj.js":"mH6q","./util.js":"KniQ"}],"HbeD":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source"};exports.default=e; },{}],"T6DQ":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("../Object.js")),e=r(require("./Property.js")),o=require("../util.js"),i=require("../asserts.js"),n=require("../obj.js"),s=require("../math.js");function r(t){return t&&t.__esModule?t:{default:t}}var a=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function i(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),u=function(t){function r(o){var s=t.call(this)||this,r=(0,n.assign)({},o);return r[e.default.OPACITY]=void 0!==o.opacity?o.opacity:1,(0,i.assert)("number"==typeof r[e.default.OPACITY],64),r[e.default.VISIBLE]=void 0===o.visible||o.visible,r[e.default.Z_INDEX]=o.zIndex,r[e.default.MAX_RESOLUTION]=void 0!==o.maxResolution?o.maxResolution:1/0,r[e.default.MIN_RESOLUTION]=void 0!==o.minResolution?o.minResolution:0,r[e.default.MIN_ZOOM]=void 0!==o.minZoom?o.minZoom:-1/0,r[e.default.MAX_ZOOM]=void 0!==o.maxZoom?o.maxZoom:1/0,s.className_=void 0!==r.className?o.className:"ol-layer",delete r.className,s.setProperties(r),s.state_=null,s}return a(r,t),r.prototype.getClassName=function(){return this.className_},r.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},o=this.getZIndex();return e.opacity=(0,s.clamp)(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==o?o:!1===e.managed?1/0:0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},r.prototype.getLayersArray=function(t){return(0,o.abstract)()},r.prototype.getLayerStatesArray=function(t){return(0,o.abstract)()},r.prototype.getExtent=function(){return this.get(e.default.EXTENT)},r.prototype.getMaxResolution=function(){return this.get(e.default.MAX_RESOLUTION)},r.prototype.getMinResolution=function(){return this.get(e.default.MIN_RESOLUTION)},r.prototype.getMinZoom=function(){return this.get(e.default.MIN_ZOOM)},r.prototype.getMaxZoom=function(){return this.get(e.default.MAX_ZOOM)},r.prototype.getOpacity=function(){return this.get(e.default.OPACITY)},r.prototype.getSourceState=function(){return(0,o.abstract)()},r.prototype.getVisible=function(){return this.get(e.default.VISIBLE)},r.prototype.getZIndex=function(){return this.get(e.default.Z_INDEX)},r.prototype.setExtent=function(t){this.set(e.default.EXTENT,t)},r.prototype.setMaxResolution=function(t){this.set(e.default.MAX_RESOLUTION,t)},r.prototype.setMinResolution=function(t){this.set(e.default.MIN_RESOLUTION,t)},r.prototype.setMaxZoom=function(t){this.set(e.default.MAX_ZOOM,t)},r.prototype.setMinZoom=function(t){this.set(e.default.MIN_ZOOM,t)},r.prototype.setOpacity=function(t){(0,i.assert)("number"==typeof t,64),this.set(e.default.OPACITY,t)},r.prototype.setVisible=function(t){this.set(e.default.VISIBLE,t)},r.prototype.setZIndex=function(t){this.set(e.default.Z_INDEX,t)},r.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},r}(t.default),l=u;exports.default=l; },{"../Object.js":"PhPh","./Property.js":"HbeD","../util.js":"KniQ","../asserts.js":"fLG6","../obj.js":"mH6q","../math.js":"B96G"}],"z39m":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};exports.default=e; },{}],"iC8j":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"};exports.default=e; },{}],"GCgv":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.inView=l,exports.default=void 0;var e=p(require("./Base.js")),t=p(require("../events/EventType.js")),r=p(require("./Property.js")),n=p(require("../render/EventType.js")),o=p(require("../source/State.js")),s=require("../asserts.js"),u=require("../obj.js"),i=require("../Object.js"),a=require("../events.js");function p(e){return e&&e.__esModule?e:{default:e}}var c=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),h=function(e){function p(t){var n=this,o=(0,u.assign)({},t);delete o.source,(n=e.call(this,o)||this).mapPrecomposeKey_=null,n.mapRenderKey_=null,n.sourceChangeKey_=null,n.renderer_=null,t.render&&(n.render=t.render),t.map&&n.setMap(t.map),n.addEventListener((0,i.getChangeEventType)(r.default.SOURCE),n.handleSourcePropertyChange_);var s=t.source?t.source:null;return n.setSource(s),n}return c(p,e),p.prototype.getLayersArray=function(e){var t=e||[];return t.push(this),t},p.prototype.getLayerStatesArray=function(e){var t=e||[];return t.push(this.getLayerState()),t},p.prototype.getSource=function(){return this.get(r.default.SOURCE)||null},p.prototype.getSourceState=function(){var e=this.getSource();return e?e.getState():o.default.UNDEFINED},p.prototype.handleSourceChange_=function(){this.changed()},p.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&((0,a.unlistenByKey)(this.sourceChangeKey_),this.sourceChangeKey_=null);var e=this.getSource();e&&(this.sourceChangeKey_=(0,a.listen)(e,t.default.CHANGE,this.handleSourceChange_,this)),this.changed()},p.prototype.getFeatures=function(e){return this.renderer_.getFeatures(e)},p.prototype.render=function(e,t){var r=this.getRenderer();if(r.prepareFrame(e))return r.renderFrame(e,t)},p.prototype.setMap=function(e){this.mapPrecomposeKey_&&((0,a.unlistenByKey)(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&((0,a.unlistenByKey)(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=(0,a.listen)(e,n.default.PRECOMPOSE,function(e){var t=e.frameState.layerStatesArray,r=this.getLayerState(!1);(0,s.assert)(!t.some(function(e){return e.layer===r.layer}),67),t.push(r)},this),this.mapRenderKey_=(0,a.listen)(this,t.default.CHANGE,e.render,e),this.changed())},p.prototype.setSource=function(e){this.set(r.default.SOURCE,e)},p.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},p.prototype.hasRenderer=function(){return!!this.renderer_},p.prototype.createRenderer=function(){return null},p.prototype.disposeInternal=function(){this.setSource(null),e.prototype.disposeInternal.call(this)},p}(e.default);function l(e,t){if(!e.visible)return!1;var r=t.resolution;if(r<e.minResolution||r>=e.maxResolution)return!1;var n=t.zoom;return n>e.minZoom&&n<=e.maxZoom}var y=h;exports.default=y; },{"./Base.js":"T6DQ","../events/EventType.js":"C8cu","./Property.js":"HbeD","../render/EventType.js":"z39m","../source/State.js":"iC8j","../asserts.js":"fLG6","../obj.js":"mH6q","../Object.js":"PhPh","../events.js":"UqnM"}],"lmV0":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};exports.default=e; },{}],"LQER":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=function(){function t(){}return t.prototype.drawCustom=function(t,o,e){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,o){},t.prototype.drawFeature=function(t,o){},t.prototype.drawGeometryCollection=function(t,o){},t.prototype.drawLineString=function(t,o){},t.prototype.drawMultiLineString=function(t,o){},t.prototype.drawMultiPoint=function(t,o){},t.prototype.drawMultiPolygon=function(t,o){},t.prototype.drawPoint=function(t,o){},t.prototype.drawPolygon=function(t,o){},t.prototype.drawText=function(t,o){},t.prototype.setFillStrokeStyle=function(t,o){},t.prototype.setImageStyle=function(t,o){},t.prototype.setTextStyle=function(t,o){},t}(),o=t;exports.default=o; },{}],"V5XN":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.asColorLike=e;var r=require("./color.js");function e(e){return Array.isArray(e)?(0,r.toString)(e):e} },{"./color.js":"eucy"}],"f3Nv":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PASSIVE_EVENT_LISTENERS=exports.IMAGE_DECODE=exports.WORKER_OFFSCREEN_CANVAS=exports.DEVICE_PIXEL_RATIO=exports.MAC=exports.WEBKIT=exports.SAFARI=exports.FIREFOX=void 0;var e="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",r=-1!==e.indexOf("firefox");exports.FIREFOX=r;var o=-1!==e.indexOf("safari")&&-1==e.indexOf("chrom");exports.SAFARI=o;var t=-1!==e.indexOf("webkit")&&-1==e.indexOf("edge");exports.WEBKIT=t;var n=-1!==e.indexOf("macintosh");exports.MAC=n;var i="undefined"!=typeof devicePixelRatio?devicePixelRatio:1;exports.DEVICE_PIXEL_RATIO=i;var E="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope;exports.WORKER_OFFSCREEN_CANVAS=E;var a="undefined"!=typeof Image&&Image.prototype.decode;exports.IMAGE_DECODE=a;var s=function(){var e=!1;try{var r=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,r),window.removeEventListener("_",null,r)}catch(o){}return e}();exports.PASSIVE_EVENT_LISTENERS=s; },{}],"Xno5":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createCanvasContext2D=t,exports.outerWidth=r,exports.outerHeight=n,exports.replaceNode=o,exports.removeNode=a,exports.removeChildren=i,exports.replaceChildren=s;var e=require("./has.js");function t(t,r,n){var o=n&&n.length?n.shift():e.WORKER_OFFSCREEN_CANVAS?new OffscreenCanvas(t||300,r||300):document.createElement("canvas");return t&&(o.width=t),r&&(o.height=r),o.getContext("2d")}function r(e){var t=e.offsetWidth,r=getComputedStyle(e);return t+=parseInt(r.marginLeft,10)+parseInt(r.marginRight,10)}function n(e){var t=e.offsetHeight,r=getComputedStyle(e);return t+=parseInt(r.marginTop,10)+parseInt(r.marginBottom,10)}function o(e,t){var r=t.parentNode;r&&r.replaceChild(e,t)}function a(e){return e&&e.parentNode?e.parentNode.removeChild(e):null}function i(e){for(;e.lastChild;)e.removeChild(e.lastChild)}function s(e,t){for(var r=e.childNodes,n=0;;++n){var o=r[n],a=t[n];if(!o&&!a)break;o!==a&&(o?a?e.insertBefore(a,o):(e.removeChild(o),--n):e.appendChild(a))}} },{"./has.js":"f3Nv"}],"HgMV":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getFontParameters=exports.CLASS_COLLAPSED=exports.CLASS_CONTROL=exports.CLASS_UNSUPPORTED=exports.CLASS_UNSELECTABLE=exports.CLASS_SELECTABLE=exports.CLASS_HIDDEN=void 0;var e="ol-hidden";exports.CLASS_HIDDEN=e;var r="ol-selectable";exports.CLASS_SELECTABLE=r;var t="ol-unselectable";exports.CLASS_UNSELECTABLE=t;var s="ol-unsupported";exports.CLASS_UNSUPPORTED=s;var l="ol-control";exports.CLASS_CONTROL=l;var a="ol-collapsed";exports.CLASS_COLLAPSED=a;var o=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),S=["style","variant","weight","size","lineHeight","family"],i=function(e){var r=e.match(o);if(!r)return null;for(var t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},s=0,l=S.length;s<l;++s){var a=r[s+1];void 0!==a&&(t[S[s]]=a)}return t.families=t.family.split(/,\s?/),t};exports.getFontParameters=i; },{}],"iAG7":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.measureTextWidth=w,exports.measureAndCacheTextWidth=O,exports.measureTextWidths=H,exports.rotateAtOffset=I,exports.drawImageOrLabel=M,exports.createTransformString=_,exports.measureTextHeight=exports.registerFont=exports.textHeights=exports.labelCache=exports.checkedFonts=exports.defaultLineWidth=exports.defaultPadding=exports.defaultTextBaseline=exports.defaultTextAlign=exports.defaultStrokeStyle=exports.defaultMiterLimit=exports.defaultLineJoin=exports.defaultLineDashOffset=exports.defaultLineDash=exports.defaultLineCap=exports.defaultFillStyle=exports.defaultFont=void 0;var e=i(require("../Object.js")),t=i(require("../events/Target.js")),r=require("../has.js"),a=require("../obj.js"),n=require("../dom.js"),s=require("../css.js"),o=require("../transform.js");function i(e){return e&&e.__esModule?e:{default:e}}var l="10px sans-serif";exports.defaultFont=l;var u="#000";exports.defaultFillStyle=u;var f="round";exports.defaultLineCap=f;var d=[];exports.defaultLineDash=d;var p=0;exports.defaultLineDashOffset=p;var x="round";exports.defaultLineJoin=x;var c=10;exports.defaultMiterLimit=c;var v="#000";exports.defaultStrokeStyle=v;var g="center";exports.defaultTextAlign=g;var h="middle";exports.defaultTextBaseline=h;var m=[0,0,0,0];exports.defaultPadding=m;var y=1;exports.defaultLineWidth=y;var C=new e.default;exports.checkedFonts=C;var L=new t.default;exports.labelCache=L,L.setSize=function(){console.warn("labelCache is deprecated.")};var T,F=null,S={};exports.textHeights=S;var b=function(){var e,t,r=100,n="32px ",o=["monospace","serif"],i=o.length,l="wmytzilWMYTZIL@#/&?$%10";function u(e,r,a){for(var s=!0,u=0;u<i;++u){var f=o[u];if(t=w(e+" "+r+" "+n+f,l),a!=f){var d=w(e+" "+r+" "+n+a+","+f,l);s=s&&d!=t}}return!!s}function f(){for(var t=!0,n=C.getKeys(),s=0,o=n.length;s<o;++s){var i=n[s];C.get(i)<r&&(u.apply(this,i.split("\n"))?((0,a.clear)(S),F=null,T=void 0,C.set(i,r)):(C.set(i,C.get(i)+1,!0),t=!1))}t&&(clearInterval(e),e=void 0)}return function(t){var a=(0,s.getFontParameters)(t);if(a)for(var n=a.families,o=0,i=n.length;o<i;++o){var l=n[o],d=a.style+"\n"+a.weight+"\n"+l;void 0===C.get(d)&&(C.set(d,r,!0),u(a.style,a.weight,l)||(C.set(d,0,!0),void 0===e&&(e=setInterval(f,32))))}}}();exports.registerFont=b;var A=function(){var e,t=S;return function(a){var n=t[a];if(null==n)if(r.WORKER_OFFSCREEN_CANVAS){var o=(0,s.getFontParameters)(a),i=j(a,"Žg"),l=isNaN(Number(o.lineHeight))?1.2:Number(o.lineHeight);S[a]=l*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else e||((e=document.createElement("div")).innerHTML="M",e.style.margin="0 !important",e.style.padding="0 !important",e.style.position="absolute !important",e.style.left="-99999px !important"),e.style.font=a,document.body.appendChild(e),n=e.offsetHeight,t[a]=n,document.body.removeChild(e);return n}}();function j(e,t){return F||(F=(0,n.createCanvasContext2D)(1,1)),e!=T&&(F.font=e,T=F.font),F.measureText(t)}function w(e,t){return j(e,t).width}function O(e,t,r){if(t in r)return r[t];var a=w(e,t);return r[t]=a,a}function H(e,t,r){for(var a=t.length,n=0,s=0;s<a;++s){var o=w(e,t[s]);n=Math.max(n,o),r.push(o)}return n}function I(e,t,r,a){0!==t&&(e.translate(r,a),e.rotate(t),e.translate(-r,-a))}function M(e,t,r,a,n,s,o,i,l,u,f){e.save(),1!==r&&(e.globalAlpha*=r),t&&e.setTransform.apply(e,t),a.contextInstructions?(e.translate(l,u),e.scale(f[0],f[1]),N(a,e)):f[0]<0||f[1]<0?(e.translate(l,u),e.scale(f[0],f[1]),e.drawImage(a,n,s,o,i,0,0,o,i)):e.drawImage(a,n,s,o,i,l,u,o*f[0],i*f[1]),e.restore()}function N(e,t){for(var r=e.contextInstructions,a=0,n=r.length;a<n;a+=2)Array.isArray(r[a+1])?t[r[a]].apply(t,r[a+1]):t[r[a]]=r[a+1]}exports.measureTextHeight=A;var W=null;function _(e){return r.WORKER_OFFSCREEN_CANVAS?(0,o.toString)(e):(W||(W=(0,n.createCanvasContext2D)(1,1).canvas),W.style.transform=(0,o.toString)(e),W.style.transform)} },{"../Object.js":"PhPh","../events/Target.js":"CR4Y","../has.js":"f3Nv","../obj.js":"mH6q","../dom.js":"Xno5","../css.js":"HgMV","../transform.js":"P4eA"}],"LGwr":[function(require,module,exports) { "use strict";function r(r,t,e,n,o,a){for(var f=a||[],s=0,l=t;l<e;l+=n){var u=r[l],v=r[l+1];f[s++]=o[0]*u+o[2]*v+o[4],f[s++]=o[1]*u+o[3]*v+o[5]}return a&&f.length!=s&&(f.length=s),f}function t(r,t,e,n,o,a,f){for(var s=f||[],l=Math.cos(o),u=Math.sin(o),v=a[0],h=a[1],c=0,g=t;g<e;g+=n){var i=r[g]-v,p=r[g+1]-h;s[c++]=v+i*l-p*u,s[c++]=h+i*u+p*l;for(var x=g+2;x<g+n;++x)s[c++]=r[x]}return f&&s.length!=c&&(s.length=c),s}function e(r,t,e,n,o,a,f,s){for(var l=s||[],u=f[0],v=f[1],h=0,c=t;c<e;c+=n){var g=r[c]-u,i=r[c+1]-v;l[h++]=u+o*g,l[h++]=v+a*i;for(var p=c+2;p<c+n;++p)l[h++]=r[p]}return s&&l.length!=h&&(l.length=h),l}function n(r,t,e,n,o,a,f){for(var s=f||[],l=0,u=t;u<e;u+=n){s[l++]=r[u]+o,s[l++]=r[u+1]+a;for(var v=u+2;v<u+n;++v)s[l++]=r[v]}return f&&s.length!=l&&(s.length=l),s}Object.defineProperty(exports,"__esModule",{value:!0}),exports.transform2D=r,exports.rotate=t,exports.scale=e,exports.translate=n; },{}],"yZx6":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.METERS_PER_UNIT=void 0;var E={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},e={};exports.METERS_PER_UNIT=e,e[E.DEGREES]=2*Math.PI*6370997/360,e[E.FEET]=.3048,e[E.METERS]=1,e[E.USFEET]=1200/3937;var t=E;exports.default=t; },{}],"WUar":[function(require,module,exports) { var global = arguments[3]; var t=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./Units.js"),n=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||e.METERS_PER_UNIT[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}(),i=n;exports.default=i; },{"./Units.js":"yZx6"}],"lohs":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.fromEPSG4326=f,exports.toEPSG4326=E,exports.PROJECTIONS=exports.WORLD_EXTENT=exports.EXTENT=exports.HALF_SIZE=exports.RADIUS=void 0;var t=o(require("./Projection.js")),r=o(require("./Units.js")),e=require("../math.js");function o(t){return t&&t.__esModule?t:{default:t}}var n=function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),s=6378137;exports.RADIUS=s;var a=Math.PI*s;exports.HALF_SIZE=a;var u=[-a,-a,a,a];exports.EXTENT=u;var i=[-180,-85,180,85];exports.WORLD_EXTENT=i;var c=function(t){function o(o){return t.call(this,{code:o,units:r.default.METERS,extent:u,global:!0,worldExtent:i,getPointResolution:function(t,r){return t/(0,e.cosh)(r[1]/s)}})||this}return n(o,t),o}(t.default),p=[new c("EPSG:3857"),new c("EPSG:102100"),new c("EPSG:102113"),new c("EPSG:900913"),new c("urn:ogc:def:crs:EPSG:6.18:3:3857"),new c("urn:ogc:def:crs:EPSG::3857"),new c("http://www.opengis.net/gml/srs/epsg.xml#3857")];function f(t,r,e){var o=t.length,n=e>1?e:2,u=r;void 0===u&&(u=n>2?t.slice():new Array(o));for(var i=a,c=0;c<o;c+=n){u[c]=i*t[c]/180;var p=s*Math.log(Math.tan(Math.PI*(+t[c+1]+90)/360));p>i?p=i:p<-i&&(p=-i),u[c+1]=p}return u}function E(t,r,e){var o=t.length,n=e>1?e:2,u=r;void 0===u&&(u=n>2?t.slice():new Array(o));for(var i=0;i<o;i+=n)u[i]=180*t[i]/a,u[i+1]=360*Math.atan(Math.exp(t[i+1]/s))/Math.PI-90;return u}exports.PROJECTIONS=p; },{"./Projection.js":"WUar","./Units.js":"yZx6","../math.js":"B96G"}],"ZniN":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PROJECTIONS=exports.METERS_PER_UNIT=exports.EXTENT=exports.RADIUS=void 0;var e=r(require("./Projection.js")),t=r(require("./Units.js"));function r(e){return e&&e.__esModule?e:{default:e}}var n=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=6378137;exports.RADIUS=o;var u=[-180,-90,180,90];exports.EXTENT=u;var s=Math.PI*o/180;exports.METERS_PER_UNIT=s;var c=function(e){function r(r,n){return e.call(this,{code:r,units:t.default.DEGREES,extent:u,axisOrientation:n,global:!0,metersPerUnit:s,worldExtent:u})||this}return n(r,e),r}(e.default),i=[new c("CRS:84"),new c("EPSG:4326","neu"),new c("urn:ogc:def:crs:EPSG::4326","neu"),new c("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new c("urn:ogc:def:crs:OGC:1.3:CRS84"),new c("urn:ogc:def:crs:OGC:2:84"),new c("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new c("urn:x-ogc:def:crs:EPSG:4326","neu")];exports.PROJECTIONS=i; },{"./Projection.js":"WUar","./Units.js":"yZx6"}],"tlE8":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.clear=t,exports.get=r,exports.add=n;var e={};function t(){e={}}function r(t){return e[t]||null}function n(t,r){e[t]=r} },{}],"uhlP":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.clear=r,exports.add=o,exports.remove=n,exports.get=i;var e=require("../obj.js"),t={};function r(){t={}}function o(e,r,o){var n=e.getCode(),i=r.getCode();n in t||(t[n]={}),t[n][i]=o}function n(r,o){var n=r.getCode(),i=o.getCode(),d=t[n][i];return delete t[n][i],(0,e.isEmpty)(t[n])&&delete t[n],d}function i(e,r){var o;return e in t&&r in t[e]&&(o=t[e][r]),o} },{"../obj.js":"mH6q"}],"q4ER":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDistance=s,exports.getLength=n,exports.getArea=u,exports.offset=h,exports.DEFAULT_RADIUS=void 0;var e=a(require("./geom/GeometryType.js")),t=require("./math.js");function a(e){return e&&e.__esModule?e:{default:e}}var r=6371008.8;function s(e,a,s){var o=s||r,n=(0,t.toRadians)(e[1]),i=(0,t.toRadians)(a[1]),u=(i-n)/2,h=(0,t.toRadians)(a[0]-e[0])/2,f=Math.sin(u)*Math.sin(u)+Math.sin(h)*Math.sin(h)*Math.cos(n)*Math.cos(i);return 2*o*Math.atan2(Math.sqrt(f),Math.sqrt(1-f))}function o(e,t){for(var a=0,r=0,o=e.length;r<o-1;++r)a+=s(e[r],e[r+1],t);return a}function n(t,a){var s=a||{},i=s.radius||r,u=s.projection||"EPSG:3857",h=t.getType();h!==e.default.GEOMETRY_COLLECTION&&(t=t.clone().transform(u,"EPSG:4326"));var f,d,M,c,l,g,I=0;switch(h){case e.default.POINT:case e.default.MULTI_POINT:break;case e.default.LINE_STRING:case e.default.LINEAR_RING:I=o(f=t.getCoordinates(),i);break;case e.default.MULTI_LINE_STRING:case e.default.POLYGON:for(M=0,c=(f=t.getCoordinates()).length;M<c;++M)I+=o(f[M],i);break;case e.default.MULTI_POLYGON:for(M=0,c=(f=t.getCoordinates()).length;M<c;++M)for(l=0,g=(d=f[M]).length;l<g;++l)I+=o(d[l],i);break;case e.default.GEOMETRY_COLLECTION:var L=t.getGeometries();for(M=0,c=L.length;M<c;++M)I+=n(L[M],a);break;default:throw new Error("Unsupported geometry type: "+h)}return I}function i(e,a){for(var r=0,s=e.length,o=e[s-1][0],n=e[s-1][1],i=0;i<s;i++){var u=e[i][0],h=e[i][1];r+=(0,t.toRadians)(u-o)*(2+Math.sin((0,t.toRadians)(n))+Math.sin((0,t.toRadians)(h))),o=u,n=h}return r*a*a/2}function u(t,a){var s=a||{},o=s.radius||r,n=s.projection||"EPSG:3857",h=t.getType();h!==e.default.GEOMETRY_COLLECTION&&(t=t.clone().transform(n,"EPSG:4326"));var f,d,M,c,l,g,I=0;switch(h){case e.default.POINT:case e.default.MULTI_POINT:case e.default.LINE_STRING:case e.default.MULTI_LINE_STRING:case e.default.LINEAR_RING:break;case e.default.POLYGON:for(f=t.getCoordinates(),I=Math.abs(i(f[0],o)),M=1,c=f.length;M<c;++M)I-=Math.abs(i(f[M],o));break;case e.default.MULTI_POLYGON:for(M=0,c=(f=t.getCoordinates()).length;M<c;++M)for(d=f[M],I+=Math.abs(i(d[0],o)),l=1,g=d.length;l<g;++l)I-=Math.abs(i(d[l],o));break;case e.default.GEOMETRY_COLLECTION:var L=t.getGeometries();for(M=0,c=L.length;M<c;++M)I+=u(L[M],a);break;default:throw new Error("Unsupported geometry type: "+h)}return I}function h(e,a,s,o){var n=o||r,i=(0,t.toRadians)(e[1]),u=(0,t.toRadians)(e[0]),h=a/n,f=Math.asin(Math.sin(i)*Math.cos(h)+Math.cos(i)*Math.sin(h)*Math.cos(s)),d=u+Math.atan2(Math.sin(s)*Math.sin(h)*Math.cos(i),Math.cos(h)-Math.sin(i)*Math.sin(f));return[(0,t.toDegrees)(d),(0,t.toDegrees)(f)]}exports.DEFAULT_RADIUS=r; },{"./geom/GeometryType.js":"lmV0","./math.js":"B96G"}],"AiCK":[function(require,module,exports) { "use strict";function e(e,r,t){var n=void 0!==t?e.toFixed(t):""+e,i=n.indexOf(".");return(i=-1===i?n.length:i)>r?n:new Array(1+r-i).join("0")+n}function r(e,r){for(var t=(""+e).split("."),n=(""+r).split("."),i=0;i<Math.max(t.length,n.length);i++){var o=parseInt(t[i]||"0",10),s=parseInt(n[i]||"0",10);if(o>s)return 1;if(s>o)return-1}return 0}Object.defineProperty(exports,"__esModule",{value:!0}),exports.padNumber=e,exports.compareVersions=r; },{}],"nGsj":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.add=n,exports.closestOnCircle=o,exports.closestOnSegment=a,exports.createStringXY=u,exports.degreesToStringHDMS=s,exports.format=i,exports.equals=c,exports.rotate=f,exports.scale=p,exports.squaredDistance=x,exports.distance=d,exports.squaredDistanceToSegment=g,exports.toStringHDMS=l,exports.toStringXY=h,exports.wrapX=M,exports.getWorldsAway=v;var t=require("./extent.js"),r=require("./math.js"),e=require("./string.js");function n(t,r){return t[0]+=+r[0],t[1]+=+r[1],t}function o(t,r){var e=r.getRadius(),n=r.getCenter(),o=n[0],a=n[1],u=t[0]-o,s=t[1]-a;0===u&&0===s&&(u=1);var i=Math.sqrt(u*u+s*s);return[o+e*u/i,a+e*s/i]}function a(t,r){var e,n,o=t[0],a=t[1],u=r[0],s=r[1],i=u[0],c=u[1],f=s[0],p=s[1],x=f-i,d=p-c,g=0===x&&0===d?0:(x*(o-i)+d*(a-c))/(x*x+d*d||0);return g<=0?(e=i,n=c):g>=1?(e=f,n=p):(e=i+g*x,n=c+g*d),[e,n]}function u(t){return function(r){return h(r,t)}}function s(t,n,o){var a=(0,r.modulo)(n+180,360)-180,u=Math.abs(3600*a),s=o||0,i=Math.pow(10,s),c=Math.floor(u/3600),f=Math.floor((u-3600*c)/60),p=u-3600*c-60*f;return(p=Math.ceil(p*i)/i)>=60&&(p=0,f+=1),f>=60&&(f=0,c+=1),c+"° "+(0,e.padNumber)(f,2)+"′ "+(0,e.padNumber)(p,2,s)+"″"+(0==a?"":" "+t.charAt(a<0?1:0))}function i(t,r,e){return t?r.replace("{x}",t[0].toFixed(e)).replace("{y}",t[1].toFixed(e)):""}function c(t,r){for(var e=!0,n=t.length-1;n>=0;--n)if(t[n]!=r[n]){e=!1;break}return e}function f(t,r){var e=Math.cos(r),n=Math.sin(r),o=t[0]*e-t[1]*n,a=t[1]*e+t[0]*n;return t[0]=o,t[1]=a,t}function p(t,r){return t[0]*=r,t[1]*=r,t}function x(t,r){var e=t[0]-r[0],n=t[1]-r[1];return e*e+n*n}function d(t,r){return Math.sqrt(x(t,r))}function g(t,r){return x(t,a(t,r))}function l(t,r){return t?s("NS",t[1],r)+" "+s("EW",t[0],r):""}function h(t,r){return i(t,"{x}, {y}",r)}function M(r,e){if(e.canWrapX()){var n=(0,t.getWidth)(e.getExtent()),o=v(r,e,n);o&&(r[0]-=o*n)}return r}function v(r,e,n){var o=e.getExtent(),a=0;if(e.canWrapX()&&(r[0]<o[0]||r[0]>o[2])){var u=n||(0,t.getWidth)(o);a=Math.floor((r[0]-o[0])/u)}return a} },{"./extent.js":"QDir","./math.js":"B96G","./string.js":"AiCK"}],"Diht":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.cloneTransform=l,exports.identityTransform=E,exports.addProjection=g,exports.addProjections=P,exports.get=x,exports.getPointResolution=j,exports.addEquivalentProjections=v,exports.addEquivalentTransforms=m,exports.clearAllProjections=T,exports.createProjection=O,exports.createTransformFromCoordinateTransform=S,exports.addCoordinateTransforms=y,exports.fromLonLat=U,exports.toLonLat=h,exports.equivalent=R,exports.getTransformFromProjections=C,exports.getTransform=_,exports.transform=q,exports.transformExtent=b,exports.transformWithProjections=G,exports.setUserProjection=I,exports.clearUserProjection=N,exports.getUserProjection=W,exports.useGeographic=w,exports.toUserCoordinate=D,exports.fromUserCoordinate=J,exports.toUserExtent=L,exports.fromUserExtent=A,exports.createSafeCoordinateTransform=F,exports.addCommon=k,Object.defineProperty(exports,"Projection",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"METERS_PER_UNIT",{enumerable:!0,get:function(){return r.METERS_PER_UNIT}});var e=d(require("./proj/Projection.js")),r=p(require("./proj/Units.js")),t=require("./proj/epsg3857.js"),n=require("./proj/epsg4326.js"),o=require("./proj/projections.js"),i=require("./proj/transforms.js"),u=require("./extent.js"),s=require("./math.js"),a=require("./sphere.js"),f=require("./coordinate.js");function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=c();if(r&&r.has(e))return r.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(t,o,i):t[o]=e[o]}return t.default=e,r&&r.set(e,t),t}function d(e){return e&&e.__esModule?e:{default:e}}function l(e,r,t){var n;if(void 0!==r){for(var o=0,i=e.length;o<i;++o)r[o]=e[o];n=r}else n=e.slice();return n}function E(e,r,t){if(void 0!==r&&e!==r){for(var n=0,o=e.length;n<o;++n)r[n]=e[n];e=r}return e}function g(e){(0,o.add)(e.getCode(),e),(0,i.add)(e,e,l)}function P(e){e.forEach(g)}function x(e){return"string"==typeof e?(0,o.get)(e):e||null}function j(e,t,n,o){var i,u=(e=x(e)).getPointResolutionFunc();if(u)i=u(t,n),o&&o!==e.getUnits()&&(s=e.getMetersPerUnit())&&(i=i*s/r.METERS_PER_UNIT[o]);else if(e.getUnits()==r.default.DEGREES&&!o||o==r.default.DEGREES)i=t;else{var s,f=C(e,x("EPSG:4326")),c=[n[0]-t/2,n[1],n[0]+t/2,n[1],n[0],n[1]-t/2,n[0],n[1]+t/2];c=f(c,c,2),i=((0,a.getDistance)(c.slice(0,2),c.slice(2,4))+(0,a.getDistance)(c.slice(4,6),c.slice(6,8)))/2,void 0!==(s=o?r.METERS_PER_UNIT[o]:e.getMetersPerUnit())&&(i/=s)}return i}function v(e){P(e),e.forEach(function(r){e.forEach(function(e){r!==e&&(0,i.add)(r,e,l)})})}function m(e,r,t,n){e.forEach(function(e){r.forEach(function(r){(0,i.add)(e,r,t),(0,i.add)(r,e,n)})})}function T(){(0,o.clear)(),(0,i.clear)()}function O(e,r){return e?"string"==typeof e?x(e):e:x(r)}function S(e){return function(r,t,n){for(var o=r.length,i=void 0!==n?n:2,u=void 0!==t?t:new Array(o),s=0;s<o;s+=i){var a=e([r[s],r[s+1]]);u[s]=a[0],u[s+1]=a[1];for(var f=i-1;f>=2;--f)u[s+f]=r[s+f]}return u}}function y(e,r,t,n){var o=x(e),u=x(r);(0,i.add)(o,u,S(t)),(0,i.add)(u,o,S(n))}function U(e,r){return q(e,"EPSG:4326",void 0!==r?r:"EPSG:3857")}function h(e,r){var t=q(e,void 0!==r?r:"EPSG:3857","EPSG:4326"),n=t[0];return(n<-180||n>180)&&(t[0]=(0,s.modulo)(n+180,360)-180),t}function R(e,r){if(e===r)return!0;var t=e.getUnits()===r.getUnits();return e.getCode()===r.getCode()?t:C(e,r)===l&&t}function C(e,r){var t=e.getCode(),n=r.getCode(),o=(0,i.get)(t,n);return o||(o=E),o}function _(e,r){return C(x(e),x(r))}function q(e,r,t){return _(r,t)(e,void 0,e.length)}function b(e,r,t,n){var o=_(r,t);return(0,u.applyTransform)(e,o,void 0,n)}function G(e,r,t){return C(r,t)(e)}var M=null;function I(e){M=x(e)}function N(){M=null}function W(){return M}function w(){I("EPSG:4326")}function D(e,r){return M?q(e,r,M):e}function J(e,r){return M?q(e,M,r):e}function L(e,r){return M?b(e,r,M):e}function A(e,r){return M?b(e,M,r):e}function F(e,r,t){return function(n){var o,i,a=n[0],c=n[1];if(e.canWrapX()){var p=e.getExtent(),d=(0,u.getWidth)(p);(i=(0,f.getWorldsAway)(n,e,d))&&(a-=i*d),a=(0,s.clamp)(a,p[0],p[2]),c=(0,s.clamp)(c,p[1],p[3]),o=t([a,c])}else o=t(n);return i&&r.canWrapX()&&(o[0]+=i*(0,u.getWidth)(r.getExtent())),o}}function k(){v(t.PROJECTIONS),v(n.PROJECTIONS),m(n.PROJECTIONS,t.PROJECTIONS,t.fromEPSG4326,t.toEPSG4326)}k(); },{"./proj/Projection.js":"WUar","./proj/Units.js":"yZx6","./proj/epsg3857.js":"lohs","./proj/epsg4326.js":"ZniN","./proj/projections.js":"tlE8","./proj/transforms.js":"uhlP","./extent.js":"QDir","./math.js":"B96G","./sphere.js":"q4ER","./coordinate.js":"nGsj"}],"F8sI":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=p(require("../Object.js")),e=p(require("../proj/Units.js")),r=require("../util.js"),n=require("../transform.js"),o=require("../extent.js"),i=require("../proj.js"),s=require("../functions.js"),a=require("./flat/transform.js");function p(t){return t&&t.__esModule?t:{default:t}}var u=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),c=(0,n.create)(),f=function(t){function p(){var e=t.call(this)||this;return e.extent_=(0,o.createEmpty)(),e.extentRevision_=-1,e.simplifiedGeometryMaxMinSquaredTolerance=0,e.simplifiedGeometryRevision=0,e.simplifyTransformedInternal=(0,s.memoizeOne)(function(t,e,r){if(!r)return this.getSimplifiedGeometry(e);var n=this.clone();return n.applyTransform(r),n.getSimplifiedGeometry(e)}),e}return u(p,t),p.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},p.prototype.clone=function(){return(0,r.abstract)()},p.prototype.closestPointXY=function(t,e,n,o){return(0,r.abstract)()},p.prototype.containsXY=function(t,e){var r=this.getClosestPoint([t,e]);return r[0]===t&&r[1]===e},p.prototype.getClosestPoint=function(t,e){var r=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r},p.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},p.prototype.computeExtent=function(t){return(0,r.abstract)()},p.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&(0,o.createOrUpdateEmpty)(e),this.extentRevision_=this.getRevision()}return(0,o.returnOrUpdate)(this.extent_,t)},p.prototype.rotate=function(t,e){(0,r.abstract)()},p.prototype.scale=function(t,e,n){(0,r.abstract)()},p.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},p.prototype.getSimplifiedGeometry=function(t){return(0,r.abstract)()},p.prototype.getType=function(){return(0,r.abstract)()},p.prototype.applyTransform=function(t){(0,r.abstract)()},p.prototype.intersectsExtent=function(t){return(0,r.abstract)()},p.prototype.translate=function(t,e){(0,r.abstract)()},p.prototype.transform=function(t,r){var s=(0,i.get)(t),p=s.getUnits()==e.default.TILE_PIXELS?function(t,e,p){var u=s.getExtent(),f=s.getWorldExtent(),l=(0,o.getHeight)(f)/(0,o.getHeight)(u);return(0,n.compose)(c,f[0],f[3],l,-l,0,0,0),(0,a.transform2D)(t,0,t.length,p,c,e),(0,i.getTransform)(s,r)(t,e,p)}:(0,i.getTransform)(s,r);return this.applyTransform(p),this},p}(t.default),l=f;exports.default=l; },{"../Object.js":"PhPh","../proj/Units.js":"yZx6","../util.js":"KniQ","../transform.js":"P4eA","../extent.js":"QDir","../proj.js":"Diht","../functions.js":"RgA2","./flat/transform.js":"LGwr"}],"Utvi":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};exports.default=e; },{}],"pnrv":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStrideForLayout=l,exports.transformGeom2D=f,exports.default=void 0;var t=n(require("./Geometry.js")),e=n(require("./GeometryLayout.js")),r=require("../util.js"),i=require("../extent.js"),o=require("./flat/transform.js");function n(t){return t&&t.__esModule?t:{default:t}}var a=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),s=function(t){function n(){var r=t.call(this)||this;return r.layout=e.default.XY,r.stride=2,r.flatCoordinates=null,r}return a(n,t),n.prototype.computeExtent=function(t){return(0,i.createOrUpdateFromFlatCoordinates)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},n.prototype.getCoordinates=function(){return(0,r.abstract)()},n.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},n.prototype.getFlatCoordinates=function(){return this.flatCoordinates},n.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},n.prototype.getLayout=function(){return this.layout},n.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},n.prototype.getSimplifiedGeometryInternal=function(t){return this},n.prototype.getStride=function(){return this.stride},n.prototype.setFlatCoordinates=function(t,e){this.stride=l(t),this.layout=t,this.flatCoordinates=e},n.prototype.setCoordinates=function(t,e){(0,r.abstract)()},n.prototype.setLayout=function(t,r,i){var o;if(t)o=l(t);else{for(var n=0;n<i;++n){if(0===r.length)return this.layout=e.default.XY,void(this.stride=2);r=r[0]}t=u(o=r.length)}this.layout=t,this.stride=o},n.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},n.prototype.rotate=function(t,e){var r=this.getFlatCoordinates();if(r){var i=this.getStride();(0,o.rotate)(r,0,r.length,i,t,e,r),this.changed()}},n.prototype.scale=function(t,e,r){var n=e;void 0===n&&(n=t);var a=r;a||(a=(0,i.getCenter)(this.getExtent()));var s=this.getFlatCoordinates();if(s){var u=this.getStride();(0,o.scale)(s,0,s.length,u,t,n,a,s),this.changed()}},n.prototype.translate=function(t,e){var r=this.getFlatCoordinates();if(r){var i=this.getStride();(0,o.translate)(r,0,r.length,i,t,e,r),this.changed()}},n}(t.default);function u(t){var r;return 2==t?r=e.default.XY:3==t?r=e.default.XYZ:4==t&&(r=e.default.XYZM),r}function l(t){var r;return t==e.default.XY?r=2:t==e.default.XYZ||t==e.default.XYM?r=3:t==e.default.XYZM&&(r=4),r}function f(t,e,r){var i=t.getFlatCoordinates();if(i){var n=t.getStride();return(0,o.transform2D)(i,0,i.length,n,e,r)}return null}var d=s;exports.default=d; },{"./Geometry.js":"F8sI","./GeometryLayout.js":"Utvi","../util.js":"KniQ","../extent.js":"QDir","./flat/transform.js":"LGwr"}],"fo6K":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=h(require("../../geom/GeometryType.js")),e=h(require("../VectorContext.js")),i=require("../../colorlike.js"),s=require("../../transform.js"),a=require("../canvas.js"),o=require("../../array.js"),r=require("../../extent.js"),n=require("../../geom/flat/transform.js"),l=require("../../geom/SimpleGeometry.js");function h(t){return t&&t.__esModule?t:{default:t}}var _=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),f=function(e){function h(t,i,a,o,r,n,l){var h=e.call(this)||this;return h.context_=t,h.pixelRatio_=i,h.extent_=a,h.transform_=o,h.viewRotation_=r,h.squaredTolerance_=n,h.userTransform_=l,h.contextFillState_=null,h.contextStrokeState_=null,h.contextTextState_=null,h.fillState_=null,h.strokeState_=null,h.image_=null,h.imageAnchorX_=0,h.imageAnchorY_=0,h.imageHeight_=0,h.imageOpacity_=0,h.imageOriginX_=0,h.imageOriginY_=0,h.imageRotateWithView_=!1,h.imageRotation_=0,h.imageScale_=[0,0],h.imageWidth_=0,h.text_="",h.textOffsetX_=0,h.textOffsetY_=0,h.textRotateWithView_=!1,h.textRotation_=0,h.textScale_=[0,0],h.textFillState_=null,h.textStrokeState_=null,h.textState_=null,h.pixelCoordinates_=[],h.tmpLocalTransform_=(0,s.create)(),h}return _(h,e),h.prototype.drawImages_=function(t,e,i,a){if(this.image_){var o=(0,n.transform2D)(t,e,i,2,this.transform_,this.pixelCoordinates_),r=this.context_,l=this.tmpLocalTransform_,h=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=h*this.imageOpacity_);var _=this.imageRotation_;this.imageRotateWithView_&&(_+=this.viewRotation_);for(var f=0,g=o.length;f<g;f+=2){var x=o[f]-this.imageAnchorX_,S=o[f+1]-this.imageAnchorY_;if(0!==_||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var m=x+this.imageAnchorX_,d=S+this.imageAnchorY_;(0,s.compose)(l,m,d,1,1,_,-m,-d),r.setTransform.apply(r,l),r.translate(m,d),r.scale(this.imageScale_[0],this.imageScale_[1]),r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),r.setTransform(1,0,0,1,0,0)}else r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,x,S,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(r.globalAlpha=h)}},h.prototype.drawText_=function(t,e,i,a){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var o=(0,n.transform2D)(t,e,i,a,this.transform_,this.pixelCoordinates_),r=this.context_,l=this.textRotation_;for(this.textRotateWithView_&&(l+=this.viewRotation_);e<i;e+=a){var h=o[e]+this.textOffsetX_,_=o[e+1]+this.textOffsetY_;if(0!==l||1!=this.textScale_[0]||1!=this.textScale_[1]){var f=(0,s.compose)(this.tmpLocalTransform_,h,_,1,1,l,-h,-_);r.setTransform.apply(r,f),r.translate(h,_),r.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&r.strokeText(this.text_,0,0),this.textFillState_&&r.fillText(this.text_,0,0),r.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&r.strokeText(this.text_,h,_),this.textFillState_&&r.fillText(this.text_,h,_)}}},h.prototype.moveToLineTo_=function(t,e,i,s,a){var o=this.context_,r=(0,n.transform2D)(t,e,i,s,this.transform_,this.pixelCoordinates_);o.moveTo(r[0],r[1]);var l=r.length;a&&(l-=2);for(var h=2;h<l;h+=2)o.lineTo(r[h],r[h+1]);return a&&o.closePath(),i},h.prototype.drawRings_=function(t,e,i,s){for(var a=0,o=i.length;a<o;++a)e=this.moveToLineTo_(t,e,i[a],s,!0);return e},h.prototype.drawCircle=function(t){if((0,r.intersects)(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=(0,l.transformGeom2D)(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],s=e[3]-e[1],a=Math.sqrt(i*i+s*s),o=this.context_;o.beginPath(),o.arc(e[0],e[1],a,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},h.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},h.prototype.setTransform=function(t){this.transform_=t},h.prototype.drawGeometry=function(e){switch(e.getType()){case t.default.POINT:this.drawPoint(e);break;case t.default.LINE_STRING:this.drawLineString(e);break;case t.default.POLYGON:this.drawPolygon(e);break;case t.default.MULTI_POINT:this.drawMultiPoint(e);break;case t.default.MULTI_LINE_STRING:this.drawMultiLineString(e);break;case t.default.MULTI_POLYGON:this.drawMultiPolygon(e);break;case t.default.GEOMETRY_COLLECTION:this.drawGeometryCollection(e);break;case t.default.CIRCLE:this.drawCircle(e)}},h.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&(0,r.intersects)(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},h.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,s=e.length;i<s;++i)this.drawGeometry(e[i])},h.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},h.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},h.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),(0,r.intersects)(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var s=t.getFlatMidpoint();this.drawText_(s,0,2,2)}}},h.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if((0,r.intersects)(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,s=t.getFlatCoordinates(),a=0,o=t.getEnds(),n=t.getStride();i.beginPath();for(var l=0,h=o.length;l<h;++l)a=this.moveToLineTo_(s,a,o[l],n,!1);i.stroke()}if(""!==this.text_){var _=t.getFlatMidpoints();this.drawText_(_,0,_.length,2)}}},h.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),(0,r.intersects)(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},h.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),(0,r.intersects)(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getOrientedFlatCoordinates(),s=0,a=t.getEndss(),o=t.getStride();e.beginPath();for(var n=0,l=a.length;n<l;++n){var h=a[n];s=this.drawRings_(i,s,h,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var _=t.getFlatInteriorPoints();this.drawText_(_,0,_.length,2)}}},h.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},h.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&((0,o.equals)(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},h.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,s=t.textAlign?t.textAlign:a.defaultTextAlign;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=s&&(i.textAlign=s,e.textAlign=s),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=s,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:s,textBaseline:t.textBaseline})},h.prototype.setFillStrokeStyle=function(t,e){if(t){var s=t.getColor();this.fillState_={fillStyle:(0,i.asColorLike)(s||a.defaultFillStyle)}}else this.fillState_=null;if(e){var o=e.getColor(),r=e.getLineCap(),n=e.getLineDash(),l=e.getLineDashOffset(),h=e.getLineJoin(),_=e.getWidth(),f=e.getMiterLimit();this.strokeState_={lineCap:void 0!==r?r:a.defaultLineCap,lineDash:n||a.defaultLineDash,lineDashOffset:l||a.defaultLineDashOffset,lineJoin:void 0!==h?h:a.defaultLineJoin,lineWidth:this.pixelRatio_*(void 0!==_?_:a.defaultLineWidth),miterLimit:void 0!==f?f:a.defaultMiterLimit,strokeStyle:(0,i.asColorLike)(o||a.defaultStrokeStyle)}}else this.strokeState_=null},h.prototype.setImageStyle=function(t){if(t){var e=t.getSize();if(e){var i=t.getAnchor(),s=t.getImage(1),a=t.getOrigin(),o=t.getScaleArray();this.imageAnchorX_=i[0],this.imageAnchorY_=i[1],this.imageHeight_=e[1],this.image_=s,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=a[0],this.imageOriginY_=a[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=[this.pixelRatio_*o[0],this.pixelRatio_*o[1]],this.imageWidth_=e[0]}else this.image_=null}else this.image_=null},h.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var s=e.getColor();this.textFillState_={fillStyle:(0,i.asColorLike)(s||a.defaultFillStyle)}}else this.textFillState_=null;var o=t.getStroke();if(o){var r=o.getColor(),n=o.getLineCap(),l=o.getLineDash(),h=o.getLineDashOffset(),_=o.getLineJoin(),f=o.getWidth(),g=o.getMiterLimit();this.textStrokeState_={lineCap:void 0!==n?n:a.defaultLineCap,lineDash:l||a.defaultLineDash,lineDashOffset:h||a.defaultLineDashOffset,lineJoin:void 0!==_?_:a.defaultLineJoin,lineWidth:void 0!==f?f:a.defaultLineWidth,miterLimit:void 0!==g?g:a.defaultMiterLimit,strokeStyle:(0,i.asColorLike)(r||a.defaultStrokeStyle)}}else this.textStrokeState_=null;var x=t.getFont(),S=t.getOffsetX(),m=t.getOffsetY(),d=t.getRotateWithView(),c=t.getRotation(),u=t.getScaleArray(),p=t.getText(),y=t.getTextAlign(),T=t.getTextBaseline();this.textState_={font:void 0!==x?x:a.defaultFont,textAlign:void 0!==y?y:a.defaultTextAlign,textBaseline:void 0!==T?T:a.defaultTextBaseline},this.text_=void 0!==p?p:"",this.textOffsetX_=void 0!==S?this.pixelRatio_*S:0,this.textOffsetY_=void 0!==m?this.pixelRatio_*m:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==c?c:0,this.textScale_=[this.pixelRatio_*u[0],this.pixelRatio_*u[1]]}else this.text_=""},h}(e.default),g=f;exports.default=g; },{"../../geom/GeometryType.js":"lmV0","../VectorContext.js":"LQER","../../colorlike.js":"V5XN","../../transform.js":"P4eA","../canvas.js":"iAG7","../../array.js":"luEr","../../extent.js":"QDir","../../geom/flat/transform.js":"LGwr","../../geom/SimpleGeometry.js":"pnrv"}],"irm1":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};exports.default=e; },{}],"u3kG":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};exports.default=e; },{}],"UCah":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.defaultOrder=u,exports.getSquaredTolerance=n,exports.getTolerance=g,exports.renderFeature=o;var e=l(require("../render/canvas/BuilderType.js")),t=l(require("../geom/GeometryType.js")),r=l(require("../ImageState.js")),a=require("../util.js");function l(e){return e&&e.__esModule?e:{default:e}}var d=.5,i={Point:c,LineString:v,Polygon:m,MultiPoint:y,MultiLineString:I,MultiPolygon:S,GeometryCollection:s,Circle:f};function u(e,t){return parseInt((0,a.getUid)(e),10)-parseInt((0,a.getUid)(t),10)}function n(e,t){var r=g(e,t);return r*r}function g(e,t){return d*e/t}function f(t,r,a,l){var d=a.getFill(),i=a.getStroke();if(d||i){var u=t.getBuilder(a.getZIndex(),e.default.CIRCLE);u.setFillStrokeStyle(d,i),u.drawCircle(r,l)}var n=a.getText();if(n){var g=t.getBuilder(a.getZIndex(),e.default.TEXT);g.setTextStyle(n,t.addDeclutter(!1)),g.drawText(r,l)}}function o(e,t,a,l,d,i){var u=!1,n=a.getImage();if(n){var g=n.getImageState();g==r.default.LOADED||g==r.default.ERROR?n.unlistenImageChange(d):(g==r.default.IDLE&&n.load(),g=n.getImageState(),n.listenImageChange(d),u=!0)}return T(e,t,a,l,i),u}function T(e,t,r,a,l){var d=r.getGeometryFunction()(t);if(d){var u=d.simplifyTransformed(a,l);if(r.getRenderer())x(e,u,r,t);else(0,i[u.getType()])(e,u,r,t)}}function x(r,a,l,d){if(a.getType()!=t.default.GEOMETRY_COLLECTION)r.getBuilder(l.getZIndex(),e.default.DEFAULT).drawCustom(a,d,l.getRenderer());else for(var i=a.getGeometries(),u=0,n=i.length;u<n;++u)x(r,i[u],l,d)}function s(e,t,r,a){var l,d,u=t.getGeometriesArray();for(l=0,d=u.length;l<d;++l){(0,i[u[l].getType()])(e,u[l],r,a)}}function v(t,r,a,l){var d=a.getStroke();if(d){var i=t.getBuilder(a.getZIndex(),e.default.LINE_STRING);i.setFillStrokeStyle(null,d),i.drawLineString(r,l)}var u=a.getText();if(u){var n=t.getBuilder(a.getZIndex(),e.default.TEXT);n.setTextStyle(u,t.addDeclutter(!1)),n.drawText(r,l)}}function I(t,r,a,l){var d=a.getStroke();if(d){var i=t.getBuilder(a.getZIndex(),e.default.LINE_STRING);i.setFillStrokeStyle(null,d),i.drawMultiLineString(r,l)}var u=a.getText();if(u){var n=t.getBuilder(a.getZIndex(),e.default.TEXT);n.setTextStyle(u,t.addDeclutter(!1)),n.drawText(r,l)}}function S(t,r,a,l){var d=a.getFill(),i=a.getStroke();if(i||d){var u=t.getBuilder(a.getZIndex(),e.default.POLYGON);u.setFillStrokeStyle(d,i),u.drawMultiPolygon(r,l)}var n=a.getText();if(n){var g=t.getBuilder(a.getZIndex(),e.default.TEXT);g.setTextStyle(n,t.addDeclutter(!1)),g.drawText(r,l)}}function c(t,a,l,d){var i=l.getImage();if(i){if(i.getImageState()!=r.default.LOADED)return;var u=t.getBuilder(l.getZIndex(),e.default.IMAGE);u.setImageStyle(i,t.addDeclutter(!1)),u.drawPoint(a,d)}var n=l.getText();if(n){var g=t.getBuilder(l.getZIndex(),e.default.TEXT);g.setTextStyle(n,t.addDeclutter(!!i)),g.drawText(a,d)}}function y(t,a,l,d){var i=l.getImage();if(i){if(i.getImageState()!=r.default.LOADED)return;var u=t.getBuilder(l.getZIndex(),e.default.IMAGE);u.setImageStyle(i,t.addDeclutter(!1)),u.drawMultiPoint(a,d)}var n=l.getText();if(n){var g=t.getBuilder(l.getZIndex(),e.default.TEXT);g.setTextStyle(n,t.addDeclutter(!!i)),g.drawText(a,d)}}function m(t,r,a,l){var d=a.getFill(),i=a.getStroke();if(d||i){var u=t.getBuilder(a.getZIndex(),e.default.POLYGON);u.setFillStrokeStyle(d,i),u.drawPolygon(r,l)}var n=a.getText();if(n){var g=t.getBuilder(a.getZIndex(),e.default.TEXT);g.setTextStyle(n,t.addDeclutter(!1)),g.drawText(r,l)}} },{"../render/canvas/BuilderType.js":"irm1","../geom/GeometryType.js":"lmV0","../ImageState.js":"u3kG","../util.js":"KniQ"}],"RvU2":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.toContext=a,exports.getVectorContext=s,exports.getRenderPixel=l,exports.renderDeclutterItems=u;var e=o(require("./render/canvas/Immediate.js")),t=require("./has.js"),r=require("./transform.js"),i=require("./renderer/vector.js"),n=require("./proj.js");function o(e){return e&&e.__esModule?e:{default:e}}function a(i,n){var o=i.canvas,a=n||{},s=a.pixelRatio||t.DEVICE_PIXEL_RATIO,l=a.size;l&&(o.width=l[0]*s,o.height=l[1]*s,o.style.width=l[0]+"px",o.style.height=l[1]+"px");var u=[0,0,o.width,o.height],c=(0,r.scale)((0,r.create)(),s,s);return new e.default(i,s,u,c,0)}function s(t){var o,a=t.frameState,s=(0,r.multiply)(t.inversePixelTransform.slice(),a.coordinateToPixelTransform),l=(0,i.getSquaredTolerance)(a.viewState.resolution,a.pixelRatio),u=(0,n.getUserProjection)();return u&&(o=(0,n.getTransformFromProjections)(u,a.viewState.projection)),new e.default(t.context,a.pixelRatio,a.extent,s,a.viewState.rotation,l,o)}function l(e,t){var i=t.slice(0);return(0,r.apply)(e.inversePixelTransform.slice(),i),i}function u(e,t){t&&t.clear();for(var r=e.declutterItems,i=r.length-1;i>=0;--i)for(var n=r[i],o=n.items,a=0,s=o.length;a<s;a+=3)t=o[a].renderDeclutter(o[a+1],o[a+2],n.opacity,t);return r.length=0,t} },{"./render/canvas/Immediate.js":"fo6K","./has.js":"f3Nv","./transform.js":"P4eA","./renderer/vector.js":"UCah","./proj.js":"Diht"}],"oIh9":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=s(require("../Disposable.js")),r=require("../functions.js"),t=require("../util.js"),o=require("../transform.js"),n=require("../extent.js"),a=require("../style/IconImageCache.js"),i=require("../layer/Layer.js"),u=require("../render.js"),c=require("../coordinate.js");function s(e){return e&&e.__esModule?e:{default:e}}var p=function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}(),l=function(e){function s(r){var t=e.call(this)||this;return t.map_=r,t.declutterTree_=null,t}return p(s,e),s.prototype.dispatchRenderEvent=function(e,r){(0,t.abstract)()},s.prototype.calculateMatrices2D=function(e){var r=e.viewState,t=e.coordinateToPixelTransform,n=e.pixelToCoordinateTransform;(0,o.compose)(t,e.size[0]/2,e.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),(0,o.makeInverse)(n,t)},s.prototype.forEachFeatureAtCoordinate=function(e,r,t,o,a,u,s,p){var l,f=r.viewState;function d(e,r,t){return a.call(u,r,e?t:null)}var h=f.projection,v=(0,c.wrapX)(e.slice(),h),y=[[0,0]];if(h.canWrapX()&&o){var _=h.getExtent(),j=(0,n.getWidth)(_);y.push([-j,0],[j,0])}var m,x=r.layerStatesArray,g=x.length;this.declutterTree_&&(m=this.declutterTree_.all().map(function(e){return e.value}));for(var T=[],q=0;q<y.length;q++)for(var E=g-1;E>=0;--E){var C=x[E],b=C.layer;if(b.hasRenderer()&&(0,i.inView)(C,f)&&s.call(p,b)){var A=b.getRenderer(),w=b.getSource();if(A&&w){var F=w.getWrapX()?v:e,I=d.bind(null,C.managed);T[0]=F[0]+y[q][0],T[1]=F[1]+y[q][1],l=A.forEachFeatureAtCoordinate(T,r,t,I,m)}if(l)return l}}},s.prototype.forEachLayerAtPixel=function(e,r,o,n,a){return(0,t.abstract)()},s.prototype.hasFeatureAtCoordinate=function(e,t,o,n,a,i){return void 0!==this.forEachFeatureAtCoordinate(e,t,o,n,r.TRUE,this,a,i)},s.prototype.getMap=function(){return this.map_},s.prototype.renderFrame=function(e){this.declutterTree_=(0,u.renderDeclutterItems)(e,this.declutterTree_)},s.prototype.scheduleExpireIconCache=function(e){a.shared.canExpireCache()&&e.postRenderFunctions.push(f)},s}(e.default);function f(e,r){a.shared.expire()}var d=l;exports.default=d; },{"../Disposable.js":"DDda","../functions.js":"RgA2","../util.js":"KniQ","../transform.js":"P4eA","../extent.js":"QDir","../style/IconImageCache.js":"V0oB","../layer/Layer.js":"GCgv","../render.js":"RvU2","../coordinate.js":"nGsj"}],"EB6P":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("../events/Event.js"));function e(t){return t&&t.__esModule?t:{default:t}}var r=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),n=function(t){function e(e,r,n,o){var u=t.call(this,e)||this;return u.inversePixelTransform=r,u.frameState=n,u.context=o,u}return r(e,t),e}(t.default),o=n;exports.default=o; },{"../events/Event.js":"fKNg"}],"MHsB":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("./Map.js")),t=u(require("../ObjectEventType.js")),r=u(require("../render/Event.js")),n=u(require("../render/EventType.js")),i=u(require("../source/State.js")),s=require("../css.js"),a=require("../render/canvas.js"),l=require("../layer/Layer.js"),o=require("../events.js"),d=require("../dom.js");function u(e){return e&&e.__esModule?e:{default:e}}var c=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),h=function(e){function u(r){var n=e.call(this,r)||this;n.fontChangeListenerKey_=(0,o.listen)(a.checkedFonts,t.default.PROPERTYCHANGE,r.redrawText.bind(r)),n.element_=document.createElement("div");var i=n.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",n.element_.className=s.CLASS_UNSELECTABLE+" ol-layers";var l=r.getViewport();return l.insertBefore(n.element_,l.firstChild||null),n.children_=[],n.renderedVisible_=!0,n}return c(u,e),u.prototype.dispatchRenderEvent=function(e,t){var n=this.getMap();if(n.hasListener(e)){var i=new r.default(e,void 0,t);n.dispatchEvent(i)}},u.prototype.disposeInternal=function(){(0,o.unlistenByKey)(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),e.prototype.disposeInternal.call(this)},u.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(n.default.PRECOMPOSE,t);var r=t.layerStatesArray.sort(function(e,t){return e.zIndex-t.zIndex}),s=t.viewState;this.children_.length=0;for(var a=null,o=0,u=r.length;o<u;++o){var c=r[o];if(t.layerIndex=o,(0,l.inView)(c,s)&&(c.sourceState==i.default.READY||c.sourceState==i.default.UNDEFINED)){var h=c.layer.render(t,a);h&&h!==a&&(this.children_.push(h),a=h)}}e.prototype.renderFrame.call(this,t),(0,d.replaceChildren)(this.element_,this.children_),this.dispatchRenderEvent(n.default.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},u.prototype.forEachLayerAtPixel=function(e,t,r,n,i){for(var s=t.viewState,a=t.layerStatesArray,o=a.length-1;o>=0;--o){var d=a[o],u=d.layer;if(u.hasRenderer()&&(0,l.inView)(d,s)&&i(u)){var c=u.getRenderer().getDataAtPixel(e,t,r);if(c){var h=n(u,c);if(h)return h}}}},u}(e.default),p=h;exports.default=p; },{"./Map.js":"oIh9","../ObjectEventType.js":"zehl","../render/Event.js":"EB6P","../render/EventType.js":"z39m","../source/State.js":"iC8j","../css.js":"HgMV","../render/canvas.js":"iAG7","../layer/Layer.js":"GCgv","../events.js":"UqnM","../dom.js":"Xno5"}],"BTrx":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={ADD:"add",REMOVE:"remove"};exports.default=e; },{}],"FnDa":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.CollectionEvent=void 0;var t=i(require("./AssertionError.js")),e=i(require("./Object.js")),r=i(require("./CollectionEventType.js")),n=i(require("./events/Event.js"));function i(t){return t&&t.__esModule?t:{default:t}}var o=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),s={LENGTH:"length"},u=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.element=r,i.index=n,i}return o(e,t),e}(n.default);exports.CollectionEvent=u;var a=function(e){function n(t,r){var n=e.call(this)||this,i=r||{};if(n.unique_=!!i.unique,n.array_=t||[],n.unique_)for(var o=0,s=n.array_.length;o<s;++o)n.assertUnique_(n.array_[o],o);return n.updateLength_(),n}return o(n,e),n.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},n.prototype.extend=function(t){for(var e=0,r=t.length;e<r;++e)this.push(t[e]);return this},n.prototype.forEach=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)t(e[r],r,e)},n.prototype.getArray=function(){return this.array_},n.prototype.item=function(t){return this.array_[t]},n.prototype.getLength=function(){return this.get(s.LENGTH)},n.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new u(r.default.ADD,e,t))},n.prototype.pop=function(){return this.removeAt(this.getLength()-1)},n.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},n.prototype.remove=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)if(e[r]===t)return this.removeAt(r)},n.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new u(r.default.REMOVE,e,t)),e},n.prototype.setAt=function(t,e){var n=this.getLength();if(t<n){this.unique_&&this.assertUnique_(e,t);var i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new u(r.default.REMOVE,i,t)),this.dispatchEvent(new u(r.default.ADD,e,t))}else{for(var o=n;o<t;++o)this.insertAt(o,void 0);this.insertAt(t,e)}},n.prototype.updateLength_=function(){this.set(s.LENGTH,this.array_.length)},n.prototype.assertUnique_=function(e,r){for(var n=0,i=this.array_.length;n<i;++n)if(this.array_[n]===e&&n!==r)throw new t.default(58)},n}(e.default),h=a;exports.default=h; },{"./AssertionError.js":"ygGQ","./Object.js":"PhPh","./CollectionEventType.js":"BTrx","./events/Event.js":"fKNg"}],"q0nK":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("./Base.js")),t=c(require("../Collection.js")),r=c(require("../CollectionEventType.js")),n=c(require("../events/EventType.js")),s=c(require("../ObjectEventType.js")),i=c(require("../source/State.js")),a=require("../asserts.js"),o=require("../obj.js"),l=require("../Object.js"),u=require("../extent.js"),y=require("../util.js"),h=require("../events.js");function c(e){return e&&e.__esModule?e:{default:e}}var d=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),f={LAYERS:"layers"},p=function(e){function c(r){var n=this,s=r||{},i=(0,o.assign)({},s);delete i.layers;var u=s.layers;return(n=e.call(this,i)||this).layersListenerKeys_=[],n.listenerKeys_={},n.addEventListener((0,l.getChangeEventType)(f.LAYERS),n.handleLayersChanged_),u?Array.isArray(u)?u=new t.default(u.slice(),{unique:!0}):(0,a.assert)("function"==typeof u.getArray,43):u=new t.default(void 0,{unique:!0}),n.setLayers(u),n}return d(c,e),c.prototype.handleLayerChange_=function(){this.changed()},c.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(h.unlistenByKey),this.layersListenerKeys_.length=0;var e=this.getLayers();for(var t in this.layersListenerKeys_.push((0,h.listen)(e,r.default.ADD,this.handleLayersAdd_,this),(0,h.listen)(e,r.default.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[t].forEach(h.unlistenByKey);(0,o.clear)(this.listenerKeys_);for(var i=e.getArray(),a=0,l=i.length;a<l;a++){var u=i[a];this.listenerKeys_[(0,y.getUid)(u)]=[(0,h.listen)(u,s.default.PROPERTYCHANGE,this.handleLayerChange_,this),(0,h.listen)(u,n.default.CHANGE,this.handleLayerChange_,this)]}this.changed()},c.prototype.handleLayersAdd_=function(e){var t=e.element;this.listenerKeys_[(0,y.getUid)(t)]=[(0,h.listen)(t,s.default.PROPERTYCHANGE,this.handleLayerChange_,this),(0,h.listen)(t,n.default.CHANGE,this.handleLayerChange_,this)],this.changed()},c.prototype.handleLayersRemove_=function(e){var t=e.element,r=(0,y.getUid)(t);this.listenerKeys_[r].forEach(h.unlistenByKey),delete this.listenerKeys_[r],this.changed()},c.prototype.getLayers=function(){return this.get(f.LAYERS)},c.prototype.setLayers=function(e){this.set(f.LAYERS,e)},c.prototype.getLayersArray=function(e){var t=void 0!==e?e:[];return this.getLayers().forEach(function(e){e.getLayersArray(t)}),t},c.prototype.getLayerStatesArray=function(e){var t=void 0!==e?e:[],r=t.length;this.getLayers().forEach(function(e){e.getLayerStatesArray(t)});for(var n=this.getLayerState(),s=r,i=t.length;s<i;s++){var a=t[s];a.opacity*=n.opacity,a.visible=a.visible&&n.visible,a.maxResolution=Math.min(a.maxResolution,n.maxResolution),a.minResolution=Math.max(a.minResolution,n.minResolution),a.minZoom=Math.max(a.minZoom,n.minZoom),a.maxZoom=Math.min(a.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==a.extent?a.extent=(0,u.getIntersection)(a.extent,n.extent):a.extent=n.extent)}return t},c.prototype.getSourceState=function(){return i.default.READY},c}(e.default),g=p;exports.default=g; },{"./Base.js":"T6DQ","../Collection.js":"FnDa","../CollectionEventType.js":"BTrx","../events/EventType.js":"C8cu","../ObjectEventType.js":"zehl","../source/State.js":"iC8j","../asserts.js":"fLG6","../obj.js":"mH6q","../Object.js":"PhPh","../extent.js":"QDir","../util.js":"KniQ","../events.js":"UqnM"}],"vFcA":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("./events/Event.js"));function e(t){return t&&t.__esModule?t:{default:t}}var r=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),n=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.map=r,o.frameState=void 0!==n?n:null,o}return r(e,t),e}(t.default),o=n;exports.default=o; },{"./events/Event.js":"fKNg"}],"HMLS":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("./MapEvent.js"));function e(t){return t&&t.__esModule?t:{default:t}}var o=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),n=function(t){function e(e,o,n,r,i){var p=t.call(this,e,o,i)||this;return p.originalEvent=n,p.pixel_=null,p.coordinate_=null,p.dragging=void 0!==r&&r,p}return o(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()},e}(t.default),r=n;exports.default=r; },{"./MapEvent.js":"vFcA"}],"YhDM":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./events/EventType.js"));function t(e){return e&&e.__esModule?e:{default:e}}var r={SINGLECLICK:"singleclick",CLICK:e.default.CLICK,DBLCLICK:e.default.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};exports.default=r; },{"./events/EventType.js":"C8cu"}],"TaSm":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};exports.default=e; },{}],"ohHk":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("./events/Target.js")),t=a(require("./events/EventType.js")),i=a(require("./MapBrowserEvent.js")),n=a(require("./MapBrowserEventType.js")),o=a(require("./pointer/EventType.js")),s=require("./has.js"),r=require("./events.js");function a(e){return e&&e.__esModule?e:{default:e}}var d=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),h=function(e){function a(i,n){var a=e.call(this,i)||this;a.map_=i,a.clickTimeoutId_,a.dragging_=!1,a.dragListenerKeys_=[],a.moveTolerance_=n?n*s.DEVICE_PIXEL_RATIO:s.DEVICE_PIXEL_RATIO,a.down_=null;var d=a.map_.getViewport();return a.activePointers_=0,a.trackedTouches_={},a.element_=d,a.pointerdownListenerKey_=(0,r.listen)(d,o.default.POINTERDOWN,a.handlePointerDown_,a),a.originalPointerMoveEvent_,a.relayedListenerKey_=(0,r.listen)(d,o.default.POINTERMOVE,a.relayEvent_,a),a.boundHandleTouchMove_=a.handleTouchMove_.bind(a),a.element_.addEventListener(t.default.TOUCHMOVE,a.boundHandleTouchMove_,!!s.PASSIVE_EVENT_LISTENERS&&{passive:!1}),a}return d(a,e),a.prototype.emulateClick_=function(e){var t=new i.default(n.default.CLICK,this.map_,e);this.dispatchEvent(t),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new i.default(n.default.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var t=new i.default(n.default.SINGLECLICK,this.map_,e);this.dispatchEvent(t)}.bind(this),250)},a.prototype.updateActivePointers_=function(e){var t=e;t.type==n.default.POINTERUP||t.type==n.default.POINTERCANCEL?delete this.trackedTouches_[t.pointerId]:t.type==n.default.POINTERDOWN&&(this.trackedTouches_[t.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},a.prototype.handlePointerUp_=function(e){this.updateActivePointers_(e);var t=new i.default(n.default.POINTERUP,this.map_,e);this.dispatchEvent(t),t.propagationStopped||this.dragging_||!this.isMouseActionButton_(e)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(r.unlistenByKey),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},a.prototype.isMouseActionButton_=function(e){return 0===e.button},a.prototype.handlePointerDown_=function(e){this.updateActivePointers_(e);var t=new i.default(n.default.POINTERDOWN,this.map_,e);this.dispatchEvent(t),this.down_=e,0===this.dragListenerKeys_.length&&(this.dragListenerKeys_.push((0,r.listen)(document,n.default.POINTERMOVE,this.handlePointerMove_,this),(0,r.listen)(document,n.default.POINTERUP,this.handlePointerUp_,this),(0,r.listen)(this.element_,n.default.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==document&&this.dragListenerKeys_.push((0,r.listen)(this.element_.getRootNode(),n.default.POINTERUP,this.handlePointerUp_,this)))},a.prototype.handlePointerMove_=function(e){if(this.isMoving_(e)){this.dragging_=!0;var t=new i.default(n.default.POINTERDRAG,this.map_,e,this.dragging_);this.dispatchEvent(t)}},a.prototype.relayEvent_=function(e){this.originalPointerMoveEvent_=e;var t=!(!this.down_||!this.isMoving_(e));this.dispatchEvent(new i.default(e.type,this.map_,e,t))},a.prototype.handleTouchMove_=function(e){this.originalPointerMoveEvent_&&!this.originalPointerMoveEvent_.defaultPrevented||e.preventDefault()},a.prototype.isMoving_=function(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_},a.prototype.disposeInternal=function(){this.relayedListenerKey_&&((0,r.unlistenByKey)(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(t.default.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&((0,r.unlistenByKey)(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(r.unlistenByKey),this.dragListenerKeys_.length=0,this.element_=null,e.prototype.disposeInternal.call(this)},a}(e.default),l=h;exports.default=l; },{"./events/Target.js":"CR4Y","./events/EventType.js":"C8cu","./MapBrowserEvent.js":"HMLS","./MapBrowserEventType.js":"YhDM","./pointer/EventType.js":"TaSm","./has.js":"f3Nv","./events.js":"UqnM"}],"xLGm":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend"};exports.default=e; },{}],"zlNQ":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};exports.default=e; },{}],"RQLY":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.DROP=void 0;var t=require("../asserts.js"),e=require("../obj.js"),i=1/0;exports.DROP=i;var n=function(){function n(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return n.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,(0,e.clear)(this.queuedElements_)},n.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},n.prototype.enqueue=function(e){(0,t.assert)(!(this.keyFunction_(e)in this.queuedElements_),31);var n=this.priorityFunction_(e);return n!=i&&(this.elements_.push(e),this.priorities_.push(n),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},n.prototype.getCount=function(){return this.elements_.length},n.prototype.getLeftChildIndex_=function(t){return 2*t+1},n.prototype.getRightChildIndex_=function(t){return 2*t+2},n.prototype.getParentIndex_=function(t){return t-1>>1},n.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},n.prototype.isEmpty=function(){return 0===this.elements_.length},n.prototype.isKeyQueued=function(t){return t in this.queuedElements_},n.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},n.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,s=e[t],r=i[t],o=t;t<n>>1;){var u=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),p=h<n&&i[h]<i[u]?h:u;e[t]=e[p],i[t]=i[p],t=p}e[t]=s,i[t]=r,this.siftDown_(o,t)},n.prototype.siftDown_=function(t,e){for(var i=this.elements_,n=this.priorities_,s=i[e],r=n[e];e>t;){var o=this.getParentIndex_(e);if(!(n[o]>r))break;i[e]=i[o],n[e]=n[o],e=o}i[e]=s,n[e]=r},n.prototype.reprioritize=function(){var t,e,n,s=this.priorityFunction_,r=this.elements_,o=this.priorities_,u=0,h=r.length;for(e=0;e<h;++e)(n=s(t=r[e]))==i?delete this.queuedElements_[this.keyFunction_(t)]:(o[u]=n,r[u++]=t);r.length=u,o.length=u,this.heapify_()},n}(),s=n;exports.default=s; },{"../asserts.js":"fLG6","../obj.js":"mH6q"}],"tHOl":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getTilePriority=s,exports.default=void 0;var e=o(require("./events/EventType.js")),t=i(require("./structs/PriorityQueue.js")),n=o(require("./TileState.js"));function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}function o(e){return e&&e.__esModule?e:{default:e}}var a=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),u=function(t){function r(e,n){var r=t.call(this,function(t){return e.apply(null,t)},function(e){return e[0].getKey()})||this;return r.boundHandleTileChange_=r.handleTileChange.bind(r),r.tileChangeCallback_=n,r.tilesLoading_=0,r.tilesLoadingKeys_={},r}return a(r,t),r.prototype.enqueue=function(n){var r=t.prototype.enqueue.call(this,n);r&&n[0].addEventListener(e.default.CHANGE,this.boundHandleTileChange_);return r},r.prototype.getTilesLoading=function(){return this.tilesLoading_},r.prototype.handleTileChange=function(t){var r=t.target,i=r.getState();if(r.hifi&&i===n.default.LOADED||i===n.default.ERROR||i===n.default.EMPTY){r.removeEventListener(e.default.CHANGE,this.boundHandleTileChange_);var o=r.getKey();o in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[o],--this.tilesLoading_),this.tileChangeCallback_()}},r.prototype.loadMoreTiles=function(e,t){for(var r,i,o=0;this.tilesLoading_<e&&o<t&&this.getCount()>0;)i=(r=this.dequeue()[0]).getKey(),r.getState()!==n.default.IDLE||i in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[i]=!0,++this.tilesLoading_,++o,r.load())},r}(t.default),l=u;function s(e,n,r,i,o){if(!(e&&r in e.wantedTiles))return t.DROP;if(!e.wantedTiles[r][n.getKey()])return t.DROP;var a=e.viewState.center,u=i[0]-a[0],l=i[1]-a[1];return 65536*Math.log(o)+Math.sqrt(u*u+l*l)/o}exports.default=l; },{"./events/EventType.js":"C8cu","./structs/PriorityQueue.js":"RQLY","./TileState.js":"u3kG"}],"cuLW":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={ANIMATING:0,INTERACTING:1};exports.default=e; },{}],"cE7c":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};exports.default=e; },{}],"mOEX":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_TILE_SIZE=exports.DEFAULT_MAX_ZOOM=void 0;var e=42;exports.DEFAULT_MAX_ZOOM=e;var r=256;exports.DEFAULT_TILE_SIZE=r; },{}],"Rc7z":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createExtent=a,exports.none=e;var t=require("./math.js");function a(a,e,r){return function(n,o,u,h){if(n){var M=e?0:u[0]*o,c=e?0:u[1]*o,l=a[0]+M/2,x=a[2]-M/2,i=a[1]+c/2,m=a[3]-c/2;l>x&&(x=l=(x+l)/2),i>m&&(m=i=(m+i)/2);var s=(0,t.clamp)(n[0],l,x),p=(0,t.clamp)(n[1],i,m),f=30*o;return h&&r&&(s+=-f*Math.log(1+Math.max(0,l-n[0])/f)+f*Math.log(1+Math.max(0,n[0]-x)/f),p+=-f*Math.log(1+Math.max(0,i-n[1])/f)+f*Math.log(1+Math.max(0,n[1]-m)/f)),[s,p]}}}function e(t){return t} },{"./math.js":"B96G"}],"o7nl":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createSnapToResolutions=i,exports.createSnapToPower=o,exports.createMinMaxResolution=h;var t=require("./math.js"),a=require("./extent.js"),r=require("./array.js");function e(t,r,e,n){var i=(0,a.getWidth)(r)/e[0],o=(0,a.getHeight)(r)/e[1];return n?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function n(a,r,e){var n=Math.min(a,r);return n*=Math.log(1+50*Math.max(0,a/r-1))/50+1,e&&(n=Math.max(n,e),n/=Math.log(1+50*Math.max(0,e/a-1))/50+1),(0,t.clamp)(n,e/2,2*r)}function i(a,i,o,h){return function(u,M,l,c){if(void 0!==u){var m=a[0],f=a[a.length-1],v=o?e(m,o,l,h):m;if(c)return void 0===i||i?n(u,v,f):(0,t.clamp)(u,f,v);var s=Math.min(v,u),p=Math.floor((0,r.linearFindNearest)(a,s,M));return a[p]>v&&p<a.length-1?a[p+1]:a[p]}}}function o(a,r,i,o,h,u){return function(M,l,c,m){if(void 0!==M){var f=h?e(r,h,c,u):r,v=void 0!==i?i:0;if(m)return void 0===o||o?n(M,f,v):(0,t.clamp)(M,v,f);var s=Math.ceil(Math.log(r/f)/Math.log(a)-1e-9),p=-l*(.5-1e-9)+.5,d=Math.min(f,M),g=Math.floor(Math.log(r/d)/Math.log(a)+p),x=Math.max(s,g),j=r/Math.pow(a,x);return(0,t.clamp)(j,v,f)}}}function h(a,r,i,o,h){return function(u,M,l,c){if(void 0!==u){var m=o?e(a,o,l,h):a;return(void 0===i||i)&&c?n(u,m,r):(0,t.clamp)(u,r,m)}}} },{"./math.js":"B96G","./extent.js":"QDir","./array.js":"luEr"}],"EKd0":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.disable=e,exports.none=o,exports.createSnapToN=t,exports.createSnapToZero=n;var r=require("./math.js");function e(r){return void 0!==r?0:void 0}function o(r){return void 0!==r?r:void 0}function t(r){var e=2*Math.PI/r;return function(r,o){return o?r:void 0!==r?r=Math.floor(r/e+.5)*e:void 0}}function n(e){var o=e||(0,r.toRadians)(5);return function(r,e){return e?r:void 0!==r?Math.abs(r)<=o?0:r:void 0}} },{"./math.js":"B96G"}],"IeCz":[function(require,module,exports) { "use strict";function e(e){return Math.pow(e,3)}function t(t){return 1-e(1-t)}function n(e){return 3*e*e-2*e*e*e}function r(e){return e}function u(e){return e<.5?n(2*e):1-n(2*(e-.5))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.easeIn=e,exports.easeOut=t,exports.inAndOut=n,exports.linear=r,exports.upAndDown=u; },{}],"rMra":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.maxSquaredDelta=t,exports.arrayMaxSquaredDelta=a,exports.multiArrayMaxSquaredDelta=n,exports.assignClosestPoint=s,exports.assignClosestArrayPoint=o,exports.assignClosestMultiArrayPoint=i;var r=require("../../math.js");function e(e,t,a,n,s,o,i){var u,f=e[t],l=e[t+1],v=e[a]-f,h=e[a+1]-l;if(0===v&&0===h)u=t;else{var g=((s-f)*v+(o-l)*h)/(v*v+h*h);if(g>1)u=a;else{if(g>0){for(var c=0;c<n;++c)i[c]=(0,r.lerp)(e[t+c],e[a+c],g);return void(i.length=n)}u=t}}for(c=0;c<n;++c)i[c]=e[u+c];i.length=n}function t(e,t,a,n,s){var o=e[t],i=e[t+1];for(t+=n;t<a;t+=n){var u=e[t],f=e[t+1],l=(0,r.squaredDistance)(o,i,u,f);l>s&&(s=l),o=u,i=f}return s}function a(r,e,a,n,s){for(var o=0,i=a.length;o<i;++o){var u=a[o];s=t(r,e,u,n,s),e=u}return s}function n(r,e,t,n,s){for(var o=0,i=t.length;o<i;++o){var u=t[o];s=a(r,e,u,n,s),e=u[u.length-1]}return s}function s(t,a,n,s,o,i,u,f,l,v,h){if(a==n)return v;var g,c;if(0===o){if((c=(0,r.squaredDistance)(u,f,t[a],t[a+1]))<v){for(g=0;g<s;++g)l[g]=t[a+g];return l.length=s,c}return v}for(var N=h||[NaN,NaN],x=a+s;x<n;)if(e(t,x-s,x,s,u,f,N),(c=(0,r.squaredDistance)(u,f,N[0],N[1]))<v){for(v=c,g=0;g<s;++g)l[g]=N[g];l.length=s,x+=s}else x+=s*Math.max((Math.sqrt(c)-Math.sqrt(v))/o|0,1);if(i&&(e(t,n-s,a,s,u,f,N),(c=(0,r.squaredDistance)(u,f,N[0],N[1]))<v)){for(v=c,g=0;g<s;++g)l[g]=N[g];l.length=s}return v}function o(r,e,t,a,n,o,i,u,f,l,v){for(var h=v||[NaN,NaN],g=0,c=t.length;g<c;++g){var N=t[g];l=s(r,e,N,a,n,o,i,u,f,l,h),e=N}return l}function i(r,e,t,a,n,s,i,u,f,l,v){for(var h=v||[NaN,NaN],g=0,c=t.length;g<c;++g){var N=t[g];l=o(r,e,N,a,n,s,i,u,f,l,h),e=N[N.length-1]}return l} },{"../../math.js":"B96G"}],"FNhl":[function(require,module,exports) { "use strict";function e(e,r,t,n){for(var o=0,a=t.length;o<a;++o)e[r++]=t[o];return r}function r(e,r,t,n){for(var o=0,a=t.length;o<a;++o)for(var f=t[o],l=0;l<n;++l)e[r++]=f[l];return r}function t(e,t,n,o,a){for(var f=a||[],l=0,u=0,i=n.length;u<i;++u){var s=r(e,t,n[u],o);f[l++]=s,t=s}return f.length=l,f}function n(e,r,n,o,a){for(var f=a||[],l=0,u=0,i=n.length;u<i;++u){var s=t(e,r,n[u],o,f[l]);f[l++]=s,r=s[s.length-1]}return f.length=l,f}Object.defineProperty(exports,"__esModule",{value:!0}),exports.deflateCoordinate=e,exports.deflateCoordinates=r,exports.deflateCoordinatesArray=t,exports.deflateMultiCoordinatesArray=n; },{}],"IEpt":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.simplifyLineString=e,exports.douglasPeucker=t,exports.douglasPeuckerArray=n,exports.douglasPeuckerMultiArray=u,exports.radialDistance=a,exports.snap=o,exports.quantize=i,exports.quantizeArray=s,exports.quantizeMultiArray=f;var r=require("../../math.js");function e(r,e,n,u,o,i,s){var f=void 0!==s?s:[];return i||(n=a(r,e,n,u,o,f,0),r=f,e=0,u=2),f.length=t(r,e,n,u,o,f,0),f}function t(e,t,n,u,a,o,i){var s=(n-t)/u;if(s<3){for(;t<n;t+=u)o[i++]=e[t],o[i++]=e[t+1];return i}var f=new Array(s);f[0]=1,f[s-1]=1;for(var p=[t,n-u],v=0;p.length>0;){for(var l=p.pop(),c=p.pop(),h=0,g=e[c],d=e[c+1],x=e[l],y=e[l+1],q=c+u;q<l;q+=u){var A=e[q],M=e[q+1],P=(0,r.squaredSegmentDistance)(A,M,g,d,x,y);P>h&&(v=q,h=P)}h>a&&(f[(v-t)/u]=1,c+u<v&&p.push(c,v),v+u<l&&p.push(v,l))}for(q=0;q<s;++q)f[q]&&(o[i++]=e[t+q*u],o[i++]=e[t+q*u+1]);return i}function n(r,e,n,u,a,o,i,s){for(var f=0,p=n.length;f<p;++f){var v=n[f];i=t(r,e,v,u,a,o,i),s.push(i),e=v}return i}function u(r,e,t,u,a,o,i,s){for(var f=0,p=t.length;f<p;++f){var v=t[f],l=[];i=n(r,e,v,u,a,o,i,l),s.push(l),e=v[v.length-1]}return i}function a(e,t,n,u,a,o,i){if(n<=t+u){for(;t<n;t+=u)o[i++]=e[t],o[i++]=e[t+1];return i}var s=e[t],f=e[t+1];o[i++]=s,o[i++]=f;var p=s,v=f;for(t+=u;t<n;t+=u)p=e[t],v=e[t+1],(0,r.squaredDistance)(s,f,p,v)>a&&(o[i++]=p,o[i++]=v,s=p,f=v);return p==s&&v==f||(o[i++]=p,o[i++]=v),i}function o(r,e){return e*Math.round(r/e)}function i(r,e,t,n,u,a,i){if(e==t)return i;var s,f,p=o(r[e],u),v=o(r[e+1],u);e+=n,a[i++]=p,a[i++]=v;do{if(s=o(r[e],u),f=o(r[e+1],u),(e+=n)==t)return a[i++]=s,a[i++]=f,i}while(s==p&&f==v);for(;e<t;){var l=o(r[e],u),c=o(r[e+1],u);if(e+=n,l!=s||c!=f){var h=s-p,g=f-v,d=l-p,x=c-v;h*x==g*d&&(h<0&&d<h||h==d||h>0&&d>h)&&(g<0&&x<g||g==x||g>0&&x>g)?(s=l,f=c):(a[i++]=s,a[i++]=f,p=s,v=f,s=l,f=c)}}return a[i++]=s,a[i++]=f,i}function s(r,e,t,n,u,a,o,s){for(var f=0,p=t.length;f<p;++f){var v=t[f];o=i(r,e,v,n,u,a,o),s.push(o),e=v}return o}function f(r,e,t,n,u,a,o,i){for(var f=0,p=t.length;f<p;++f){var v=t[f],l=[];o=s(r,e,v,n,u,a,o,l),i.push(l),e=v[v.length-1]}return o} },{"../../math.js":"B96G"}],"znXl":[function(require,module,exports) { "use strict";function e(e,r,t,n,o){for(var i=void 0!==o?o:[],a=0,l=r;l<t;l+=n)i[a++]=e.slice(l,l+n);return i.length=a,i}function r(r,t,n,o,i){for(var a=void 0!==i?i:[],l=0,s=0,f=n.length;s<f;++s){var u=n[s];a[l++]=e(r,t,u,o,a[l]),t=u}return a.length=l,a}function t(e,t,n,o,i){for(var a=void 0!==i?i:[],l=0,s=0,f=n.length;s<f;++s){var u=n[s];a[l++]=r(e,t,u,o,a[l]),t=u[u.length-1]}return a.length=l,a}Object.defineProperty(exports,"__esModule",{value:!0}),exports.inflateCoordinates=e,exports.inflateCoordinatesArray=r,exports.inflateMultiCoordinatesArray=t; },{}],"EOSm":[function(require,module,exports) { "use strict";function r(r,e,n,t){for(var o=0,i=r[n-t],a=r[n-t+1];e<n;e+=t){var s=r[e],u=r[e+1];o+=a*s-i*u,i=s,a=u}return o/2}function e(e,n,t,o){for(var i=0,a=0,s=t.length;a<s;++a){var u=t[a];i+=r(e,n,u,o),n=u}return i}function n(r,n,t,o){for(var i=0,a=0,s=t.length;a<s;++a){var u=t[a];i+=e(r,n,u,o),n=u[u.length-1]}return i}Object.defineProperty(exports,"__esModule",{value:!0}),exports.linearRing=r,exports.linearRings=e,exports.linearRingss=n; },{}],"jRgU":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=u(require("./GeometryLayout.js")),e=u(require("./GeometryType.js")),i=u(require("./SimpleGeometry.js")),o=require("./flat/closest.js"),r=require("../extent.js"),s=require("./flat/deflate.js"),n=require("./flat/simplify.js"),a=require("./flat/inflate.js"),l=require("./flat/area.js");function u(t){return t&&t.__esModule?t:{default:t}}var f=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),d=function(i){function u(t,e){var o=i.call(this)||this;return o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?o.setCoordinates(t,e):o.setFlatCoordinates(e,t),o}return f(u,i),u.prototype.clone=function(){return new u(this.flatCoordinates.slice(),this.layout)},u.prototype.closestPointXY=function(t,e,i,s){return s<(0,r.closestSquaredDistanceXY)(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt((0,o.maxSquaredDelta)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),(0,o.assignClosestPoint)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,s))},u.prototype.getArea=function(){return(0,l.linearRing)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},u.prototype.getCoordinates=function(){return(0,a.inflateCoordinates)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},u.prototype.getSimplifiedGeometryInternal=function(e){var i=[];return i.length=(0,n.douglasPeucker)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new u(i,t.default.XY)},u.prototype.getType=function(){return e.default.LINEAR_RING},u.prototype.intersectsExtent=function(t){return!1},u.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=(0,s.deflateCoordinates)(this.flatCoordinates,0,t,this.stride),this.changed()},u}(i.default),h=d;exports.default=h; },{"./GeometryLayout.js":"Utvi","./GeometryType.js":"lmV0","./SimpleGeometry.js":"pnrv","./flat/closest.js":"rMra","../extent.js":"QDir","./flat/deflate.js":"FNhl","./flat/simplify.js":"IEpt","./flat/inflate.js":"znXl","./flat/area.js":"EOSm"}],"gLcY":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=i(require("./GeometryType.js")),e=i(require("./SimpleGeometry.js")),o=require("../extent.js"),r=require("./flat/deflate.js"),n=require("../math.js");function i(t){return t&&t.__esModule?t:{default:t}}var s=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),a=function(e){function i(t,o){var r=e.call(this)||this;return r.setCoordinates(t,o),r}return s(i,e),i.prototype.clone=function(){return new i(this.flatCoordinates.slice(),this.layout)},i.prototype.closestPointXY=function(t,e,o,r){var i=this.flatCoordinates,s=(0,n.squaredDistance)(t,e,i[0],i[1]);if(s<r){for(var a=this.stride,u=0;u<a;++u)o[u]=i[u];return o.length=a,s}return r},i.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},i.prototype.computeExtent=function(t){return(0,o.createOrUpdateFromCoordinate)(this.flatCoordinates,t)},i.prototype.getType=function(){return t.default.POINT},i.prototype.intersectsExtent=function(t){return(0,o.containsXY)(t,this.flatCoordinates[0],this.flatCoordinates[1])},i.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=(0,r.deflateCoordinate)(this.flatCoordinates,0,t,this.stride),this.changed()},i}(e.default),u=a;exports.default=u; },{"./GeometryType.js":"lmV0","./SimpleGeometry.js":"pnrv","../extent.js":"QDir","./flat/deflate.js":"FNhl","../math.js":"B96G"}],"dzdN":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.linearRingContainsExtent=n,exports.linearRingContainsXY=e,exports.linearRingsContainsXY=t,exports.linearRingssContainsXY=i;var r=require("../../extent.js");function n(n,t,i,o,u){return!(0,r.forEachCorner)(u,function(r){return!e(n,t,i,o,r[0],r[1])})}function e(r,n,e,t,i,o){for(var u=0,a=r[e-t],s=r[e-t+1];n<e;n+=t){var f=r[n],l=r[n+1];s<=o?l>o&&(f-a)*(o-s)-(i-a)*(l-s)>0&&u++:l<=o&&(f-a)*(o-s)-(i-a)*(l-s)<0&&u--,a=f,s=l}return 0!==u}function t(r,n,t,i,o,u){if(0===t.length)return!1;if(!e(r,n,t[0],i,o,u))return!1;for(var a=1,s=t.length;a<s;++a)if(e(r,t[a-1],t[a],i,o,u))return!1;return!0}function i(r,n,e,i,o,u){if(0===e.length)return!1;for(var a=0,s=e.length;a<s;++a){var f=e[a];if(t(r,n,f,i,o,u))return!0;n=f[f.length-1]}return!1} },{"../../extent.js":"QDir"}],"UDvN":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getInteriorPointOfArray=t,exports.getInteriorPointsOfMultiArray=n;var r=require("./contains.js"),e=require("../../array.js");function t(t,n,a,o,i,s,u){for(var f,l,v,g,h,p,c,y=i[s+1],N=[],b=0,j=a.length;b<j;++b){var x=a[b];for(g=t[x-o],p=t[x-o+1],f=n;f<x;f+=o)h=t[f],c=t[f+1],(y<=p&&c<=y||p<=y&&y<=c)&&(v=(y-p)/(c-p)*(h-g)+g,N.push(v)),g=h,p=c}var M=NaN,O=-1/0;for(N.sort(e.numberSafeCompareFunction),g=N[0],f=1,l=N.length;f<l;++f){h=N[f];var P=Math.abs(h-g);P>O&&(v=(g+h)/2,(0,r.linearRingsContainsXY)(t,n,a,o,v,y)&&(M=v,O=P)),g=h}return isNaN(M)&&(M=i[s]),u?(u.push(M,y,O),u):[M,y,O]}function n(r,e,n,a,o){for(var i=[],s=0,u=n.length;s<u;++s){var f=n[s];i=t(r,e,f,a,o,2*s,i),e=f[f.length-1]}return i} },{"./contains.js":"dzdN","../../array.js":"luEr"}],"U8i0":[function(require,module,exports) { "use strict";function e(e,r,t,o,u){for(var f,n=[e[r],e[r+1]],s=[];r+o<t;r+=o){if(s[0]=e[r+o],s[1]=e[r+o+1],f=u(n,s))return f;n[0]=s[0],n[1]=s[1]}return!1}Object.defineProperty(exports,"__esModule",{value:!0}),exports.forEach=e; },{}],"GZir":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.intersectsLineString=t,exports.intersectsLineStringArray=i,exports.intersectsLinearRing=s,exports.intersectsLinearRingArray=a,exports.intersectsLinearRingMultiArray=o;var n=require("../../extent.js"),e=require("./segments.js"),r=require("./contains.js");function t(r,t,i,s,a){var o=(0,n.extendFlatCoordinates)((0,n.createEmpty)(),r,t,i,s);return!!(0,n.intersects)(a,o)&&(!!(0,n.containsExtent)(a,o)||(o[0]>=a[0]&&o[2]<=a[2]||(o[1]>=a[1]&&o[3]<=a[3]||(0,e.forEach)(r,t,i,s,function(e,r){return(0,n.intersectsSegment)(a,e,r)}))))}function i(n,e,r,i,s){for(var a=0,o=r.length;a<o;++a){if(t(n,e,r[a],i,s))return!0;e=r[a]}return!1}function s(n,e,i,s,a){return!!t(n,e,i,s,a)||(!!(0,r.linearRingContainsXY)(n,e,i,s,a[0],a[1])||(!!(0,r.linearRingContainsXY)(n,e,i,s,a[0],a[3])||(!!(0,r.linearRingContainsXY)(n,e,i,s,a[2],a[1])||!!(0,r.linearRingContainsXY)(n,e,i,s,a[2],a[3]))))}function a(n,e,i,a,o){if(!s(n,e,i[0],a,o))return!1;if(1===i.length)return!0;for(var u=1,c=i.length;u<c;++u)if((0,r.linearRingContainsExtent)(n,i[u-1],i[u],a,o)&&!t(n,i[u-1],i[u],a,o))return!1;return!0}function o(n,e,r,t,i){for(var s=0,o=r.length;s<o;++s){var u=r[s];if(a(n,e,u,t,i))return!0;e=u[u.length-1]}return!1} },{"../../extent.js":"QDir","./segments.js":"U8i0","./contains.js":"dzdN"}],"ElTe":[function(require,module,exports) { "use strict";function e(e,r,o,t){for(;r<o-t;){for(var s=0;s<t;++s){var a=e[r+s];e[r+s]=e[o-t+s],e[o-t+s]=a}r+=t,o-=t}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.coordinates=e; },{}],"cJkE":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.linearRingIsClockwise=e,exports.linearRingsAreOriented=t,exports.linearRingssAreOriented=i,exports.orientLinearRings=o,exports.orientLinearRingsArray=a;var r=require("./reverse.js");function e(r,e,t,i){for(var o=!0,a=0;a<i;++a)if(r[e+a]!==r[t-i+a]){o=!1;break}o&&(t-=i);var s=n(r,e,t,i),u=s-i;u<e&&(u=t-i);var f=s+i;f>=t&&(f=e);var v=r[u],l=r[u+1],g=r[s],c=r[s+1],d=r[f],p=r[f+1];return g*p+v*c+l*d-(l*g+c*d+v*p)<0}function n(r,e,n,t){for(var i=-1,o=1/0,a=1/0,s=e;s<n;s+=t){var u=r[s],f=r[s+1];f>o||(f==o&&u>=a||(i=s,o=f,a=u))}return i}function t(r,n,t,i,o){for(var a=void 0!==o&&o,s=0,u=t.length;s<u;++s){var f=t[s],v=e(r,n,f,i);if(0===s){if(a&&v||!a&&!v)return!1}else if(a&&!v||!a&&v)return!1;n=f}return!0}function i(r,e,n,i,o){for(var a=0,s=n.length;a<s;++a){var u=n[a];if(!t(r,e,u,i,o))return!1;u.length&&(e=u[u.length-1])}return!0}function o(n,t,i,o,a){for(var s=void 0!==a&&a,u=0,f=i.length;u<f;++u){var v=i[u],l=e(n,t,v,o);(0===u?s&&l||!s&&!l:s&&!l||!s&&l)&&(0,r.coordinates)(n,t,v,o),t=v}return t}function a(r,e,n,t,i){for(var a=0,s=n.length;a<s;++a)e=o(r,e,n[a],t,i);return e} },{"./reverse.js":"ElTe"}],"Nwwk":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.circular=x,exports.fromExtent=j,exports.fromCircle=P,exports.makeRegular=m,exports.default=void 0;var t=C(require("./GeometryLayout.js")),e=C(require("./GeometryType.js")),i=C(require("./LinearRing.js")),r=C(require("./Point.js")),n=C(require("./SimpleGeometry.js")),s=require("./flat/closest.js"),o=require("../extent.js"),a=require("./flat/deflate.js"),l=require("../array.js"),d=require("./flat/interiorpoint.js"),h=require("./flat/inflate.js"),u=require("./flat/intersectsextent.js"),f=require("./flat/orient.js"),g=require("./flat/area.js"),p=require("./flat/contains.js"),c=require("../math.js"),_=require("./flat/simplify.js"),y=require("../sphere.js");function C(t){return t&&t.__esModule?t:{default:t}}var v=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),R=function(n){function c(t,e,i){var r=n.call(this)||this;return r.ends_=[],r.flatInteriorPointRevision_=-1,r.flatInteriorPoint_=null,r.maxDelta_=-1,r.maxDeltaRevision_=-1,r.orientedRevision_=-1,r.orientedFlatCoordinates_=null,void 0!==e&&i?(r.setFlatCoordinates(e,t),r.ends_=i):r.setCoordinates(t,e),r}return v(c,n),c.prototype.appendLinearRing=function(t){this.flatCoordinates?(0,l.extend)(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},c.prototype.clone=function(){return new c(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},c.prototype.closestPointXY=function(t,e,i,r){return r<(0,o.closestSquaredDistanceXY)(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt((0,s.arrayMaxSquaredDelta)(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),(0,s.assignClosestArrayPoint)(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,r))},c.prototype.containsXY=function(t,e){return(0,p.linearRingsContainsXY)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},c.prototype.getArea=function(){return(0,g.linearRings)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},c.prototype.getCoordinates=function(t){var e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),(0,f.orientLinearRings)(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,(0,h.inflateCoordinatesArray)(e,0,this.ends_,this.stride)},c.prototype.getEnds=function(){return this.ends_},c.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=(0,o.getCenter)(this.getExtent());this.flatInteriorPoint_=(0,d.getInteriorPointOfArray)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},c.prototype.getInteriorPoint=function(){return new r.default(this.getFlatInteriorPoint(),t.default.XYM)},c.prototype.getLinearRingCount=function(){return this.ends_.length},c.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new i.default(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},c.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.ends_,n=[],s=0,o=0,a=r.length;o<a;++o){var l=r[o],d=new i.default(e.slice(s,l),t);n.push(d),s=l}return n},c.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;(0,f.linearRingsAreOriented)(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=(0,f.orientLinearRings)(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},c.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=(0,_.quantizeArray)(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),i,0,r),new c(i,t.default.XY,r)},c.prototype.getType=function(){return e.default.POLYGON},c.prototype.intersectsExtent=function(t){return(0,u.intersectsLinearRingArray)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},c.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=(0,a.deflateCoordinatesArray)(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},c}(n.default),q=R;function x(e,i,r,n){for(var s=r||32,o=[],a=0;a<s;++a)(0,l.extend)(o,(0,y.offset)(e,i,2*Math.PI*a/s,n));return o.push(o[0],o[1]),new R(o,t.default.XY,[o.length])}function j(e){var i=e[0],r=e[1],n=e[2],s=e[3],o=[i,r,i,s,n,s,n,r,i,r];return new R(o,t.default.XY,[o.length])}function P(t,e,i){for(var r=e||32,n=t.getStride(),s=t.getLayout(),o=t.getCenter(),a=n*(r+1),l=new Array(a),d=0;d<a;d+=n){l[d]=0,l[d+1]=0;for(var h=2;h<n;h++)l[d+h]=o[h]}var u=[l.length],f=new R(l,s,u);return m(f,o,t.getRadius(),i),f}function m(t,e,i,r){for(var n=t.getFlatCoordinates(),s=t.getStride(),o=n.length/s-1,a=r||0,l=0;l<=o;++l){var d=l*s,h=a+2*(0,c.modulo)(l,o)*Math.PI/o;n[d]=e[0]+i*Math.cos(h),n[d+1]=e[1]+i*Math.sin(h)}t.changed()}exports.default=q; },{"./GeometryLayout.js":"Utvi","./GeometryType.js":"lmV0","./LinearRing.js":"jRgU","./Point.js":"gLcY","./SimpleGeometry.js":"pnrv","./flat/closest.js":"rMra","../extent.js":"QDir","./flat/deflate.js":"FNhl","../array.js":"luEr","./flat/interiorpoint.js":"UDvN","./flat/inflate.js":"znXl","./flat/intersectsextent.js":"GZir","./flat/orient.js":"cJkE","./flat/area.js":"EOSm","./flat/contains.js":"dzdN","../math.js":"B96G","./flat/simplify.js":"IEpt","../sphere.js":"q4ER"}],"hNqE":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createCenterConstraint=j,exports.createResolutionConstraint=x,exports.createRotationConstraint=A,exports.isNoopAnimation=E,exports.default=void 0;var t=v(require("./Object.js")),o=v(require("./geom/GeometryType.js")),e=v(require("./proj/Units.js")),n=v(require("./ViewHint.js")),i=v(require("./ViewProperty.js")),r=require("./tilegrid/common.js"),s=require("./proj.js"),a=require("./functions.js"),u=require("./coordinate.js"),h=require("./asserts.js"),l=require("./obj.js"),c=require("./centerconstraint.js"),p=require("./math.js"),g=require("./resolutionconstraint.js"),m=require("./rotationconstraint.js"),f=require("./easing.js"),_=require("./extent.js"),d=require("./array.js"),R=require("./geom/Polygon.js");function v(t){return t&&t.__esModule?t:{default:t}}var y=function(){var t=function(o,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var e in o)o.hasOwnProperty(e)&&(t[e]=o[e])})(o,e)};return function(o,e){function n(){this.constructor=o}t(o,e),o.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),C=0,I=function(t){function e(o){var e=t.call(this)||this,n=(0,l.assign)({},o);return e.hints_=[0,0],e.animations_=[],e.updateAnimationKey_,e.projection_=(0,s.createProjection)(n.projection,"EPSG:3857"),e.viewportSize_=[100,100],e.targetCenter_=null,e.targetResolution_,e.targetRotation_,e.cancelAnchor_=void 0,n.center&&(n.center=(0,s.fromUserCoordinate)(n.center,e.projection_)),n.extent&&(n.extent=(0,s.fromUserExtent)(n.extent,e.projection_)),e.applyOptions_(n),e}return y(e,t),e.prototype.applyOptions_=function(t){var o=x(t);this.maxResolution_=o.maxResolution,this.minResolution_=o.minResolution,this.zoomFactor_=o.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=o.minZoom;var e=j(t),n=o.constraint,i=A(t);this.constraints_={center:e,resolution:n,rotation:i},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom),this.setProperties({}),this.options_=t},e.prototype.getUpdatedOptions_=function(t){var o=(0,l.assign)({},this.options_);return void 0!==o.resolution?o.resolution=this.getResolution():o.zoom=this.getZoom(),o.center=this.getCenterInternal(),o.rotation=this.getRotation(),(0,l.assign)({},o,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var o=new Array(arguments.length),e=0;e<o.length;++e){var n=arguments[e];n.center&&((n=(0,l.assign)({},n)).center=(0,s.fromUserCoordinate)(n.center,this.getProjection())),n.anchor&&((n=(0,l.assign)({},n)).anchor=(0,s.fromUserCoordinate)(n.anchor,this.getProjection())),o[e]=n}this.animateInternal.apply(this,o)},e.prototype.animateInternal=function(t){var o,e=arguments.length;if(e>1&&"function"==typeof arguments[e-1]&&(o=arguments[e-1],--e),!this.isDef()){var i=arguments[e-1];return i.center&&this.setCenterInternal(i.center),void 0!==i.zoom&&this.setZoom(i.zoom),void 0!==i.rotation&&this.setRotation(i.rotation),void(o&&M(o,!0))}for(var r=Date.now(),s=this.targetCenter_.slice(),a=this.targetResolution_,u=this.targetRotation_,h=[],l=0;l<e;++l){var c=arguments[l],g={start:r,complete:!1,anchor:c.anchor,duration:void 0!==c.duration?c.duration:1e3,easing:c.easing||f.inAndOut,callback:o};if(c.center&&(g.sourceCenter=s,g.targetCenter=c.center.slice(),s=g.targetCenter),void 0!==c.zoom?(g.sourceResolution=a,g.targetResolution=this.getResolutionForZoom(c.zoom),a=g.targetResolution):c.resolution&&(g.sourceResolution=a,g.targetResolution=c.resolution,a=g.targetResolution),void 0!==c.rotation){g.sourceRotation=u;var m=(0,p.modulo)(c.rotation-u+Math.PI,2*Math.PI)-Math.PI;g.targetRotation=u+m,u=g.targetRotation}E(g)?g.complete=!0:r+=g.duration,h.push(g)}this.animations_.push(h),this.setHint(n.default.ANIMATING,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[n.default.ANIMATING]>0},e.prototype.getInteracting=function(){return this.hints_[n.default.INTERACTING]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(n.default.ANIMATING,-this.hints_[n.default.ANIMATING]);for(var o=0,e=this.animations_.length;o<e;++o){var i=this.animations_[o];if(i[0].callback&&M(i[0].callback,!1),!t)for(var r=0,s=i.length;r<s;++r){var a=i[r];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),o=!1,e=this.animations_.length-1;e>=0;--e){for(var i=this.animations_[e],r=!0,s=0,a=i.length;s<a;++s){var u=i[s];if(!u.complete){var h=t-u.start,l=u.duration>0?h/u.duration:1;l>=1?(u.complete=!0,l=1):r=!1;var c=u.easing(l);if(u.sourceCenter){var g=u.sourceCenter[0],m=u.sourceCenter[1],f=g+c*(u.targetCenter[0]-g),_=m+c*(u.targetCenter[1]-m);this.targetCenter_=[f,_]}if(u.sourceResolution&&u.targetResolution){var d=1===c?u.targetResolution:u.sourceResolution+c*(u.targetResolution-u.sourceResolution);if(u.anchor){var R=this.getViewportSize_(this.getRotation()),v=this.constraints_.resolution(d,0,R,!0);this.targetCenter_=this.calculateCenterZoom(v,u.anchor)}this.targetResolution_=d,this.applyTargetState_(!0)}if(void 0!==u.sourceRotation&&void 0!==u.targetRotation){var y=1===c?(0,p.modulo)(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+c*(u.targetRotation-u.sourceRotation);if(u.anchor){var C=this.constraints_.rotation(y,!0);this.targetCenter_=this.calculateCenterRotate(C,u.anchor)}this.targetRotation_=y}if(this.applyTargetState_(!0),o=!0,!u.complete)break}}if(r){this.animations_[e]=null,this.setHint(n.default.ANIMATING,-1);var I=i[0].callback;I&&M(I,!0)}}this.animations_=this.animations_.filter(Boolean),o&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,o){var e,n=this.getCenterInternal();return void 0!==n&&(e=[n[0]-o[0],n[1]-o[1]],(0,u.rotate)(e,t-this.getRotation()),(0,u.add)(e,o)),e},e.prototype.calculateCenterZoom=function(t,o){var e,n=this.getCenterInternal(),i=this.getResolution();void 0!==n&&void 0!==i&&(e=[o[0]-t*(o[0]-n[0])/i,o[1]-t*(o[1]-n[1])/i]);return e},e.prototype.getViewportSize_=function(t){var o=this.viewportSize_;if(t){var e=o[0],n=o[1];return[Math.abs(e*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(e*Math.sin(t))+Math.abs(n*Math.cos(t))]}return o},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?(0,s.toUserCoordinate)(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(i.default.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var o=this.calculateExtentInternal(t);return(0,s.toUserExtent)(o,this.getProjection())},e.prototype.calculateExtentInternal=function(t){var o=t||this.getViewportSize_(),e=this.getCenterInternal();(0,h.assert)(e,1);var n=this.getResolution();(0,h.assert)(void 0!==n,2);var i=this.getRotation();return(0,h.assert)(void 0!==i,3),(0,_.getForViewAndSize)(e,n,i,o)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(i.default.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,o){return this.getResolutionForExtentInternal((0,s.fromUserExtent)(t,this.getProjection()),o)},e.prototype.getResolutionForExtentInternal=function(t,o){var e=o||this.getViewportSize_(),n=(0,_.getWidth)(t)/e[0],i=(0,_.getHeight)(t)/e[1];return Math.max(n,i)},e.prototype.getResolutionForValueFunction=function(t){var o=t||2,e=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(e/n)/Math.log(o);return function(t){return e/Math.pow(o,t*i)}},e.prototype.getRotation=function(){return this.get(i.default.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var o=Math.log(t||2),e=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(e/n)/o;return function(t){return Math.log(e/t)/o/i}},e.prototype.getState=function(){var t=this.getCenterInternal(),o=this.getProjection(),e=this.getResolution(),n=this.getRotation();return{center:t.slice(0),projection:void 0!==o?o:null,resolution:e,rotation:n,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,o=this.getResolution();return void 0!==o&&(t=this.getZoomForResolution(o)),t},e.prototype.getZoomForResolution=function(t){var o,e,n=this.minZoom_||0;if(this.resolutions_){var i=(0,d.linearFindNearest)(this.resolutions_,t,1);n=i,o=this.resolutions_[i],e=i==this.resolutions_.length-1?2:o/this.resolutions_[i+1]}else o=this.maxResolution_,e=this.zoomFactor_;return n+Math.log(o/t)/Math.log(e)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var o=(0,p.clamp)(Math.floor(t),0,this.resolutions_.length-2),e=this.resolutions_[o]/this.resolutions_[o+1];return this.resolutions_[o]/Math.pow(e,(0,p.clamp)(t-o,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var n,i=(0,l.assign)({size:this.getViewportSize_()},e||{});if((0,h.assert)(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)){(0,h.assert)(!(0,_.isEmpty)(t),25);var r=(0,s.fromUserExtent)(t,this.getProjection());n=(0,R.fromExtent)(r)}else if(t.getType()===o.default.CIRCLE){r=(0,s.fromUserExtent)(t.getExtent(),this.getProjection());(n=(0,R.fromExtent)(r)).rotate(this.getRotation(),(0,_.getCenter)(r))}else{var a=(0,s.getUserProjection)();n=a?t.clone().transform(a,this.getProjection()):t}this.fitInternal(n,i)},e.prototype.fitInternal=function(t,o){var e=o||{},n=e.size;n||(n=this.getViewportSize_());var i,r=void 0!==e.padding?e.padding:[0,0,0,0],s=void 0!==e.nearest&&e.nearest;i=void 0!==e.minResolution?e.minResolution:void 0!==e.maxZoom?this.getResolutionForZoom(e.maxZoom):0;for(var u=t.getFlatCoordinates(),h=this.getRotation(),l=Math.cos(-h),c=Math.sin(-h),p=1/0,g=1/0,m=-1/0,f=-1/0,_=t.getStride(),d=0,R=u.length;d<R;d+=_){var v=u[d]*l-u[d+1]*c,y=u[d]*c+u[d+1]*l;p=Math.min(p,v),g=Math.min(g,y),m=Math.max(m,v),f=Math.max(f,y)}var C=this.getResolutionForExtentInternal([p,g,m,f],[n[0]-r[1]-r[3],n[1]-r[0]-r[2]]);C=isNaN(C)?i:Math.max(C,i),C=this.getConstrainedResolution(C,s?0:1),c=-c;var I=(p+m)/2,j=(g+f)/2,x=[(I+=(r[1]-r[3])/2*C)*l-(j+=(r[0]-r[2])/2*C)*c,j*l+I*c],A=e.callback?e.callback:a.VOID;void 0!==e.duration?this.animateInternal({resolution:C,center:this.getConstrainedCenter(x,C),duration:e.duration,easing:e.easing},A):(this.targetResolution_=C,this.targetCenter_=x,this.applyTargetState_(!1,!0),M(A,!0))},e.prototype.centerOn=function(t,o,e){this.centerOnInternal((0,s.fromUserCoordinate)(t,this.getProjection()),o,e)},e.prototype.centerOnInternal=function(t,o,e){var n=this.getRotation(),i=Math.cos(-n),r=Math.sin(-n),s=t[0]*i-t[1]*r,a=t[1]*i+t[0]*r,u=this.getResolution(),h=(s+=(o[0]/2-e[0])*u)*i-(a+=(e[1]-o[1]/2)*u)*(r=-r),l=a*i+s*r;this.setCenterInternal([h,l])},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var o=(0,s.toUserCoordinate)(this.targetCenter_,this.getProjection());this.setCenter([o[0]+t[0],o[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var o=this.targetCenter_;this.setCenterInternal([o[0]+t[0],o[1]+t[1]])},e.prototype.adjustResolution=function(t,o){var e=o&&(0,s.fromUserCoordinate)(o,this.getProjection());this.adjustResolutionInternal(t,e)},e.prototype.adjustResolutionInternal=function(t,o){var e=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*t,0,n,e);o&&(this.targetCenter_=this.calculateCenterZoom(i,o)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,o){this.adjustResolution(Math.pow(this.zoomFactor_,-t),o)},e.prototype.adjustRotation=function(t,o){o&&(o=(0,s.fromUserCoordinate)(o,this.getProjection())),this.adjustRotationInternal(t,o)},e.prototype.adjustRotationInternal=function(t,o){var e=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,e);o&&(this.targetCenter_=this.calculateCenterRotate(n,o)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal((0,s.fromUserCoordinate)(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,o){return this.hints_[t]+=o,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,o){var e=this.getAnimating()||this.getInteracting()||o,n=this.constraints_.rotation(this.targetRotation_,e),r=this.getViewportSize_(n),s=this.constraints_.resolution(this.targetResolution_,0,r,e),a=this.constraints_.center(this.targetCenter_,s,r,e);this.get(i.default.ROTATION)!==n&&this.set(i.default.ROTATION,n),this.get(i.default.RESOLUTION)!==s&&this.set(i.default.RESOLUTION,s),this.get(i.default.CENTER)&&(0,u.equals)(this.get(i.default.CENTER),a)||this.set(i.default.CENTER,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,o,e){var n=void 0!==t?t:200,i=o||0,r=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,i,s),h=this.constraints_.center(this.targetCenter_,a,s);if(0===n&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=r,this.targetCenter_=h,void this.applyTargetState_();var l=e||(0===n?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===r&&this.getCenterInternal()&&(0,u.equals)(this.getCenterInternal(),h)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:h,resolution:a,duration:n,easing:f.easeOut,anchor:l}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(n.default.INTERACTING,1)},e.prototype.endInteraction=function(t,o,e){var n=e&&(0,s.fromUserCoordinate)(e,this.getProjection());this.endInteractionInternal(t,o,n)},e.prototype.endInteractionInternal=function(t,o,e){this.setHint(n.default.INTERACTING,-1),this.resolveConstraints(t,o,e)},e.prototype.getConstrainedCenter=function(t,o){var e=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,o||this.getResolution(),e)},e.prototype.getConstrainedZoom=function(t,o){var e=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(e,o))},e.prototype.getConstrainedResolution=function(t,o){var e=o||0,n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,n)},e}(t.default);function M(t,o){setTimeout(function(){t(o)},0)}function j(t){if(void 0!==t.extent){var o=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return(0,c.createExtent)(t.extent,t.constrainOnlyCenter,o)}var e=(0,s.createProjection)(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&e.isGlobal()){var n=e.getExtent().slice();return n[0]=-1/0,n[2]=1/0,(0,c.createExtent)(n,!1,!1)}return c.none}function x(t){var o,n,i,a=void 0!==t.minZoom?t.minZoom:C,u=void 0!==t.maxZoom?t.maxZoom:28,h=void 0!==t.zoomFactor?t.zoomFactor:2,l=void 0!==t.multiWorld&&t.multiWorld,c=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,p=void 0!==t.showFullExtent&&t.showFullExtent,m=(0,s.createProjection)(t.projection,"EPSG:3857"),f=m.getExtent(),d=t.constrainOnlyCenter,R=t.extent;if(l||R||!m.isGlobal()||(d=!1,R=f),void 0!==t.resolutions){var v=t.resolutions;n=v[a],i=void 0!==v[u]?v[u]:v[v.length-1],o=t.constrainResolution?(0,g.createSnapToResolutions)(v,c,!d&&R,p):(0,g.createMinMaxResolution)(n,i,c,!d&&R,p)}else{var y=(f?Math.max((0,_.getWidth)(f),(0,_.getHeight)(f)):360*s.METERS_PER_UNIT[e.default.DEGREES]/m.getMetersPerUnit())/r.DEFAULT_TILE_SIZE/Math.pow(2,C),I=y/Math.pow(2,28-C);void 0!==(n=t.maxResolution)?a=0:n=y/Math.pow(h,a),void 0===(i=t.minResolution)&&(i=void 0!==t.maxZoom?void 0!==t.maxResolution?n/Math.pow(h,u):y/Math.pow(h,u):I),u=a+Math.floor(Math.log(n/i)/Math.log(h)),i=n/Math.pow(h,u-a),o=t.constrainResolution?(0,g.createSnapToPower)(h,n,i,c,!d&&R,p):(0,g.createMinMaxResolution)(n,i,c,!d&&R,p)}return{constraint:o,maxResolution:n,minResolution:i,minZoom:a,zoomFactor:h}}function A(t){if(void 0===t.enableRotation||t.enableRotation){var o=t.constrainRotation;return void 0===o||!0===o?(0,m.createSnapToZero)():!1===o?m.none:"number"==typeof o?(0,m.createSnapToN)(o):m.none}return m.disable}function E(t){return!(t.sourceCenter&&t.targetCenter&&!(0,u.equals)(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}var T=I;exports.default=T; },{"./Object.js":"PhPh","./geom/GeometryType.js":"lmV0","./proj/Units.js":"yZx6","./ViewHint.js":"cuLW","./ViewProperty.js":"cE7c","./tilegrid/common.js":"mOEX","./proj.js":"Diht","./functions.js":"RgA2","./coordinate.js":"nGsj","./asserts.js":"fLG6","./obj.js":"mH6q","./centerconstraint.js":"Rc7z","./math.js":"B96G","./resolutionconstraint.js":"o7nl","./rotationconstraint.js":"EKd0","./easing.js":"IeCz","./extent.js":"QDir","./array.js":"luEr","./geom/Polygon.js":"Nwwk"}],"TAHd":[function(require,module,exports) { "use strict";function r(r,e,t){return void 0===t&&(t=[0,0]),t[0]=r[0]+2*e,t[1]=r[1]+2*e,t}function e(r){return r[0]>0&&r[1]>0}function t(r,e,t){return void 0===t&&(t=[0,0]),t[0]=r[0]*e+.5|0,t[1]=r[1]*e+.5|0,t}function o(r,e){return Array.isArray(r)?r:(void 0===e?e=[r,r]:(e[0]=r,e[1]=r),e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.buffer=r,exports.hasArea=e,exports.scale=t,exports.toSize=o; },{}],"kRwz":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=x(require("./Object.js")),t=S(require("./Collection.js")),r=S(require("./CollectionEventType.js")),n=S(require("./events/EventType.js")),i=S(require("./layer/Group.js")),o=S(require("./MapBrowserEvent.js")),a=S(require("./MapBrowserEventHandler.js")),s=S(require("./MapBrowserEventType.js")),l=S(require("./MapEvent.js")),d=S(require("./MapEventType.js")),u=S(require("./MapProperty.js")),p=S(require("./ObjectEventType.js")),h=S(require("./pointer/EventType.js")),y=S(require("./render/EventType.js")),v=x(require("./TileQueue.js")),f=S(require("./View.js")),c=S(require("./ViewHint.js")),_=require("./has.js"),E=require("./functions.js"),g=require("./transform.js"),m=require("./asserts.js"),w=require("./extent.js"),T=require("./proj.js"),C=require("./size.js"),L=require("./events.js"),R=require("./dom.js");function S(e){return e&&e.__esModule?e:{default:e}}function P(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return P=function(){return e},e}function x(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=P();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=n?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}var I=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),A=function(i){function f(n){var o=i.call(this)||this,a=O(n);return o.boundHandleBrowserEvent_=o.handleBrowserEvent.bind(o),o.maxTilesLoading_=void 0!==n.maxTilesLoading?n.maxTilesLoading:16,o.pixelRatio_=void 0!==n.pixelRatio?n.pixelRatio:_.DEVICE_PIXEL_RATIO,o.postRenderTimeoutHandle_,o.animationDelayKey_,o.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(o),o.coordinateToPixelTransform_=(0,g.create)(),o.pixelToCoordinateTransform_=(0,g.create)(),o.frameIndex_=0,o.frameState_=null,o.previousExtent_=null,o.viewPropertyListenerKey_=null,o.viewChangeListenerKey_=null,o.layerGroupPropertyListenerKeys_=null,o.viewport_=document.createElement("div"),o.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),o.viewport_.style.position="relative",o.viewport_.style.overflow="hidden",o.viewport_.style.width="100%",o.viewport_.style.height="100%",o.overlayContainer_=document.createElement("div"),o.overlayContainer_.style.position="absolute",o.overlayContainer_.style.zIndex="0",o.overlayContainer_.style.width="100%",o.overlayContainer_.style.height="100%",o.overlayContainer_.style.pointerEvents="none",o.overlayContainer_.className="ol-overlaycontainer",o.viewport_.appendChild(o.overlayContainer_),o.overlayContainerStopEvent_=document.createElement("div"),o.overlayContainerStopEvent_.style.position="absolute",o.overlayContainerStopEvent_.style.zIndex="0",o.overlayContainerStopEvent_.style.width="100%",o.overlayContainerStopEvent_.style.height="100%",o.overlayContainerStopEvent_.style.pointerEvents="none",o.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",o.viewport_.appendChild(o.overlayContainerStopEvent_),o.mapBrowserEventHandler_=null,o.moveTolerance_=n.moveTolerance,o.keyboardEventTarget_=a.keyboardEventTarget,o.keyHandlerKeys_=null,o.controls=a.controls||new t.default,o.interactions=a.interactions||new t.default,o.overlays_=a.overlays,o.overlayIdIndex_={},o.renderer_=null,o.handleResize_,o.postRenderFunctions_=[],o.tileQueue_=new v.default(o.getTilePriority.bind(o),o.handleTileChange_.bind(o)),o.addEventListener((0,e.getChangeEventType)(u.default.LAYERGROUP),o.handleLayerGroupChanged_),o.addEventListener((0,e.getChangeEventType)(u.default.VIEW),o.handleViewChanged_),o.addEventListener((0,e.getChangeEventType)(u.default.SIZE),o.handleSizeChanged_),o.addEventListener((0,e.getChangeEventType)(u.default.TARGET),o.handleTargetChanged_),o.setProperties(a.values),o.controls.forEach(function(e){e.setMap(this)}.bind(o)),o.controls.addEventListener(r.default.ADD,function(e){e.element.setMap(this)}.bind(o)),o.controls.addEventListener(r.default.REMOVE,function(e){e.element.setMap(null)}.bind(o)),o.interactions.forEach(function(e){e.setMap(this)}.bind(o)),o.interactions.addEventListener(r.default.ADD,function(e){e.element.setMap(this)}.bind(o)),o.interactions.addEventListener(r.default.REMOVE,function(e){e.element.setMap(null)}.bind(o)),o.overlays_.forEach(o.addOverlayInternal_.bind(o)),o.overlays_.addEventListener(r.default.ADD,function(e){this.addOverlayInternal_(e.element)}.bind(o)),o.overlays_.addEventListener(r.default.REMOVE,function(e){var t=e.element.getId();void 0!==t&&delete this.overlayIdIndex_[t.toString()],e.element.setMap(null)}.bind(o)),o}return I(f,i),f.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},f.prototype.addControl=function(e){this.getControls().push(e)},f.prototype.addInteraction=function(e){this.getInteractions().push(e)},f.prototype.addLayer=function(e){this.getLayerGroup().getLayers().push(e)},f.prototype.addOverlay=function(e){this.getOverlays().push(e)},f.prototype.addOverlayInternal_=function(e){var t=e.getId();void 0!==t&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)},f.prototype.disposeInternal=function(){this.setTarget(null),i.prototype.disposeInternal.call(this)},f.prototype.forEachFeatureAtPixel=function(e,t,r){if(this.frameState_){var n=this.getCoordinateFromPixelInternal(e),i=void 0!==(r=void 0!==r?r:{}).hitTolerance?r.hitTolerance*this.frameState_.pixelRatio:0,o=void 0!==r.layerFilter?r.layerFilter:E.TRUE,a=!1!==r.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,i,a,t,null,o,null)}},f.prototype.getFeaturesAtPixel=function(e,t){var r=[];return this.forEachFeatureAtPixel(e,function(e){r.push(e)},t),r},f.prototype.forEachLayerAtPixel=function(e,t,r){if(this.frameState_){var n=r||{},i=void 0!==n.hitTolerance?n.hitTolerance*this.frameState_.pixelRatio:0,o=n.layerFilter||E.TRUE;return this.renderer_.forEachLayerAtPixel(e,this.frameState_,i,t,o)}},f.prototype.hasFeatureAtPixel=function(e,t){if(!this.frameState_)return!1;var r=this.getCoordinateFromPixelInternal(e),n=void 0!==(t=void 0!==t?t:{}).layerFilter?t.layerFilter:E.TRUE,i=void 0!==t.hitTolerance?t.hitTolerance*this.frameState_.pixelRatio:0,o=!1!==t.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(r,this.frameState_,i,o,n,null)},f.prototype.getEventCoordinate=function(e){return this.getCoordinateFromPixel(this.getEventPixel(e))},f.prototype.getEventCoordinateInternal=function(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))},f.prototype.getEventPixel=function(e){var t=this.viewport_.getBoundingClientRect(),r="changedTouches"in e?e.changedTouches[0]:e;return[r.clientX-t.left,r.clientY-t.top]},f.prototype.getTarget=function(){return this.get(u.default.TARGET)},f.prototype.getTargetElement=function(){var e=this.getTarget();return void 0!==e?"string"==typeof e?document.getElementById(e):e:null},f.prototype.getCoordinateFromPixel=function(e){return(0,T.toUserCoordinate)(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())},f.prototype.getCoordinateFromPixelInternal=function(e){var t=this.frameState_;return t?(0,g.apply)(t.pixelToCoordinateTransform,e.slice()):null},f.prototype.getControls=function(){return this.controls},f.prototype.getOverlays=function(){return this.overlays_},f.prototype.getOverlayById=function(e){var t=this.overlayIdIndex_[e.toString()];return void 0!==t?t:null},f.prototype.getInteractions=function(){return this.interactions},f.prototype.getLayerGroup=function(){return this.get(u.default.LAYERGROUP)},f.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},f.prototype.getLoading=function(){for(var e=this.getLayerGroup().getLayerStatesArray(),t=0,r=e.length;t<r;++t){var n=e[t].layer.getSource();if(n&&n.loading)return!0}return!1},f.prototype.getPixelFromCoordinate=function(e){var t=(0,T.fromUserCoordinate)(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)},f.prototype.getPixelFromCoordinateInternal=function(e){var t=this.frameState_;return t?(0,g.apply)(t.coordinateToPixelTransform,e.slice(0,2)):null},f.prototype.getRenderer=function(){return this.renderer_},f.prototype.getSize=function(){return this.get(u.default.SIZE)},f.prototype.getView=function(){return this.get(u.default.VIEW)},f.prototype.getViewport=function(){return this.viewport_},f.prototype.getOverlayContainer=function(){return this.overlayContainer_},f.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},f.prototype.getTilePriority=function(e,t,r,n){return(0,v.getTilePriority)(this.frameState_,e,t,r,n)},f.prototype.handleBrowserEvent=function(e,t){var r=t||e.type,n=new o.default(r,this,e);this.handleMapBrowserEvent(n)},f.prototype.handleMapBrowserEvent=function(e){if(this.frameState_){var t=e.originalEvent,r=t.type;if(r===h.default.POINTERDOWN||r===n.default.WHEEL||r===n.default.KEYDOWN){var i=this.viewport_.getRootNode?this.viewport_.getRootNode():document,o=i===document?t.target:i.elementFromPoint(t.clientX,t.clientY);if(this.overlayContainerStopEvent_.contains(o)||!(i===document?document.documentElement:i).contains(o))return}e.frameState=this.frameState_;var a=this.getInteractions().getArray();if(!1!==this.dispatchEvent(e))for(var s=a.length-1;s>=0;s--){var l=a[s];if(l.getActive())if(!l.handleEvent(e))break}}},f.prototype.handlePostRender=function(){var e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){var r=this.maxTilesLoading_,n=r;if(e){var i=e.viewHints;if(i[c.default.ANIMATING]||i[c.default.INTERACTING]){var o=!_.IMAGE_DECODE&&Date.now()-e.time>8;r=o?0:8,n=o?0:2}}t.getTilesLoading()<r&&(t.reprioritize(),t.loadMoreTiles(r,n))}!e||!this.hasListener(y.default.RENDERCOMPLETE)||e.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(y.default.RENDERCOMPLETE,e);for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,e);a.length=0},f.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},f.prototype.handleTargetChanged_=function(){var e;if(this.getTarget()&&(e=this.getTargetElement()),this.mapBrowserEventHandler_){for(var t=0,r=this.keyHandlerKeys_.length;t<r;++t)(0,L.unlistenByKey)(this.keyHandlerKeys_[t]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(n.default.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(n.default.WHEEL,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(n.default.RESIZE,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,(0,R.removeNode)(this.viewport_)}if(e){for(var i in e.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new a.default(this,this.moveTolerance_),s.default)this.mapBrowserEventHandler_.addEventListener(s.default[i],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(n.default.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(n.default.WHEEL,this.boundHandleBrowserEvent_,!!_.PASSIVE_EVENT_LISTENERS&&{passive:!1});var o=this.keyboardEventTarget_?this.keyboardEventTarget_:e;this.keyHandlerKeys_=[(0,L.listen)(o,n.default.KEYDOWN,this.handleBrowserEvent,this),(0,L.listen)(o,n.default.KEYPRESS,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(n.default.RESIZE,this.handleResize_,!1))}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},f.prototype.handleTileChange_=function(){this.render()},f.prototype.handleViewPropertyChanged_=function(){this.render()},f.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&((0,L.unlistenByKey)(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&((0,L.unlistenByKey)(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var e=this.getView();e&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=(0,L.listen)(e,p.default.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=(0,L.listen)(e,n.default.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()},f.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(L.unlistenByKey),this.layerGroupPropertyListenerKeys_=null);var e=this.getLayerGroup();e&&(this.layerGroupPropertyListenerKeys_=[(0,L.listen)(e,p.default.PROPERTYCHANGE,this.render,this),(0,L.listen)(e,n.default.CHANGE,this.render,this)]),this.render()},f.prototype.isRendered=function(){return!!this.frameState_},f.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},f.prototype.redrawText=function(){for(var e=this.getLayerGroup().getLayerStatesArray(),t=0,r=e.length;t<r;++t){var n=e[t].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}},f.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},f.prototype.removeControl=function(e){return this.getControls().remove(e)},f.prototype.removeInteraction=function(e){return this.getInteractions().remove(e)},f.prototype.removeLayer=function(e){return this.getLayerGroup().getLayers().remove(e)},f.prototype.removeOverlay=function(e){return this.getOverlays().remove(e)},f.prototype.renderFrame_=function(e){var t=this.getSize(),r=this.getView(),n=this.frameState_,i=null;if(void 0!==t&&(0,C.hasArea)(t)&&r&&r.isDef()){var o=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=r.getState();i={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterItems:n?n.declutterItems:[],extent:(0,w.getForViewAndSize)(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{}}}if(this.frameState_=i,this.renderer_.renderFrame(i),i){if(i.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,i.postRenderFunctions),n)(!this.previousExtent_||!(0,w.isEmpty)(this.previousExtent_)&&!(0,w.equals)(i.extent,this.previousExtent_))&&(this.dispatchEvent(new l.default(d.default.MOVESTART,this,n)),this.previousExtent_=(0,w.createOrUpdateEmpty)(this.previousExtent_));this.previousExtent_&&!i.viewHints[c.default.ANIMATING]&&!i.viewHints[c.default.INTERACTING]&&!(0,w.equals)(i.extent,this.previousExtent_)&&(this.dispatchEvent(new l.default(d.default.MOVEEND,this,i)),(0,w.clone)(i.extent,this.previousExtent_))}this.dispatchEvent(new l.default(d.default.POSTRENDER,this,i)),this.postRenderTimeoutHandle_=setTimeout(this.handlePostRender.bind(this),0)},f.prototype.setLayerGroup=function(e){this.set(u.default.LAYERGROUP,e)},f.prototype.setSize=function(e){this.set(u.default.SIZE,e)},f.prototype.setTarget=function(e){this.set(u.default.TARGET,e)},f.prototype.setView=function(e){this.set(u.default.VIEW,e)},f.prototype.updateSize=function(){var e=this.getTargetElement();if(e){var t=getComputedStyle(e);this.setSize([e.offsetWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)-parseFloat(t.borderRightWidth),e.offsetHeight-parseFloat(t.borderTopWidth)-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)-parseFloat(t.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},f.prototype.updateViewportSize_=function(){var e=this.getView();if(e){var t=void 0,r=getComputedStyle(this.viewport_);r.width&&r.height&&(t=[parseInt(r.width,10),parseInt(r.height,10)]),e.setViewportSize(t)}},f}(e.default);function O(e){var r=null;void 0!==e.keyboardEventTarget&&(r="string"==typeof e.keyboardEventTarget?document.getElementById(e.keyboardEventTarget):e.keyboardEventTarget);var n,o,a,s={},l=e.layers&&"function"==typeof e.layers.getLayers?e.layers:new i.default({layers:e.layers});return s[u.default.LAYERGROUP]=l,s[u.default.TARGET]=e.target,s[u.default.VIEW]=void 0!==e.view?e.view:new f.default,void 0!==e.controls&&(Array.isArray(e.controls)?n=new t.default(e.controls.slice()):((0,m.assert)("function"==typeof e.controls.getArray,47),n=e.controls)),void 0!==e.interactions&&(Array.isArray(e.interactions)?o=new t.default(e.interactions.slice()):((0,m.assert)("function"==typeof e.interactions.getArray,48),o=e.interactions)),void 0!==e.overlays?Array.isArray(e.overlays)?a=new t.default(e.overlays.slice()):((0,m.assert)("function"==typeof e.overlays.getArray,49),a=e.overlays):a=new t.default,{controls:n,interactions:o,keyboardEventTarget:r,overlays:a,values:s}}var b=A;exports.default=b; },{"./Object.js":"PhPh","./Collection.js":"FnDa","./CollectionEventType.js":"BTrx","./events/EventType.js":"C8cu","./layer/Group.js":"q0nK","./MapBrowserEvent.js":"HMLS","./MapBrowserEventHandler.js":"ohHk","./MapBrowserEventType.js":"YhDM","./MapEvent.js":"vFcA","./MapEventType.js":"xLGm","./MapProperty.js":"zlNQ","./ObjectEventType.js":"zehl","./pointer/EventType.js":"TaSm","./render/EventType.js":"z39m","./TileQueue.js":"tHOl","./View.js":"hNqE","./ViewHint.js":"cuLW","./has.js":"f3Nv","./functions.js":"RgA2","./transform.js":"P4eA","./asserts.js":"fLG6","./extent.js":"QDir","./proj.js":"Diht","./size.js":"TAHd","./events.js":"UqnM","./dom.js":"Xno5"}],"xxE2":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=s(require("../Object.js")),t=s(require("../MapEventType.js")),r=require("../functions.js"),n=require("../events.js"),o=require("../dom.js");function s(e){return e&&e.__esModule?e:{default:e}}var i=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),p=function(e){function s(t){var r=e.call(this)||this,n=t.element;return!n||t.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),r.element=n||null,r.target_=null,r.map_=null,r.listenerKeys=[],t.render&&(r.render=t.render),t.target&&r.setTarget(t.target),r}return i(s,e),s.prototype.disposeInternal=function(){(0,o.removeNode)(this.element),e.prototype.disposeInternal.call(this)},s.prototype.getMap=function(){return this.map_},s.prototype.setMap=function(e){this.map_&&(0,o.removeNode)(this.element);for(var s=0,i=this.listenerKeys.length;s<i;++s)(0,n.unlistenByKey)(this.listenerKeys[s]);(this.listenerKeys.length=0,this.map_=e,this.map_)&&((this.target_?this.target_:e.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==r.VOID&&this.listenerKeys.push((0,n.listen)(e,t.default.POSTRENDER,this.render,this)),e.render())},s.prototype.render=function(e){},s.prototype.setTarget=function(e){this.target_="string"==typeof e?document.getElementById(e):e},s}(e.default),u=p;exports.default=u; },{"../Object.js":"PhPh","../MapEventType.js":"xLGm","../functions.js":"RgA2","../events.js":"UqnM","../dom.js":"Xno5"}],"Q4Cf":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=s(require("./Control.js")),t=s(require("../events/EventType.js")),l=require("../css.js"),i=require("../array.js"),o=require("../layer/Layer.js"),r=require("../dom.js");function s(e){return e&&e.__esModule?e:{default:e}}var a=function(){var e=function(t,l){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l])})(t,l)};return function(t,l){function i(){this.constructor=t}e(t,l),t.prototype=null===l?Object.create(l):(i.prototype=l.prototype,new i)}}(),n=function(e){function s(i){var o=this,r=i||{};(o=e.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).ulElement_=document.createElement("ul"),o.collapsed_=void 0===r.collapsed||r.collapsed,o.overrideCollapsible_=void 0!==r.collapsible,o.collapsible_=void 0===r.collapsible||r.collapsible,o.collapsible_||(o.collapsed_=!1);var s=void 0!==r.className?r.className:"ol-attribution",a=void 0!==r.tipLabel?r.tipLabel:"Attributions",n=void 0!==r.collapseLabel?r.collapseLabel:"»";"string"==typeof n?(o.collapseLabel_=document.createElement("span"),o.collapseLabel_.textContent=n):o.collapseLabel_=n;var p=void 0!==r.label?r.label:"i";"string"==typeof p?(o.label_=document.createElement("span"),o.label_.textContent=p):o.label_=p;var c=o.collapsible_&&!o.collapsed_?o.collapseLabel_:o.label_,d=document.createElement("button");d.setAttribute("type","button"),d.title=a,d.appendChild(c),d.addEventListener(t.default.CLICK,o.handleClick_.bind(o),!1);var u=s+" "+l.CLASS_UNSELECTABLE+" "+l.CLASS_CONTROL+(o.collapsed_&&o.collapsible_?" "+l.CLASS_COLLAPSED:"")+(o.collapsible_?"":" ol-uncollapsible"),_=o.element;return _.className=u,_.appendChild(o.ulElement_),_.appendChild(d),o.renderedAttributions_=[],o.renderedVisible_=!0,o}return a(s,e),s.prototype.collectSourceAttributions_=function(e){for(var t={},l=[],i=e.layerStatesArray,r=0,s=i.length;r<s;++r){var a=i[r];if((0,o.inView)(a,e.viewState)){var n=a.layer.getSource();if(n){var p=n.getAttributions();if(p){var c=p(e);if(c)if(this.overrideCollapsible_||!1!==n.getAttributionsCollapsible()||this.setCollapsible(!1),Array.isArray(c))for(var d=0,u=c.length;d<u;++d)c[d]in t||(l.push(c[d]),t[c[d]]=!0);else c in t||(l.push(c),t[c]=!0)}}}}return l},s.prototype.updateElement_=function(e){if(e){var t=this.collectSourceAttributions_(e),l=t.length>0;if(this.renderedVisible_!=l&&(this.element.style.display=l?"":"none",this.renderedVisible_=l),!(0,i.equals)(t,this.renderedAttributions_)){(0,r.removeChildren)(this.ulElement_);for(var o=0,s=t.length;o<s;++o){var a=document.createElement("li");a.innerHTML=t[o],this.ulElement_.appendChild(a)}this.renderedAttributions_=t}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},s.prototype.handleClick_=function(e){e.preventDefault(),this.handleToggle_()},s.prototype.handleToggle_=function(){this.element.classList.toggle(l.CLASS_COLLAPSED),this.collapsed_?(0,r.replaceNode)(this.collapseLabel_,this.label_):(0,r.replaceNode)(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},s.prototype.getCollapsible=function(){return this.collapsible_},s.prototype.setCollapsible=function(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),!e&&this.collapsed_&&this.handleToggle_())},s.prototype.setCollapsed=function(e){this.collapsible_&&this.collapsed_!==e&&this.handleToggle_()},s.prototype.getCollapsed=function(){return this.collapsed_},s.prototype.render=function(e){this.updateElement_(e.frameState)},s}(e.default),p=n;exports.default=p; },{"./Control.js":"xxE2","../events/EventType.js":"C8cu","../css.js":"HgMV","../array.js":"luEr","../layer/Layer.js":"GCgv","../dom.js":"Xno5"}],"sCgw":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("./Control.js")),e=r(require("../events/EventType.js")),a=require("../css.js"),o=require("../easing.js");function r(t){return t&&t.__esModule?t:{default:t}}var i=function(){var t=function(e,a){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a])})(e,a)};return function(e,a){function o(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(o.prototype=a.prototype,new o)}}(),n=function(t){function r(o){var r=this,i=o||{};r=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this;var n=void 0!==i.className?i.className:"ol-rotate",s=void 0!==i.label?i.label:"⇧";r.label_=null,"string"==typeof s?(r.label_=document.createElement("span"),r.label_.className="ol-compass",r.label_.textContent=s):(r.label_=s,r.label_.classList.add("ol-compass"));var l=i.tipLabel?i.tipLabel:"Reset rotation",u=document.createElement("button");u.className=n+"-reset",u.setAttribute("type","button"),u.title=l,u.appendChild(r.label_),u.addEventListener(e.default.CLICK,r.handleClick_.bind(r),!1);var d=n+" "+a.CLASS_UNSELECTABLE+" "+a.CLASS_CONTROL,c=r.element;return c.className=d,c.appendChild(u),r.callResetNorth_=i.resetNorth?i.resetNorth:void 0,r.duration_=void 0!==i.duration?i.duration:250,r.autoHide_=void 0===i.autoHide||i.autoHide,r.rotation_=void 0,r.autoHide_&&r.element.classList.add(a.CLASS_HIDDEN),r}return i(r,t),r.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},r.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:o.easeOut}):t.setRotation(0))}},r.prototype.render=function(t){var e=t.frameState;if(e){var o=e.viewState.rotation;if(o!=this.rotation_){var r="rotate("+o+"rad)";if(this.autoHide_){var i=this.element.classList.contains(a.CLASS_HIDDEN);i||0!==o?i&&0!==o&&this.element.classList.remove(a.CLASS_HIDDEN):this.element.classList.add(a.CLASS_HIDDEN)}this.label_.style.transform=r}this.rotation_=o}},r}(t.default),s=n;exports.default=s; },{"./Control.js":"xxE2","../events/EventType.js":"C8cu","../css.js":"HgMV","../easing.js":"IeCz"}],"L3CO":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=a(require("./Control.js")),e=a(require("../events/EventType.js")),o=require("../css.js"),n=require("../easing.js");function a(t){return t&&t.__esModule?t:{default:t}}var i=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),r=function(t){function a(n){var a=this,i=n||{};a=t.call(this,{element:document.createElement("div"),target:i.target})||this;var r=void 0!==i.className?i.className:"ol-zoom",u=void 0!==i.delta?i.delta:1,d=void 0!==i.zoomInLabel?i.zoomInLabel:"+",l=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",s=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",c=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=r+"-in",p.setAttribute("type","button"),p.title=s,p.appendChild("string"==typeof d?document.createTextNode(d):d),p.addEventListener(e.default.CLICK,a.handleClick_.bind(a,u),!1);var m=document.createElement("button");m.className=r+"-out",m.setAttribute("type","button"),m.title=c,m.appendChild("string"==typeof l?document.createTextNode(l):l),m.addEventListener(e.default.CLICK,a.handleClick_.bind(a,-u),!1);var v=r+" "+o.CLASS_UNSELECTABLE+" "+o.CLASS_CONTROL,f=a.element;return f.className=v,f.appendChild(p),f.appendChild(m),a.duration_=void 0!==i.duration?i.duration:250,a}return i(a,t),a.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},a.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var o=e.getZoom();if(void 0!==o){var a=e.getConstrainedZoom(o+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:a,duration:this.duration_,easing:n.easeOut})):e.setZoom(a)}}},a}(t.default),u=r;exports.default=u; },{"./Control.js":"xxE2","../events/EventType.js":"C8cu","../css.js":"HgMV","../easing.js":"IeCz"}],"dOoh":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./Control.js")),t=r(require("../events/EventType.js")),s=require("../css.js"),n=require("../events.js"),l=require("../dom.js");function r(e){return e&&e.__esModule?e:{default:e}}var u=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function n(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(n.prototype=s.prototype,new n)}}(),o=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],c={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"},i=function(e){function r(n){var l=this,r=n||{};(l=e.call(this,{element:document.createElement("div"),target:r.target})||this).cssClassName_=void 0!==r.className?r.className:"ol-full-screen";var u=void 0!==r.label?r.label:"⤢";l.labelNode_="string"==typeof u?document.createTextNode(u):u;var o=void 0!==r.labelActive?r.labelActive:"×";l.labelActiveNode_="string"==typeof o?document.createTextNode(o):o,l.button_=document.createElement("button");var c=r.tipLabel?r.tipLabel:"Toggle full-screen";l.setClassName_(l.button_,d()),l.button_.setAttribute("type","button"),l.button_.title=c,l.button_.appendChild(l.labelNode_),l.button_.addEventListener(t.default.CLICK,l.handleClick_.bind(l),!1);var i=l.cssClassName_+" "+s.CLASS_UNSELECTABLE+" "+s.CLASS_CONTROL+" "+(a()?"":s.CLASS_UNSUPPORTED),_=l.element;return _.className=i,_.appendChild(l.button_),l.keys_=void 0!==r.keys&&r.keys,l.source_=r.source,l}return u(r,e),r.prototype.handleClick_=function(e){e.preventDefault(),this.handleFullScreen_()},r.prototype.handleFullScreen_=function(){if(a()){var e=this.getMap();if(e)if(d())m();else{var t=void 0;t=this.source_?"string"==typeof this.source_?document.getElementById(this.source_):this.source_:e.getTargetElement(),this.keys_?p(t):_(t)}}},r.prototype.handleFullScreenChange_=function(){var e=this.getMap();d()?(this.setClassName_(this.button_,!0),(0,l.replaceNode)(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(c.ENTERFULLSCREEN)):(this.setClassName_(this.button_,!1),(0,l.replaceNode)(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(c.LEAVEFULLSCREEN)),e&&e.updateSize()},r.prototype.setClassName_=function(e,t){var s=this.cssClassName_+"-true",n=this.cssClassName_+"-false",l=t?s:n;e.classList.remove(s),e.classList.remove(n),e.classList.add(l)},r.prototype.setMap=function(t){if(e.prototype.setMap.call(this,t),t)for(var s=0,l=o.length;s<l;++s)this.listenerKeys.push((0,n.listen)(document,o[s],this.handleFullScreenChange_,this))},r}(e.default);function a(){var e=document.body;return!!(e.webkitRequestFullscreen||e.msRequestFullscreen&&document.msFullscreenEnabled||e.requestFullscreen&&document.fullscreenEnabled)}function d(){return!!(document.webkitIsFullScreen||document.msFullscreenElement||document.fullscreenElement)}function _(e){e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}function p(e){e.webkitRequestFullscreen?e.webkitRequestFullscreen():_(e)}function m(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}var f=i;exports.default=f; },{"./Control.js":"xxE2","../events/EventType.js":"C8cu","../css.js":"HgMV","../events.js":"UqnM","../dom.js":"Xno5"}],"Cbl8":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=i(require("./Control.js")),e=i(require("../pointer/EventType.js")),o=require("../Object.js"),r=require("../proj.js"),n=require("../events.js");function i(t){return t&&t.__esModule?t:{default:t}}var s=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),a="projection",u="coordinateFormat",p=function(t){function i(e){var r=this,n=e||{},i=document.createElement("div");return i.className=void 0!==n.className?n.className:"ol-mouse-position",(r=t.call(this,{element:i,render:n.render,target:n.target})||this).addEventListener((0,o.getChangeEventType)(a),r.handleProjectionChanged_),n.coordinateFormat&&r.setCoordinateFormat(n.coordinateFormat),n.projection&&r.setProjection(n.projection),r.undefinedHTML_=void 0!==n.undefinedHTML?n.undefinedHTML:" ",r.renderOnMouseOut_=!!r.undefinedHTML_,r.renderedHTML_=i.innerHTML,r.mapProjection_=null,r.transform_=null,r}return s(i,t),i.prototype.handleProjectionChanged_=function(){this.transform_=null},i.prototype.getCoordinateFormat=function(){return this.get(u)},i.prototype.getProjection=function(){return this.get(a)},i.prototype.handleMouseMove=function(t){var e=this.getMap();this.updateHTML_(e.getEventPixel(t))},i.prototype.handleMouseOut=function(t){this.updateHTML_(null)},i.prototype.setMap=function(o){if(t.prototype.setMap.call(this,o),o){var r=o.getViewport();this.listenerKeys.push((0,n.listen)(r,e.default.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push((0,n.listen)(r,e.default.POINTEROUT,this.handleMouseOut,this))}},i.prototype.setCoordinateFormat=function(t){this.set(u,t)},i.prototype.setProjection=function(t){this.set(a,(0,r.get)(t))},i.prototype.updateHTML_=function(t){var e=this.undefinedHTML_;if(t&&this.mapProjection_){if(!this.transform_){var o=this.getProjection();this.transform_=o?(0,r.getTransformFromProjections)(this.mapProjection_,o):r.identityTransform}var n=this.getMap().getCoordinateFromPixelInternal(t);if(n){var i=(0,r.getUserProjection)();i&&(this.transform_=(0,r.getTransformFromProjections)(this.mapProjection_,i)),this.transform_(n,n);var s=this.getCoordinateFormat();e=s?s(n):n.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)},i.prototype.render=function(t){var e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null},i}(t.default),c=p;exports.default=c; },{"./Control.js":"xxE2","../pointer/EventType.js":"TaSm","../Object.js":"PhPh","../proj.js":"Diht","../events.js":"UqnM"}],"VpAM":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"};exports.default=t; },{}],"qWcX":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("./Object.js")),t=a(require("./MapEventType.js")),n=a(require("./OverlayPositioning.js")),i=require("./css.js"),o=require("./extent.js"),r=require("./events.js"),s=require("./dom.js");function a(e){return e&&e.__esModule?e:{default:e}}function p(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return p=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=p();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var r=i?Object.getOwnPropertyDescriptor(e,o):null;r&&(r.get||r.set)?Object.defineProperty(n,o,r):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}var d=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),l={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"},f=function(a){function p(t){var o=a.call(this)||this;o.options=t,o.id=t.id,o.insertFirst=void 0===t.insertFirst||t.insertFirst,o.stopEvent=void 0===t.stopEvent||t.stopEvent,o.element=document.createElement("div"),o.element.className=void 0!==t.className?t.className:"ol-overlay-container "+i.CLASS_SELECTABLE,o.element.style.position="absolute",o.element.style.pointerEvents="auto";var r=t.autoPan;return r&&"object"!=typeof r&&(r={animation:t.autoPanAnimation,margin:t.autoPanMargin}),o.autoPan=r||!1,o.rendered={transform_:"",visible:!0},o.mapPostrenderListenerKey=null,o.addEventListener((0,e.getChangeEventType)(l.ELEMENT),o.handleElementChanged),o.addEventListener((0,e.getChangeEventType)(l.MAP),o.handleMapChanged),o.addEventListener((0,e.getChangeEventType)(l.OFFSET),o.handleOffsetChanged),o.addEventListener((0,e.getChangeEventType)(l.POSITION),o.handlePositionChanged),o.addEventListener((0,e.getChangeEventType)(l.POSITIONING),o.handlePositioningChanged),void 0!==t.element&&o.setElement(t.element),o.setOffset(void 0!==t.offset?t.offset:[0,0]),o.setPositioning(void 0!==t.positioning?t.positioning:n.default.TOP_LEFT),void 0!==t.position&&o.setPosition(t.position),o}return d(p,a),p.prototype.getElement=function(){return this.get(l.ELEMENT)},p.prototype.getId=function(){return this.id},p.prototype.getMap=function(){return this.get(l.MAP)},p.prototype.getOffset=function(){return this.get(l.OFFSET)},p.prototype.getPosition=function(){return this.get(l.POSITION)},p.prototype.getPositioning=function(){return this.get(l.POSITIONING)},p.prototype.handleElementChanged=function(){(0,s.removeChildren)(this.element);var e=this.getElement();e&&this.element.appendChild(e)},p.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&((0,s.removeNode)(this.element),(0,r.unlistenByKey)(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var e=this.getMap();if(e){this.mapPostrenderListenerKey=(0,r.listen)(e,t.default.POSTRENDER,this.render,this),this.updatePixelPosition();var n=this.stopEvent?e.getOverlayContainerStopEvent():e.getOverlayContainer();this.insertFirst?n.insertBefore(this.element,n.childNodes[0]||null):n.appendChild(this.element),this.performAutoPan()}},p.prototype.render=function(){this.updatePixelPosition()},p.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},p.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},p.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},p.prototype.setElement=function(e){this.set(l.ELEMENT,e)},p.prototype.setMap=function(e){this.set(l.MAP,e)},p.prototype.setOffset=function(e){this.set(l.OFFSET,e)},p.prototype.setPosition=function(e){this.set(l.POSITION,e)},p.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},p.prototype.panIntoView=function(e){var t=this.getMap();if(t&&t.getTargetElement()&&this.get(l.POSITION)){var n=this.getRect(t.getTargetElement(),t.getSize()),i=this.getElement(),r=this.getRect(i,[(0,s.outerWidth)(i),(0,s.outerHeight)(i)]),a=e||{},p=void 0===a.margin?20:a.margin;if(!(0,o.containsExtent)(n,r)){var u=r[0]-n[0],d=n[2]-r[2],f=r[1]-n[1],h=n[3]-r[3],g=[0,0];if(u<0?g[0]=u-p:d<0&&(g[0]=Math.abs(d)+p),f<0?g[1]=f-p:h<0&&(g[1]=Math.abs(h)+p),0!==g[0]||0!==g[1]){var c=t.getView().getCenterInternal(),E=t.getPixelFromCoordinateInternal(c),P=[E[0]+g[0],E[1]+g[1]],y=a.animation||{};t.getView().animateInternal({center:t.getCoordinateFromPixelInternal(P),duration:y.duration,easing:y.easing})}}}},p.prototype.getRect=function(e,t){var n=e.getBoundingClientRect(),i=n.left+window.pageXOffset,o=n.top+window.pageYOffset;return[i,o,i+t[0],o+t[1]]},p.prototype.setPositioning=function(e){this.set(l.POSITIONING,e)},p.prototype.setVisible=function(e){this.rendered.visible!==e&&(this.element.style.display=e?"":"none",this.rendered.visible=e)},p.prototype.updatePixelPosition=function(){var e=this.getMap(),t=this.getPosition();if(e&&e.isRendered()&&t){var n=e.getPixelFromCoordinate(t),i=e.getSize();this.updateRenderedPosition(n,i)}else this.setVisible(!1)},p.prototype.updateRenderedPosition=function(e,t){var i=this.element.style,o=this.getOffset(),r=this.getPositioning();this.setVisible(!0);var s=Math.round(e[0]+o[0])+"px",a=Math.round(e[1]+o[1])+"px",p="0%",u="0%";r==n.default.BOTTOM_RIGHT||r==n.default.CENTER_RIGHT||r==n.default.TOP_RIGHT?p="-100%":r!=n.default.BOTTOM_CENTER&&r!=n.default.CENTER_CENTER&&r!=n.default.TOP_CENTER||(p="-50%"),r==n.default.BOTTOM_LEFT||r==n.default.BOTTOM_CENTER||r==n.default.BOTTOM_RIGHT?u="-100%":r!=n.default.CENTER_LEFT&&r!=n.default.CENTER_CENTER&&r!=n.default.CENTER_RIGHT||(u="-50%");var d="translate("+p+", "+u+") translate("+s+", "+a+")";this.rendered.transform_!=d&&(this.rendered.transform_=d,i.transform=d,i.msTransform=d)},p.prototype.getOptions=function(){return this.options},p}(e.default),h=f;exports.default=h; },{"./Object.js":"PhPh","./MapEventType.js":"xLGm","./OverlayPositioning.js":"VpAM","./css.js":"HgMV","./extent.js":"QDir","./events.js":"UqnM","./dom.js":"Xno5"}],"KMhA":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=f(require("../renderer/Composite.js")),t=f(require("./Control.js")),i=f(require("../events/EventType.js")),o=f(require("../MapEventType.js")),n=f(require("../MapProperty.js")),a=f(require("../ObjectEventType.js")),l=f(require("../Overlay.js")),r=f(require("../OverlayPositioning.js")),s=f(require("../PluggableMap.js")),p=f(require("../View.js")),d=f(require("../ViewProperty.js")),h=require("../css.js"),u=require("../extent.js"),c=require("../Object.js"),v=require("../events.js"),_=require("../geom/Polygon.js"),g=require("../dom.js");function f(e){return e&&e.__esModule?e:{default:e}}var w=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),m=.75,b=.1,y=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return w(i,t),i.prototype.createRenderer=function(){return new e.default(this)},i}(s.default),E=function(e){function t(t){var o=this,n=t||{};(o=e.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).boundHandleRotationChanged_=o.handleRotationChanged_.bind(o),o.collapsed_=void 0===n.collapsed||n.collapsed,o.collapsible_=void 0===n.collapsible||n.collapsible,o.collapsible_||(o.collapsed_=!1),o.rotateWithView_=void 0!==n.rotateWithView&&n.rotateWithView,o.viewExtent_=void 0;var a=void 0!==n.className?n.className:"ol-overviewmap",s=void 0!==n.tipLabel?n.tipLabel:"Overview map",p=void 0!==n.collapseLabel?n.collapseLabel:"«";"string"==typeof p?(o.collapseLabel_=document.createElement("span"),o.collapseLabel_.textContent=p):o.collapseLabel_=p;var d=void 0!==n.label?n.label:"»";"string"==typeof d?(o.label_=document.createElement("span"),o.label_.textContent=d):o.label_=d;var u=o.collapsible_&&!o.collapsed_?o.collapseLabel_:o.label_,c=document.createElement("button");c.setAttribute("type","button"),c.title=s,c.appendChild(u),c.addEventListener(i.default.CLICK,o.handleClick_.bind(o),!1),o.ovmapDiv_=document.createElement("div"),o.ovmapDiv_.className="ol-overviewmap-map",o.view_=n.view,o.ovmap_=new y({view:n.view});var v=o.ovmap_;n.layers&&n.layers.forEach(function(e){v.addLayer(e)});var _=document.createElement("div");_.className="ol-overviewmap-box",_.style.boxSizing="border-box",o.boxOverlay_=new l.default({position:[0,0],positioning:r.default.CENTER_CENTER,element:_}),o.ovmap_.addOverlay(o.boxOverlay_);var g=a+" "+h.CLASS_UNSELECTABLE+" "+h.CLASS_CONTROL+(o.collapsed_&&o.collapsible_?" "+h.CLASS_COLLAPSED:"")+(o.collapsible_?"":" ol-uncollapsible"),f=o.element;f.className=g,f.appendChild(o.ovmapDiv_),f.appendChild(c);var w=o,m=o.boxOverlay_,b=o.boxOverlay_.getElement(),E=function(e){var t,i={clientX:(t=e).clientX,clientY:t.clientY},o=v.getEventCoordinateInternal(i);m.setPosition(o)},C=function(e){var t=v.getEventCoordinateInternal(e);w.getMap().getView().setCenterInternal(t),window.removeEventListener("mousemove",E),window.removeEventListener("mouseup",C)};return b.addEventListener("mousedown",function(){window.addEventListener("mousemove",E),window.addEventListener("mouseup",C)}),o}return w(t,e),t.prototype.setMap=function(t){var i=this.getMap();if(t!==i){if(i){var o=i.getView();o&&this.unbindView_(o),this.ovmap_.setTarget(null)}if(e.prototype.setMap.call(this,t),t){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push((0,v.listen)(t,a.default.PROPERTYCHANGE,this.handleMapPropertyChange_,this));var n=t.getView();n&&(this.bindView_(n),n.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_()))}}},t.prototype.handleMapPropertyChange_=function(e){if(e.key===n.default.VIEW){var t=e.oldValue;t&&this.unbindView_(t);var i=this.getMap().getView();this.bindView_(i)}},t.prototype.bindView_=function(e){if(!this.view_){var t=new p.default({projection:e.getProjection()});this.ovmap_.setView(t)}e.addEventListener((0,c.getChangeEventType)(d.default.ROTATION),this.boundHandleRotationChanged_),this.handleRotationChanged_()},t.prototype.unbindView_=function(e){e.removeEventListener((0,c.getChangeEventType)(d.default.ROTATION),this.boundHandleRotationChanged_)},t.prototype.handleRotationChanged_=function(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},t.prototype.validateExtent_=function(){var e=this.getMap(),t=this.ovmap_;if(e.isRendered()&&t.isRendered()){var i=e.getSize(),o=e.getView().calculateExtentInternal(i);if(!this.viewExtent_||!(0,u.equals)(o,this.viewExtent_)){this.viewExtent_=o;var n=t.getSize(),a=t.getView().calculateExtentInternal(n),l=t.getPixelFromCoordinateInternal((0,u.getTopLeft)(o)),r=t.getPixelFromCoordinateInternal((0,u.getBottomRight)(o)),s=Math.abs(l[0]-r[0]),p=Math.abs(l[1]-r[1]),d=n[0],h=n[1];s<d*b||p<h*b||s>d*m||p>h*m?this.resetExtent_():(0,u.containsExtent)(a,o)||this.recenter_()}}},t.prototype.resetExtent_=function(){if(0!==m&&0!==b){var e=this.getMap(),t=this.ovmap_,i=e.getSize(),o=e.getView().calculateExtentInternal(i),n=t.getView(),a=Math.log(m/b)/Math.LN2,l=1/(Math.pow(2,a/2)*b);(0,u.scaleFromCenter)(o,l),n.fitInternal((0,_.fromExtent)(o))}},t.prototype.recenter_=function(){var e=this.getMap(),t=this.ovmap_,i=e.getView();t.getView().setCenterInternal(i.getCenterInternal())},t.prototype.updateBox_=function(){var e=this.getMap(),t=this.ovmap_;if(e.isRendered()&&t.isRendered()){var i=e.getSize(),o=e.getView(),n=t.getView(),a=this.rotateWithView_?0:-o.getRotation(),l=this.boxOverlay_,r=this.boxOverlay_.getElement(),s=o.getCenterInternal(),p=o.getResolution(),d=n.getResolution(),h=i[0]*p/d,u=i[1]*p/d;if(l.setPosition(s),r){r.style.width=h+"px",r.style.height=u+"px";var c="rotate("+a+"rad)";r.style.transform=c}}},t.prototype.handleClick_=function(e){e.preventDefault(),this.handleToggle_()},t.prototype.handleToggle_=function(){this.element.classList.toggle(h.CLASS_COLLAPSED),this.collapsed_?(0,g.replaceNode)(this.collapseLabel_,this.label_):(0,g.replaceNode)(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var e=this.ovmap_;if(!this.collapsed_){if(e.isRendered())return this.viewExtent_=void 0,void e.render();e.updateSize(),this.resetExtent_(),(0,v.listenOnce)(e,o.default.POSTRENDER,function(e){this.updateBox_()},this)}},t.prototype.getCollapsible=function(){return this.collapsible_},t.prototype.setCollapsible=function(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),!e&&this.collapsed_&&this.handleToggle_())},t.prototype.setCollapsed=function(e){this.collapsible_&&this.collapsed_!==e&&this.handleToggle_()},t.prototype.getCollapsed=function(){return this.collapsed_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.setRotateWithView=function(e){this.rotateWithView_!==e&&(this.rotateWithView_=e,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},t.prototype.getOverviewMap=function(){return this.ovmap_},t.prototype.render=function(e){this.validateExtent_(),this.updateBox_()},t}(t.default),C=E;exports.default=C; },{"../renderer/Composite.js":"MHsB","./Control.js":"xxE2","../events/EventType.js":"C8cu","../MapEventType.js":"xLGm","../MapProperty.js":"zlNQ","../ObjectEventType.js":"zehl","../Overlay.js":"qWcX","../OverlayPositioning.js":"VpAM","../PluggableMap.js":"kRwz","../View.js":"hNqE","../ViewProperty.js":"cE7c","../css.js":"HgMV","../extent.js":"QDir","../Object.js":"PhPh","../events.js":"UqnM","../geom/Polygon.js":"Nwwk","../dom.js":"Xno5"}],"DK5d":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Units=void 0;var e=a(require("./Control.js")),t=a(require("../proj/Units.js")),i=require("../css.js"),r=require("../proj.js"),s=require("../asserts.js"),n=require("../Object.js");function a(e){return e&&e.__esModule?e:{default:e}}var o=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),l="units",d={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"};exports.Units=d;var p=[1,2,5],c=25.4/.28,h=function(e){function a(t){var r=this,s=t||{},a=void 0!==s.className?s.className:s.bar?"ol-scale-bar":"ol-scale-line";return(r=e.call(this,{element:document.createElement("div"),render:s.render,target:s.target})||this).innerElement_=document.createElement("div"),r.innerElement_.className=a+"-inner",r.element.className=a+" "+i.CLASS_UNSELECTABLE,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==s.minWidth?s.minWidth:64,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addEventListener((0,n.getChangeEventType)(l),r.handleUnitsChanged_),r.setUnits(s.units||d.METRIC),r.scaleBar_=s.bar||!1,r.scaleBarSteps_=s.steps||4,r.scaleBarText_=s.text||!1,r.dpi_=s.dpi||void 0,r}return o(a,e),a.prototype.getUnits=function(){return this.get(l)},a.prototype.handleUnitsChanged_=function(){this.updateElement_()},a.prototype.setUnits=function(e){this.set(l,e)},a.prototype.setDpi=function(e){this.dpi_=e},a.prototype.updateElement_=function(){var e=this.viewState_;if(e){var i=e.center,n=e.projection,a=this.getUnits(),o=a==d.DEGREES?t.default.DEGREES:t.default.METERS,l=(0,r.getPointResolution)(n,e.resolution,i,o),h=this.minWidth_*(this.dpi_||c)/c,u=h*l,f="";if(a==d.DEGREES){var _=r.METERS_PER_UNIT[t.default.DEGREES];(u*=_)<_/60?(f="″",l*=3600):u<_?(f="′",l*=60):f="°"}else a==d.IMPERIAL?u<.9144?(f="in",l/=.0254):u<1609.344?(f="ft",l/=.3048):(f="mi",l/=1609.344):a==d.NAUTICAL?(l/=1852,f="nm"):a==d.METRIC?u<.001?(f="μm",l*=1e6):u<1?(f="mm",l*=1e3):u<1e3?f="m":(f="km",l/=1e3):a==d.US?u<.9144?(f="in",l*=39.37):u<1609.344?(f="ft",l/=.30480061):(f="mi",l/=1609.3472):(0,s.assert)(!1,33);for(var v,m,E,S,y=3*Math.floor(Math.log(h*l)/Math.log(10));;){E=Math.floor(y/3);var M=Math.pow(10,E);if(v=p[(y%3+3)%3]*M,m=Math.round(v/l),isNaN(m))return this.element.style.display="none",void(this.renderedVisible_=!1);if(m>=h)break;++y}S=this.scaleBar_?this.createScaleBar(m,v,f):v.toFixed(E<0?-E:0)+" "+f,this.renderedHTML_!=S&&(this.innerElement_.innerHTML=S,this.renderedHTML_=S),this.renderedWidth_!=m&&(this.innerElement_.style.width=m+"px",this.renderedWidth_=m),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},a.prototype.createScaleBar=function(e,t,i){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),s=[],n=e/this.scaleBarSteps_,a="#ffffff",o=0;o<this.scaleBarSteps_;o++)0===o&&s.push(this.createMarker("absolute",o)),s.push('<div><div class="ol-scale-singlebar" style="width: '+n+"px;background-color: "+a+';"></div>'+this.createMarker("relative",o)+(o%2==0||2===this.scaleBarSteps_?this.createStepText(o,e,!1,t,i):"")+"</div>"),o===this.scaleBarSteps_-1&&s.push(this.createStepText(o+1,e,!0,t,i)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+e+'px;">'+r+"</div>":"")+s.join("")+"</div>"},a.prototype.createMarker=function(e,t){return'<div class="ol-scale-step-marker" style="position: '+e+";top: "+("absolute"===e?3:-10)+'px;"></div>'},a.prototype.createStepText=function(e,t,i,r,s){var n=(0===e?0:Math.round(r/this.scaleBarSteps_*e*100)/100)+(0===e?"":" "+s);return'<div class="ol-scale-step-text" style="margin-left: '+(0===e?-3:t/this.scaleBarSteps_*-1)+"px;text-align: "+(0===e?"left":"center")+"; min-width: "+(0===e?0:t/this.scaleBarSteps_*2)+"px;left: "+(i?t+"px":"unset")+';">'+n+"</div>"},a.prototype.getScaleForResolution=function(){var e=(0,r.getPointResolution)(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),t=this.dpi_||c,i=this.viewState_.projection.getMetersPerUnit();return parseFloat(e.toString())*i*39.37*t},a.prototype.render=function(e){var t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElement_()},a}(e.default),u=h;exports.default=u; },{"./Control.js":"xxE2","../proj/Units.js":"yZx6","../css.js":"HgMV","../proj.js":"Diht","../asserts.js":"fLG6","../Object.js":"PhPh"}],"AKwM":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=l(require("./Control.js")),e=l(require("../events/EventType.js")),i=l(require("../pointer/EventType.js")),n=require("../css.js"),r=require("../math.js"),o=require("../easing.js"),s=require("../events.js"),a=require("../events/Event.js");function l(t){return t&&t.__esModule?t:{default:t}}var h=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),d={VERTICAL:0,HORIZONTAL:1},u=function(t){function l(r){var o=this,s=r||{};(o=t.call(this,{element:document.createElement("div"),render:s.render})||this).dragListenerKeys_=[],o.currentResolution_=void 0,o.direction_=d.VERTICAL,o.dragging_,o.heightLimit_=0,o.widthLimit_=0,o.startX_,o.startY_,o.thumbSize_=null,o.sliderInitialized_=!1,o.duration_=void 0!==s.duration?s.duration:200;var l=void 0!==s.className?s.className:"ol-zoomslider",h=document.createElement("button");h.setAttribute("type","button"),h.className=l+"-thumb "+n.CLASS_UNSELECTABLE;var u=o.element;return u.className=l+" "+n.CLASS_UNSELECTABLE+" "+n.CLASS_CONTROL,u.appendChild(h),u.addEventListener(i.default.POINTERDOWN,o.handleDraggerStart_.bind(o),!1),u.addEventListener(i.default.POINTERMOVE,o.handleDraggerDrag_.bind(o),!1),u.addEventListener(i.default.POINTERUP,o.handleDraggerEnd_.bind(o),!1),u.addEventListener(e.default.CLICK,o.handleContainerClick_.bind(o),!1),h.addEventListener(e.default.CLICK,a.stopPropagation,!1),o}return h(l,t),l.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&e.render()},l.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,i=t.offsetHeight;if(0===e&&0===i)return this.sliderInitialized_=!1;var n=t.firstElementChild,r=getComputedStyle(n),o=n.offsetWidth+parseFloat(r.marginRight)+parseFloat(r.marginLeft),s=n.offsetHeight+parseFloat(r.marginTop)+parseFloat(r.marginBottom);return this.thumbSize_=[o,s],e>i?(this.direction_=d.HORIZONTAL,this.widthLimit_=e-o):(this.direction_=d.VERTICAL,this.heightLimit_=i-s),this.sliderInitialized_=!0},l.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),i=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),n=this.getResolutionForPosition_(i),r=e.getConstrainedZoom(e.getZoomForResolution(n));e.animateInternal({zoom:r,duration:this.duration_,easing:o.easeOut})},l.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){var n=this.handleDraggerDrag_,r=this.handleDraggerEnd_;this.dragListenerKeys_.push((0,s.listen)(document,i.default.POINTERMOVE,n,this),(0,s.listen)(document,i.default.POINTERUP,r,this))}}},l.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,i=t.clientY-this.startY_,n=this.getRelativePosition_(e,i);this.currentResolution_=this.getResolutionForPosition_(n),this.getMap().getView().setResolution(this.currentResolution_)}},l.prototype.handleDraggerEnd_=function(t){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(s.unlistenByKey),this.dragListenerKeys_.length=0)},l.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),i=this.element.firstElementChild;this.direction_==d.HORIZONTAL?i.style.left=this.widthLimit_*e+"px":i.style.top=this.heightLimit_*e+"px"},l.prototype.getRelativePosition_=function(t,e){var i;return i=this.direction_===d.HORIZONTAL?t/this.widthLimit_:e/this.heightLimit_,(0,r.clamp)(i,0,1)},l.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},l.prototype.getPositionForResolution_=function(t){var e=this.getMap().getView().getValueForResolutionFunction();return(0,r.clamp)(1-e(t),0,1)},l.prototype.render=function(t){if(t.frameState&&(this.sliderInitialized_||this.initSlider_())){var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}},l}(t.default),g=u;exports.default=g; },{"./Control.js":"xxE2","../events/EventType.js":"C8cu","../pointer/EventType.js":"TaSm","../css.js":"HgMV","../math.js":"B96G","../easing.js":"IeCz","../events.js":"UqnM","../events/Event.js":"fKNg"}],"W4Y0":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("./Control.js")),e=r(require("../events/EventType.js")),n=require("../css.js"),o=require("../geom/Polygon.js");function r(t){return t&&t.__esModule?t:{default:t}}var i=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),a=function(t){function r(o){var r=this,i=o||{};(r=t.call(this,{element:document.createElement("div"),target:i.target})||this).extent=i.extent?i.extent:null;var a=void 0!==i.className?i.className:"ol-zoom-extent",l=void 0!==i.label?i.label:"E",u=void 0!==i.tipLabel?i.tipLabel:"Fit to extent",s=document.createElement("button");s.setAttribute("type","button"),s.title=u,s.appendChild("string"==typeof l?document.createTextNode(l):l),s.addEventListener(e.default.CLICK,r.handleClick_.bind(r),!1);var c=a+" "+n.CLASS_UNSELECTABLE+" "+n.CLASS_CONTROL,p=r.element;return p.className=c,p.appendChild(s),r}return i(r,t),r.prototype.handleClick_=function(t){t.preventDefault(),this.handleZoomToExtent()},r.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),e=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal((0,o.fromExtent)(e))},r}(t.default),l=a;exports.default=l; },{"./Control.js":"xxE2","../events/EventType.js":"C8cu","../css.js":"HgMV","../geom/Polygon.js":"Nwwk"}],"ucqx":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.defaults=d,Object.defineProperty(exports,"Attribution",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"Rotate",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"Zoom",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(exports,"Control",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"FullScreen",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"MousePosition",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"OverviewMap",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"ScaleLine",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(exports,"ZoomSlider",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(exports,"ZoomToExtent",{enumerable:!0,get:function(){return f.default}});var e=s(require("./control/Attribution.js")),t=s(require("./Collection.js")),r=s(require("./control/Rotate.js")),o=s(require("./control/Zoom.js")),n=s(require("./control/Control.js")),u=s(require("./control/FullScreen.js")),i=s(require("./control/MousePosition.js")),l=s(require("./control/OverviewMap.js")),a=s(require("./control/ScaleLine.js")),c=s(require("./control/ZoomSlider.js")),f=s(require("./control/ZoomToExtent.js"));function s(e){return e&&e.__esModule?e:{default:e}}function d(n){var u=n||{},i=new t.default;return(void 0===u.zoom||u.zoom)&&i.push(new o.default(u.zoomOptions)),(void 0===u.rotate||u.rotate)&&i.push(new r.default(u.rotateOptions)),(void 0===u.attribution||u.attribution)&&i.push(new e.default(u.attributionOptions)),i} },{"./control/Attribution.js":"Q4Cf","./Collection.js":"FnDa","./control/Rotate.js":"sCgw","./control/Zoom.js":"L3CO","./control/Control.js":"xxE2","./control/FullScreen.js":"dOoh","./control/MousePosition.js":"Cbl8","./control/OverviewMap.js":"KMhA","./control/ScaleLine.js":"DK5d","./control/ZoomSlider.js":"AKwM","./control/ZoomToExtent.js":"W4Y0"}],"caOi":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={ACTIVE:"active"};exports.default=e; },{}],"jB2p":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.pan=a,exports.zoomByDelta=u,exports.default=void 0;var t=o(require("../Object.js")),e=o(require("./Property.js")),n=require("../easing.js");function o(t){return t&&t.__esModule?t:{default:t}}var r=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),i=function(t){function n(e){var n=t.call(this)||this;return e&&e.handleEvent&&(n.handleEvent=e.handleEvent),n.map_=null,n.setActive(!0),n}return r(n,t),n.prototype.getActive=function(){return this.get(e.default.ACTIVE)},n.prototype.getMap=function(){return this.map_},n.prototype.handleEvent=function(t){return!0},n.prototype.setActive=function(t){this.set(e.default.ACTIVE,t)},n.prototype.setMap=function(t){this.map_=t},n}(t.default);function a(t,e,o){var r=t.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];t.animateInternal({duration:void 0!==o?o:250,easing:n.linear,center:t.getConstrainedCenter(i)})}}function u(t,e,o,r){var i=t.getZoom();if(void 0!==i){var a=t.getConstrainedZoom(i+e),u=t.getResolutionForZoom(a);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:u,anchor:o,duration:void 0!==r?r:250,easing:n.easeOut})}}var s=i;exports.default=s; },{"../Object.js":"PhPh","./Property.js":"caOi","../easing.js":"IeCz"}],"NSa4":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=o(require("./Interaction.js")),e=r(require("../MapBrowserEventType.js"));function r(t){return t&&t.__esModule?t:{default:t}}function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function o(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)){var i=o?Object.getOwnPropertyDescriptor(t,u):null;i&&(i.get||i.set)?Object.defineProperty(r,u,i):r[u]=t[u]}return r.default=t,e&&e.set(t,r),r}var u=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=function(r){function n(t){var e=r.call(this)||this,n=t||{};return e.delta_=n.delta?n.delta:1,e.duration_=void 0!==n.duration?n.duration:250,e}return u(n,r),n.prototype.handleEvent=function(r){var n=!1;if(r.type==e.default.DBLCLICK){var o=r.originalEvent,u=r.map,i=r.coordinate,a=o.shiftKey?-this.delta_:this.delta_,f=u.getView();(0,t.zoomByDelta)(f,a,i,this.duration_),r.preventDefault(),n=!0}return!n},n}(t.default),a=i;exports.default=a; },{"./Interaction.js":"jB2p","../MapBrowserEventType.js":"YhDM"}],"dnA2":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.centroid=a,exports.default=void 0;var t=r(require("./Interaction.js")),e=r(require("../MapBrowserEventType.js")),n=require("../obj.js");function r(t){return t&&t.__esModule?t:{default:t}}var o=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(t){function r(e){var n=this,r=e||{};return n=t.call(this,r)||this,r.handleDownEvent&&(n.handleDownEvent=r.handleDownEvent),r.handleDragEvent&&(n.handleDragEvent=r.handleDragEvent),r.handleMoveEvent&&(n.handleMoveEvent=r.handleMoveEvent),r.handleUpEvent&&(n.handleUpEvent=r.handleUpEvent),r.stopDown&&(n.stopDown=r.stopDown),n.handlingDownUpSequence=!1,n.trackedPointers_={},n.targetPointers=[],n}return o(r,t),r.prototype.getPointerCount=function(){return this.targetPointers.length},r.prototype.handleDownEvent=function(t){return!1},r.prototype.handleDragEvent=function(t){},r.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var n=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==e.default.POINTERDRAG)this.handleDragEvent(t),t.preventDefault();else if(t.type==e.default.POINTERUP){var r=this.handleUpEvent(t);this.handlingDownUpSequence=r&&this.targetPointers.length>0}}else if(t.type==e.default.POINTERDOWN){var o=this.handleDownEvent(t);this.handlingDownUpSequence=o,n=this.stopDown(o)}else t.type==e.default.POINTERMOVE&&this.handleMoveEvent(t);return!n},r.prototype.handleMoveEvent=function(t){},r.prototype.handleUpEvent=function(t){return!1},r.prototype.stopDown=function(t){return t},r.prototype.updateTrackedPointers_=function(t){if(u(t)){var r=t.originalEvent,o=r.pointerId.toString();t.type==e.default.POINTERUP?delete this.trackedPointers_[o]:t.type==e.default.POINTERDOWN?this.trackedPointers_[o]=r:o in this.trackedPointers_&&(this.trackedPointers_[o]=r),this.targetPointers=(0,n.getValues)(this.trackedPointers_)}},r}(t.default);function a(t){for(var e=t.length,n=0,r=0,o=0;o<e;o++)n+=t[o].clientX,r+=t[o].clientY;return[n/e,r/e]}function u(t){var n=t.type;return n===e.default.POINTERDOWN||n===e.default.POINTERDRAG||n===e.default.POINTERUP}var l=i;exports.default=l; },{"./Interaction.js":"jB2p","../MapBrowserEventType.js":"YhDM","../obj.js":"mH6q"}],"YcID":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.all=i,exports.primaryAction=exports.penOnly=exports.touchOnly=exports.mouseOnly=exports.targetNotEditable=exports.shiftKeyOnly=exports.platformModifierKeyOnly=exports.noModifierKeys=exports.doubleClick=exports.singleClick=exports.pointerMove=exports.never=exports.mouseActionButton=exports.click=exports.always=exports.focusWithTabindex=exports.focus=exports.altShiftKeysOnly=exports.altKeyOnly=void 0;var e=o(require("../MapBrowserEventType.js")),t=require("../functions.js"),r=require("../has.js"),n=require("../asserts.js");function o(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=arguments;return function(e){for(var r=!0,n=0,o=t.length;n<o&&(r=r&&t[n](e));++n);return r}}var a=function(e){var t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey};exports.altKeyOnly=a;var s=function(e){var t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey};exports.altShiftKeysOnly=s;var u=function(e){return e.target.getTargetElement().contains(document.activeElement)};exports.focus=u;var l=function(e){return!e.map.getTargetElement().hasAttribute("tabindex")||u(e)};exports.focusWithTabindex=l;var p=t.TRUE;exports.always=p;var y=function(t){return t.type==e.default.CLICK};exports.click=y;var v=function(e){var t=e.originalEvent;return 0==t.button&&!(r.WEBKIT&&r.MAC&&t.ctrlKey)};exports.mouseActionButton=v;var c=t.FALSE;exports.never=c;var f=function(e){return"pointermove"==e.type};exports.pointerMove=f;var x=function(t){return t.type==e.default.SINGLECLICK};exports.singleClick=x;var K=function(t){return t.type==e.default.DBLCLICK};exports.doubleClick=K;var E=function(e){var t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey};exports.noModifierKeys=E;var d=function(e){var t=e.originalEvent;return!t.altKey&&(r.MAC?t.metaKey:t.ctrlKey)&&!t.shiftKey};exports.platformModifierKeyOnly=d;var g=function(e){var t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey};exports.shiftKeyOnly=g;var m=function(e){var t=e.originalEvent.target.tagName;return"INPUT"!==t&&"SELECT"!==t&&"TEXTAREA"!==t};exports.targetNotEditable=m;var h=function(e){var t=e.originalEvent;return(0,n.assert)(void 0!==t,56),"mouse"==t.pointerType};exports.mouseOnly=h;var O=function(e){var t=e.originalEvent;return(0,n.assert)(void 0!==t,56),"touch"===t.pointerType};exports.touchOnly=O;var T=function(e){var t=e.originalEvent;return(0,n.assert)(void 0!==t,56),"pen"===t.pointerType};exports.penOnly=T;var C=function(e){var t=e.originalEvent;return(0,n.assert)(void 0!==t,56),t.isPrimary&&0===t.button};exports.primaryAction=C; },{"../MapBrowserEventType.js":"YhDM","../functions.js":"RgA2","../has.js":"f3Nv","../asserts.js":"fLG6"}],"N4gU":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=a(require("./Pointer.js")),e=require("../functions.js"),n=require("../events/condition.js"),i=require("../easing.js"),r=require("../coordinate.js");function o(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return o=function(){return t},t}function a(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=o();if(e&&e.has(t))return e.get(t);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var a=i?Object.getOwnPropertyDescriptor(t,r):null;a&&(a.get||a.set)?Object.defineProperty(n,r,a):n[r]=t[r]}return n.default=t,e&&e.set(t,n),n}var s=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),c=function(o){function a(t){var i=o.call(this,{stopDown:e.FALSE})||this,r=t||{};i.kinetic_=r.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var a=r.condition?r.condition:(0,n.all)(n.noModifierKeys,n.primaryAction);return i.condition_=r.onFocusOnly?(0,n.all)(n.focusWithTabindex,a):a,i.noKinetic_=!1,i}return s(a,o),a.prototype.handleDragEvent=function(e){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var n=this.targetPointers,i=(0,t.centroid)(n);if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){var o=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],a=e.map.getView();(0,r.scale)(o,a.getResolution()),(0,r.rotate)(o,a.getRotation()),a.adjustCenterInternal(o)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=n.length,e.originalEvent.preventDefault()},a.prototype.handleUpEvent=function(t){var e=t.map,n=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var r=this.kinetic_.getDistance(),o=this.kinetic_.getAngle(),a=n.getCenterInternal(),s=e.getPixelFromCoordinateInternal(a),c=e.getCoordinateFromPixelInternal([s[0]-r*Math.cos(o),s[1]-r*Math.sin(o)]);n.animateInternal({center:n.getConstrainedCenter(c),duration:500,easing:i.easeOut})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},a.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},a}(t.default),u=c;exports.default=u; },{"./Pointer.js":"dnA2","../functions.js":"RgA2","../events/condition.js":"YcID","../easing.js":"IeCz","../coordinate.js":"nGsj"}],"PgBj":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=i(require("./Pointer.js")),n=require("../functions.js"),e=require("../events/condition.js"),o=require("../rotationconstraint.js");function i(t){return t&&t.__esModule?t:{default:t}}var r=function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(n,e)};return function(n,e){function o(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),a=function(t){function i(o){var i=this,r=o||{};return(i=t.call(this,{stopDown:n.FALSE})||this).condition_=r.condition?r.condition:e.altShiftKeysOnly,i.lastAngle_=void 0,i.duration_=void 0!==r.duration?r.duration:250,i}return r(i,t),i.prototype.handleDragEvent=function(t){if((0,e.mouseOnly)(t)){var n=t.map,i=n.getView();if(i.getConstraints().rotation!==o.disable){var r=n.getSize(),a=t.pixel,u=Math.atan2(r[1]/2-a[1],a[0]-r[0]/2);if(void 0!==this.lastAngle_){var s=u-this.lastAngle_;i.adjustRotationInternal(-s)}this.lastAngle_=u}}},i.prototype.handleUpEvent=function(t){return!(0,e.mouseOnly)(t)||(t.map.getView().endInteraction(this.duration_),!1)},i.prototype.handleDownEvent=function(t){return!!(0,e.mouseOnly)(t)&&(!(!(0,e.mouseActionButton)(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},i}(t.default),u=a;exports.default=u; },{"./Pointer.js":"dnA2","../functions.js":"RgA2","../events/condition.js":"YcID","../rotationconstraint.js":"EKd0"}],"bMDg":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=i(require("../Disposable.js")),e=i(require("../geom/Polygon.js"));function i(t){return t&&t.__esModule?t:{default:t}}var n=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),r=function(t){function i(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return n(i,t),i.prototype.disposeInternal=function(){this.setMap(null)},i.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i=this.element_.style;i.left=Math.min(t[0],e[0])+"px",i.top=Math.min(t[1],e[1])+"px",i.width=Math.abs(e[0]-t[0])+"px",i.height=Math.abs(e[1]-t[1])+"px"},i.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},i.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},i.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,i=this.endPixel_,n=[t,[t[0],i[1]],i,[i[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new e.default([n])},i.prototype.getGeometry=function(){return this.geometry_},i}(t.default),o=r;exports.default=o; },{"../Disposable.js":"DDda","../geom/Polygon.js":"Nwwk"}],"AQRw":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=i(require("../events/Event.js")),n=i(require("./Pointer.js")),o=i(require("../render/Box.js")),e=require("../events/condition.js");function i(t){return t&&t.__esModule?t:{default:t}}var r=function(){var t=function(n,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])})(n,o)};return function(n,o){function e(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}}(),s={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend"},a=function(t){function n(n,o,e){var i=t.call(this,n)||this;return i.coordinate=o,i.mapBrowserEvent=e,i}return r(n,t),n}(t.default),u=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.box_=new o.default(r.className||"ol-dragbox"),i.minArea_=void 0!==r.minArea?r.minArea:64,r.onBoxEnd&&(i.onBoxEnd=r.onBoxEnd),i.startPixel_=null,i.condition_=r.condition?r.condition:e.mouseActionButton,i.boxEndCondition_=r.boxEndCondition?r.boxEndCondition:i.defaultBoxEndCondition,i}return r(n,t),n.prototype.defaultBoxEndCondition=function(t,n,o){var e=o[0]-n[0],i=o[1]-n[1];return e*e+i*i>=this.minArea_},n.prototype.getGeometry=function(){return this.box_.getGeometry()},n.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new a(s.BOXDRAG,t.coordinate,t))},n.prototype.handleUpEvent=function(t){return this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd(t),this.dispatchEvent(new a(s.BOXEND,t.coordinate,t))),!1},n.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new a(s.BOXSTART,t.coordinate,t)),!0)},n.prototype.onBoxEnd=function(t){},n}(n.default),d=u;exports.default=d; },{"../events/Event.js":"fKNg","./Pointer.js":"dnA2","../render/Box.js":"bMDg","../events/condition.js":"YcID"}],"pTqW":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("./DragBox.js")),e=require("../extent.js"),n=require("../easing.js"),o=require("../events/condition.js");function r(t){return t&&t.__esModule?t:{default:t}}var i=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),a=function(t){function r(e){var n=this,r=e||{},i=r.condition?r.condition:o.shiftKeyOnly;return(n=t.call(this,{condition:i,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).duration_=void 0!==r.duration?r.duration:200,n.out_=void 0!==r.out&&r.out,n}return i(r,t),r.prototype.onBoxEnd=function(t){var o=this.getMap(),r=o.getView(),i=o.getSize(),a=this.getGeometry().getExtent();if(this.out_){var u=r.calculateExtentInternal(i),s=(0,e.createOrUpdateFromCoordinates)([o.getPixelFromCoordinateInternal((0,e.getBottomLeft)(a)),o.getPixelFromCoordinateInternal((0,e.getTopRight)(a))]),c=r.getResolutionForExtentInternal(s,i);(0,e.scaleFromCenter)(u,1/c),a=u}var l=r.getConstrainedResolution(r.getResolutionForExtentInternal(a,i)),d=r.getConstrainedCenter((0,e.getCenter)(a),l);r.animateInternal({resolution:l,center:d,duration:this.duration_,easing:n.easeOut})},r}(t.default),u=a;exports.default=u; },{"./DragBox.js":"AQRw","../extent.js":"QDir","../easing.js":"IeCz","../events/condition.js":"YcID"}],"mmJk":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={LEFT:37,UP:38,RIGHT:39,DOWN:40};exports.default=e; },{}],"CFRo":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=a(require("../events/EventType.js")),e=u(require("./Interaction.js")),r=a(require("../events/KeyCode.js")),n=require("../events/condition.js"),o=require("../coordinate.js");function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function u(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=n?Object.getOwnPropertyDescriptor(t,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=t[o]}return r.default=t,e&&e.set(t,r),r}function a(t){return t&&t.__esModule?t:{default:t}}var f=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),l=function(i){function u(t){var e=i.call(this)||this,r=t||{};return e.defaultCondition_=function(t){return(0,n.noModifierKeys)(t)&&(0,n.targetNotEditable)(t)},e.condition_=void 0!==r.condition?r.condition:e.defaultCondition_,e.duration_=void 0!==r.duration?r.duration:100,e.pixelDelta_=void 0!==r.pixelDelta?r.pixelDelta:128,e}return f(u,i),u.prototype.handleEvent=function(n){var i=!1;if(n.type==t.default.KEYDOWN){var u=n.originalEvent.keyCode;if(this.condition_(n)&&(u==r.default.DOWN||u==r.default.LEFT||u==r.default.RIGHT||u==r.default.UP)){var a=n.map.getView(),f=a.getResolution()*this.pixelDelta_,l=0,d=0;u==r.default.DOWN?d=-f:u==r.default.LEFT?l=-f:u==r.default.RIGHT?l=f:d=f;var c=[l,d];(0,o.rotate)(c,a.getRotation()),(0,e.pan)(a,c,this.duration_),n.preventDefault(),i=!0}}return!i},u}(e.default),d=l;exports.default=d; },{"../events/EventType.js":"C8cu","./Interaction.js":"jB2p","../events/KeyCode.js":"mmJk","../events/condition.js":"YcID","../coordinate.js":"nGsj"}],"S8wR":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=i(require("../events/EventType.js")),e=o(require("./Interaction.js")),r=require("../events/condition.js");function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function o(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,e&&e.set(t,r),r}function i(t){return t&&t.__esModule?t:{default:t}}var a=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),u=function(n){function o(t){var e=n.call(this)||this,o=t||{};return e.condition_=o.condition?o.condition:r.targetNotEditable,e.delta_=o.delta?o.delta:1,e.duration_=void 0!==o.duration?o.duration:100,e}return a(o,n),o.prototype.handleEvent=function(r){var n=!1;if(r.type==t.default.KEYDOWN||r.type==t.default.KEYPRESS){var o=r.originalEvent.charCode;if(this.condition_(r)&&(o=="+".charCodeAt(0)||o=="-".charCodeAt(0))){var i=r.map,a=o=="+".charCodeAt(0)?this.delta_:-this.delta_,u=i.getView();(0,e.zoomByDelta)(u,a,void 0,this.duration_),r.preventDefault(),n=!0}}return!n},o}(e.default),c=u;exports.default=c; },{"../events/EventType.js":"C8cu","./Interaction.js":"jB2p","../events/condition.js":"YcID"}],"gAnK":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=function(){function t(t,i,n){this.decay_=t,this.minVelocity_=i,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,i){this.points_.push(t,i,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,i=this.points_.length-3;if(this.points_[i+2]<t)return!1;for(var n=i-3;n>0&&this.points_[n+2]>t;)n-=3;var e=this.points_[i+2]-this.points_[n+2];if(e<1e3/60)return!1;var s=this.points_[i]-this.points_[n],o=this.points_[i+1]-this.points_[n+1];return this.angle_=Math.atan2(o,s),this.initialVelocity_=Math.sqrt(s*s+o*o)/e,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),i=t;exports.default=i; },{}],"kPt6":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Mode=void 0;var t=s(require("../events/EventType.js")),e=a(require("./Interaction.js")),o=require("../has.js"),i=require("../events/condition.js"),n=require("../math.js");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function a(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var a=i?Object.getOwnPropertyDescriptor(t,n):null;a&&(a.get||a.set)?Object.defineProperty(o,n,a):o[n]=t[n]}return o.default=t,e&&e.set(t,o),o}function s(t){return t&&t.__esModule?t:{default:t}}var u=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function i(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),l={TRACKPAD:"trackpad",WHEEL:"wheel"};exports.Mode=l;var _=function(r){function a(t){var e=this,o=t||{};(e=r.call(this,o)||this).totalDelta_=0,e.lastDelta_=0,e.maxDelta_=void 0!==o.maxDelta?o.maxDelta:1,e.duration_=void 0!==o.duration?o.duration:250,e.timeout_=void 0!==o.timeout?o.timeout:80,e.useAnchor_=void 0===o.useAnchor||o.useAnchor,e.constrainResolution_=void 0!==o.constrainResolution&&o.constrainResolution;var n=o.condition?o.condition:i.always;return e.condition_=o.onFocusOnly?(0,i.all)(i.focusWithTabindex,n):n,e.lastAnchor_=null,e.startTime_=void 0,e.timeoutId_,e.mode_=void 0,e.trackpadEventGap_=400,e.trackpadTimeoutId_,e.deltaPerZoom_=300,e}return u(a,r),a.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},a.prototype.handleEvent=function(e){if(!this.condition_(e))return!0;if(e.type!==t.default.WHEEL)return!0;e.preventDefault();var i,n=e.map,r=e.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=e.coordinate),e.type==t.default.WHEEL&&(i=r.deltaY,o.FIREFOX&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(i/=o.DEVICE_PIXEL_RATIO),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=40)),0===i)return!1;this.lastDelta_=i;var a=Date.now();void 0===this.startTime_&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?l.TRACKPAD:l.WHEEL);var s=n.getView();if(this.mode_===l.TRACKPAD&&!s.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(s.getAnimating()&&s.cancelAnimations(),s.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),s.adjustZoom(-i/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=a,!1;this.totalDelta_+=i;var u=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),u),!1},a.prototype.handleWheelZoom_=function(t){var o=t.getView();o.getAnimating()&&o.cancelAnimations();var i=-(0,n.clamp)(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(o.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),(0,e.zoomByDelta)(o,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},a.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},a}(e.default),c=_;exports.default=c; },{"../events/EventType.js":"C8cu","./Interaction.js":"jB2p","../has.js":"f3Nv","../events/condition.js":"YcID","../math.js":"B96G"}],"hbGN":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=o(require("./Pointer.js")),e=require("../functions.js"),n=require("../rotationconstraint.js");function r(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return r=function(){return t},t}function o(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=r();if(e&&e.has(t))return e.get(t);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,e&&e.set(t,n),n}var i=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=function(r){function o(t){var n=this,o=t||{},i=o;return i.stopDown||(i.stopDown=e.FALSE),(n=r.call(this,i)||this).anchor_=null,n.lastAngle_=void 0,n.rotating_=!1,n.rotationDelta_=0,n.threshold_=void 0!==o.threshold?o.threshold:.3,n.duration_=void 0!==o.duration?o.duration:250,n}return i(o,r),o.prototype.handleDragEvent=function(e){var r=0,o=this.targetPointers[0],i=this.targetPointers[1],a=Math.atan2(i.clientY-o.clientY,i.clientX-o.clientX);if(void 0!==this.lastAngle_){var s=a-this.lastAngle_;this.rotationDelta_+=s,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=s}this.lastAngle_=a;var l=e.map,u=l.getView();if(u.getConstraints().rotation!==n.disable){var c=l.getViewport().getBoundingClientRect(),h=(0,t.centroid)(this.targetPointers);h[0]-=c.left,h[1]-=c.top,this.anchor_=l.getCoordinateFromPixelInternal(h),this.rotating_&&(l.render(),u.adjustRotationInternal(r,this.anchor_))}},o.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},o.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},o}(t.default),s=a;exports.default=s; },{"./Pointer.js":"dnA2","../functions.js":"RgA2","../rotationconstraint.js":"EKd0"}],"rcXm":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("./Pointer.js")),e=require("../functions.js");function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function r(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,e&&e.set(t,r),r}var o=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(n){function r(t){var r=this,o=t||{},i=o;return i.stopDown||(i.stopDown=e.FALSE),(r=n.call(this,i)||this).anchor_=null,r.duration_=void 0!==o.duration?o.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return o(r,n),r.prototype.handleDragEvent=function(e){var n=1,r=this.targetPointers[0],o=this.targetPointers[1],i=r.clientX-o.clientX,a=r.clientY-o.clientY,s=Math.sqrt(i*i+a*a);void 0!==this.lastDistance_&&(n=this.lastDistance_/s),this.lastDistance_=s;var u=e.map,c=u.getView();1!=n&&(this.lastScaleDelta_=n);var l=u.getViewport().getBoundingClientRect(),p=(0,t.centroid)(this.targetPointers);p[0]-=l.left,p[1]-=l.top,this.anchor_=u.getCoordinateFromPixelInternal(p),u.render(),c.adjustResolutionInternal(n,this.anchor_)},r.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),!1}return!0},r.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},r}(t.default),a=i;exports.default=a; },{"./Pointer.js":"dnA2","../functions.js":"RgA2"}],"IYO6":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=o(require("../events/Event.js")),e=o(require("../events/EventType.js")),r=o(require("./Interaction.js")),s=require("../functions.js"),n=require("../proj.js"),i=require("../events.js");function o(t){return t&&t.__esModule?t:{default:t}}var a=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function s(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(s.prototype=r.prototype,new s)}}(),u={ADD_FEATURES:"addfeatures"},p=function(t){function e(e,r,s,n){var i=t.call(this,e)||this;return i.features=s,i.file=r,i.projection=n,i}return a(e,t),e}(t.default),c=function(t){function r(e){var r=this,i=e||{};return(r=t.call(this,{handleEvent:s.TRUE})||this).formatConstructors_=i.formatConstructors?i.formatConstructors:[],r.projection_=i.projection?(0,n.get)(i.projection):null,r.dropListenKeys_=null,r.source_=i.source||null,r.target=i.target?i.target:null,r}return a(r,t),r.prototype.handleResult_=function(t,e){var r=e.target.result,s=this.getMap(),n=this.projection_;n||(n=s.getView().getProjection());for(var i=this.formatConstructors_,o=0,a=i.length;o<a;++o){var c=new i[o],l=this.tryReadFeatures_(c,r,{featureProjection:n});if(l&&l.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(l)),this.dispatchEvent(new p(u.ADD_FEATURES,t,l,n));break}}},r.prototype.registerListeners_=function(){var t=this.getMap();if(t){var r=this.target?this.target:t.getViewport();this.dropListenKeys_=[(0,i.listen)(r,e.default.DROP,this.handleDrop,this),(0,i.listen)(r,e.default.DRAGENTER,this.handleStop,this),(0,i.listen)(r,e.default.DRAGOVER,this.handleStop,this),(0,i.listen)(r,e.default.DROP,this.handleStop,this)]}},r.prototype.setActive=function(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),t.prototype.setActive.call(this,e)},r.prototype.setMap=function(e){this.unregisterListeners_(),t.prototype.setMap.call(this,e),this.getActive()&&this.registerListeners_()},r.prototype.tryReadFeatures_=function(t,e,r){try{return t.readFeatures(e,r)}catch(s){return null}},r.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(i.unlistenByKey),this.dropListenKeys_=null)},r.prototype.handleDrop=function(t){for(var r=t.dataTransfer.files,s=0,n=r.length;s<n;++s){var i=r.item(s),o=new FileReader;o.addEventListener(e.default.LOAD,this.handleResult_.bind(this,i)),o.readAsText(i)}},r.prototype.handleStop=function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},r}(r.default),l=c;exports.default=l; },{"../events/Event.js":"fKNg","../events/EventType.js":"C8cu","./Interaction.js":"jB2p","../functions.js":"RgA2","../proj.js":"Diht","../events.js":"UqnM"}],"ITeC":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=n(require("./Pointer.js")),e=require("../events/condition.js");function n(t){return t&&t.__esModule?t:{default:t}}var i=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=function(t){function n(n){var i=this,o=n||{};return(i=t.call(this,o)||this).condition_=o.condition?o.condition:e.shiftKeyOnly,i.lastAngle_=void 0,i.lastMagnitude_=void 0,i.lastScaleDelta_=0,i.duration_=void 0!==o.duration?o.duration:400,i}return i(n,t),n.prototype.handleDragEvent=function(t){if((0,e.mouseOnly)(t)){var n=t.map,i=n.getSize(),o=t.pixel,a=o[0]-i[0]/2,r=i[1]/2-o[1],s=Math.atan2(r,a),l=Math.sqrt(a*a+r*r),u=n.getView();if(void 0!==this.lastAngle_){var d=this.lastAngle_-s;u.adjustRotationInternal(d)}this.lastAngle_=s,void 0!==this.lastMagnitude_&&u.adjustResolutionInternal(this.lastMagnitude_/l),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/l),this.lastMagnitude_=l}},n.prototype.handleUpEvent=function(t){if(!(0,e.mouseOnly)(t))return!0;var n=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return n.endInteraction(this.duration_,i),this.lastScaleDelta_=0,!1},n.prototype.handleDownEvent=function(t){return!!(0,e.mouseOnly)(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},n}(t.default),a=o;exports.default=a; },{"./Pointer.js":"dnA2","../events/condition.js":"YcID"}],"AyCw":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=s(require("./GeometryType.js")),e=s(require("./SimpleGeometry.js")),r=require("../extent.js"),o=require("./flat/deflate.js"),i=require("./flat/transform.js");function s(t){return t&&t.__esModule?t:{default:t}}var n=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),a=function(e){function s(t,r,o){var i=e.call(this)||this;if(void 0!==o&&void 0===r)i.setFlatCoordinates(o,t);else{var s=r||0;i.setCenterAndRadius(t,s,o)}return i}return n(s,e),s.prototype.clone=function(){return new s(this.flatCoordinates.slice(),void 0,this.layout)},s.prototype.closestPointXY=function(t,e,r,o){var i=this.flatCoordinates,s=t-i[0],n=e-i[1],a=s*s+n*n;if(a<o){if(0===a)for(var u=0;u<this.stride;++u)r[u]=i[u];else{var d=this.getRadius()/Math.sqrt(a);r[0]=i[0]+d*s,r[1]=i[1]+d*n;for(u=2;u<this.stride;++u)r[u]=i[u]}return r.length=this.stride,a}return o},s.prototype.containsXY=function(t,e){var r=this.flatCoordinates,o=t-r[0],i=e-r[1];return o*o+i*i<=this.getRadiusSquared_()},s.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},s.prototype.computeExtent=function(t){var e=this.flatCoordinates,o=e[this.stride]-e[0];return(0,r.createOrUpdate)(e[0]-o,e[1]-o,e[0]+o,e[1]+o,t)},s.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},s.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},s.prototype.getType=function(){return t.default.CIRCLE},s.prototype.intersectsExtent=function(t){var e=this.getExtent();if((0,r.intersects)(t,e)){var o=this.getCenter();return t[0]<=o[0]&&t[2]>=o[0]||(t[1]<=o[1]&&t[3]>=o[1]||(0,r.forEachCorner)(t,this.intersectsCoordinate.bind(this)))}return!1},s.prototype.setCenter=function(t){var e=this.stride,r=this.flatCoordinates[e]-this.flatCoordinates[0],o=t.slice();o[e]=o[0]+r;for(var i=1;i<e;++i)o[e+i]=t[i];this.setFlatCoordinates(this.layout,o),this.changed()},s.prototype.setCenterAndRadius=function(t,e,r){this.setLayout(r,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var i=this.flatCoordinates,s=(0,o.deflateCoordinate)(i,0,t,this.stride);i[s++]=i[0]+e;for(var n=1,a=this.stride;n<a;++n)i[s++]=i[n];i.length=s,this.changed()},s.prototype.getCoordinates=function(){return null},s.prototype.setCoordinates=function(t,e){},s.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},s.prototype.rotate=function(t,e){var r=this.getCenter(),o=this.getStride();this.setCenter((0,i.rotate)(r,0,r.length,o,t,e,r)),this.changed()},s.prototype.translate=function(t,e){var r=this.getCenter(),o=this.getStride();this.setCenter((0,i.translate)(r,0,r.length,o,t,e,r)),this.changed()},s}(e.default);a.prototype.transform;var u=a;exports.default=u; },{"./GeometryType.js":"lmV0","./SimpleGeometry.js":"pnrv","../extent.js":"QDir","./flat/deflate.js":"FNhl","./flat/transform.js":"LGwr"}],"mYW9":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createStyleFunction=u,exports.default=void 0;var e=s(require("./Object.js")),t=o(require("./events/EventType.js")),r=require("./asserts.js"),n=require("./events.js");function o(e){return e&&e.__esModule?e:{default:e}}function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}var y=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),a=function(r){function o(t){var n=r.call(this)||this;if(n.id_=void 0,n.geometryName_="geometry",n.style_=null,n.styleFunction_=void 0,n.geometryChangeKey_=null,n.addEventListener((0,e.getChangeEventType)(n.geometryName_),n.handleGeometryChanged_),t)if("function"==typeof t.getSimplifiedGeometry){var o=t;n.setGeometry(o)}else{var i=t;n.setProperties(i)}return n}return y(o,r),o.prototype.clone=function(){var e=new o(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());var t=this.getGeometry();t&&e.setGeometry(t.clone());var r=this.getStyle();return r&&e.setStyle(r),e},o.prototype.getGeometry=function(){return this.get(this.geometryName_)},o.prototype.getId=function(){return this.id_},o.prototype.getGeometryName=function(){return this.geometryName_},o.prototype.getStyle=function(){return this.style_},o.prototype.getStyleFunction=function(){return this.styleFunction_},o.prototype.handleGeometryChange_=function(){this.changed()},o.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&((0,n.unlistenByKey)(this.geometryChangeKey_),this.geometryChangeKey_=null);var e=this.getGeometry();e&&(this.geometryChangeKey_=(0,n.listen)(e,t.default.CHANGE,this.handleGeometryChange_,this)),this.changed()},o.prototype.setGeometry=function(e){this.set(this.geometryName_,e)},o.prototype.setStyle=function(e){this.style_=e,this.styleFunction_=e?u(e):void 0,this.changed()},o.prototype.setId=function(e){this.id_=e,this.changed()},o.prototype.setGeometryName=function(t){this.removeEventListener((0,e.getChangeEventType)(this.geometryName_),this.handleGeometryChanged_),this.geometryName_=t,this.addEventListener((0,e.getChangeEventType)(this.geometryName_),this.handleGeometryChanged_),this.handleGeometryChanged_()},o}(e.default);function u(e){return"function"==typeof e?e:(Array.isArray(e)?t=e:((0,r.assert)("function"==typeof e.getZIndex,41),t=[e]),function(){return t});var t}var h=a;exports.default=h; },{"./Object.js":"PhPh","./events/EventType.js":"C8cu","./asserts.js":"fLG6","./events.js":"UqnM"}],"rDTq":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.interpolatePoint=n,exports.lineStringCoordinateAtM=t,exports.lineStringsCoordinateAtM=i;var r=require("../../array.js"),e=require("../../math.js");function n(n,t,i,l,u,a,f){var o,s,v=(i-t)/l;if(1===v)o=t;else if(2===v)o=t,s=u;else if(0!==v){for(var c=n[t],p=n[t+1],h=0,d=[0],g=t+l;g<i;g+=l){var x=n[g],y=n[g+1];h+=Math.sqrt((x-c)*(x-c)+(y-p)*(y-p)),d.push(h),c=x,p=y}var M=u*h,j=(0,r.binarySearch)(d,M);j<0?(s=(M-d[-j-2])/(d[-j-1]-d[-j-2]),o=t+(-j-2)*l):o=t+j*l}var q=f>1?f:2,A=a||new Array(q);for(g=0;g<q;++g)A[g]=void 0===o?NaN:void 0===s?n[o+g]:(0,e.lerp)(n[o+g],n[o+l+g],s);return A}function t(r,n,t,i,l,u){if(t==n)return null;var a;if(l<r[n+i-1])return u?((a=r.slice(n,n+i))[i-1]=l,a):null;if(r[t-1]<l)return u?((a=r.slice(t-i,t))[i-1]=l,a):null;if(l==r[n+i-1])return r.slice(n,n+i);for(var f=n/i,o=t/i;f<o;){var s=f+o>>1;l<r[(s+1)*i-1]?o=s:f=s+1}var v=r[f*i-1];if(l==v)return r.slice((f-1)*i,(f-1)*i+i);var c=(l-v)/(r[(f+1)*i-1]-v);a=[];for(var p=0;p<i-1;++p)a.push((0,e.lerp)(r[(f-1)*i+p],r[f*i+p],c));return a.push(l),a}function i(r,e,n,i,l,u,a){if(a)return t(r,e,n[n.length-1],i,l,u);var f;if(l<r[i-1])return u?((f=r.slice(0,i))[i-1]=l,f):null;if(r[r.length-1]<l)return u?((f=r.slice(r.length-i))[i-1]=l,f):null;for(var o=0,s=n.length;o<s;++o){var v=n[o];if(e!=v){if(l<r[e+i-1])return null;if(l<=r[v-1])return t(r,e,v,i,l,!1);e=v}}return null} },{"../../array.js":"luEr","../../math.js":"B96G"}],"ZZrx":[function(require,module,exports) { "use strict";function r(r,t,e,n){for(var i=r[t],o=r[t+1],s=0,a=t+n;a<e;a+=n){var u=r[a],c=r[a+1];s+=Math.sqrt((u-i)*(u-i)+(c-o)*(c-o)),i=u,o=c}return s}function t(t,e,n,i){var o=r(t,e,n,i),s=t[n-i]-t[e],a=t[n-i+1]-t[e+1];return o+=Math.sqrt(s*s+a*a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.lineStringLength=r,exports.linearRingLength=t; },{}],"DfxW":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=p(require("./GeometryLayout.js")),e=p(require("./GeometryType.js")),i=p(require("./SimpleGeometry.js")),o=require("./flat/closest.js"),n=require("../extent.js"),r=require("./flat/deflate.js"),s=require("./flat/simplify.js"),a=require("../array.js"),l=require("./flat/segments.js"),f=require("./flat/inflate.js"),h=require("./flat/interpolate.js"),d=require("./flat/intersectsextent.js"),u=require("./flat/length.js");function p(t){return t&&t.__esModule?t:{default:t}}var c=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),C=function(i){function p(t,e){var o=i.call(this)||this;return o.flatMidpoint_=null,o.flatMidpointRevision_=-1,o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?o.setCoordinates(t,e):o.setFlatCoordinates(e,t),o}return c(p,i),p.prototype.appendCoordinate=function(t){this.flatCoordinates?(0,a.extend)(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},p.prototype.clone=function(){return new p(this.flatCoordinates.slice(),this.layout)},p.prototype.closestPointXY=function(t,e,i,r){return r<(0,n.closestSquaredDistanceXY)(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt((0,o.maxSquaredDelta)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),(0,o.assignClosestPoint)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,r))},p.prototype.forEachSegment=function(t){return(0,l.forEach)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},p.prototype.getCoordinateAtM=function(e,i){if(this.layout!=t.default.XYM&&this.layout!=t.default.XYZM)return null;var o=void 0!==i&&i;return(0,h.lineStringCoordinateAtM)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,o)},p.prototype.getCoordinates=function(){return(0,f.inflateCoordinates)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},p.prototype.getCoordinateAt=function(t,e){return(0,h.interpolatePoint)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},p.prototype.getLength=function(){return(0,u.lineStringLength)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},p.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},p.prototype.getSimplifiedGeometryInternal=function(e){var i=[];return i.length=(0,s.douglasPeucker)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i,0),new p(i,t.default.XY)},p.prototype.getType=function(){return e.default.LINE_STRING},p.prototype.intersectsExtent=function(t){return(0,d.intersectsLineString)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},p.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=(0,r.deflateCoordinates)(this.flatCoordinates,0,t,this.stride),this.changed()},p}(i.default),g=C;exports.default=g; },{"./GeometryLayout.js":"Utvi","./GeometryType.js":"lmV0","./SimpleGeometry.js":"pnrv","./flat/closest.js":"rMra","../extent.js":"QDir","./flat/deflate.js":"FNhl","./flat/simplify.js":"IEpt","../array.js":"luEr","./flat/segments.js":"U8i0","./flat/inflate.js":"znXl","./flat/interpolate.js":"rDTq","./flat/intersectsextent.js":"GZir","./flat/length.js":"ZZrx"}],"fbCo":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=f(require("./GeometryLayout.js")),e=f(require("./GeometryType.js")),i=f(require("./LineString.js")),r=f(require("./SimpleGeometry.js")),s=require("./flat/closest.js"),n=require("../extent.js"),o=require("./flat/deflate.js"),a=require("./flat/simplify.js"),l=require("../array.js"),d=require("./flat/inflate.js"),u=require("./flat/interpolate.js"),h=require("./flat/intersectsextent.js");function f(t){return t&&t.__esModule?t:{default:t}}var p=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),c=function(r){function f(t,e,i){var s=r.call(this)||this;if(s.ends_=[],s.maxDelta_=-1,s.maxDeltaRevision_=-1,Array.isArray(t[0]))s.setCoordinates(t,e);else if(void 0!==e&&i)s.setFlatCoordinates(e,t),s.ends_=i;else{for(var n=s.getLayout(),o=t,a=[],d=[],u=0,h=o.length;u<h;++u){var f=o[u];0===u&&(n=f.getLayout()),(0,l.extend)(a,f.getFlatCoordinates()),d.push(a.length)}s.setFlatCoordinates(n,a),s.ends_=d}return s}return p(f,r),f.prototype.appendLineString=function(t){this.flatCoordinates?(0,l.extend)(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},f.prototype.clone=function(){return new f(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},f.prototype.closestPointXY=function(t,e,i,r){return r<(0,n.closestSquaredDistanceXY)(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt((0,s.arrayMaxSquaredDelta)(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),(0,s.assignClosestArrayPoint)(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,r))},f.prototype.getCoordinateAtM=function(e,i,r){if(this.layout!=t.default.XYM&&this.layout!=t.default.XYZM||0===this.flatCoordinates.length)return null;var s=void 0!==i&&i,n=void 0!==r&&r;return(0,u.lineStringsCoordinateAtM)(this.flatCoordinates,0,this.ends_,this.stride,e,s,n)},f.prototype.getCoordinates=function(){return(0,d.inflateCoordinatesArray)(this.flatCoordinates,0,this.ends_,this.stride)},f.prototype.getEnds=function(){return this.ends_},f.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new i.default(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},f.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,r=this.layout,s=[],n=0,o=0,a=e.length;o<a;++o){var l=e[o],d=new i.default(t.slice(n,l),r);s.push(d),n=l}return s},f.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,r=this.ends_,s=this.stride,n=0,o=r.length;n<o;++n){var a=r[n],d=(0,u.interpolatePoint)(e,i,a,s,.5);(0,l.extend)(t,d),i=a}return t},f.prototype.getSimplifiedGeometryInternal=function(e){var i=[],r=[];return i.length=(0,a.douglasPeuckerArray)(this.flatCoordinates,0,this.ends_,this.stride,e,i,0,r),new f(i,t.default.XY,r)},f.prototype.getType=function(){return e.default.MULTI_LINE_STRING},f.prototype.intersectsExtent=function(t){return(0,h.intersectsLineStringArray)(this.flatCoordinates,0,this.ends_,this.stride,t)},f.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=(0,o.deflateCoordinatesArray)(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},f}(r.default),y=c;exports.default=y; },{"./GeometryLayout.js":"Utvi","./GeometryType.js":"lmV0","./LineString.js":"DfxW","./SimpleGeometry.js":"pnrv","./flat/closest.js":"rMra","../extent.js":"QDir","./flat/deflate.js":"FNhl","./flat/simplify.js":"IEpt","../array.js":"luEr","./flat/inflate.js":"znXl","./flat/interpolate.js":"rDTq","./flat/intersectsextent.js":"GZir"}],"dNu5":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=u(require("./GeometryType.js")),e=u(require("./Point.js")),r=u(require("./SimpleGeometry.js")),o=require("../extent.js"),i=require("./flat/deflate.js"),n=require("../array.js"),s=require("./flat/inflate.js"),a=require("../math.js");function u(t){return t&&t.__esModule?t:{default:t}}var l=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),f=function(r){function u(t,e){var o=r.call(this)||this;return e&&!Array.isArray(t[0])?o.setFlatCoordinates(e,t):o.setCoordinates(t,e),o}return l(u,r),u.prototype.appendPoint=function(t){this.flatCoordinates?(0,n.extend)(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},u.prototype.clone=function(){return new u(this.flatCoordinates.slice(),this.layout)},u.prototype.closestPointXY=function(t,e,r,i){if(i<(0,o.closestSquaredDistanceXY)(this.getExtent(),t,e))return i;for(var n=this.flatCoordinates,s=this.stride,u=0,l=n.length;u<l;u+=s){var f=(0,a.squaredDistance)(t,e,n[u],n[u+1]);if(f<i){i=f;for(var d=0;d<s;++d)r[d]=n[u+d];r.length=s}}return i},u.prototype.getCoordinates=function(){return(0,s.inflateCoordinates)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},u.prototype.getPoint=function(t){var r=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||r<=t?null:new e.default(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},u.prototype.getPoints=function(){for(var t=this.flatCoordinates,r=this.layout,o=this.stride,i=[],n=0,s=t.length;n<s;n+=o){var a=new e.default(t.slice(n,n+o),r);i.push(a)}return i},u.prototype.getType=function(){return t.default.MULTI_POINT},u.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,r=this.stride,i=0,n=e.length;i<n;i+=r){var s=e[i],a=e[i+1];if((0,o.containsXY)(t,s,a))return!0}return!1},u.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=(0,i.deflateCoordinates)(this.flatCoordinates,0,t,this.stride),this.changed()},u}(r.default),d=f;exports.default=d; },{"./GeometryType.js":"lmV0","./Point.js":"gLcY","./SimpleGeometry.js":"pnrv","../extent.js":"QDir","./flat/deflate.js":"FNhl","../array.js":"luEr","./flat/inflate.js":"znXl","../math.js":"B96G"}],"VjQP":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.linearRingss=r;var e=require("../../extent.js");function r(r,t,a,n){for(var s=[],o=(0,e.createEmpty)(),i=0,u=a.length;i<u;++i){var l=a[i];o=(0,e.createOrUpdateFromFlatCoordinates)(r,t,l[0],n),s.push((o[0]+o[2])/2,(o[1]+o[3])/2),t=l[l.length-1]}return s} },{"../../extent.js":"QDir"}],"ouhF":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=y(require("./GeometryLayout.js")),e=y(require("./GeometryType.js")),i=y(require("./MultiPoint.js")),s=y(require("./Polygon.js")),r=y(require("./SimpleGeometry.js")),n=require("./flat/closest.js"),o=require("../extent.js"),a=require("./flat/deflate.js"),l=require("../array.js"),d=require("./flat/interiorpoint.js"),h=require("./flat/inflate.js"),u=require("./flat/intersectsextent.js"),f=require("./flat/orient.js"),g=require("./flat/area.js"),c=require("./flat/center.js"),p=require("./flat/contains.js"),_=require("./flat/simplify.js");function y(t){return t&&t.__esModule?t:{default:t}}var v=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),C=function(r){function y(t,e,i){var s=r.call(this)||this;if(s.endss_=[],s.flatInteriorPointsRevision_=-1,s.flatInteriorPoints_=null,s.maxDelta_=-1,s.maxDeltaRevision_=-1,s.orientedRevision_=-1,s.orientedFlatCoordinates_=null,!i&&!Array.isArray(t[0])){for(var n=s.getLayout(),o=t,a=[],d=[],h=0,u=o.length;h<u;++h){var f=o[h];0===h&&(n=f.getLayout());for(var g=a.length,c=f.getEnds(),p=0,_=c.length;p<_;++p)c[p]+=g;(0,l.extend)(a,f.getFlatCoordinates()),d.push(c)}e=n,t=a,i=d}return void 0!==e&&i?(s.setFlatCoordinates(e,t),s.endss_=i):s.setCoordinates(t,e),s}return v(y,r),y.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;(0,l.extend)(this.flatCoordinates,t.getFlatCoordinates());for(var s=0,r=(e=t.getEnds().slice()).length;s<r;++s)e[s]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},y.prototype.clone=function(){for(var t=this.endss_.length,e=new Array(t),i=0;i<t;++i)e[i]=this.endss_[i].slice();return new y(this.flatCoordinates.slice(),this.layout,e)},y.prototype.closestPointXY=function(t,e,i,s){return s<(0,o.closestSquaredDistanceXY)(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt((0,n.multiArrayMaxSquaredDelta)(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),(0,n.assignClosestMultiArrayPoint)(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,s))},y.prototype.containsXY=function(t,e){return(0,p.linearRingssContainsXY)(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},y.prototype.getArea=function(){return(0,g.linearRingss)(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},y.prototype.getCoordinates=function(t){var e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),(0,f.orientLinearRingsArray)(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,(0,h.inflateMultiCoordinatesArray)(e,0,this.endss_,this.stride)},y.prototype.getEndss=function(){return this.endss_},y.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=(0,c.linearRingss)(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=(0,d.getInteriorPointsOfMultiArray)(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},y.prototype.getInteriorPoints=function(){return new i.default(this.getFlatInteriorPoints().slice(),t.default.XYM)},y.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;(0,f.linearRingssAreOriented)(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=(0,f.orientLinearRingsArray)(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},y.prototype.getSimplifiedGeometryInternal=function(e){var i=[],s=[];return i.length=(0,_.quantizeMultiArray)(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),i,0,s),new y(i,t.default.XY,s)},y.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var i=this.endss_[t-1];e=i[i.length-1]}var r=this.endss_[t].slice(),n=r[r.length-1];if(0!==e)for(var o=0,a=r.length;o<a;++o)r[o]-=e;return new s.default(this.flatCoordinates.slice(e,n),this.layout,r)},y.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,r=[],n=0,o=0,a=i.length;o<a;++o){var l=i[o].slice(),d=l[l.length-1];if(0!==n)for(var h=0,u=l.length;h<u;++h)l[h]-=n;var f=new s.default(e.slice(n,d),t,l);r.push(f),n=d}return r},y.prototype.getType=function(){return e.default.MULTI_POLYGON},y.prototype.intersectsExtent=function(t){return(0,u.intersectsLinearRingMultiArray)(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},y.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=(0,a.deflateMultiCoordinatesArray)(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var s=i[i.length-1];this.flatCoordinates.length=0===s.length?0:s[s.length-1]}this.changed()},y}(r.default),q=C;exports.default=q; },{"./GeometryLayout.js":"Utvi","./GeometryType.js":"lmV0","./MultiPoint.js":"dNu5","./Polygon.js":"Nwwk","./SimpleGeometry.js":"pnrv","./flat/closest.js":"rMra","../extent.js":"QDir","./flat/deflate.js":"FNhl","../array.js":"luEr","./flat/interiorpoint.js":"UDvN","./flat/inflate.js":"znXl","./flat/intersectsextent.js":"GZir","./flat/orient.js":"cJkE","./flat/area.js":"EOSm","./flat/center.js":"VjQP","./flat/contains.js":"dzdN","./flat/simplify.js":"IEpt"}],"S8ow":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=require("../util.js"),e=require("../size.js"),o=function(){function o(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=(0,e.toSize)(t.scale),this.displacement_=t.displacement}return o.prototype.clone=function(){var t=this.getScale();return new o({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},o.prototype.getOpacity=function(){return this.opacity_},o.prototype.getRotateWithView=function(){return this.rotateWithView_},o.prototype.getRotation=function(){return this.rotation_},o.prototype.getScale=function(){return this.scale_},o.prototype.getScaleArray=function(){return this.scaleArray_},o.prototype.getDisplacement=function(){return this.displacement_},o.prototype.getAnchor=function(){return(0,t.abstract)()},o.prototype.getImage=function(e){return(0,t.abstract)()},o.prototype.getHitDetectionImage=function(){return(0,t.abstract)()},o.prototype.getPixelRatio=function(t){return 1},o.prototype.getImageState=function(){return(0,t.abstract)()},o.prototype.getImageSize=function(){return(0,t.abstract)()},o.prototype.getHitDetectionImageSize=function(){return(0,t.abstract)()},o.prototype.getOrigin=function(){return(0,t.abstract)()},o.prototype.getSize=function(){return(0,t.abstract)()},o.prototype.setOpacity=function(t){this.opacity_=t},o.prototype.setRotateWithView=function(t){this.rotateWithView_=t},o.prototype.setRotation=function(t){this.rotation_=t},o.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=(0,e.toSize)(t)},o.prototype.listenImageChange=function(e){(0,t.abstract)()},o.prototype.load=function(){(0,t.abstract)()},o.prototype.unlistenImageChange=function(e){(0,t.abstract)()},o}(),i=o;exports.default=i; },{"../util.js":"KniQ","../size.js":"TAHd"}],"il3X":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("../ImageState.js")),e=r(require("./Image.js")),i=require("../color.js"),s=require("../colorlike.js"),n=require("../dom.js"),o=require("../render/canvas.js");function r(t){return t&&t.__esModule?t:{default:t}}var a=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),l=function(e){function r(t){var i=this,s=void 0!==t.rotateWithView&&t.rotateWithView;return(i=e.call(this,{opacity:1,rotateWithView:s,rotation:void 0!==t.rotation?t.rotation:0,scale:1,displacement:void 0!==t.displacement?t.displacement:[0,0]})||this).canvas_={},i.hitDetectionCanvas_=null,i.fill_=void 0!==t.fill?t.fill:null,i.origin_=[0,0],i.points_=t.points,i.radius_=void 0!==t.radius?t.radius:t.radius1,i.radius2_=t.radius2,i.angle_=void 0!==t.angle?t.angle:0,i.stroke_=void 0!==t.stroke?t.stroke:null,i.anchor_=null,i.size_=null,i.imageSize_=null,i.hitDetectionImageSize_=null,i.render(),i}return a(r,e),r.prototype.clone=function(){var t=new r({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},r.prototype.getAnchor=function(){return this.anchor_},r.prototype.getAngle=function(){return this.angle_},r.prototype.getFill=function(){return this.fill_},r.prototype.getHitDetectionImage=function(){if(!this.hitDetectionCanvas_){var t=this.createRenderOptions();this.createHitDetectionCanvas_(t)}return this.hitDetectionCanvas_},r.prototype.getImage=function(t){if(!this.canvas_[t||1]){var e=this.createRenderOptions(),i=(0,n.createCanvasContext2D)(e.size*t||1,e.size*t||1);this.draw_(e,i,0,0,t||1),this.canvas_[t||1]=i.canvas}return this.canvas_[t||1]},r.prototype.getPixelRatio=function(t){return t},r.prototype.getImageSize=function(){return this.imageSize_},r.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},r.prototype.getImageState=function(){return t.default.LOADED},r.prototype.getOrigin=function(){return this.origin_},r.prototype.getPoints=function(){return this.points_},r.prototype.getRadius=function(){return this.radius_},r.prototype.getRadius2=function(){return this.radius2_},r.prototype.getSize=function(){return this.size_},r.prototype.getStroke=function(){return this.stroke_},r.prototype.listenImageChange=function(t){},r.prototype.load=function(){},r.prototype.unlistenImageChange=function(t){},r.prototype.createRenderOptions=function(){var t,e=o.defaultLineCap,i=o.defaultLineJoin,n=0,r=null,a=0,l=0;return this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=o.defaultStrokeStyle),t=(0,s.asColorLike)(t),void 0===(l=this.stroke_.getWidth())&&(l=o.defaultLineWidth),r=this.stroke_.getLineDash(),a=this.stroke_.getLineDashOffset(),void 0===(i=this.stroke_.getLineJoin())&&(i=o.defaultLineJoin),void 0===(e=this.stroke_.getLineCap())&&(e=o.defaultLineCap),void 0===(n=this.stroke_.getMiterLimit())&&(n=o.defaultMiterLimit)),{strokeStyle:t,strokeWidth:l,size:2*(this.radius_+l)+1,lineCap:e,lineDash:r,lineDashOffset:a,lineJoin:i,miterLimit:n}},r.prototype.render=function(){var t=this.createRenderOptions(),e=(0,n.createCanvasContext2D)(t.size,t.size);this.draw_(t,e,0,0,1),this.canvas_[1]=e.canvas;var i=e.canvas.width,s=i,o=this.getDisplacement();this.hitDetectionImageSize_=[t.size,t.size],this.createHitDetectionCanvas_(t),this.anchor_=[i/2-o[0],i/2+o[1]],this.size_=[i,i],this.imageSize_=[s,s]},r.prototype.draw_=function(t,e,i,n,r){var a,l,h;e.setTransform(r,0,0,r,0,0),e.translate(i,n),e.beginPath();var u=this.points_;if(u===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var c=void 0!==this.radius2_?this.radius2_:this.radius_;for(c!==this.radius_&&(u*=2),a=0;a<=u;a++)l=2*a*Math.PI/u-Math.PI/2+this.angle_,h=a%2==0?this.radius_:c,e.lineTo(t.size/2+h*Math.cos(l),t.size/2+h*Math.sin(l))}if(this.fill_){var d=this.fill_.getColor();null===d&&(d=o.defaultFillStyle),e.fillStyle=(0,s.asColorLike)(d),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()},r.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionCanvas_=this.getImage(1),this.fill_){var e=this.fill_.getColor(),s=0;if("string"==typeof e&&(e=(0,i.asArray)(e)),null===e?s=1:Array.isArray(e)&&(s=4===e.length?e[3]:1),0===s){var o=(0,n.createCanvasContext2D)(t.size,t.size);this.hitDetectionCanvas_=o.canvas,this.drawHitDetectionCanvas_(t,o,0,0)}}},r.prototype.drawHitDetectionCanvas_=function(t,e,i,s){e.translate(i,s),e.beginPath();var n=this.points_;if(n===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var r=void 0!==this.radius2_?this.radius2_:this.radius_;r!==this.radius_&&(n*=2);var a=void 0,l=void 0,h=void 0;for(a=0;a<=n;a++)h=2*a*Math.PI/n-Math.PI/2+this.angle_,l=a%2==0?this.radius_:r,e.lineTo(t.size/2+l*Math.cos(h),t.size/2+l*Math.sin(h))}e.fillStyle=o.defaultFillStyle,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke()),e.closePath()},r}(e.default),h=l;exports.default=h; },{"../ImageState.js":"u3kG","./Image.js":"S8ow","../color.js":"eucy","../colorlike.js":"V5XN","../dom.js":"Xno5","../render/canvas.js":"iAG7"}],"cdf1":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("./RegularShape.js"));function e(t){return t&&t.__esModule?t:{default:t}}var r=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),i=function(t){function e(e){var r=e||{};return t.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke,displacement:void 0!==r.displacement?r.displacement:[0,0]})||this}return r(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(t.default),o=i;exports.default=o; },{"./RegularShape.js":"il3X"}],"AFcg":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var o=function(){function o(o){var r=o||{};this.color_=void 0!==r.color?r.color:null}return o.prototype.clone=function(){var r=this.getColor();return new o({color:Array.isArray(r)?r.slice():r||void 0})},o.prototype.getColor=function(){return this.color_},o.prototype.setColor=function(o){this.color_=o},o}(),r=o;exports.default=r; },{}],"TXDt":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=function(){function t(t){var i=t||{};this.color_=void 0!==i.color?i.color:null,this.lineCap_=i.lineCap,this.lineDash_=void 0!==i.lineDash?i.lineDash:null,this.lineDashOffset_=i.lineDashOffset,this.lineJoin_=i.lineJoin,this.miterLimit_=i.miterLimit,this.width_=i.width}return t.prototype.clone=function(){var i=this.getColor();return new t({color:Array.isArray(i)?i.slice():i||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),i=t;exports.default=i; },{}],"he4w":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.toFunction=l,exports.createDefaultStyle=f,exports.createEditingStyle=d,exports.default=void 0;var e=i(require("./Circle.js")),t=i(require("./Fill.js")),o=i(require("../geom/GeometryType.js")),r=i(require("./Stroke.js")),n=require("../asserts.js");function i(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e){var t=e||{};this.geometry_=null,this.geometryFunction_=a,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex}return e.prototype.clone=function(){var t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new e({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.setRenderer=function(e){this.renderer_=e},e.prototype.getGeometry=function(){return this.geometry_},e.prototype.getGeometryFunction=function(){return this.geometryFunction_},e.prototype.getFill=function(){return this.fill_},e.prototype.setFill=function(e){this.fill_=e},e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(e){this.image_=e},e.prototype.getStroke=function(){return this.stroke_},e.prototype.setStroke=function(e){this.stroke_=e},e.prototype.getText=function(){return this.text_},e.prototype.setText=function(e){this.text_=e},e.prototype.getZIndex=function(){return this.zIndex_},e.prototype.setGeometry=function(e){"function"==typeof e?this.geometryFunction_=e:"string"==typeof e?this.geometryFunction_=function(t){return t.get(e)}:e?void 0!==e&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=a,this.geometry_=e},e.prototype.setZIndex=function(e){this.zIndex_=e},e}();function l(e){var t;if("function"==typeof e)t=e;else{var o;if(Array.isArray(e))o=e;else(0,n.assert)("function"==typeof e.getZIndex,41),o=[e];t=function(){return o}}return t}var s=null;function f(o,n){if(!s){var i=new t.default({color:"rgba(255,255,255,0.4)"}),l=new r.default({color:"#3399CC",width:1.25});s=[new u({image:new e.default({fill:i,stroke:l,radius:5}),fill:i,stroke:l})]}return s}function d(){var n={},i=[255,255,255,1],l=[0,153,255,1];return n[o.default.POLYGON]=[new u({fill:new t.default({color:[255,255,255,.5]})})],n[o.default.MULTI_POLYGON]=n[o.default.POLYGON],n[o.default.LINE_STRING]=[new u({stroke:new r.default({color:i,width:5})}),new u({stroke:new r.default({color:l,width:3})})],n[o.default.MULTI_LINE_STRING]=n[o.default.LINE_STRING],n[o.default.CIRCLE]=n[o.default.POLYGON].concat(n[o.default.LINE_STRING]),n[o.default.POINT]=[new u({image:new e.default({radius:6,fill:new t.default({color:l}),stroke:new r.default({color:i,width:1.5})}),zIndex:1/0})],n[o.default.MULTI_POINT]=n[o.default.POINT],n[o.default.GEOMETRY_COLLECTION]=n[o.default.POLYGON].concat(n[o.default.LINE_STRING],n[o.default.POINT]),n}function a(e){return e.getGeometry()}var c=u;exports.default=c; },{"./Circle.js":"cdf1","./Fill.js":"AFcg","../geom/GeometryType.js":"lmV0","./Stroke.js":"TXDt","../asserts.js":"fLG6"}],"pskK":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=n(require("./Layer.js")),e=require("../obj.js"),r=require("../style/Style.js");function n(t){return t&&t.__esModule?t:{default:t}}var i=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o={RENDER_ORDER:"renderOrder"},u=function(t){function n(r){var n=this,i=r||{},o=(0,e.assign)({},i);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,(n=t.call(this,o)||this).declutter_=void 0!==i.declutter&&i.declutter,n.renderBuffer_=void 0!==i.renderBuffer?i.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(i.style),n.updateWhileAnimating_=void 0!==i.updateWhileAnimating&&i.updateWhileAnimating,n.updateWhileInteracting_=void 0!==i.updateWhileInteracting&&i.updateWhileInteracting,n}return i(n,t),n.prototype.getDeclutter=function(){return this.declutter_},n.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},n.prototype.getRenderBuffer=function(){return this.renderBuffer_},n.prototype.getRenderOrder=function(){return this.get(o.RENDER_ORDER)},n.prototype.getStyle=function(){return this.style_},n.prototype.getStyleFunction=function(){return this.styleFunction_},n.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},n.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},n.prototype.setRenderOrder=function(t){this.set(o.RENDER_ORDER,t)},n.prototype.setStyle=function(t){this.style_=void 0!==t?t:r.createDefaultStyle,this.styleFunction_=null===t?void 0:(0,r.toFunction)(this.style_),this.changed()},n}(t.default),l=u;exports.default=l; },{"./Layer.js":"GCgv","../obj.js":"mH6q","../style/Style.js":"he4w"}],"kTJv":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.closePathInstruction=exports.beginPathInstruction=exports.strokeInstruction=exports.fillInstruction=void 0;var t={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},r=[t.FILL];exports.fillInstruction=r;var e=[t.STROKE];exports.strokeInstruction=e;var o=[t.BEGIN_PATH];exports.beginPathInstruction=o;var s=[t.CLOSE_PATH];exports.closePathInstruction=s;var E=t;exports.default=E; },{}],"QBj4":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=l(require("./Instruction.js")),e=l(require("../../geom/GeometryType.js")),i=l(require("../../extent/Relationship.js")),n=l(require("../VectorContext.js")),r=require("../../colorlike.js"),o=require("../../extent.js"),s=require("../canvas.js"),a=require("../../array.js"),u=require("../../geom/flat/inflate.js");function l(t){return t&&t.__esModule?t:{default:t}}var h=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),d=function(n){function l(t,e,i,r){var o=n.call(this)||this;return o.tolerance=t,o.maxExtent=e,o.pixelRatio=r,o.maxLineWidth=0,o.resolution=i,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return h(l,n),l.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})},l.prototype.appendFlatCoordinates=function(t,e,n,r,s,a){var u=this.coordinates.length,l=this.getBufferedMaxExtent();a&&(e+=r);var h,d,c,f=t[e],p=t[e+1],y=this.tmpCoordinate_,v=!0;for(h=e+r;h<n;h+=r)y[0]=t[h],y[1]=t[h+1],(c=(0,o.coordinateRelationship)(l,y))!==d?(v&&(this.coordinates[u++]=f,this.coordinates[u++]=p),this.coordinates[u++]=y[0],this.coordinates[u++]=y[1],v=!1):c===i.default.INTERSECTING?(this.coordinates[u++]=y[0],this.coordinates[u++]=y[1],v=!1):v=!0,f=y[0],p=y[1],d=c;return(s&&v||h===e+r)&&(this.coordinates[u++]=f,this.coordinates[u++]=p),u},l.prototype.drawCustomCoordinates_=function(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){var a=i[o],u=this.appendFlatCoordinates(t,e,a,n,!1,!1);r.push(u),e=a}return e},l.prototype.drawCustom=function(i,n,r){this.beginGeometry(i,n);var o,s,a,l,h,d=i.getType(),c=i.getStride(),f=this.coordinates.length;if(d==e.default.MULTI_POLYGON){o=i.getOrientedFlatCoordinates(),l=[];var p=i.getEndss();h=0;for(var y=0,v=p.length;y<v;++y){var _=[];h=this.drawCustomCoordinates_(o,h,p[y],c,_),l.push(_)}this.instructions.push([t.default.CUSTOM,f,l,i,r,u.inflateMultiCoordinatesArray])}else d==e.default.POLYGON||d==e.default.MULTI_LINE_STRING?(a=[],o=d==e.default.POLYGON?i.getOrientedFlatCoordinates():i.getFlatCoordinates(),h=this.drawCustomCoordinates_(o,0,i.getEnds(),c,a),this.instructions.push([t.default.CUSTOM,f,a,i,r,u.inflateCoordinatesArray])):d==e.default.LINE_STRING||d==e.default.MULTI_POINT?(o=i.getFlatCoordinates(),s=this.appendFlatCoordinates(o,0,o.length,c,!1,!1),this.instructions.push([t.default.CUSTOM,f,s,i,r,u.inflateCoordinates])):d==e.default.POINT&&(o=i.getFlatCoordinates(),this.coordinates.push(o[0],o[1]),s=this.coordinates.length,this.instructions.push([t.default.CUSTOM,f,s,i,r]));this.endGeometry(n)},l.prototype.beginGeometry=function(e,i){var n=e.getExtent();this.beginGeometryInstruction1_=[t.default.BEGIN_GEOMETRY,i,0,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[t.default.BEGIN_GEOMETRY,i,0,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},l.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},l.prototype.reverseHitDetectionInstructions=function(){var e,i=this.hitDetectionInstructions;i.reverse();var n,r,o=i.length,s=-1;for(e=0;e<o;++e)(r=(n=i[e])[0])==t.default.END_GEOMETRY?s=e:r==t.default.BEGIN_GEOMETRY&&(n[2]=e,(0,a.reverseSubArray)(this.hitDetectionInstructions,s,e),s=-1)},l.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var n=t.getColor();i.fillStyle=(0,r.asColorLike)(n||s.defaultFillStyle)}else i.fillStyle=void 0;if(e){var o=e.getColor();i.strokeStyle=(0,r.asColorLike)(o||s.defaultStrokeStyle);var a=e.getLineCap();i.lineCap=void 0!==a?a:s.defaultLineCap;var u=e.getLineDash();i.lineDash=u?u.slice():s.defaultLineDash;var l=e.getLineDashOffset();i.lineDashOffset=l||s.defaultLineDashOffset;var h=e.getLineJoin();i.lineJoin=void 0!==h?h:s.defaultLineJoin;var d=e.getWidth();i.lineWidth=void 0!==d?d:s.defaultLineWidth;var c=e.getMiterLimit();i.miterLimit=void 0!==c?c:s.defaultMiterLimit,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},l.prototype.createFill=function(e){var i=e.fillStyle,n=[t.default.SET_FILL_STYLE,i];return"string"!=typeof i&&n.push(!0),n},l.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},l.prototype.createStroke=function(e){return[t.default.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,this.applyPixelRatio(e.lineDash),e.lineDashOffset*this.pixelRatio]},l.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},l.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,r=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,u=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||r!=t.currentLineDash&&!(0,a.equals)(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=u||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=u,t.currentMiterLimit=l)},l.prototype.endGeometry=function(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[t.default.END_GEOMETRY,e];this.instructions.push(i),this.hitDetectionInstructions.push(i)},l.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=(0,o.clone)(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;(0,o.buffer)(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},l}(n.default),c=d;exports.default=c; },{"./Instruction.js":"kTJv","../../geom/GeometryType.js":"lmV0","../../extent/Relationship.js":"bUAS","../VectorContext.js":"LQER","../../colorlike.js":"V5XN","../../extent.js":"QDir","../canvas.js":"iAG7","../../array.js":"luEr","../../geom/flat/inflate.js":"znXl"}],"JWDt":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("./Builder.js")),i=e(require("./Instruction.js"));function e(t){return t&&t.__esModule?t:{default:t}}var o=function(){var t=function(i,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])})(i,e)};return function(i,e){function o(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),h=function(t){function e(i,e,o,h){var s=t.call(this,i,e,o,h)||this;return s.declutterGroups_=null,s.hitDetectionImage_=null,s.image_=null,s.imagePixelRatio_=void 0,s.anchorX_=void 0,s.anchorY_=void 0,s.height_=void 0,s.opacity_=void 0,s.originX_=void 0,s.originY_=void 0,s.rotateWithView_=void 0,s.rotation_=void 0,s.scale_=void 0,s.width_=void 0,s}return o(e,t),e.prototype.drawCoordinates_=function(t,i,e,o){return this.appendFlatCoordinates(t,i,e,o,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var o=t.getFlatCoordinates(),h=t.getStride(),s=this.coordinates.length,a=this.drawCoordinates_(o,0,o.length,h);this.instructions.push([i.default.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([i.default.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var o=t.getFlatCoordinates(),h=t.getStride(),s=this.coordinates.length,a=this.drawCoordinates_(o,0,o.length,h);this.instructions.push([i.default.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,this.declutterGroups_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_)]),this.hitDetectionInstructions.push([i.default.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,i){var e=t.getAnchor(),o=t.getSize(),h=t.getHitDetectionImage(),s=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=e[0],this.anchorY_=e[1],this.declutterGroups_=i,this.hitDetectionImage_=h,this.image_=s,this.height_=o[1],this.opacity_=t.getOpacity(),this.originX_=a[0],this.originY_=a[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=o[0]},e}(t.default),s=h;exports.default=s; },{"./Builder.js":"QBj4","./Instruction.js":"kTJv"}],"ppsk":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("./Builder.js")),e=n(require("./Instruction.js"));function i(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return i=function(){return t},t}function n(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=i();if(e&&e.has(t))return e.get(t);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=r?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,e&&e.set(t,n),n}function r(t){return t&&t.__esModule?t:{default:t}}var o=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),s=function(t){function i(e,i,n,r){return t.call(this,e,i,n,r)||this}return o(i,t),i.prototype.drawFlatCoordinates_=function(t,i,n,r){var o=this.coordinates.length,s=this.appendFlatCoordinates(t,i,n,r,!1,!1),u=[e.default.MOVE_TO_LINE_TO,o,s];return this.instructions.push(u),this.hitDetectionInstructions.push(u),n},i.prototype.drawLineString=function(t,i){var n=this.state,r=n.strokeStyle,o=n.lineWidth;if(void 0!==r&&void 0!==o){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([e.default.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],e.beginPathInstruction);var s=t.getFlatCoordinates(),u=t.getStride();this.drawFlatCoordinates_(s,0,s.length,u),this.hitDetectionInstructions.push(e.strokeInstruction),this.endGeometry(i)}},i.prototype.drawMultiLineString=function(t,i){var n=this.state,r=n.strokeStyle,o=n.lineWidth;if(void 0!==r&&void 0!==o){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([e.default.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],e.beginPathInstruction);for(var s=t.getEnds(),u=t.getFlatCoordinates(),a=t.getStride(),l=0,h=0,c=s.length;h<c;++h)l=this.drawFlatCoordinates_(u,l,s[h],a);this.hitDetectionInstructions.push(e.strokeInstruction),this.endGeometry(i)}},i.prototype.finish=function(){var i=this.state;return null!=i.lastStroke&&i.lastStroke!=this.coordinates.length&&this.instructions.push(e.strokeInstruction),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},i.prototype.applyStroke=function(i){null!=i.lastStroke&&i.lastStroke!=this.coordinates.length&&(this.instructions.push(e.strokeInstruction),i.lastStroke=this.coordinates.length),i.lastStroke=0,t.prototype.applyStroke.call(this,i),this.instructions.push(e.beginPathInstruction)},i}(t.default),u=s;exports.default=u; },{"./Builder.js":"QBj4","./Instruction.js":"kTJv"}],"e19k":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("./Builder.js")),e=o(require("./Instruction.js")),i=require("../canvas.js"),s=require("../../geom/flat/simplify.js");function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function o(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var r=s?Object.getOwnPropertyDescriptor(t,o):null;r&&(r.get||r.set)?Object.defineProperty(i,o,r):i[o]=t[o]}return i.default=t,e&&e.set(t,i),i}function r(t){return t&&t.__esModule?t:{default:t}}var l=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),u=function(t){function n(e,i,s,n){return t.call(this,e,i,s,n)||this}return l(n,t),n.prototype.drawFlatCoordinatess_=function(t,i,s,n){var o=this.state,r=void 0!==o.fillStyle,l=void 0!==o.strokeStyle,u=s.length;this.instructions.push(e.beginPathInstruction),this.hitDetectionInstructions.push(e.beginPathInstruction);for(var h=0;h<u;++h){var a=s[h],c=this.coordinates.length,f=this.appendFlatCoordinates(t,i,a,n,!0,!l),d=[e.default.MOVE_TO_LINE_TO,c,f];this.instructions.push(d),this.hitDetectionInstructions.push(d),l&&(this.instructions.push(e.closePathInstruction),this.hitDetectionInstructions.push(e.closePathInstruction)),i=a}return r&&(this.instructions.push(e.fillInstruction),this.hitDetectionInstructions.push(e.fillInstruction)),l&&(this.instructions.push(e.strokeInstruction),this.hitDetectionInstructions.push(e.strokeInstruction)),i},n.prototype.drawCircle=function(t,s){var n=this.state,o=n.fillStyle,r=n.strokeStyle;if(void 0!==o||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,s),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([e.default.SET_FILL_STYLE,i.defaultFillStyle]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([e.default.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var l=t.getFlatCoordinates(),u=t.getStride(),h=this.coordinates.length;this.appendFlatCoordinates(l,0,l.length,u,!1,!1);var a=[e.default.CIRCLE,h];this.instructions.push(e.beginPathInstruction,a),this.hitDetectionInstructions.push(e.beginPathInstruction,a),void 0!==n.fillStyle&&(this.instructions.push(e.fillInstruction),this.hitDetectionInstructions.push(e.fillInstruction)),void 0!==n.strokeStyle&&(this.instructions.push(e.strokeInstruction),this.hitDetectionInstructions.push(e.strokeInstruction)),this.endGeometry(s)}},n.prototype.drawPolygon=function(t,s){var n=this.state,o=n.fillStyle,r=n.strokeStyle;if(void 0!==o||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,s),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([e.default.SET_FILL_STYLE,i.defaultFillStyle]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([e.default.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var l=t.getEnds(),u=t.getOrientedFlatCoordinates(),h=t.getStride();this.drawFlatCoordinatess_(u,0,l,h),this.endGeometry(s)}},n.prototype.drawMultiPolygon=function(t,s){var n=this.state,o=n.fillStyle,r=n.strokeStyle;if(void 0!==o||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,s),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([e.default.SET_FILL_STYLE,i.defaultFillStyle]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([e.default.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);for(var l=t.getEndss(),u=t.getOrientedFlatCoordinates(),h=t.getStride(),a=0,c=0,f=l.length;c<f;++c)a=this.drawFlatCoordinatess_(u,a,l[c],h);this.endGeometry(s)}},n.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,n=0,o=i.length;n<o;++n)i[n]=(0,s.snap)(i[n],e);return t.prototype.finish.call(this)},n.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},n}(t.default),h=u;exports.default=h; },{"./Builder.js":"QBj4","./Instruction.js":"kTJv","../canvas.js":"iAG7","../../geom/flat/simplify.js":"IEpt"}],"AXKs":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={POINT:"point",LINE:"line"};exports.default=e; },{}],"hCfl":[function(require,module,exports) { "use strict";function t(t,e,r,o,a){var s,i,n,u,c,v,d,h,f,p=r,M=r,l=0,x=0,_=r;for(s=r;s<o;s+=a){var b=e[s],g=e[s+1];void 0!==u&&(h=b-u,f=g-c,n=Math.sqrt(h*h+f*f),void 0!==v&&(x+=i,Math.acos((v*h+d*f)/(i*n))>t&&(x>l&&(l=x,p=_,M=s),x=0,_=s-a)),i=n,v=h,d=f),u=b,c=g}return(x+=n)>l?[_,s]:[p,M]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.matchingChunk=t; },{}],"DEzw":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.TEXT_ALIGN=void 0;var t=h(require("./Builder.js")),e=h(require("./Instruction.js")),i=h(require("../../geom/GeometryType.js")),s=h(require("../../style/TextPlacement.js")),l=require("../../colorlike.js"),a=require("../canvas.js"),r=require("../../util.js"),o=require("../../extent.js"),n=require("../../geom/flat/straightchunk.js");function h(t){return t&&t.__esModule?t:{default:t}}var f=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),u={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};exports.TEXT_ALIGN=u;var d=function(t){function h(e,i,s,l){var a=t.call(this,e,i,s,l)||this;return a.declutterGroups_,a.labels_=null,a.text_="",a.textOffsetX_=0,a.textOffsetY_=0,a.textRotateWithView_=void 0,a.textRotation_=0,a.textFillState_=null,a.fillStates={},a.textStrokeState_=null,a.strokeStates={},a.textState_={},a.textStates={},a.textKey_="",a.fillKey_="",a.strokeKey_="",a}return f(h,t),h.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},h.prototype.drawText=function(t,l){var r=this.textFillState_,h=this.textStrokeState_,f=this.textState_;if(""!==this.text_&&f&&(r||h)){var u,d,g=this.coordinates.length,_=t.getType(),c=null,x=2,S=t.getStride();if(f.placement===s.default.LINE){if(!(0,o.intersects)(this.getBufferedMaxExtent(),t.getExtent()))return;var p=void 0;if(c=t.getFlatCoordinates(),_==i.default.LINE_STRING)p=[c.length];else if(_==i.default.MULTI_LINE_STRING)p=t.getEnds();else if(_==i.default.POLYGON)p=t.getEnds().slice(0,1);else if(_==i.default.MULTI_POLYGON){var k=t.getEndss();for(p=[],u=0,d=k.length;u<d;++u)p.push(k[u][0])}this.beginGeometry(t,l);for(var y=f.textAlign,v=0,L=void 0,N=0,O=p.length;N<O;++N){if(null==y){var m=(0,n.matchingChunk)(f.maxAngle,c,v,p[N],S);v=m[0],L=m[1]}else L=p[N];for(u=v;u<L;u+=S)this.coordinates.push(c[u],c[u+1]);x=this.coordinates.length,v=p[N];var F=this.declutterGroups_?0===N?this.declutterGroups_[0]:[].concat(this.declutterGroups_[0]):null;this.drawChars_(g,x,F),g=x}this.endGeometry(l)}else{var T=null;switch(f.overflow||(T=[]),_){case i.default.POINT:case i.default.MULTI_POINT:x=(c=t.getFlatCoordinates()).length;break;case i.default.LINE_STRING:c=t.getFlatMidpoint();break;case i.default.CIRCLE:c=t.getCenter();break;case i.default.MULTI_LINE_STRING:S=2,x=(c=t.getFlatMidpoints()).length;break;case i.default.POLYGON:c=t.getFlatInteriorPoint(),f.overflow||T.push(c[2]/this.resolution),S=3;break;case i.default.MULTI_POLYGON:var I=t.getFlatInteriorPoints();for(c=[],u=0,d=I.length;u<d;u+=3)f.overflow||T.push(I[u+2]/this.resolution),c.push(I[u],I[u+1]);if(S=2,0==(x=c.length))return}x=this.appendFlatCoordinates(c,0,x,S,!1,!1),this.saveTextStates_(),(f.backgroundFill||f.backgroundStroke)&&(this.setFillStrokeStyle(f.backgroundFill,f.backgroundStroke),f.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),f.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,l);var b=f.padding;if(b!=a.defaultPadding&&(f.scale[0]<0||f.scale[1]<0)){var A=f.padding[0],G=f.padding[1],R=f.padding[2],C=f.padding[3];f.scale[0]<0&&(G=-G,C=-C),f.scale[1]<0&&(A=-A,R=-R),b=[A,G,R,C]}var D=this.pixelRatio;this.instructions.push([e.default.DRAW_IMAGE,g,x,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,b==a.defaultPadding?a.defaultPadding:b.map(function(t){return t*D}),!!f.backgroundFill,!!f.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,T]);var w=1/D;this.hitDetectionInstructions.push([e.default.DRAW_IMAGE,g,x,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[w,w],NaN,b,!!f.backgroundFill,!!f.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,T]),this.endGeometry(l)}}},h.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,s=this.strokeKey_;t&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var l=this.textKey_;l in this.textStates||(this.textStates[l]={font:e.font,textAlign:e.textAlign||a.defaultTextAlign,textBaseline:e.textBaseline||a.defaultTextBaseline,scale:e.scale});var r=this.fillKey_;i&&(r in this.fillStates||(this.fillStates[r]={fillStyle:i.fillStyle}))},h.prototype.drawChars_=function(t,i,s){var l=this.textStrokeState_,a=this.textState_,r=this.strokeKey_,o=this.textKey_,n=this.fillKey_;this.saveTextStates_();var h=this.pixelRatio,f=u[a.textBaseline],d=this.textOffsetY_*h,g=this.text_,_=l?l.lineWidth*Math.abs(a.scale[0])/2:0;this.instructions.push([e.default.DRAW_CHARS,t,i,f,s,a.overflow,n,a.maxAngle,h,d,r,_*h,g,o,1]),this.hitDetectionInstructions.push([e.default.DRAW_CHARS,t,i,f,s,a.overflow,n,a.maxAngle,1,d,r,_,g,o,1/h])},h.prototype.setTextStyle=function(t,e){var i,s,o;if(t){this.declutterGroups_=e;var n=t.getFill();n?((s=this.textFillState_)||(s={},this.textFillState_=s),s.fillStyle=(0,l.asColorLike)(n.getColor()||a.defaultFillStyle)):(s=null,this.textFillState_=s);var h=t.getStroke();if(h){(o=this.textStrokeState_)||(o={},this.textStrokeState_=o);var f=h.getLineDash(),u=h.getLineDashOffset(),d=h.getWidth(),g=h.getMiterLimit();o.lineCap=h.getLineCap()||a.defaultLineCap,o.lineDash=f?f.slice():a.defaultLineDash,o.lineDashOffset=void 0===u?a.defaultLineDashOffset:u,o.lineJoin=h.getLineJoin()||a.defaultLineJoin,o.lineWidth=void 0===d?a.defaultLineWidth:d,o.miterLimit=void 0===g?a.defaultMiterLimit:g,o.strokeStyle=(0,l.asColorLike)(h.getColor()||a.defaultStrokeStyle)}else o=null,this.textStrokeState_=o;i=this.textState_;var _=t.getFont()||a.defaultFont;(0,a.registerFont)(_);var c=t.getScaleArray();i.overflow=t.getOverflow(),i.font=_,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||a.defaultTextBaseline,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||a.defaultPadding,i.scale=void 0===c?[1,1]:c;var x=t.getOffsetX(),S=t.getOffsetY(),p=t.getRotateWithView(),k=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===x?0:x,this.textOffsetY_=void 0===S?0:S,this.textRotateWithView_=void 0!==p&&p,this.textRotation_=void 0===k?0:k,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:(0,r.getUid)(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=s?"string"==typeof s.fillStyle?s.fillStyle:"|"+(0,r.getUid)(s.fillStyle):""}else this.text_=""},h}(t.default),g=d;exports.default=g; },{"./Builder.js":"QBj4","./Instruction.js":"kTJv","../../geom/GeometryType.js":"lmV0","../../style/TextPlacement.js":"AXKs","../../colorlike.js":"V5XN","../canvas.js":"iAG7","../../util.js":"KniQ","../../extent.js":"QDir","../../geom/flat/straightchunk.js":"hCfl"}],"vqHd":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=l(require("./Builder.js")),t=l(require("./ImageBuilder.js")),r=l(require("./LineStringBuilder.js")),i=l(require("./PolygonBuilder.js")),u=l(require("./TextBuilder.js"));function l(e){return e&&e.__esModule?e:{default:e}}var n={Circle:i.default,Default:e.default,Image:t.default,LineString:r.default,Polygon:i.default,Text:u.default},s=function(){function e(e,t,r,i,u){this.declutter_=u,this.declutterGroups_=null,this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=i,this.resolution_=r,this.buildersByZIndex_={}}return e.prototype.addDeclutter=function(e){var t=null;return this.declutter_&&(e?(t=this.declutterGroups_)[0][0]++:(t=[[1]],this.declutterGroups_=t)),t},e.prototype.finish=function(){var e={};for(var t in this.buildersByZIndex_){e[t]=e[t]||{};var r=this.buildersByZIndex_[t];for(var i in r){var u=r[i].finish();e[t][i]=u}}return e},e.prototype.getBuilder=function(e,t){var r=void 0!==e?e.toString():"0",i=this.buildersByZIndex_[r];void 0===i&&(i={},this.buildersByZIndex_[r]=i);var u=i[t];void 0===u&&(u=new(0,n[t])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[t]=u);return u},e}(),o=s;exports.default=o; },{"./Builder.js":"QBj4","./ImageBuilder.js":"JWDt","./LineStringBuilder.js":"ppsk","./PolygonBuilder.js":"e19k","./TextBuilder.js":"DEzw"}],"fpOz":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("../events/EventType.js")),t=a(require("../ImageState.js")),r=a(require("../Observable.js")),n=a(require("../source/State.js")),o=require("../util.js");function a(e){return e&&e.__esModule?e:{default:e}}var u=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=function(r){function a(e){var t=r.call(this)||this;return t.boundHandleImageChange_=t.handleImageChange_.bind(t),t.layer_=e,t}return u(a,r),a.prototype.getFeatures=function(e){return(0,o.abstract)()},a.prototype.prepareFrame=function(e){return(0,o.abstract)()},a.prototype.renderFrame=function(e,t){return(0,o.abstract)()},a.prototype.loadedTileCallback=function(e,t,r){e[t]||(e[t]={}),e[t][r.tileCoord.toString()]=r},a.prototype.createLoadedTileFinder=function(e,t,r){return function(n,o){var a=this.loadedTileCallback.bind(this,r,n);return e.forEachLoadedTile(t,n,o,a)}.bind(this)},a.prototype.forEachFeatureAtCoordinate=function(e,t,r,n,o){},a.prototype.getDataAtPixel=function(e,t,r){return(0,o.abstract)()},a.prototype.getLayer=function(){return this.layer_},a.prototype.handleFontsChanged=function(){},a.prototype.handleImageChange_=function(e){e.target.getState()===t.default.LOADED&&this.renderIfReadyAndVisible()},a.prototype.loadImage=function(r){var n=r.getState();return n!=t.default.LOADED&&n!=t.default.ERROR&&r.addEventListener(e.default.CHANGE,this.boundHandleImageChange_),n==t.default.IDLE&&(r.load(),n=r.getState()),n==t.default.LOADED},a.prototype.renderIfReadyAndVisible=function(){var e=this.getLayer();e.getVisible()&&e.getSourceState()==n.default.READY&&e.changed()},a}(r.default),d=i;exports.default=d; },{"../events/EventType.js":"C8cu","../ImageState.js":"u3kG","../Observable.js":"IdSm","../source/State.js":"iC8j","../util.js":"KniQ"}],"vPfl":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=s(require("../Layer.js")),e=s(require("../../render/Event.js")),r=s(require("../../render/EventType.js")),n=require("../../transform.js"),o=require("../../dom.js"),a=require("../../extent.js"),i=require("../../render/canvas.js");function s(t){return t&&t.__esModule?t:{default:t}}var l=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),p=function(t){function s(e){var r=t.call(this,e)||this;return r.container=null,r.renderedResolution,r.tempTransform=(0,n.create)(),r.pixelTransform=(0,n.create)(),r.inversePixelTransform=(0,n.create)(),r.context=null,r.containerReused=!1,r}return l(s,t),s.prototype.useContainer=function(t,e,r){var n,a,i=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===i&&((l=t.firstElementChild)instanceof HTMLCanvasElement&&(a=l.getContext("2d")));if(!a||0!==a.canvas.width&&a.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=a,this.containerReused=!0),!this.container){(n=document.createElement("div")).className=i;var s=n.style;s.position="absolute",s.width="100%",s.height="100%";var l=(a=(0,o.createCanvasContext2D)()).canvas;n.appendChild(l),(s=l.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=n,this.context=a}},s.prototype.clip=function(t,e,r){var o=e.pixelRatio,s=e.size[0]*o/2,l=e.size[1]*o/2,p=e.viewState.rotation,c=(0,a.getTopLeft)(r),u=(0,a.getTopRight)(r),d=(0,a.getBottomRight)(r),f=(0,a.getBottomLeft)(r);(0,n.apply)(e.coordinateToPixelTransform,c),(0,n.apply)(e.coordinateToPixelTransform,u),(0,n.apply)(e.coordinateToPixelTransform,d),(0,n.apply)(e.coordinateToPixelTransform,f),t.save(),(0,i.rotateAtOffset)(t,-p,s,l),t.beginPath(),t.moveTo(c[0]*o,c[1]*o),t.lineTo(u[0]*o,u[1]*o),t.lineTo(d[0]*o,d[1]*o),t.lineTo(f[0]*o,f[1]*o),t.clip(),(0,i.rotateAtOffset)(t,p,s,l)},s.prototype.clipUnrotated=function(t,e,r){var o=(0,a.getTopLeft)(r),i=(0,a.getTopRight)(r),s=(0,a.getBottomRight)(r),l=(0,a.getBottomLeft)(r);(0,n.apply)(e.coordinateToPixelTransform,o),(0,n.apply)(e.coordinateToPixelTransform,i),(0,n.apply)(e.coordinateToPixelTransform,s),(0,n.apply)(e.coordinateToPixelTransform,l);var p=this.inversePixelTransform;(0,n.apply)(p,o),(0,n.apply)(p,i),(0,n.apply)(p,s),(0,n.apply)(p,l),t.save(),t.beginPath(),t.moveTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(l[0]),Math.round(l[1])),t.clip()},s.prototype.dispatchRenderEvent_=function(t,r,n){var o=this.getLayer();if(o.hasListener(t)){var a=new e.default(t,this.inversePixelTransform,n,r);o.dispatchEvent(a)}},s.prototype.preRender=function(t,e){this.dispatchRenderEvent_(r.default.PRERENDER,t,e)},s.prototype.postRender=function(t,e){this.dispatchRenderEvent_(r.default.POSTRENDER,t,e)},s.prototype.getRenderTransform=function(t,e,r,o,a,i,s){var l=a/2,p=i/2,c=o/e,u=-c,d=-t[0]+s,f=-t[1];return(0,n.compose)(this.tempTransform,l,p,c,u,-r,d,f)},s.prototype.getDataAtPixel=function(t,e,r){var o,a=(0,n.apply)(this.inversePixelTransform,t.slice()),i=this.context;try{var s=Math.round(a[0]),l=Math.round(a[1]),p=document.createElement("canvas"),c=p.getContext("2d");p.width=1,p.height=1,c.clearRect(0,0,1,1),c.drawImage(i.canvas,s,l,1,1,0,0,1,1),o=c.getImageData(0,0,1,1).data}catch(u){return"SecurityError"===u.name?new Uint8Array:o}return 0===o[3]?null:o},s}(t.default),c=p;exports.default=c; },{"../Layer.js":"fpOz","../../render/Event.js":"EB6P","../../render/EventType.js":"z39m","../../transform.js":"P4eA","../../dom.js":"Xno5","../../extent.js":"QDir","../../render/canvas.js":"iAG7"}],"C6Up":[function(require,module,exports) { var define; var global = arguments[3]; var t,i=arguments[3];!function(i,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof t&&t.amd?t(n):(i=i||self).RBush=n()}(this,function(){"use strict";function t(t,r,e,a,h){!function t(n,r,e,a,h){for(;a>e;){if(a-e>600){var o=a-e+1,s=r-e+1,l=Math.log(o),f=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*f*(o-f)/o)*(s-o/2<0?-1:1),m=Math.max(e,Math.floor(r-s*f/o+u)),c=Math.min(a,Math.floor(r+(o-s)*f/o+u));t(n,r,m,c,h)}var p=n[r],d=e,x=a;for(i(n,e,r),h(n[a],p)>0&&i(n,e,a);d<x;){for(i(n,d,x),d++,x--;h(n[d],p)<0;)d++;for(;h(n[x],p)>0;)x--}0===h(n[e],p)?i(n,e,x):i(n,++x,a),x<=r&&(e=x+1),r<=x&&(a=x-1)}}(t,r,e||0,a||t.length-1,h||n)}function i(t,i,n){var r=t[i];t[i]=t[n],t[n]=r}function n(t,i){return t<i?-1:t>i?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(t,i,n){if(!n)return i.indexOf(t);for(var r=0;r<i.length;r++)if(n(t,i[r]))return r;return-1}function a(t,i){h(t,0,t.children.length,i,t)}function h(t,i,n,r,e){e||(e=p(null)),e.minX=1/0,e.minY=1/0,e.maxX=-1/0,e.maxY=-1/0;for(var a=i;a<n;a++){var h=t.children[a];o(e,t.leaf?r(h):h)}return e}function o(t,i){return t.minX=Math.min(t.minX,i.minX),t.minY=Math.min(t.minY,i.minY),t.maxX=Math.max(t.maxX,i.maxX),t.maxY=Math.max(t.maxY,i.maxY),t}function s(t,i){return t.minX-i.minX}function l(t,i){return t.minY-i.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function u(t){return t.maxX-t.minX+(t.maxY-t.minY)}function m(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function c(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(i,n,r,e,a){for(var h=[n,r];h.length;)if(!((r=h.pop())-(n=h.pop())<=e)){var o=n+Math.ceil((r-n)/e/2)*e;t(i,o,n,r,a),h.push(n,o,o,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var i=this.data,n=[];if(!c(t,i))return n;for(var r=this.toBBox,e=[];i;){for(var a=0;a<i.children.length;a++){var h=i.children[a],o=i.leaf?r(h):h;c(t,o)&&(i.leaf?n.push(h):m(t,o)?this._all(h,n):e.push(h))}i=e.pop()}return n},r.prototype.collides=function(t){var i=this.data;if(!c(t,i))return!1;for(var n=[];i;){for(var r=0;r<i.children.length;r++){var e=i.children[r],a=i.leaf?this.toBBox(e):e;if(c(t,a)){if(i.leaf||m(t,a))return!0;n.push(e)}}i=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var i=0;i<t.length;i++)this.insert(t[i]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=p([]),this},r.prototype.remove=function(t,i){if(!t)return this;for(var n,r,a,h=this.data,o=this.toBBox(t),s=[],l=[];h||s.length;){if(h||(h=s.pop(),r=s[s.length-1],n=l.pop(),a=!0),h.leaf){var f=e(t,h.children,i);if(-1!==f)return h.children.splice(f,1),s.push(h),this._condense(s),this}a||h.leaf||!m(h,o)?r?(n++,h=r.children[n],a=!1):h=null:(s.push(h),l.push(n),n=0,r=h,h=h.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,i){return t.minX-i.minX},r.prototype.compareMinY=function(t,i){return t.minY-i.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,i){for(var n=[];t;)t.leaf?i.push.apply(i,t.children):n.push.apply(n,t.children),t=n.pop();return i},r.prototype._build=function(t,i,n,r){var e,h=n-i+1,o=this._maxEntries;if(h<=o)return a(e=p(t.slice(i,n+1)),this.toBBox),e;r||(r=Math.ceil(Math.log(h)/Math.log(o)),o=Math.ceil(h/Math.pow(o,r-1))),(e=p([])).leaf=!1,e.height=r;var s=Math.ceil(h/o),l=s*Math.ceil(Math.sqrt(o));d(t,i,n,l,this.compareMinX);for(var f=i;f<=n;f+=l){var u=Math.min(f+l-1,n);d(t,f,u,s,this.compareMinY);for(var m=f;m<=u;m+=s){var c=Math.min(m+s-1,u);e.children.push(this._build(t,m,c,r-1))}}return a(e,this.toBBox),e},r.prototype._chooseSubtree=function(t,i,n,r){for(;r.push(i),!i.leaf&&r.length-1!==n;){for(var e=1/0,a=1/0,h=void 0,o=0;o<i.children.length;o++){var s=i.children[o],l=f(s),u=(m=t,c=s,(Math.max(c.maxX,m.maxX)-Math.min(c.minX,m.minX))*(Math.max(c.maxY,m.maxY)-Math.min(c.minY,m.minY))-l);u<a?(a=u,e=l<e?l:e,h=s):u===a&&l<e&&(e=l,h=s)}i=h||i.children[0]}var m,c;return i},r.prototype._insert=function(t,i,n){var r=n?t:this.toBBox(t),e=[],a=this._chooseSubtree(r,this.data,i,e);for(a.children.push(t),o(a,r);i>=0&&e[i].children.length>this._maxEntries;)this._split(e,i),i--;this._adjustParentBBoxes(r,e,i)},r.prototype._split=function(t,i){var n=t[i],r=n.children.length,e=this._minEntries;this._chooseSplitAxis(n,e,r);var h=this._chooseSplitIndex(n,e,r),o=p(n.children.splice(h,n.children.length-h));o.height=n.height,o.leaf=n.leaf,a(n,this.toBBox),a(o,this.toBBox),i?t[i-1].children.push(o):this._splitRoot(n,o)},r.prototype._splitRoot=function(t,i){this.data=p([t,i]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,i,n){for(var r,e,a,o,s,l,u,m=1/0,c=1/0,p=i;p<=n-i;p++){var d=h(t,0,p,this.toBBox),x=h(t,p,n,this.toBBox),v=(e=d,a=x,o=void 0,s=void 0,l=void 0,u=void 0,o=Math.max(e.minX,a.minX),s=Math.max(e.minY,a.minY),l=Math.min(e.maxX,a.maxX),u=Math.min(e.maxY,a.maxY),Math.max(0,l-o)*Math.max(0,u-s)),M=f(d)+f(x);v<m?(m=v,r=p,c=M<c?M:c):v===m&&M<c&&(c=M,r=p)}return r||n-i},r.prototype._chooseSplitAxis=function(t,i,n){var r=t.leaf?this.compareMinX:s,e=t.leaf?this.compareMinY:l;this._allDistMargin(t,i,n,r)<this._allDistMargin(t,i,n,e)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,i,n,r){t.children.sort(r);for(var e=this.toBBox,a=h(t,0,i,e),s=h(t,n-i,n,e),l=u(a)+u(s),f=i;f<n-i;f++){var m=t.children[f];o(a,t.leaf?e(m):m),l+=u(a)}for(var c=n-i-1;c>=i;c--){var p=t.children[c];o(s,t.leaf?e(p):p),l+=u(s)}return l},r.prototype._adjustParentBBoxes=function(t,i,n){for(var r=n;r>=0;r--)o(i[r],t)},r.prototype._condense=function(t){for(var i=t.length-1,n=void 0;i>=0;i--)0===t[i].children.length?i>0?(n=t[i-1].children).splice(n.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},r}); },{}],"JxN9":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.drawTextOnPath=r;var t=require("../../math.js"),a=require("./transform.js");function r(r,e,h,M,o,s,n,v,i,l,p,u){var f,P=[];if(u){var I=(0,a.rotate)(r,e,h,M,u,[r[e],r[e+1]]);f=I[0]>I[I.length-M]}else f=r[e]>r[h-M];for(var w,d,q=o.length,c=r[e],j=r[e+1],x=r[e+=M],b=r[e+1],g=0,m=Math.sqrt(Math.pow(x-c,2)+Math.pow(b-j,2)),O=!1,_=0;_<q;++_){for(var y=o[w=f?q-_-1:_],T=v*i(l,y,p),k=s+T/2;e<h-M&&g+m<k;)c=x,j=b,x=r[e+=M],b=r[e+1],g+=m,m=Math.sqrt(Math.pow(x-c,2)+Math.pow(b-j,2));var z=k-g,A=Math.atan2(b-j,x-c);if(f&&(A+=A>0?-Math.PI:Math.PI),void 0!==d){var B=A-d;if(O=O||0!==B,B+=B>Math.PI?-2*Math.PI:B<-Math.PI?2*Math.PI:0,Math.abs(B)>n)return null}d=A;var C=z/m,D=(0,t.lerp)(c,x,C),E=(0,t.lerp)(j,b,C);P[w]=[D,E,T/2,A,y],s+=T}return O?P:[[P[0][0],P[0][1],P[0][2],P[0][3],o]]} },{"../../math.js":"B96G","./transform.js":"LGwr"}],"pZKE":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=d(require("./Instruction.js")),e=d(require("rbush/rbush.js")),i=require("./TextBuilder.js"),a=require("../../has.js"),s=require("../../transform.js"),r=require("../../extent.js"),l=require("../canvas.js"),n=require("../../geom/flat/textpath.js"),h=require("../../array.js"),o=require("../../geom/flat/length.js"),u=require("../../geom/flat/transform.js");function d(t){return t&&t.__esModule?t:{default:t}}var f=(0,r.createEmpty)(),c=(0,s.create)(),p=[],v=[],_=[],g=[],x=function(){function d(t,e,i,a,r){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.declutterItems=[],this.instructions=a.instructions,this.coordinates=a.coordinates,this.coordinateCache_={},this.renderBuffer_=r,this.renderedTransform_=(0,s.create)(),this.hitDetectionInstructions=a.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=a.fillStates||{},this.strokeStates=a.strokeStates||{},this.textStates=a.textStates||{},this.widths_={},this.labels_={}}return d.prototype.createLabel=function(t,e,s,r){var n=t+e+s+r;if(this.labels_[n])return this.labels_[n];var h=r?this.strokeStates[r]:null,o=s?this.fillStates[s]:null,u=this.textStates[e],d=this.pixelRatio,f=[u.scale[0]*d,u.scale[1]*d],c=i.TEXT_ALIGN[u.textAlign||l.defaultTextAlign],p=r&&h.lineWidth?h.lineWidth:0,v=t.split("\n"),_=v.length,g=[],x=(0,l.measureTextWidths)(u.font,v,g),m=(0,l.measureTextHeight)(u.font),T=x+p,y=[],b=(T+2)*f[0],S=(m*_+p)*f[1],k={width:b<0?Math.floor(b):Math.ceil(b),height:S<0?Math.floor(S):Math.ceil(S),contextInstructions:y};(1==f[0]&&1==f[1]||y.push("scale",f),y.push("font",u.font),r)&&(y.push("strokeStyle",h.strokeStyle),y.push("lineWidth",p),y.push("lineCap",h.lineCap),y.push("lineJoin",h.lineJoin),y.push("miterLimit",h.miterLimit),(a.WORKER_OFFSCREEN_CANVAS?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(y.push("setLineDash",[h.lineDash]),y.push("lineDashOffset",h.lineDashOffset)));s&&y.push("fillStyle",o.fillStyle),y.push("textBaseline","middle"),y.push("textAlign","center");var L,R=.5-c,I=c*T+R*p;if(r)for(L=0;L<_;++L)y.push("strokeText",[v[L],I+R*g[L],.5*(p+m)+L*m]);if(s)for(L=0;L<_;++L)y.push("fillText",[v[L],I+R*g[L],.5*(p+m)+L*m]);return this.labels_[n]=k,k},d.prototype.replayTextBackground_=function(t,e,i,a,s,r,l,n){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,a),t.lineTo.apply(t,s),t.lineTo.apply(t,e),r&&(this.alignFill_=r[2],n&&(t.fillStyle=r[1]),this.fill_(t)),l&&(this.setStrokeStyle_(t,l),t.stroke())},d.prototype.replayImageOrLabel_=function(t,e,i,a,n,h,o,u,d,x,m,T,y,b,S,k,L,R,I){var E=R||I;i-=h*=b[0],a-=o*=b[1];var M=k+m>n.width?n.width-m:k,w=d+T>n.height?n.height-T:d,O=L[3]+M*b[0]+L[1],A=L[0]+w*b[1]+L[2],C=i-L[3],D=a-L[0];(E||0!==y)&&(p[0]=C,g[0]=C,p[1]=D,v[1]=D,v[0]=C+O,_[0]=v[0],_[1]=D+A,g[1]=_[1]);var P=null;if(0!==y){var W=i+h,N=a+o;P=(0,s.compose)(c,W,N,1,1,y,-W,-N),(0,s.apply)(c,p),(0,s.apply)(c,v),(0,s.apply)(c,_),(0,s.apply)(c,g),(0,r.createOrUpdate)(Math.min(p[0],v[0],_[0],g[0]),Math.min(p[1],v[1],_[1],g[1]),Math.max(p[0],v[0],_[0],g[0]),Math.max(p[1],v[1],_[1],g[1]),f)}else(0,r.createOrUpdate)(C,D,C+O,D+A,f);var q=0,j=0;if(u){var B=this.renderBuffer_;B[0]=Math.max(B[0],(0,r.getWidth)(f)),q=B[0],B[1]=Math.max(B[1],(0,r.getHeight)(f)),j=B[1]}var F=t.canvas,G=I?I[2]*b[0]/2:0,X=f[0]-G<=(F.width+q)/e&&f[2]+G>=-q/e&&f[1]-G<=(F.height+j)/e&&f[3]+G>=-j/e;if(S&&(i=Math.round(i),a=Math.round(a)),u){if(!X&&1==u[0])return!1;var Y=X?[t,P?P.slice(0):null,x,n,m,T,M,w,i,a,b,f.slice()]:null;Y&&(E&&Y.push(R,I,p.slice(0),v.slice(0),_.slice(0),g.slice(0)),u.push(Y))}else X&&(E&&this.replayTextBackground_(t,p,v,_,g,R,I,!1),(0,l.drawImageOrLabel)(t,P,x,n,m,T,M,w,i,a,b));return!0},d.prototype.fill_=function(t){if(this.alignFill_){var e=(0,s.apply)(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},d.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},d.prototype.renderDeclutter=function(t,i,a,s){for(var r=[],n=1,h=t.length;n<h;++n){var o=(c=t[n])[11];r.push({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:i})}s||(s=new e.default(9));var u=!1;for(n=0,h=r.length;n<h;++n)if(s.collides(r[n])){u=!0;break}if(!u){s.load(r);for(var d=1,f=t.length;d<f;++d){var c,p=(c=t[d])[0],v=p.globalAlpha;v!==a&&(p.globalAlpha=a),c.length>12&&this.replayTextBackground_(c[0],c[14],c[15],c[16],c[17],c[12],c[13],!0),l.drawImageOrLabel.apply(void 0,c),v!==a&&(p.globalAlpha=v)}}return t.length=1,s},d.prototype.drawLabelWithPointPlacement_=function(t,e,a,s){var r=this.textStates[e],n=this.createLabel(t,e,s,a),h=this.strokeStates[a],o=this.pixelRatio,u=i.TEXT_ALIGN[r.textAlign||l.defaultTextAlign],d=i.TEXT_ALIGN[r.textBaseline||l.defaultTextBaseline],f=h&&h.lineWidth?h.lineWidth:0;return{label:n,anchorX:u*(n.width/o-2*r.scale[0])+2*(.5-u)*f,anchorY:d*n.height/o+2*(.5-d)*f}},d.prototype.execute_=function(e,a,d,f,c,p,v){var _;this.declutterItems.length=0,this.pixelCoordinates_&&(0,h.equals)(d,this.renderedTransform_)?_=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),_=(0,u.transform2D)(this.coordinates,0,this.coordinates.length,2,d,this.pixelCoordinates_),(0,s.setFromArray)(this.renderedTransform_,d));for(var g,x,m,T,y,b,S,k,L,R,I,E,M,w,O,A,C,D=0,P=f.length,W=0,N=0,q=0,j=null,B=null,F=this.coordinateCache_,G=this.viewRotation_,X=Math.round(1e12*Math.atan2(-d[1],d[0]))/1e12,Y={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:G},H=this.instructions!=f||this.overlaps?0:200;D<P;){var J=f[D];switch(J[0]){case t.default.BEGIN_GEOMETRY:(O=J[1]).getGeometry()?void 0===v||(0,r.intersects)(v,J[3])?++D:D=J[2]+1:D=J[2];break;case t.default.BEGIN_PATH:N>H&&(this.fill_(e),N=0),q>H&&(e.stroke(),q=0),N||q||(e.beginPath(),T=NaN,y=NaN),++D;break;case t.default.CIRCLE:var K=_[W=J[1]],U=_[W+1],V=_[W+2]-K,z=_[W+3]-U,Q=Math.sqrt(V*V+z*z);e.moveTo(K+Q,U),e.arc(K,U,Q,0,2*Math.PI,!0),++D;break;case t.default.CLOSE_PATH:e.closePath(),++D;break;case t.default.CUSTOM:W=J[1],g=J[2];var Z=J[3],$=J[4],tt=6==J.length?J[5]:void 0;Y.geometry=Z,Y.feature=O,D in F||(F[D]=[]);var et=F[D];tt?tt(_,W,g,2,et):(et[0]=_[W],et[1]=_[W+1],et.length=2),$(et,Y),++D;break;case t.default.DRAW_IMAGE:W=J[1],g=J[2],R=J[3],x=J[4],m=J[5],L=p?null:J[6];var it=J[7],at=J[8],st=J[9],rt=J[10],lt=J[11],nt=J[12],ht=J[13],ot=J[14];if(!R&&J.length>=19){I=J[18],E=J[19],M=J[20],w=J[21];var ut=this.drawLabelWithPointPlacement_(I,E,M,w);R=ut.label,J[3]=R;var dt=J[22];x=(ut.anchorX-dt)*this.pixelRatio,J[4]=x;var ft=J[23];m=(ut.anchorY-ft)*this.pixelRatio,J[5]=m,it=R.height,J[7]=it,ot=R.width,J[14]=ot}var ct=void 0;J.length>24&&(ct=J[24]);var pt=void 0,vt=void 0,_t=void 0;J.length>16?(pt=J[15],vt=J[16],_t=J[17]):(pt=l.defaultPadding,vt=!1,_t=!1),lt&&X?nt+=G:lt||X||(nt-=G);for(var gt=0,xt=0;W<g;W+=2)if(!(ct&&ct[gt++]<ot/this.pixelRatio)){if(L){var mt=Math.floor(xt);k=L.length<mt+1?[L[0][0]]:L[mt]}(qt=this.replayImageOrLabel_(e,a,_[W],_[W+1],R,x,m,k,it,at,st,rt,nt,ht,c,ot,pt,vt?j:null,_t?B:null))&&k&&L[L.length-1]!==k&&L.push(k),k&&(k.length-1===k[0]&&this.declutterItems.push(this,k,O),xt+=1/k[0])}++D;break;case t.default.DRAW_CHARS:var Tt=J[1],yt=J[2],bt=J[3];k=p?null:J[4];var St=J[5];w=J[6];var kt=J[7],Lt=J[8],Rt=J[9];M=J[10];var It=J[11];I=J[12],E=J[13];var Et=[J[14],J[14]],Mt=this.textStates[E],wt=Mt.font,Ot=[Mt.scale[0]*Lt,Mt.scale[1]*Lt],At=void 0;wt in this.widths_?At=this.widths_[wt]:(At={},this.widths_[wt]=At);var Ct=(0,o.lineStringLength)(_,Tt,yt,2),Dt=Math.abs(Ot[0])*(0,l.measureAndCacheTextWidth)(wt,I,At);if(St||Dt<=Ct){var Pt=this.textStates[E].textAlign,Wt=(Ct-Dt)*i.TEXT_ALIGN[Pt],Nt=(0,n.drawTextOnPath)(_,Tt,yt,2,I,Wt,kt,Math.abs(Ot[0]),l.measureAndCacheTextWidth,wt,At,X?0:this.viewRotation_);if(Nt){var qt=!1,jt=void 0,Bt=void 0,Ft=void 0,Gt=void 0,Xt=void 0;if(M)for(jt=0,Bt=Nt.length;jt<Bt;++jt)Ft=(Xt=Nt[jt])[4],Gt=this.createLabel(Ft,E,"",M),x=Xt[2]+It,m=bt*Gt.height+2*(.5-bt)*It*Ot[1]/Ot[0]-Rt,qt=this.replayImageOrLabel_(e,a,Xt[0],Xt[1],Gt,x,m,k,Gt.height,1,0,0,Xt[3],Et,!1,Gt.width,l.defaultPadding,null,null)||qt;if(w)for(jt=0,Bt=Nt.length;jt<Bt;++jt)Ft=(Xt=Nt[jt])[4],Gt=this.createLabel(Ft,E,w,""),x=Xt[2],m=bt*Gt.height-Rt,qt=this.replayImageOrLabel_(e,a,Xt[0],Xt[1],Gt,x,m,k,Gt.height,1,0,0,Xt[3],Et,!1,Gt.width,l.defaultPadding,null,null)||qt;qt&&this.declutterItems.push(this,k,O)}}++D;break;case t.default.END_GEOMETRY:if(void 0!==p){var Yt=p(O=J[1]);if(Yt)return Yt}++D;break;case t.default.FILL:H?N++:this.fill_(e),++D;break;case t.default.MOVE_TO_LINE_TO:for(W=J[1],g=J[2],A=_[W],S=(C=_[W+1])+.5|0,(b=A+.5|0)===T&&S===y||(e.moveTo(A,C),T=b,y=S),W+=2;W<g;W+=2)b=(A=_[W])+.5|0,S=(C=_[W+1])+.5|0,W!=g-2&&b===T&&S===y||(e.lineTo(A,C),T=b,y=S);++D;break;case t.default.SET_FILL_STYLE:j=J,this.alignFill_=J[2],N&&(this.fill_(e),N=0,q&&(e.stroke(),q=0)),e.fillStyle=J[1],++D;break;case t.default.SET_STROKE_STYLE:B=J,q&&(e.stroke(),q=0),this.setStrokeStyle_(e,J),++D;break;case t.default.STROKE:H?q++:e.stroke(),++D;break;default:++D}}N&&this.fill_(e),q&&e.stroke()},d.prototype.execute=function(t,e,i,a,s){this.viewRotation_=a,this.execute_(t,e,i,this.instructions,s,void 0,void 0)},d.prototype.executeHitDetection=function(t,e,i,a,s){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,a,s)},d}(),m=x;exports.default=m; },{"./Instruction.js":"kTJv","rbush/rbush.js":"C6Up","./TextBuilder.js":"DEzw","../../has.js":"f3Nv","../../transform.js":"P4eA","../../extent.js":"QDir","../canvas.js":"iAG7","../../geom/flat/textpath.js":"JxN9","../../array.js":"luEr","../../geom/flat/length.js":"ZZrx","../../geom/flat/transform.js":"LGwr"}],"ngEc":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getCircleArray=d,exports.replayDeclutter=v,exports.default=void 0;var e=u(require("./BuilderType.js")),t=u(require("./Executor.js")),r=require("../../extent.js"),o=require("../../transform.js"),i=require("../../dom.js"),n=require("../../obj.js"),a=require("../../array.js"),s=require("../../geom/flat/transform.js");function u(e){return e&&e.__esModule?e:{default:e}}var f=[e.default.POLYGON,e.default.CIRCLE,e.default.LINE_STRING,e.default.IMAGE,e.default.TEXT,e.default.DEFAULT],c=function(){function u(e,t,r,i,n,a){this.maxExtent_=e,this.overlaps_=i,this.pixelRatio_=r,this.resolution_=t,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=(0,o.create)(),this.createExecutors_(n)}return u.prototype.clip=function(e,t){var r=this.getClipCoords(t);e.beginPath(),e.moveTo(r[0],r[1]),e.lineTo(r[2],r[3]),e.lineTo(r[4],r[5]),e.lineTo(r[6],r[7]),e.clip()},u.prototype.createExecutors_=function(e){for(var r in e){var o=this.executorsByZIndex_[r];void 0===o&&(o={},this.executorsByZIndex_[r]=o);var i=e[r],n=[this.renderBuffer_||0,this.renderBuffer_||0];for(var a in i){var s=i[a];o[a]=new t.default(this.resolution_,this.pixelRatio_,this.overlaps_,s,n)}}},u.prototype.hasExecutors=function(e){for(var t in this.executorsByZIndex_)for(var r=this.executorsByZIndex_[t],o=0,i=e.length;o<i;++o)if(e[o]in r)return!0;return!1},u.prototype.forEachFeatureAtCoordinate=function(t,n,s,u,c,h){var l=2*(u=Math.round(u))+1,v=(0,o.compose)(this.hitDetectionTransform_,u+.5,u+.5,1/n,-1/n,-s,-t[0],-t[1]);this.hitDetectionContext_||(this.hitDetectionContext_=(0,i.createCanvasContext2D)(l,l));var x,p=this.hitDetectionContext_;p.canvas.width!==l||p.canvas.height!==l?(p.canvas.width=l,p.canvas.height=l):p.clearRect(0,0,l,l),void 0!==this.renderBuffer_&&(x=(0,r.createEmpty)(),(0,r.extendCoordinate)(x,t),(0,r.buffer)(x,n*(this.renderBuffer_+u),x));var _,m=d(u);function y(t){for(var r=p.getImageData(0,0,l,l).data,o=0;o<l;o++)for(var i=0;i<l;i++)if(m[o][i]&&r[4*(i*l+o)+3]>0){var n=void 0;return(!h||_!=e.default.IMAGE&&_!=e.default.TEXT||-1!==h.indexOf(t))&&(n=c(t)),n||void p.clearRect(0,0,l,l)}}var g,E,I,C,B,T=Object.keys(this.executorsByZIndex_).map(Number);for(T.sort(a.numberSafeCompareFunction),g=T.length-1;g>=0;--g){var b=T[g].toString();for(I=this.executorsByZIndex_[b],E=f.length-1;E>=0;--E)if(void 0!==(C=I[_=f[E]])&&(B=C.executeHitDetection(p,v,s,y,x)))return B}},u.prototype.getClipCoords=function(e){var t=this.maxExtent_;if(!t)return null;var r=t[0],o=t[1],i=t[2],n=t[3],a=[r,o,r,n,i,n,i,o];return(0,s.transform2D)(a,0,8,2,e,a),a},u.prototype.isEmpty=function(){return(0,n.isEmpty)(this.executorsByZIndex_)},u.prototype.execute=function(t,r,o,i,n,s,u){var c=Object.keys(this.executorsByZIndex_).map(Number);c.sort(a.numberSafeCompareFunction),this.maxExtent_&&(t.save(),this.clip(t,o));var h,l,d,v,x,p,_=s||f;for(h=0,l=c.length;h<l;++h){var m=c[h].toString();for(x=this.executorsByZIndex_[m],d=0,v=_.length;d<v;++d){var y=_[d];if(void 0!==(p=x[y]))if(!u||y!=e.default.IMAGE&&y!=e.default.TEXT)p.execute(t,r,o,i,n);else{var g=u[m];g?g.push(p,o.slice(0)):u[m]=[p,o.slice(0)]}}}this.maxExtent_&&t.restore()},u}(),h={0:[[!0]]};function l(e,t,r){var o,i=Math.floor(e.length/2);if(t>=i)for(o=i;o<t;o++)e[o][r]=!0;else if(t<i)for(o=t+1;o<i;o++)e[o][r]=!0}function d(e){if(void 0!==h[e])return h[e];for(var t=2*e+1,r=new Array(t),o=0;o<t;o++)r[o]=new Array(t);for(var i=e,n=0,a=0;i>=n;)l(r,e+i,e+n),l(r,e+n,e+i),l(r,e-n,e+i),l(r,e-i,e+n),l(r,e-i,e-n),l(r,e-n,e-i),l(r,e+n,e-i),l(r,e+i,e-n),2*((a+=1+2*++n)-i)+1>0&&(a+=1-2*(i-=1));return h[e]=r,r}function v(e,t,r,o,i,n){for(var s=Object.keys(e).map(Number).sort(a.numberSafeCompareFunction),u=0,f=s.length;u<f;++u)for(var c=e[s[u].toString()],h=void 0,l=0,d=c.length;l<d;){var v=c[l++],x=c[l++];v.execute(t,1,x,r,i),v!==h&&v.declutterItems.length>0&&(h=v,n.push({items:v.declutterItems,opacity:o}))}}var x=c;exports.default=x; },{"./BuilderType.js":"irm1","./Executor.js":"pZKE","../../extent.js":"QDir","../../transform.js":"P4eA","../../dom.js":"Xno5","../../obj.js":"mH6q","../../array.js":"luEr","../../geom/flat/transform.js":"LGwr"}],"Rlas":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={FRACTION:"fraction",PIXELS:"pixels"};exports.default=e; },{}],"Ojbp":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("./events/Target.js")),e=r(require("./events/EventType.js")),o=require("./util.js");function r(t){return t&&t.__esModule?t:{default:t}}var n=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),u=function(t){function r(e,o,r,n){var u=t.call(this)||this;return u.extent=e,u.pixelRatio_=r,u.resolution=o,u.state=n,u}return n(r,t),r.prototype.changed=function(){this.dispatchEvent(e.default.CHANGE)},r.prototype.getExtent=function(){return this.extent},r.prototype.getImage=function(){return(0,o.abstract)()},r.prototype.getPixelRatio=function(){return this.pixelRatio_},r.prototype.getResolution=function(){return this.resolution},r.prototype.getState=function(){return this.state},r.prototype.load=function(){(0,o.abstract)()},r}(t.default),i=u;exports.default=i; },{"./events/Target.js":"CR4Y","./events/EventType.js":"C8cu","./util.js":"KniQ"}],"DHWK":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.listenImage=h,exports.default=void 0;var t=a(require("./events/EventType.js")),e=a(require("./ImageBase.js")),n=a(require("./ImageState.js")),i=require("./has.js"),r=require("./extent.js"),s=require("./events.js");function a(t){return t&&t.__esModule?t:{default:t}}var o=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),u=function(t){function e(e,i,r,s,a,o){var u=t.call(this,e,i,r,n.default.IDLE)||this;return u.src_=s,u.image_=new Image,null!==a&&(u.image_.crossOrigin=a),u.unlisten_=null,u.state=n.default.IDLE,u.imageLoadFunction_=o,u}return o(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=n.default.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=(0,r.getHeight)(this.extent)/this.image_.height),this.state=n.default.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=n.default.IDLE&&this.state!=n.default.ERROR||(this.state=n.default.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=h(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(e.default);function h(e,n,r){var a=e;if(a.src&&i.IMAGE_DECODE){var o=a.decode(),u=!0;return o.then(function(){u&&n()}).catch(function(t){u&&("EncodingError"===t.name&&"Invalid image type."===t.message?n():r())}),function(){u=!1}}var h=[(0,s.listenOnce)(a,t.default.LOAD,n),(0,s.listenOnce)(a,t.default.ERROR,r)];return function(){h.forEach(s.unlistenByKey)}}var l=u;exports.default=l; },{"./events/EventType.js":"C8cu","./ImageBase.js":"Ojbp","./ImageState.js":"u3kG","./has.js":"f3Nv","./extent.js":"QDir","./events.js":"UqnM"}],"XCOy":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.get=c,exports.default=void 0;var t=r(require("../events/Target.js")),e=r(require("../events/EventType.js")),i=r(require("../ImageState.js")),a=require("../dom.js"),n=require("./IconImageCache.js"),s=require("../Image.js");function r(t){return t&&t.__esModule?t:{default:t}}var o=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function a(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),h=null,_=function(t){function n(e,i,a,n,s,r){var o=t.call(this)||this;return o.hitDetectionImage_=null,o.image_=e||new Image,null!==n&&(o.image_.crossOrigin=n),o.canvas_={},o.color_=r,o.unlisten_=null,o.imageState_=s,o.size_=a,o.src_=i,o.tainted_,o}return o(n,t),n.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===i.default.LOADED){h||(h=(0,a.createCanvasContext2D)(1,1)),h.drawImage(this.image_,0,0);try{h.getImageData(0,0,1,1),this.tainted_=!1}catch(t){h=null,this.tainted_=!0}}return!0===this.tainted_},n.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(e.default.CHANGE)},n.prototype.handleImageError_=function(){this.imageState_=i.default.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},n.prototype.handleImageLoad_=function(){this.imageState_=i.default.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},n.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},n.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},n.prototype.getImageState=function(){return this.imageState_},n.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=(0,a.createCanvasContext2D)(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},n.prototype.getSize=function(){return this.size_},n.prototype.getSrc=function(){return this.src_},n.prototype.load=function(){if(this.imageState_==i.default.IDLE){this.imageState_=i.default.LOADING;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=(0,s.listenImage)(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},n.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),this.isTainted_()){var a=this.color_;return i.globalCompositeOperation="multiply",i.fillStyle="rgb("+a[0]+","+a[1]+","+a[2]+")",i.fillRect(0,0,e.width,e.height),i.globalCompositeOperation="destination-in",void i.drawImage(this.image_,0,0)}for(var n=i.getImageData(0,0,e.width,e.height),s=n.data,r=this.color_[0]/255,o=this.color_[1]/255,h=this.color_[2]/255,_=0,c=s.length;_<c;_+=4)s[_]*=r,s[_+1]*=o,s[_+2]*=h;i.putImageData(n,0,0)}},n.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},n}(t.default);function c(t,e,i,a,s,r){var o=n.shared.get(e,a,r);return o||(o=new _(t,e,i,a,s,r),n.shared.set(e,a,r,o)),o}var l=_;exports.default=l; },{"../events/Target.js":"CR4Y","../events/EventType.js":"C8cu","../ImageState.js":"u3kG","../dom.js":"Xno5","./IconImageCache.js":"V0oB","../Image.js":"DHWK"}],"z2xv":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=h(require("../events/EventType.js")),i=h(require("./IconAnchorUnits.js")),e=h(require("./IconOrigin.js")),o=h(require("../ImageState.js")),r=h(require("./Image.js")),n=require("../color.js"),s=require("../asserts.js"),a=require("./IconImage.js"),c=require("../util.js");function h(t){return t&&t.__esModule?t:{default:t}}var l=function(){var t=function(i,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])})(i,e)};return function(i,e){function o(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),u=function(r){function h(t){var h=this,l=t||{},u=void 0!==l.opacity?l.opacity:1,g=void 0!==l.rotation?l.rotation:0,f=void 0!==l.scale?l.scale:1,_=void 0!==l.rotateWithView&&l.rotateWithView;(h=r.call(this,{opacity:u,rotation:g,scale:f,displacement:void 0!==l.displacement?l.displacement:[0,0],rotateWithView:_})||this).anchor_=void 0!==l.anchor?l.anchor:[.5,.5],h.normalizedAnchor_=null,h.anchorOrigin_=void 0!==l.anchorOrigin?l.anchorOrigin:e.default.TOP_LEFT,h.anchorXUnits_=void 0!==l.anchorXUnits?l.anchorXUnits:i.default.FRACTION,h.anchorYUnits_=void 0!==l.anchorYUnits?l.anchorYUnits:i.default.FRACTION,h.crossOrigin_=void 0!==l.crossOrigin?l.crossOrigin:null;var d=void 0!==l.img?l.img:null,O=void 0!==l.imgSize?l.imgSize:null,p=l.src;(0,s.assert)(!(void 0!==p&&d),4),(0,s.assert)(!d||d&&O,5),void 0!==p&&0!==p.length||!d||(p=d.src||(0,c.getUid)(d)),(0,s.assert)(void 0!==p&&p.length>0,6);var I=void 0!==l.src?o.default.IDLE:o.default.LOADED;return h.color_=void 0!==l.color?(0,n.asArray)(l.color):null,h.iconImage_=(0,a.get)(d,p,O,h.crossOrigin_,I,h.color_),h.offset_=void 0!==l.offset?l.offset:[0,0],h.offsetOrigin_=void 0!==l.offsetOrigin?l.offsetOrigin:e.default.TOP_LEFT,h.origin_=null,h.size_=void 0!==l.size?l.size:null,h}return l(h,r),h.prototype.clone=function(){var t=this.getScale();return new h({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},h.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,o=this.getSize();if(this.anchorXUnits_==i.default.FRACTION||this.anchorYUnits_==i.default.FRACTION){if(!o)return null;t=this.anchor_.slice(),this.anchorXUnits_==i.default.FRACTION&&(t[0]*=o[0]),this.anchorYUnits_==i.default.FRACTION&&(t[1]*=o[1])}if(this.anchorOrigin_!=e.default.TOP_LEFT){if(!o)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=e.default.TOP_RIGHT&&this.anchorOrigin_!=e.default.BOTTOM_RIGHT||(t[0]=-t[0]+o[0]),this.anchorOrigin_!=e.default.BOTTOM_LEFT&&this.anchorOrigin_!=e.default.BOTTOM_RIGHT||(t[1]=-t[1]+o[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},h.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},h.prototype.getColor=function(){return this.color_},h.prototype.getImage=function(t){return this.iconImage_.getImage(t)},h.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},h.prototype.getImageSize=function(){return this.iconImage_.getSize()},h.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},h.prototype.getImageState=function(){return this.iconImage_.getImageState()},h.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},h.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_,i=this.getDisplacement();if(this.offsetOrigin_!=e.default.TOP_LEFT){var o=this.getSize(),r=this.iconImage_.getSize();if(!o||!r)return null;t=t.slice(),this.offsetOrigin_!=e.default.TOP_RIGHT&&this.offsetOrigin_!=e.default.BOTTOM_RIGHT||(t[0]=r[0]-o[0]-t[0]),this.offsetOrigin_!=e.default.BOTTOM_LEFT&&this.offsetOrigin_!=e.default.BOTTOM_RIGHT||(t[1]=r[1]-o[1]-t[1])}return t[0]+=i[0],t[1]+=i[1],this.origin_=t,this.origin_},h.prototype.getSrc=function(){return this.iconImage_.getSrc()},h.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},h.prototype.listenImageChange=function(i){this.iconImage_.addEventListener(t.default.CHANGE,i)},h.prototype.load=function(){this.iconImage_.load()},h.prototype.unlistenImageChange=function(i){this.iconImage_.removeEventListener(t.default.CHANGE,i)},h}(r.default),g=u;exports.default=g; },{"../events/EventType.js":"C8cu","./IconAnchorUnits.js":"Rlas","./IconOrigin.js":"urGY","../ImageState.js":"u3kG","./Image.js":"S8ow","../color.js":"eucy","../asserts.js":"fLG6","./IconImage.js":"XCOy","../util.js":"KniQ"}],"RPsG":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=i(require("./Fill.js")),e=i(require("./TextPlacement.js")),o=require("../size.js");function i(t){return t&&t.__esModule?t:{default:t}}var n="#333",r=function(){function i(i){var r=i||{};this.font_=r.font,this.rotation_=r.rotation,this.rotateWithView_=r.rotateWithView,this.scale_=r.scale,this.scaleArray_=(0,o.toSize)(void 0!==r.scale?r.scale:1),this.text_=r.text,this.textAlign_=r.textAlign,this.textBaseline_=r.textBaseline,this.fill_=void 0!==r.fill?r.fill:new t.default({color:n}),this.maxAngle_=void 0!==r.maxAngle?r.maxAngle:Math.PI/4,this.placement_=void 0!==r.placement?r.placement:e.default.POINT,this.overflow_=!!r.overflow,this.stroke_=void 0!==r.stroke?r.stroke:null,this.offsetX_=void 0!==r.offsetX?r.offsetX:0,this.offsetY_=void 0!==r.offsetY?r.offsetY:0,this.backgroundFill_=r.backgroundFill?r.backgroundFill:null,this.backgroundStroke_=r.backgroundStroke?r.backgroundStroke:null,this.padding_=void 0===r.padding?null:r.padding}return i.prototype.clone=function(){var t=this.getScale();return new i({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},i.prototype.getOverflow=function(){return this.overflow_},i.prototype.getFont=function(){return this.font_},i.prototype.getMaxAngle=function(){return this.maxAngle_},i.prototype.getPlacement=function(){return this.placement_},i.prototype.getOffsetX=function(){return this.offsetX_},i.prototype.getOffsetY=function(){return this.offsetY_},i.prototype.getFill=function(){return this.fill_},i.prototype.getRotateWithView=function(){return this.rotateWithView_},i.prototype.getRotation=function(){return this.rotation_},i.prototype.getScale=function(){return this.scale_},i.prototype.getScaleArray=function(){return this.scaleArray_},i.prototype.getStroke=function(){return this.stroke_},i.prototype.getText=function(){return this.text_},i.prototype.getTextAlign=function(){return this.textAlign_},i.prototype.getTextBaseline=function(){return this.textBaseline_},i.prototype.getBackgroundFill=function(){return this.backgroundFill_},i.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},i.prototype.getPadding=function(){return this.padding_},i.prototype.setOverflow=function(t){this.overflow_=t},i.prototype.setFont=function(t){this.font_=t},i.prototype.setMaxAngle=function(t){this.maxAngle_=t},i.prototype.setOffsetX=function(t){this.offsetX_=t},i.prototype.setOffsetY=function(t){this.offsetY_=t},i.prototype.setPlacement=function(t){this.placement_=t},i.prototype.setRotateWithView=function(t){this.rotateWithView_=t},i.prototype.setFill=function(t){this.fill_=t},i.prototype.setRotation=function(t){this.rotation_=t},i.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=(0,o.toSize)(void 0!==t?t:1)},i.prototype.setStroke=function(t){this.stroke_=t},i.prototype.setText=function(t){this.text_=t},i.prototype.setTextAlign=function(t){this.textAlign_=t},i.prototype.setTextBaseline=function(t){this.textBaseline_=t},i.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},i.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},i.prototype.setPadding=function(t){this.padding_=t},i}(),s=r;exports.default=s; },{"./Fill.js":"AFcg","./TextPlacement.js":"AXKs","../size.js":"TAHd"}],"qeKX":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Circle",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"Fill",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"Icon",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"IconImage",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"Image",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"RegularShape",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"Stroke",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(exports,"Style",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"Text",{enumerable:!0,get:function(){return s.default}});var e=f(require("./style/Circle.js")),t=f(require("./style/Fill.js")),r=f(require("./style/Icon.js")),u=f(require("./style/IconImage.js")),n=f(require("./style/Image.js")),l=f(require("./style/RegularShape.js")),o=f(require("./style/Stroke.js")),i=f(require("./style/Style.js")),s=f(require("./style/Text.js"));function f(e){return e&&e.__esModule?e:{default:e}} },{"./style/Circle.js":"cdf1","./style/Fill.js":"AFcg","./style/Icon.js":"z2xv","./style/IconImage.js":"XCOy","./style/Image.js":"S8ow","./style/RegularShape.js":"il3X","./style/Stroke.js":"TXDt","./style/Style.js":"he4w","./style/Text.js":"RPsG"}],"MrCe":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createHitDetectionImageData=s,exports.hitDetect=g;var e=l(require("./Immediate.js")),t=l(require("../../geom/GeometryType.js")),r=l(require("../../style/IconAnchorUnits.js")),a=require("../../style.js"),i=require("../../dom.js"),n=require("../../extent.js"),o=require("../../array.js");function l(e){return e&&e.__esModule?e:{default:e}}function s(l,s,g,u,c,h,f){var d=l[0]/2,v=l[1]/2,m=(0,i.createCanvasContext2D)(d,v);m.imageSmoothingEnabled=!1;for(var y=m.canvas,I=new e.default(m,.5,c,null,f),p=g.length,S=Math.floor(16777215/p),w={},x=1;x<=p;++x){var C=g[x-1],j=C.getStyleFunction()||u;if(u){var q=j(C,h);if(q){Array.isArray(q)||(q=[q]);for(var E="#"+("000000"+(x*S).toString(16)).slice(-6),M=0,O=q.length;M<O;++M){var b=q[M],D=b.clone(),N=D.getFill();N&&N.setColor(E);var T=D.getStroke();T&&T.setColor(E),D.setText(void 0);var G=b.getImage();if(G){var L=G.getImageSize();if(!L)continue;var P=document.createElement("canvas");P.width=L[0],P.height=L[1];var R=P.getContext("2d",{alpha:!1});R.fillStyle=E;var _=R.canvas;R.fillRect(0,0,_.width,_.height);var z=L?L[0]:_.width,A=L?L[1]:_.height;(0,i.createCanvasContext2D)(z,A).drawImage(_,0,0),D.setImage(new a.Icon({img:_,imgSize:L,anchor:G.getAnchor(),anchorXUnits:r.default.PIXELS,anchorYUnits:r.default.PIXELS,offset:G.getOrigin(),size:G.getSize(),opacity:G.getOpacity(),scale:G.getScale(),rotation:G.getRotation(),rotateWithView:G.getRotateWithView()}))}var F=Number(D.getZIndex());(V=w[F])||(V={},w[F]=V,V[t.default.POLYGON]=[],V[t.default.CIRCLE]=[],V[t.default.LINE_STRING]=[],V[t.default.POINT]=[]);var U=D.getGeometryFunction()(C);U&&(0,n.intersects)(c,U.getExtent())&&V[U.getType().replace("Multi","")].push(U,D)}}}}for(var X=Object.keys(w).map(Number).sort(o.numberSafeCompareFunction),k=(x=0,X.length);x<k;++x){var V=w[X[x]];for(var W in V){var Y=V[W];for(M=0,O=Y.length;M<O;M+=2){I.setStyle(Y[M+1]);for(var H=0,Z=s.length;H<Z;++H)I.setTransform(s[H]),I.drawGeometry(Y[M])}}}return m.getImageData(0,0,y.width,y.height)}function g(e,t,r){var a=[];if(r){var i=4*(Math.round(e[0]/2)+Math.round(e[1]/2)*r.width),n=r.data[i],o=r.data[i+1],l=r.data[i+2]+256*(o+256*n),s=Math.floor(16777215/t.length);l&&l%s==0&&a.push(t[l/s-1])}return a} },{"./Immediate.js":"fo6K","../../geom/GeometryType.js":"lmV0","../../style/IconAnchorUnits.js":"Rlas","../../style.js":"qeKX","../../dom.js":"Xno5","../../extent.js":"QDir","../../array.js":"luEr"}],"F2e3":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=p(require("../../render/canvas/BuilderGroup.js")),t=p(require("./Layer.js")),r=c(require("../../render/canvas/ExecutorGroup.js")),n=p(require("../../ViewHint.js")),i=require("../../transform.js"),a=require("../../extent.js"),o=require("../../render/canvas/hitdetect.js"),s=require("../vector.js"),u=require("../../proj.js"),d=require("../../util.js"),h=require("../../coordinate.js");function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function c(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function p(e){return e&&e.__esModule?e:{default:e}}var f=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),g=function(t){function l(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.animatingOrInteracting_,r.dirty_=!1,r.hitDetectionImageData_=null,r.renderedFeatures_=null,r.renderedRevision_=-1,r.renderedResolution_=NaN,r.renderedExtent_=(0,a.createEmpty)(),r.renderedRotation_,r.renderedCenter_=null,r.renderedProjection_=null,r.renderedRenderOrder_=null,r.replayGroup_=null,r.replayGroupChanged=!0,r.clipping=!0,r}return f(l,t),l.prototype.useContainer=function(e,r,n){n<1&&(e=null),t.prototype.useContainer.call(this,e,r,n)},l.prototype.renderFrame=function(e,t){var o=e.pixelRatio,s=e.layerStatesArray[e.layerIndex];(0,i.makeScale)(this.pixelTransform,1/o,1/o),(0,i.makeInverse)(this.inversePixelTransform,this.pixelTransform);var d=(0,i.toString)(this.pixelTransform);this.useContainer(t,d,s.opacity);var h=this.context,l=h.canvas,c=this.replayGroup_;if(!c||c.isEmpty())return!this.containerReused&&l.width>0&&(l.width=0),this.container;var p=Math.round(e.size[0]*o),f=Math.round(e.size[1]*o);l.width!=p||l.height!=f?(l.width=p,l.height=f,l.style.transform!==d&&(l.style.transform=d)):this.containerReused||h.clearRect(0,0,p,f),this.preRender(h,e);var g=e.extent,y=e.viewState,v=y.center,_=y.resolution,m=y.projection,x=y.rotation,R=m.getExtent(),I=this.getLayer().getSource(),j=!1;if(s.extent&&this.clipping){var w=(0,u.fromUserExtent)(s.extent,m);(j=!(0,a.containsExtent)(w,e.extent)&&(0,a.intersects)(w,e.extent))&&this.clipUnrotated(h,e,w)}var E=e.viewHints,O=!(E[n.default.ANIMATING]||E[n.default.INTERACTING]),T=this.getRenderTransform(v,_,x,o,p,f,0),F=this.getLayer().getDeclutter()?{}:null;if(c.execute(h,1,T,x,O,void 0,F),I.getWrapX()&&m.canWrapX()&&!(0,a.containsExtent)(R,g)){for(var D=g[0],C=(0,a.getWidth)(R),S=0,b=void 0;D<R[0];){b=C*--S;var G=this.getRenderTransform(v,_,x,o,p,f,b);c.execute(h,1,G,x,O,void 0,F),D+=C}for(S=0,D=g[2];D>R[2];){b=C*++S;var A=this.getRenderTransform(v,_,x,o,p,f,b);c.execute(h,1,A,x,O,void 0,F),D-=C}}if(F){var P=e.viewHints,N=!(P[n.default.ANIMATING]||P[n.default.INTERACTING]);(0,r.replayDeclutter)(F,h,x,1,N,e.declutterItems)}j&&h.restore(),this.postRender(h,e);var W=s.opacity,q=this.container;return W!==parseFloat(q.style.opacity)&&(q.style.opacity=1===W?"":String(W)),this.renderedRotation_!==y.rotation&&(this.renderedRotation_=y.rotation,this.hitDetectionImageData_=null),this.container},l.prototype.getFeatures=function(e){return new Promise(function(t,r){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var n=[this.context.canvas.width,this.context.canvas.height];(0,i.apply)(this.pixelTransform,n);var s=this.renderedCenter_,u=this.renderedResolution_,d=this.renderedRotation_,h=this.renderedProjection_,l=this.renderedExtent_,c=this.getLayer(),p=[],f=n[0]/2,g=n[1]/2;p.push(this.getRenderTransform(s,u,d,.5,f,g,0).slice());var y=c.getSource(),v=h.getExtent();if(y.getWrapX()&&h.canWrapX()&&!(0,a.containsExtent)(v,l)){for(var _=l[0],m=(0,a.getWidth)(v),x=0,R=void 0;_<v[0];)R=m*--x,p.push(this.getRenderTransform(s,u,d,.5,f,g,R).slice()),_+=m;for(x=0,_=l[2];_>v[2];)R=m*++x,p.push(this.getRenderTransform(s,u,d,.5,f,g,R).slice()),_-=m}this.hitDetectionImageData_=(0,o.createHitDetectionImageData)(n,p,this.renderedFeatures_,c.getStyleFunction(),l,u,d)}t((0,o.hitDetect)(e,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},l.prototype.forEachFeatureAtCoordinate=function(e,t,r,n,i){if(this.replayGroup_){var a=t.viewState.resolution,o=t.viewState.rotation,s=this.getLayer(),u={};return this.replayGroup_.forEachFeatureAtCoordinate(e,a,o,r,function(e){var t=(0,d.getUid)(e);if(!(t in u))return u[t]=!0,n(e,s)},s.getDeclutter()?i:null)}},l.prototype.handleFontsChanged=function(){var e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()},l.prototype.handleStyleImageChange_=function(e){this.renderIfReadyAndVisible()},l.prototype.prepareFrame=function(t){var i=this.getLayer(),o=i.getSource();if(!o)return!1;var d=t.viewHints[n.default.ANIMATING],l=t.viewHints[n.default.INTERACTING],c=i.getUpdateWhileAnimating(),p=i.getUpdateWhileInteracting();if(!this.dirty_&&!c&&d||!p&&l)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var f=t.extent,g=t.viewState,y=g.projection,v=g.resolution,_=t.pixelRatio,m=i.getRevision(),x=i.getRenderBuffer(),R=i.getRenderOrder();void 0===R&&(R=s.defaultOrder);var I=g.center.slice(),j=(0,a.buffer)(f,x*v),w=[j.slice()],E=y.getExtent();if(o.getWrapX()&&y.canWrapX()&&!(0,a.containsExtent)(E,t.extent)){var O=(0,a.getWidth)(E),T=Math.max((0,a.getWidth)(j)/2,O);j[0]=E[0]-T,j[2]=E[2]+T,(0,h.wrapX)(I,y);var F=(0,a.wrapX)(w[0],y);F[0]<E[0]&&F[2]<E[2]?w.push([F[0]+O,F[1],F[2]+O,F[3]]):F[0]>E[0]&&F[2]>E[2]&&w.push([F[0]-O,F[1],F[2]-O,F[3]])}if(!this.dirty_&&this.renderedResolution_==v&&this.renderedRevision_==m&&this.renderedRenderOrder_==R&&(0,a.containsExtent)(this.renderedExtent_,j))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var D,C=new e.default((0,s.getTolerance)(v,_),j,v,_,i.getDeclutter()),S=(0,u.getUserProjection)();if(S){for(var b=0,G=w.length;b<G;++b)o.loadFeatures((0,u.toUserExtent)(w[b],y),v,S);D=(0,u.getTransformFromProjections)(S,y)}else for(b=0,G=w.length;b<G;++b)o.loadFeatures(w[b],v,y);var A=(0,s.getSquaredTolerance)(v,_),P=function(e){var t,r=e.getStyleFunction()||i.getStyleFunction();if(r&&(t=r(e,v)),t){var n=this.renderFeature(e,A,t,C,D);this.dirty_=this.dirty_||n}}.bind(this),N=(0,u.toUserExtent)(j,y),W=o.getFeaturesInExtent(N);R&&W.sort(R);for(b=0,G=W.length;b<G;++b)P(W[b]);this.renderedFeatures_=W;var q=C.finish(),M=new r.default(j,v,_,o.getOverlaps(),q,i.getRenderBuffer());return this.renderedResolution_=v,this.renderedRevision_=m,this.renderedRenderOrder_=R,this.renderedExtent_=j,this.renderedCenter_=I,this.renderedProjection_=y,this.replayGroup_=M,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},l.prototype.renderFeature=function(e,t,r,n,i){if(!r)return!1;var a=!1;if(Array.isArray(r))for(var o=0,u=r.length;o<u;++o)a=(0,s.renderFeature)(n,e,r[o],t,this.boundHandleStyleImageChange_,i)||a;else a=(0,s.renderFeature)(n,e,r,t,this.boundHandleStyleImageChange_,i);return a},l}(t.default),y=g;exports.default=y; },{"../../render/canvas/BuilderGroup.js":"vqHd","./Layer.js":"vPfl","../../render/canvas/ExecutorGroup.js":"ngEc","../../ViewHint.js":"cuLW","../../transform.js":"P4eA","../../extent.js":"QDir","../../render/canvas/hitdetect.js":"MrCe","../vector.js":"UCah","../../proj.js":"Diht","../../util.js":"KniQ","../../coordinate.js":"nGsj"}],"dflx":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("./BaseVector.js")),e=r(require("../renderer/canvas/VectorLayer.js"));function r(t){return t&&t.__esModule?t:{default:t}}var n=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=function(t){function r(e){return t.call(this,e)||this}return n(r,t),r.prototype.createRenderer=function(){return new e.default(this)},r}(t.default),u=o;exports.default=u; },{"./BaseVector.js":"pskK","../renderer/canvas/VectorLayer.js":"F2e3"}],"MiUH":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=n(require("rbush/rbush.js")),e=require("../extent.js"),r=require("../util.js"),i=require("../obj.js");function n(t){return t&&t.__esModule?t:{default:t}}var o=function(){function n(e){this.rbush_=new t.default(e),this.items_={}}return n.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[(0,r.getUid)(e)]=i},n.prototype.load=function(t,e){for(var i=new Array(e.length),n=0,o=e.length;n<o;n++){var s=t[n],u=e[n],a={minX:s[0],minY:s[1],maxX:s[2],maxY:s[3],value:u};i[n]=a,this.items_[(0,r.getUid)(u)]=a}this.rbush_.load(i)},n.prototype.remove=function(t){var e=(0,r.getUid)(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},n.prototype.update=function(t,i){var n=this.items_[(0,r.getUid)(i)],o=[n.minX,n.minY,n.maxX,n.maxY];(0,e.equals)(o,t)||(this.remove(i),this.insert(t,i))},n.prototype.getAll=function(){return this.rbush_.all().map(function(t){return t.value})},n.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(t){return t.value})},n.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},n.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},n.prototype.forEach_=function(t,e){for(var r,i=0,n=t.length;i<n;i++)if(r=e(t[i]))return r;return r},n.prototype.isEmpty=function(){return(0,i.isEmpty)(this.items_)},n.prototype.clear=function(){this.rbush_.clear(),this.items_={}},n.prototype.getExtent=function(t){var r=this.rbush_.toJSON();return(0,e.createOrUpdate)(r.minX,r.minY,r.maxX,r.maxY,t)},n.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},n}(),s=o;exports.default=s; },{"rbush/rbush.js":"C6Up","../extent.js":"QDir","../util.js":"KniQ","../obj.js":"mH6q"}],"H38a":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=n(require("../Object.js")),o=n(require("./State.js")),r=require("../util.js"),e=require("../proj.js");function n(t){return t&&t.__esModule?t:{default:t}}var i=function(){var t=function(o,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var r in o)o.hasOwnProperty(r)&&(t[r]=o[r])})(o,r)};return function(o,r){function e(){this.constructor=o}t(o,r),o.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}}(),u=function(t){function n(r){var n=t.call(this)||this;return n.projection_=(0,e.get)(r.projection),n.attributions_=s(r.attributions),n.attributionsCollapsible_=void 0===r.attributionsCollapsible||r.attributionsCollapsible,n.loading=!1,n.state_=void 0!==r.state?r.state:o.default.READY,n.wrapX_=void 0!==r.wrapX&&r.wrapX,n}return i(n,t),n.prototype.getAttributions=function(){return this.attributions_},n.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},n.prototype.getProjection=function(){return this.projection_},n.prototype.getResolutions=function(){return(0,r.abstract)()},n.prototype.getState=function(){return this.state_},n.prototype.getWrapX=function(){return this.wrapX_},n.prototype.getContextOptions=function(){},n.prototype.refresh=function(){this.changed()},n.prototype.setAttributions=function(t){this.attributions_=s(t),this.changed()},n.prototype.setState=function(t){this.state_=t,this.changed()},n}(t.default);function s(t){return t?Array.isArray(t)?function(o){return t}:"function"==typeof t?t:function(o){return[t]}:null}var a=u;exports.default=a; },{"../Object.js":"PhPh","./State.js":"iC8j","../util.js":"KniQ","../proj.js":"Diht"}],"s8Fc":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature"};exports.default=e; },{}],"JpXE":[function(require,module,exports) { "use strict";function e(e,t){return[[-1/0,-1/0,1/0,1/0]]}function t(e,t){return[e]}function r(e){return function(t,r){var n=e.getZForResolution(r),o=e.getTileRangeForExtentAndZ(t,n),u=[],i=[n,0,0];for(i[1]=o.minX;i[1]<=o.maxX;++i[1])for(i[2]=o.minY;i[2]<=o.maxY;++i[2])u.push(e.getTileCoordExtent(i));return u}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.all=e,exports.bbox=t,exports.tile=r; },{}],"AbO3":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};exports.default=e; },{}],"U3JP":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.loadFeaturesXhr=n,exports.xhr=o,exports.setWithCredentials=a;var e=r(require("./format/FormatType.js")),t=require("./functions.js");function r(e){return e&&e.__esModule?e:{default:e}}var s=!1;function n(t,r,n,o){return function(a,i,u){var f=new XMLHttpRequest;f.open("GET","function"==typeof t?t(a,i,u):t,!0),r.getType()==e.default.ARRAY_BUFFER&&(f.responseType="arraybuffer"),f.withCredentials=s,f.onload=function(t){if(!f.status||f.status>=200&&f.status<300){var s=r.getType(),i=void 0;s==e.default.JSON||s==e.default.TEXT?i=f.responseText:s==e.default.XML?(i=f.responseXML)||(i=(new DOMParser).parseFromString(f.responseText,"application/xml")):s==e.default.ARRAY_BUFFER&&(i=f.response),i?n.call(this,r.readFeatures(i,{extent:a,featureProjection:u}),r.readProjection(i)):o.call(this)}else o.call(this)}.bind(this),f.onerror=function(){o.call(this)}.bind(this),f.send()}}function o(e,r){return n(e,r,function(e,t){"function"==typeof this.addFeatures&&this.addFeatures(e)},t.VOID)}function a(e){s=e} },{"./format/FormatType.js":"AbO3","./functions.js":"RgA2"}],"ZS12":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.VectorSourceEvent=void 0;var e=E(require("../Collection.js")),t=E(require("../CollectionEventType.js")),r=E(require("../events/Event.js")),n=E(require("../events/EventType.js")),i=E(require("../ObjectEventType.js")),o=E(require("../structs/RBush.js")),s=E(require("./Source.js")),a=E(require("./State.js")),u=E(require("./VectorEventType.js")),h=require("../functions.js"),l=require("../loadingstrategy.js"),d=require("../asserts.js"),f=require("../extent.js"),c=require("../array.js"),_=require("../util.js"),p=require("../obj.js"),v=require("../events.js"),y=require("../featureloader.js");function E(e){return e&&e.__esModule?e:{default:e}}var g=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),x=function(e){function t(t,r){var n=e.call(this,t)||this;return n.feature=r,n}return g(t,e),t}(r.default);exports.VectorSourceEvent=x;var F=function(r){function s(t){var n=this,i=t||{};(n=r.call(this,{attributions:i.attributions,projection:void 0,state:a.default.READY,wrapX:void 0===i.wrapX||i.wrapX})||this).loader_=h.VOID,n.format_=i.format,n.overlaps_=void 0===i.overlaps||i.overlaps,n.url_=i.url,void 0!==i.loader?n.loader_=i.loader:void 0!==n.url_&&((0,d.assert)(n.format_,7),n.loader_=(0,y.xhr)(n.url_,n.format_)),n.strategy_=void 0!==i.strategy?i.strategy:l.all;var s,u,f=void 0===i.useSpatialIndex||i.useSpatialIndex;return n.featuresRtree_=f?new o.default:null,n.loadedExtentsRtree_=new o.default,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(i.features)?u=i.features:i.features&&(u=(s=i.features).getArray()),f||void 0!==s||(s=new e.default(u)),void 0!==u&&n.addFeaturesInternal(u),void 0!==s&&n.bindFeaturesCollection_(s),n}return g(s,r),s.prototype.addFeature=function(e){this.addFeatureInternal(e),this.changed()},s.prototype.addFeatureInternal=function(e){var t=(0,_.getUid)(e);if(this.addToIndex_(t,e)){this.setupChangeEvents_(t,e);var r=e.getGeometry();if(r){var n=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new x(u.default.ADDFEATURE,e))}else this.featuresCollection_&&this.featuresCollection_.remove(e)},s.prototype.setupChangeEvents_=function(e,t){this.featureChangeKeys_[e]=[(0,v.listen)(t,n.default.CHANGE,this.handleFeatureChange_,this),(0,v.listen)(t,i.default.PROPERTYCHANGE,this.handleFeatureChange_,this)]},s.prototype.addToIndex_=function(e,t){var r=!0,n=t.getId();return void 0!==n&&(n.toString()in this.idIndex_?r=!1:this.idIndex_[n.toString()]=t),r&&((0,d.assert)(!(e in this.uidIndex_),30),this.uidIndex_[e]=t),r},s.prototype.addFeatures=function(e){this.addFeaturesInternal(e),this.changed()},s.prototype.addFeaturesInternal=function(e){for(var t=[],r=[],n=[],i=0,o=e.length;i<o;i++){var s=e[i],a=(0,_.getUid)(s);this.addToIndex_(a,s)&&r.push(s)}i=0;for(var h=r.length;i<h;i++){s=r[i],a=(0,_.getUid)(s);this.setupChangeEvents_(a,s);var l=s.getGeometry();if(l){var d=l.getExtent();t.push(d),n.push(s)}else this.nullGeometryFeatures_[a]=s}this.featuresRtree_&&this.featuresRtree_.load(t,n);i=0;for(var f=r.length;i<f;i++)this.dispatchEvent(new x(u.default.ADDFEATURE,r[i]))},s.prototype.bindFeaturesCollection_=function(e){var r=!1;this.addEventListener(u.default.ADDFEATURE,function(t){r||(r=!0,e.push(t.feature),r=!1)}),this.addEventListener(u.default.REMOVEFEATURE,function(t){r||(r=!0,e.remove(t.feature),r=!1)}),e.addEventListener(t.default.ADD,function(e){r||(r=!0,this.addFeature(e.element),r=!1)}.bind(this)),e.addEventListener(t.default.REMOVE,function(e){r||(r=!0,this.removeFeature(e.element),r=!1)}.bind(this)),this.featuresCollection_=e},s.prototype.clear=function(e){if(e){for(var t in this.featureChangeKeys_){this.featureChangeKeys_[t].forEach(v.unlistenByKey)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var r in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var n=new x(u.default.CLEAR);this.dispatchEvent(n),this.changed()},s.prototype.forEachFeature=function(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},s.prototype.forEachFeatureAtCoordinateDirect=function(e,t){var r=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(r,function(r){return r.getGeometry().intersectsCoordinate(e)?t(r):void 0})},s.prototype.forEachFeatureInExtent=function(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},s.prototype.forEachFeatureIntersectingExtent=function(e,t){return this.forEachFeatureInExtent(e,function(r){if(r.getGeometry().intersectsExtent(e)){var n=t(r);if(n)return n}})},s.prototype.getFeaturesCollection=function(){return this.featuresCollection_},s.prototype.getFeatures=function(){var e;return this.featuresCollection_?e=this.featuresCollection_.getArray():this.featuresRtree_&&(e=this.featuresRtree_.getAll(),(0,p.isEmpty)(this.nullGeometryFeatures_)||(0,c.extend)(e,(0,p.getValues)(this.nullGeometryFeatures_))),e},s.prototype.getFeaturesAtCoordinate=function(e){var t=[];return this.forEachFeatureAtCoordinateDirect(e,function(e){t.push(e)}),t},s.prototype.getFeaturesInExtent=function(e){return this.featuresRtree_?this.featuresRtree_.getInExtent(e):this.featuresCollection_?this.featuresCollection_.getArray():[]},s.prototype.getClosestFeatureToCoordinate=function(e,t){var r=e[0],n=e[1],i=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],u=t||h.TRUE;return this.featuresRtree_.forEachInExtent(a,function(e){if(u(e)){var t=e.getGeometry(),h=s;if((s=t.closestPointXY(r,n,o,s))<h){i=e;var l=Math.sqrt(s);a[0]=r-l,a[1]=n-l,a[2]=r+l,a[3]=n+l}}}),i},s.prototype.getExtent=function(e){return this.featuresRtree_.getExtent(e)},s.prototype.getFeatureById=function(e){var t=this.idIndex_[e.toString()];return void 0!==t?t:null},s.prototype.getFeatureByUid=function(e){var t=this.uidIndex_[e];return void 0!==t?t:null},s.prototype.getFormat=function(){return this.format_},s.prototype.getOverlaps=function(){return this.overlaps_},s.prototype.getUrl=function(){return this.url_},s.prototype.handleFeatureChange_=function(e){var t=e.target,r=(0,_.getUid)(t),n=t.getGeometry();if(n){var i=n.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(i,t)):this.featuresRtree_&&this.featuresRtree_.update(i,t)}else r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[r]=t);var o=t.getId();if(void 0!==o){var s=o.toString();this.idIndex_[s]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[s]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[r]=t;this.changed(),this.dispatchEvent(new x(u.default.CHANGEFEATURE,t))},s.prototype.hasFeature=function(e){var t=e.getId();return void 0!==t?t in this.idIndex_:(0,_.getUid)(e)in this.uidIndex_},s.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&(0,p.isEmpty)(this.nullGeometryFeatures_)},s.prototype.loadFeatures=function(e,t,r){var n=this.loadedExtentsRtree_,i=this.strategy_(e,t);this.loading=!1;for(var o=function(e,o){var a=i[e];n.forEachInExtent(a,function(e){return(0,f.containsExtent)(e.extent,a)})||(s.loader_.call(s,a,t,r),n.insert(a,{extent:a.slice()}),s.loading=s.loader_!==h.VOID)},s=this,a=0,u=i.length;a<u;++a)o(a)},s.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),r.prototype.refresh.call(this)},s.prototype.removeLoadedExtent=function(e){var t,r=this.loadedExtentsRtree_;r.forEachInExtent(e,function(r){if((0,f.equals)(r.extent,e))return t=r,!0}),t&&r.remove(t)},s.prototype.removeFeature=function(e){var t=(0,_.getUid)(e);t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e),this.removeFeatureInternal(e),this.changed()},s.prototype.removeFeatureInternal=function(e){var t=(0,_.getUid)(e);this.featureChangeKeys_[t].forEach(v.unlistenByKey),delete this.featureChangeKeys_[t];var r=e.getId();void 0!==r&&delete this.idIndex_[r.toString()],delete this.uidIndex_[t],this.dispatchEvent(new x(u.default.REMOVEFEATURE,e))},s.prototype.removeFromIdIndex_=function(e){var t=!1;for(var r in this.idIndex_)if(this.idIndex_[r]===e){delete this.idIndex_[r],t=!0;break}return t},s.prototype.setLoader=function(e){this.loader_=e},s.prototype.setUrl=function(e){(0,d.assert)(this.format_,7),this.setLoader((0,y.xhr)(e,this.format_))},s}(s.default),I=F;exports.default=I; },{"../Collection.js":"FnDa","../CollectionEventType.js":"BTrx","../events/Event.js":"fKNg","../events/EventType.js":"C8cu","../ObjectEventType.js":"zehl","../structs/RBush.js":"MiUH","./Source.js":"H38a","./State.js":"iC8j","./VectorEventType.js":"s8Fc","../functions.js":"RgA2","../loadingstrategy.js":"JpXE","../asserts.js":"fLG6","../extent.js":"QDir","../array.js":"luEr","../util.js":"KniQ","../obj.js":"mH6q","../events.js":"UqnM","../featureloader.js":"U3JP"}],"e7i2":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createRegularPolygon=R,exports.createBox=j,exports.default=void 0;var t=L(require("../geom/Circle.js")),e=L(require("../events/Event.js")),i=L(require("../events/EventType.js")),o=L(require("../Feature.js")),s=L(require("../geom/GeometryType.js")),r=L(require("./Property.js")),n=L(require("../geom/LineString.js")),a=L(require("../MapBrowserEvent.js")),h=L(require("../MapBrowserEventType.js")),d=L(require("../geom/MultiLineString.js")),u=L(require("../geom/MultiPoint.js")),_=L(require("../geom/MultiPolygon.js")),c=L(require("../geom/Point.js")),l=L(require("./Pointer.js")),f=O(require("../geom/Polygon.js")),p=L(require("../layer/Vector.js")),g=L(require("../source/Vector.js")),y=require("../functions.js"),m=require("../events/condition.js"),C=require("../extent.js"),v=require("../style/Style.js"),P=require("../proj.js"),k=require("../Object.js"),T=require("../coordinate.js");function w(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return w=function(){return t},t}function O(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=w();if(e&&e.has(t))return e.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){var r=o?Object.getOwnPropertyDescriptor(t,s):null;r&&(r.get||r.set)?Object.defineProperty(i,s,r):i[s]=t[s]}return i.default=t,e&&e.set(t,i),i}function L(t){return t&&t.__esModule?t:{default:t}}var N=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),D={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",CIRCLE:"Circle"},I={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"},E=function(t){function e(e,i){var o=t.call(this,e)||this;return o.feature=i,o}return N(e,t),e}(e.default),G=function(e){function l(i){var o=this,a=i;a.stopDown||(a.stopDown=y.FALSE),(o=e.call(this,a)||this).shouldHandle_=!1,o.downPx_=null,o.downTimeout_,o.lastDragTime_,o.freehand_=!1,o.source_=i.source?i.source:null,o.features_=i.features?i.features:null,o.snapTolerance_=i.snapTolerance?i.snapTolerance:12,o.type_=i.type,o.mode_=M(o.type_),o.stopClick_=!!i.stopClick,o.minPoints_=i.minPoints?i.minPoints:o.mode_===D.POLYGON?3:2,o.maxPoints_=i.maxPoints?i.maxPoints:1/0,o.finishCondition_=i.finishCondition?i.finishCondition:y.TRUE;var h=i.geometryFunction;if(!h)if(o.type_===s.default.CIRCLE)h=function(e,i,o){var s=i||new t.default([NaN,NaN]),r=(0,P.fromUserCoordinate)(e[0],o),n=(0,T.squaredDistance)(r,(0,P.fromUserCoordinate)(e[1],o));s.setCenterAndRadius(r,Math.sqrt(n));var a=(0,P.getUserProjection)();return a&&s.transform(o,a),s};else{var d,u=o.mode_;u===D.POINT?d=c.default:u===D.LINE_STRING?d=n.default:u===D.POLYGON&&(d=f.default),h=function(t,e,i){var o=e;return o?u===D.POLYGON?t[0].length?o.setCoordinates([t[0].concat([t[0][0]])]):o.setCoordinates([]):o.setCoordinates(t):o=new d(t),o}}return o.geometryFunction_=h,o.dragVertexDelay_=void 0!==i.dragVertexDelay?i.dragVertexDelay:500,o.finishCoordinate_=null,o.sketchFeature_=null,o.sketchPoint_=null,o.sketchCoords_=null,o.sketchLine_=null,o.sketchLineCoords_=null,o.squaredClickTolerance_=i.clickTolerance?i.clickTolerance*i.clickTolerance:36,o.overlay_=new p.default({source:new g.default({useSpatialIndex:!1,wrapX:!!i.wrapX&&i.wrapX}),style:i.style?i.style:F(),updateWhileInteracting:!0}),o.geometryName_=i.geometryName,o.condition_=i.condition?i.condition:m.noModifierKeys,o.freehandCondition_,i.freehand?o.freehandCondition_=m.always:o.freehandCondition_=i.freehandCondition?i.freehandCondition:m.shiftKeyOnly,o.addEventListener((0,k.getChangeEventType)(r.default.ACTIVE),o.updateState_),o}return N(l,e),l.prototype.setMap=function(t){e.prototype.setMap.call(this,t),this.updateState_()},l.prototype.getOverlay=function(){return this.overlay_},l.prototype.handleEvent=function(t){t.originalEvent.type===i.default.CONTEXTMENU&&t.preventDefault(),this.freehand_=this.mode_!==D.POINT&&this.freehandCondition_(t);var o=t.type===h.default.POINTERMOVE,s=!0;!this.freehand_&&this.lastDragTime_&&t.type===h.default.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,o=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&t.type===h.default.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(t.coordinate),s=!1):this.freehand_&&t.type===h.default.POINTERDOWN?s=!1:o?(s=t.type===h.default.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(t),this.shouldHandle_&&t.preventDefault()):("mouse"==t.originalEvent.pointerType||t.type===h.default.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(t):t.type===h.default.DBLCLICK&&(s=!1),e.prototype.handleEvent.call(this,t)&&s},l.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new a.default(h.default.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},l.prototype.handleUpEvent=function(t){var e=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);var i=this.mode_===D.CIRCLE;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||i?this.finishDrawing():this.atFinish_(t)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate):(this.startDrawing_(t),this.mode_===D.POINT&&this.finishDrawing()),e=!1):this.freehand_&&this.abortDrawing(),!e&&this.stopClick_&&t.stopPropagation(),e},l.prototype.handlePointerMove_=function(t){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,i=t.pixel,o=e[0]-i[0],s=e[1]-i[1],r=o*o+s*s;if(this.shouldHandle_=this.freehand_?r>this.squaredClickTolerance_:r<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t):this.createOrUpdateSketchPoint_(t)},l.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_];if(this.mode_===D.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===D.POLYGON){var s=this.sketchCoords_;i=s[0].length>this.minPoints_,o=[s[0][0],s[0][s[0].length-2]]}if(i)for(var r=t.map,n=0,a=o.length;n<a;n++){var h=o[n],d=r.getPixelFromCoordinate(h),u=t.pixel,_=u[0]-d[0],c=u[1]-d[1],l=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(_*_+c*c)<=l){this.finishCoordinate_=h;break}}}return e},l.prototype.createOrUpdateSketchPoint_=function(t){var e=t.coordinate.slice();this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new o.default(new c.default(e)),this.updateSketchFeatures_())},l.prototype.startDrawing_=function(t){var e=t.coordinate,i=t.map.getView().getProjection();this.finishCoordinate_=e,this.mode_===D.POINT?this.sketchCoords_=e.slice():this.mode_===D.POLYGON?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new o.default(new n.default(this.sketchLineCoords_)));var s=this.geometryFunction_(this.sketchCoords_,void 0,i);this.sketchFeature_=new o.default,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(s),this.updateSketchFeatures_(),this.dispatchEvent(new E(I.DRAWSTART,this.sketchFeature_))},l.prototype.modifyDrawing_=function(t){var e,i,r,a=t.coordinate,h=this.sketchFeature_.getGeometry(),d=t.map.getView().getProjection();(this.mode_===D.POINT?i=this.sketchCoords_:this.mode_===D.POLYGON?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(t)&&(a=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=a[0],i[1]=a[1],this.geometryFunction_(this.sketchCoords_,h,d),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(a);if(h.getType()==s.default.POLYGON&&this.mode_!==D.POLYGON){this.sketchLine_||(this.sketchLine_=new o.default);var u=h.getLinearRing(0);(r=this.sketchLine_.getGeometry())?(r.setFlatCoordinates(u.getLayout(),u.getFlatCoordinates()),r.changed()):(r=new n.default(u.getFlatCoordinates(),u.getLayout()),this.sketchLine_.setGeometry(r))}else this.sketchLineCoords_&&(r=this.sketchLine_.getGeometry()).setCoordinates(this.sketchLineCoords_);this.updateSketchFeatures_()},l.prototype.addToDrawing_=function(t){var e,i,o=this.sketchFeature_.getGeometry(),s=this.getMap().getView().getProjection();this.mode_===D.LINE_STRING?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,o,s)):this.mode_===D.POLYGON&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,o,s)),this.updateSketchFeatures_(),e&&this.finishDrawing()},l.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection();this.mode_===D.LINE_STRING?((t=this.sketchCoords_).splice(-2,1),this.geometryFunction_(t,e,i),t.length>=2&&(this.finishCoordinate_=t[t.length-2].slice())):this.mode_===D.POLYGON&&((t=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)),0===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},l.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===D.LINE_STRING?(e.pop(),this.geometryFunction_(e,i,o)):this.mode_===D.POLYGON&&(e[0].pop(),this.geometryFunction_(e,i,o),e=i.getCoordinates()),this.type_===s.default.MULTI_POINT?t.setGeometry(new u.default([e])):this.type_===s.default.MULTI_LINE_STRING?t.setGeometry(new d.default([e])):this.type_===s.default.MULTI_POLYGON&&t.setGeometry(new _.default([e])),this.dispatchEvent(new E(I.DRAWEND,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},l.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},l.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new E(I.DRAWABORT,t))},l.prototype.appendCoordinates=function(t){var e=this.mode_,i=[];e===D.LINE_STRING?i=this.sketchCoords_:e===D.POLYGON&&(i=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]);for(var o=i.pop(),s=0;s<t.length;s++)this.addToDrawing_(t[s]);this.addToDrawing_(o)},l.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.updateSketchFeatures_(),this.dispatchEvent(new E(I.DRAWSTART,this.sketchFeature_))},l.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},l.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},l}(l.default);function F(){var t=(0,v.createEditingStyle)();return function(e,i){return t[e.getGeometry().getType()]}}function R(e,i){return function(o,s,r){var n=(0,P.fromUserCoordinate)(o[0],r),a=(0,P.fromUserCoordinate)(o[1],r),h=Math.sqrt((0,T.squaredDistance)(n,a)),d=s||(0,f.fromCircle)(new t.default(n),e),u=i;if(!i){var _=a[0]-n[0],c=a[1]-n[1];u=Math.atan(c/_)-(_<0?Math.PI:0)}(0,f.makeRegular)(d,n,h,u);var l=(0,P.getUserProjection)();return l&&d.transform(r,l),d}}function j(){return function(t,e,i){var o=(0,C.boundingExtent)(t.map(function(t){return(0,P.fromUserCoordinate)(t,i)})),s=[[(0,C.getBottomLeft)(o),(0,C.getBottomRight)(o),(0,C.getTopRight)(o),(0,C.getTopLeft)(o),(0,C.getBottomLeft)(o)]],r=e;r?r.setCoordinates(s):r=new f.default(s);var n=(0,P.getUserProjection)();return n&&r.transform(i,n),r}}function M(t){var e;return t===s.default.POINT||t===s.default.MULTI_POINT?e=D.POINT:t===s.default.LINE_STRING||t===s.default.MULTI_LINE_STRING?e=D.LINE_STRING:t===s.default.POLYGON||t===s.default.MULTI_POLYGON?e=D.POLYGON:t===s.default.CIRCLE&&(e=D.CIRCLE),e}var S=G;exports.default=S; },{"../geom/Circle.js":"AyCw","../events/Event.js":"fKNg","../events/EventType.js":"C8cu","../Feature.js":"mYW9","../geom/GeometryType.js":"lmV0","./Property.js":"caOi","../geom/LineString.js":"DfxW","../MapBrowserEvent.js":"HMLS","../MapBrowserEventType.js":"YhDM","../geom/MultiLineString.js":"fbCo","../geom/MultiPoint.js":"dNu5","../geom/MultiPolygon.js":"ouhF","../geom/Point.js":"gLcY","./Pointer.js":"dnA2","../geom/Polygon.js":"Nwwk","../layer/Vector.js":"dflx","../source/Vector.js":"ZS12","../functions.js":"RgA2","../events/condition.js":"YcID","../extent.js":"QDir","../style/Style.js":"he4w","../proj.js":"Diht","../Object.js":"PhPh","../coordinate.js":"nGsj"}],"o7b8":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=h(require("../events/Event.js")),t=h(require("../Feature.js")),n=h(require("../geom/GeometryType.js")),r=h(require("../MapBrowserEventType.js")),o=h(require("../geom/Point.js")),i=h(require("./Pointer.js")),a=h(require("../layer/Vector.js")),u=h(require("../source/Vector.js")),l=require("../events/condition.js"),s=require("../extent.js"),p=require("../coordinate.js"),c=require("../style/Style.js"),d=require("../geom/Polygon.js"),x=require("../proj.js");function h(e){return e&&e.__esModule?e:{default:e}}var f=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_={EXTENTCHANGED:"extentchanged"},v=function(e){function t(t){var n=e.call(this,_.EXTENTCHANGED)||this;return n.extent=t,n}return f(t,e),t}(e.default),y=function(e){function n(t){var n=this,r=t||{};return(n=e.call(this,r)||this).condition_=r.condition?r.condition:l.always,n.extent_=null,n.pointerHandler_=null,n.pixelTolerance_=void 0!==r.pixelTolerance?r.pixelTolerance:10,n.snappedToVertex_=!1,n.extentFeature_=null,n.vertexFeature_=null,t||(t={}),n.extentOverlay_=new a.default({source:new u.default({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.boxStyle?t.boxStyle:g(),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.vertexOverlay_=new a.default({source:new u.default({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.pointerStyle?t.pointerStyle:E(),updateWhileAnimating:!0,updateWhileInteracting:!0}),t.extent&&n.setExtent(t.extent),n}return f(n,e),n.prototype.snapToVertex_=function(e,t){var n=t.getCoordinateFromPixelInternal(e),r=this.getExtentInternal();if(r){var o=P(r);o.sort(function(e,t){return(0,p.squaredDistanceToSegment)(n,e)-(0,p.squaredDistanceToSegment)(n,t)});var i=o[0],a=(0,p.closestOnSegment)(n,i),u=t.getPixelFromCoordinateInternal(a);if((0,p.distance)(e,u)<=this.pixelTolerance_){var l=t.getPixelFromCoordinateInternal(i[0]),s=t.getPixelFromCoordinateInternal(i[1]),c=(0,p.squaredDistance)(u,l),d=(0,p.squaredDistance)(u,s),x=Math.sqrt(Math.min(c,d));return this.snappedToVertex_=x<=this.pixelTolerance_,this.snappedToVertex_&&(a=c>d?i[1]:i[0]),a}}return null},n.prototype.handlePointerMove_=function(e){var t=e.pixel,n=e.map,r=this.snapToVertex_(t,n);r||(r=n.getCoordinateFromPixelInternal(t)),this.createOrUpdatePointerFeature_(r)},n.prototype.createOrUpdateExtentFeature_=function(e){var n=this.extentFeature_;return n?e?n.setGeometry((0,d.fromExtent)(e)):n.setGeometry(void 0):(n=e?new t.default((0,d.fromExtent)(e)):new t.default({}),this.extentFeature_=n,this.extentOverlay_.getSource().addFeature(n)),n},n.prototype.createOrUpdatePointerFeature_=function(e){var n=this.vertexFeature_;n?n.getGeometry().setCoordinates(e):(n=new t.default(new o.default(e)),this.vertexFeature_=n,this.vertexOverlay_.getSource().addFeature(n));return n},n.prototype.handleEvent=function(t){return!t.originalEvent||!this.condition_(t)||(t.type!=r.default.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),e.prototype.handleEvent.call(this,t),!1)},n.prototype.handleDownEvent=function(e){var t=e.pixel,n=e.map,r=this.getExtentInternal(),o=this.snapToVertex_(t,n),i=function(e){var t=null,n=null;return e[0]==r[0]?t=r[2]:e[0]==r[2]&&(t=r[0]),e[1]==r[1]?n=r[3]:e[1]==r[3]&&(n=r[1]),null!==t&&null!==n?[t,n]:null};if(o&&r){var a=o[0]==r[0]||o[0]==r[2]?o[0]:null,u=o[1]==r[1]||o[1]==r[3]?o[1]:null;null!==a&&null!==u?this.pointerHandler_=m(i(o)):null!==a?this.pointerHandler_=O(i([a,r[1]]),i([a,r[3]])):null!==u&&(this.pointerHandler_=O(i([r[0],u]),i([r[2],u])))}else o=n.getCoordinateFromPixelInternal(t),this.setExtent([o[0],o[1],o[0],o[1]]),this.pointerHandler_=m(o);return!0},n.prototype.handleDragEvent=function(e){if(this.pointerHandler_){var t=e.coordinate;this.setExtent(this.pointerHandler_(t)),this.createOrUpdatePointerFeature_(t)}},n.prototype.handleUpEvent=function(e){this.pointerHandler_=null;var t=this.getExtentInternal();return t&&0!==(0,s.getArea)(t)||this.setExtent(null),!1},n.prototype.setMap=function(t){this.extentOverlay_.setMap(t),this.vertexOverlay_.setMap(t),e.prototype.setMap.call(this,t)},n.prototype.getExtent=function(){return(0,x.toUserExtent)(this.getExtentInternal(),this.getMap().getView().getProjection())},n.prototype.getExtentInternal=function(){return this.extent_},n.prototype.setExtent=function(e){this.extent_=e||null,this.createOrUpdateExtentFeature_(e),this.dispatchEvent(new v(this.extent_))},n}(i.default);function g(){var e=(0,c.createEditingStyle)();return function(t,r){return e[n.default.POLYGON]}}function E(){var e=(0,c.createEditingStyle)();return function(t,r){return e[n.default.POINT]}}function m(e){return function(t){return(0,s.boundingExtent)([e,t])}}function O(e,t){return e[0]==t[0]?function(n){return(0,s.boundingExtent)([e,[n[0],t[1]]])}:e[1]==t[1]?function(n){return(0,s.boundingExtent)([e,[t[0],n[1]]])}:null}function P(e){return[[[e[0],e[1]],[e[0],e[3]]],[[e[0],e[3]],[e[2],e[3]]],[[e[2],e[3]],[e[2],e[1]]],[[e[2],e[1]],[e[0],e[1]]]]}var T=y;exports.default=T; },{"../events/Event.js":"fKNg","../Feature.js":"mYW9","../geom/GeometryType.js":"lmV0","../MapBrowserEventType.js":"YhDM","../geom/Point.js":"gLcY","./Pointer.js":"dnA2","../layer/Vector.js":"dflx","../source/Vector.js":"ZS12","../events/condition.js":"YcID","../extent.js":"QDir","../coordinate.js":"nGsj","../style/Style.js":"he4w","../geom/Polygon.js":"Nwwk","../proj.js":"Diht"}],"qrxo":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.ModifyEvent=void 0;var e=C(require("../Collection.js")),t=C(require("../CollectionEventType.js")),r=C(require("../events/Event.js")),n=C(require("../events/EventType.js")),i=C(require("../Feature.js")),o=C(require("../geom/GeometryType.js")),a=C(require("../MapBrowserEventType.js")),s=C(require("../geom/Point.js")),u=C(require("./Pointer.js")),d=C(require("../structs/RBush.js")),l=C(require("../source/VectorEventType.js")),g=C(require("../layer/Vector.js")),h=C(require("../source/Vector.js")),f=require("../events/condition.js"),_=require("../extent.js"),p=require("../coordinate.js"),c=require("../style/Style.js"),m=require("../array.js"),v=require("../geom/Polygon.js"),y=require("../proj.js"),x=require("../util.js");function C(e){return e&&e.__esModule?e:{default:e}}var E=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),S=0,F=1,P=[0,0,0,0],T=[],I={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"},w=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.features=r,i.mapBrowserEvent=n,i}return E(t,e),t}(r.default);exports.ModifyEvent=w;var G=function(r){function u(n){var i,o=r.call(this,n)||this;if(o.boundHandleFeatureChange_=o.handleFeatureChange_.bind(o),o.condition_=n.condition?n.condition:f.primaryAction,o.defaultDeleteCondition_=function(e){return(0,f.altKeyOnly)(e)&&(0,f.singleClick)(e)},o.deleteCondition_=n.deleteCondition?n.deleteCondition:o.defaultDeleteCondition_,o.insertVertexCondition_=n.insertVertexCondition?n.insertVertexCondition:f.always,o.vertexFeature_=null,o.vertexSegments_=null,o.lastPixel_=[0,0],o.ignoreNextSingleClick_=!1,o.modified_=!1,o.rBush_=new d.default,o.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,o.snappedToVertex_=!1,o.changingFeature_=!1,o.dragSegments_=[],o.overlay_=new g.default({source:new h.default({useSpatialIndex:!1,wrapX:!!n.wrapX}),style:n.style?n.style:b(),updateWhileAnimating:!0,updateWhileInteracting:!0}),o.SEGMENT_WRITERS_={Point:o.writePointGeometry_.bind(o),LineString:o.writeLineStringGeometry_.bind(o),LinearRing:o.writeLineStringGeometry_.bind(o),Polygon:o.writePolygonGeometry_.bind(o),MultiPoint:o.writeMultiPointGeometry_.bind(o),MultiLineString:o.writeMultiLineStringGeometry_.bind(o),MultiPolygon:o.writeMultiPolygonGeometry_.bind(o),Circle:o.writeCircleGeometry_.bind(o),GeometryCollection:o.writeGeometryCollectionGeometry_.bind(o)},o.source_=null,n.source?(o.source_=n.source,i=new e.default(o.source_.getFeatures()),o.source_.addEventListener(l.default.ADDFEATURE,o.handleSourceAdd_.bind(o)),o.source_.addEventListener(l.default.REMOVEFEATURE,o.handleSourceRemove_.bind(o))):i=n.features,!i)throw new Error("The modify interaction requires features or a source");return o.features_=i,o.features_.forEach(o.addFeature_.bind(o)),o.features_.addEventListener(t.default.ADD,o.handleFeatureAdd_.bind(o)),o.features_.addEventListener(t.default.REMOVE,o.handleFeatureRemove_.bind(o)),o.lastPointerEvent_=null,o}return E(u,r),u.prototype.addFeature_=function(e){var t=e.getGeometry();if(t){var r=this.SEGMENT_WRITERS_[t.getType()];r&&r(e,t)}var i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),e.addEventListener(n.default.CHANGE,this.boundHandleFeatureChange_)},u.prototype.willModifyFeatures_=function(e){this.modified_||(this.modified_=!0,this.dispatchEvent(new w(I.MODIFYSTART,this.features_,e)))},u.prototype.removeFeature_=function(e){this.removeFeatureSegmentData_(e),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.removeEventListener(n.default.CHANGE,this.boundHandleFeatureChange_)},u.prototype.removeFeatureSegmentData_=function(e){var t=this.rBush_,r=[];t.forEach(function(t){e===t.feature&&r.push(t)});for(var n=r.length-1;n>=0;--n){for(var i=r[n],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===i&&this.dragSegments_.splice(o,1);t.remove(i)}},u.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),r.prototype.setActive.call(this,e)},u.prototype.setMap=function(e){this.overlay_.setMap(e),r.prototype.setMap.call(this,e)},u.prototype.getOverlay=function(){return this.overlay_},u.prototype.handleSourceAdd_=function(e){e.feature&&this.features_.push(e.feature)},u.prototype.handleSourceRemove_=function(e){e.feature&&this.features_.remove(e.feature)},u.prototype.handleFeatureAdd_=function(e){this.addFeature_(e.element)},u.prototype.handleFeatureChange_=function(e){if(!this.changingFeature_){var t=e.target;this.removeFeature_(t),this.addFeature_(t)}},u.prototype.handleFeatureRemove_=function(e){var t=e.element;this.removeFeature_(t)},u.prototype.writePointGeometry_=function(e,t){var r=t.getCoordinates(),n={feature:e,geometry:t,segment:[r,r]};this.rBush_.insert(t.getExtent(),n)},u.prototype.writeMultiPointGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,i=r.length;n<i;++n){var o=r[n],a={feature:e,geometry:t,depth:[n],index:n,segment:[o,o]};this.rBush_.insert(t.getExtent(),a)}},u.prototype.writeLineStringGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),a={feature:e,geometry:t,index:n,segment:o};this.rBush_.insert((0,_.boundingExtent)(o),a)}},u.prototype.writeMultiLineStringGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),d={feature:e,geometry:t,depth:[n],index:a,segment:u};this.rBush_.insert((0,_.boundingExtent)(u),d)}},u.prototype.writePolygonGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),d={feature:e,geometry:t,depth:[n],index:a,segment:u};this.rBush_.insert((0,_.boundingExtent)(u),d)}},u.prototype.writeMultiPolygonGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length;a<s;++a)for(var u=o[a],d=0,l=u.length-1;d<l;++d){var g=u.slice(d,d+2),h={feature:e,geometry:t,depth:[a,n],index:d,segment:g};this.rBush_.insert((0,_.boundingExtent)(g),h)}},u.prototype.writeCircleGeometry_=function(e,t){var r=t.getCenter(),n={feature:e,geometry:t,index:S,segment:[r,r]},i={feature:e,geometry:t,index:F,segment:[r,r]},o=[n,i];n.featureSegments=o,i.featureSegments=o,this.rBush_.insert((0,_.createOrUpdateFromCoordinate)(r),n);var a=t,s=(0,y.getUserProjection)();if(s&&this.getMap()){var u=this.getMap().getView().getProjection();a=a.clone().transform(s,u),a=(0,v.fromCircle)(a).transform(u,s)}this.rBush_.insert(a.getExtent(),i)},u.prototype.writeGeometryCollectionGeometry_=function(e,t){for(var r=t.getGeometriesArray(),n=0;n<r.length;++n){var i=r[n];(0,this.SEGMENT_WRITERS_[i.getType()])(e,i)}},u.prototype.createOrUpdateVertexFeature_=function(e){var t=this.vertexFeature_;t?t.getGeometry().setCoordinates(e):(t=new i.default(new s.default(e)),this.vertexFeature_=t,this.overlay_.getSource().addFeature(t));return t},u.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=a.default.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(t=!(e.type!=a.default.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==a.default.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),r.prototype.handleEvent.call(this,e)&&!t);var t},u.prototype.handleDragEvent=function(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e);for(var t=e.coordinate,r=0,n=this.dragSegments_.length;r<n;++r){for(var i=this.dragSegments_[r],a=i[0],s=a.depth,u=a.geometry,d=void 0,l=a.segment,g=i[1];t.length<u.getStride();)t.push(l[g][t.length]);switch(u.getType()){case o.default.POINT:d=t,l[0]=t,l[1]=t;break;case o.default.MULTI_POINT:(d=u.getCoordinates())[a.index]=t,l[0]=t,l[1]=t;break;case o.default.LINE_STRING:(d=u.getCoordinates())[a.index+g]=t,l[g]=t;break;case o.default.MULTI_LINE_STRING:case o.default.POLYGON:(d=u.getCoordinates())[s[0]][a.index+g]=t,l[g]=t;break;case o.default.MULTI_POLYGON:(d=u.getCoordinates())[s[1]][s[0]][a.index+g]=t,l[g]=t;break;case o.default.CIRCLE:if(l[0]=t,l[1]=t,a.index===S)this.changingFeature_=!0,u.setCenter(t),this.changingFeature_=!1;else{this.changingFeature_=!0;var h=e.map.getView().getProjection(),f=(0,p.distance)((0,y.fromUserCoordinate)(u.getCenter(),h),(0,y.fromUserCoordinate)(t,h)),_=(0,y.getUserProjection)();if(_){var c=u.clone().transform(_,h);c.setRadius(f),f=c.transform(h,_).getRadius()}u.setRadius(f),this.changingFeature_=!1}}d&&this.setGeometryCoordinates_(u,d)}this.createOrUpdateVertexFeature_(t)},u.prototype.handleDownEvent=function(e){if(!this.condition_(e))return!1;var t=e.coordinate;this.handlePointerAtPixel_(e.pixel,e.map,t),this.dragSegments_.length=0,this.modified_=!1;var r=this.vertexFeature_;if(r){var n=e.map.getView().getProjection(),i=[],a=r.getGeometry().getCoordinates(),s=(0,_.boundingExtent)([a]),u=this.rBush_.getInExtent(s),d={};u.sort(M);for(var l=0,g=u.length;l<g;++l){var h=u[l],f=h.segment,c=(0,x.getUid)(h.geometry),m=h.depth;if(m&&(c+="-"+m.join("-")),d[c]||(d[c]=new Array(2)),h.geometry.getType()!==o.default.CIRCLE||h.index!==F)if(!(0,p.equals)(f[0],a)||d[c][0])if(!(0,p.equals)(f[1],a)||d[c][1])(0,x.getUid)(f)in this.vertexSegments_&&!d[c][0]&&!d[c][1]&&this.insertVertexCondition_(e)&&i.push([h,a]);else{if((h.geometry.getType()===o.default.LINE_STRING||h.geometry.getType()===o.default.MULTI_LINE_STRING)&&d[c][0]&&0===d[c][0].index)continue;this.dragSegments_.push([h,1]),d[c][1]=h}else this.dragSegments_.push([h,0]),d[c][0]=h;else{var v=U(t,h,n);(0,p.equals)(v,a)&&!d[c][0]&&(this.dragSegments_.push([h,0]),d[c][0]=h)}}i.length&&this.willModifyFeatures_(e);for(var y=i.length-1;y>=0;--y)this.insertVertex_.apply(this,i[y])}return!!this.vertexFeature_},u.prototype.handleUpEvent=function(e){for(var t=this.dragSegments_.length-1;t>=0;--t){var r=this.dragSegments_[t][0],n=r.geometry;if(n.getType()===o.default.CIRCLE){var i=n.getCenter(),a=r.featureSegments[0],s=r.featureSegments[1];a.segment[0]=i,a.segment[1]=i,s.segment[0]=i,s.segment[1]=i,this.rBush_.update((0,_.createOrUpdateFromCoordinate)(i),a);var u=n,d=(0,y.getUserProjection)();if(d){var l=e.map.getView().getProjection();u=u.clone().transform(d,l),u=(0,v.fromCircle)(u).transform(l,d)}this.rBush_.update(u.getExtent(),s)}else this.rBush_.update((0,_.boundingExtent)(r.segment),r)}return this.modified_&&(this.dispatchEvent(new w(I.MODIFYEND,this.features_,e)),this.modified_=!1),!1},u.prototype.handlePointerMove_=function(e){this.lastPixel_=e.pixel,this.handlePointerAtPixel_(e.pixel,e.map,e.coordinate)},u.prototype.handlePointerAtPixel_=function(e,t,r){var n=r||t.getCoordinateFromPixel(e),i=t.getView().getProjection(),a=(0,y.fromUserExtent)((0,_.createOrUpdateFromCoordinate)(n,P),i),s=t.getView().getResolution()*this.pixelTolerance_,u=(0,y.toUserExtent)((0,_.buffer)(a,s,P),i),d=this.rBush_.getInExtent(u);if(d.length>0){d.sort(function(e,t){return L(n,e,i)-L(n,t,i)});var l=d[0],g=l.segment,h=U(n,l,i),f=t.getPixelFromCoordinate(h),c=(0,p.distance)(e,f);if(c<=this.pixelTolerance_){var m={};if(l.geometry.getType()===o.default.CIRCLE&&l.index===F)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h);else{var v=t.getPixelFromCoordinate(g[0]),C=t.getPixelFromCoordinate(g[1]),E=(0,p.squaredDistance)(f,v),S=(0,p.squaredDistance)(f,C);c=Math.sqrt(Math.min(E,S)),this.snappedToVertex_=c<=this.pixelTolerance_,this.snappedToVertex_&&(h=E>S?g[1]:g[0]),this.createOrUpdateVertexFeature_(h);for(var T=1,I=d.length;T<I;++T){var w=d[T].segment;if(!((0,p.equals)(g[0],w[0])&&(0,p.equals)(g[1],w[1])||(0,p.equals)(g[0],w[1])&&(0,p.equals)(g[1],w[0])))break;m[(0,x.getUid)(w)]=!0}}return m[(0,x.getUid)(g)]=!0,void(this.vertexSegments_=m)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},u.prototype.insertVertex_=function(e,t){for(var r,n=e.segment,i=e.feature,a=e.geometry,s=e.depth,u=e.index;t.length<a.getStride();)t.push(0);switch(a.getType()){case o.default.MULTI_LINE_STRING:case o.default.POLYGON:(r=a.getCoordinates())[s[0]].splice(u+1,0,t);break;case o.default.MULTI_POLYGON:(r=a.getCoordinates())[s[1]][s[0]].splice(u+1,0,t);break;case o.default.LINE_STRING:(r=a.getCoordinates()).splice(u+1,0,t);break;default:return}this.setGeometryCoordinates_(a,r);var d=this.rBush_;d.remove(e),this.updateSegmentIndices_(a,u,s,1);var l={segment:[n[0],t],feature:i,geometry:a,depth:s,index:u};d.insert((0,_.boundingExtent)(l.segment),l),this.dragSegments_.push([l,1]);var g={segment:[t,n[1]],feature:i,geometry:a,depth:s,index:u+1};d.insert((0,_.boundingExtent)(g.segment),g),this.dragSegments_.push([g,0]),this.ignoreNextSingleClick_=!0},u.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=a.default.POINTERDRAG){var e=this.lastPointerEvent_;this.willModifyFeatures_(e);var t=this.removeVertex_();return this.dispatchEvent(new w(I.MODIFYEND,this.features_,e)),this.modified_=!1,t}return!1},u.prototype.removeVertex_=function(){var e,t,r,n,i,a,s,u,d,l,g,h=this.dragSegments_,f={},p=!1;for(i=h.length-1;i>=0;--i)l=(r=h[i])[0],g=(0,x.getUid)(l.feature),l.depth&&(g+="-"+l.depth.join("-")),g in f||(f[g]={}),0===r[1]?(f[g].right=l,f[g].index=l.index):1==r[1]&&(f[g].left=l,f[g].index=l.index+1);for(g in f){switch(d=f[g].right,s=f[g].left,(u=(a=f[g].index)-1)<0&&(u=0),e=t=(n=(l=void 0!==s?s:d).geometry).getCoordinates(),p=!1,n.getType()){case o.default.MULTI_LINE_STRING:t[l.depth[0]].length>2&&(t[l.depth[0]].splice(a,1),p=!0);break;case o.default.LINE_STRING:t.length>2&&(t.splice(a,1),p=!0);break;case o.default.MULTI_POLYGON:e=e[l.depth[1]];case o.default.POLYGON:(e=e[l.depth[0]]).length>4&&(a==e.length-1&&(a=0),e.splice(a,1),p=!0,0===a&&(e.pop(),e.push(e[0]),u=e.length-1))}if(p){this.setGeometryCoordinates_(n,t);var c=[];if(void 0!==s&&(this.rBush_.remove(s),c.push(s.segment[0])),void 0!==d&&(this.rBush_.remove(d),c.push(d.segment[1])),void 0!==s&&void 0!==d){var m={depth:l.depth,feature:l.feature,geometry:l.geometry,index:u,segment:c};this.rBush_.insert((0,_.boundingExtent)(m.segment),m)}this.updateSegmentIndices_(n,a,l.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),h.length=0}}return p},u.prototype.setGeometryCoordinates_=function(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1},u.prototype.updateSegmentIndices_=function(e,t,r,n){this.rBush_.forEachInExtent(e.getExtent(),function(i){i.geometry===e&&(void 0===r||void 0===i.depth||(0,m.equals)(i.depth,r))&&i.index>t&&(i.index+=n)})},u}(u.default);function M(e,t){return e.index-t.index}function L(e,t,r){var n=t.geometry;if(n.getType()===o.default.CIRCLE){var i=n;if(t.index===F){var a=(0,y.getUserProjection)();a&&(i=i.clone().transform(a,r));var s=(0,p.squaredDistance)(i.getCenter(),(0,y.fromUserCoordinate)(e,r)),u=Math.sqrt(s)-i.getRadius();return u*u}}var d=(0,y.fromUserCoordinate)(e,r);return T[0]=(0,y.fromUserCoordinate)(t.segment[0],r),T[1]=(0,y.fromUserCoordinate)(t.segment[1],r),(0,p.squaredDistanceToSegment)(d,T)}function U(e,t,r){var n=t.geometry;if(n.getType()===o.default.CIRCLE&&t.index===F){var i=n,a=(0,y.getUserProjection)();return a&&(i=i.clone().transform(a,r)),(0,y.toUserCoordinate)(i.getClosestPoint((0,y.fromUserCoordinate)(e,r)),r)}var s=(0,y.fromUserCoordinate)(e,r);return T[0]=(0,y.fromUserCoordinate)(t.segment[0],r),T[1]=(0,y.fromUserCoordinate)(t.segment[1],r),(0,y.toUserCoordinate)((0,p.closestOnSegment)(s,T),r)}function b(){var e=(0,c.createEditingStyle)();return function(t,r){return e[o.default.POINT]}}var N=G;exports.default=N; },{"../Collection.js":"FnDa","../CollectionEventType.js":"BTrx","../events/Event.js":"fKNg","../events/EventType.js":"C8cu","../Feature.js":"mYW9","../geom/GeometryType.js":"lmV0","../MapBrowserEventType.js":"YhDM","../geom/Point.js":"gLcY","./Pointer.js":"dnA2","../structs/RBush.js":"MiUH","../source/VectorEventType.js":"s8Fc","../layer/Vector.js":"dflx","../source/Vector.js":"ZS12","../events/condition.js":"YcID","../extent.js":"QDir","../coordinate.js":"nGsj","../style/Style.js":"he4w","../array.js":"luEr","../geom/Polygon.js":"Nwwk","../proj.js":"Diht","../util.js":"KniQ"}],"SMGe":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("../Collection.js")),t=c(require("../CollectionEventType.js")),r=c(require("../events/Event.js")),i=c(require("../geom/GeometryType.js")),n=c(require("./Interaction.js")),o=require("../functions.js"),s=require("../obj.js"),a=require("../style/Style.js"),u=require("../array.js"),l=require("../util.js"),d=require("../events/condition.js");function c(e){return e&&e.__esModule?e:{default:e}}var f=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),h={SELECT:"select"},y=function(e){function t(t,r,i,n){var o=e.call(this,t)||this;return o.selected=r,o.deselected=i,o.mapBrowserEvent=n,o}return f(t,e),t}(r.default),_={},p=function(r){function i(t){var i,n=r.call(this)||this,s=t||{};if(n.boundAddFeature_=n.addFeature_.bind(n),n.boundRemoveFeature_=n.removeFeature_.bind(n),n.condition_=s.condition?s.condition:d.singleClick,n.addCondition_=s.addCondition?s.addCondition:d.never,n.removeCondition_=s.removeCondition?s.removeCondition:d.never,n.toggleCondition_=s.toggleCondition?s.toggleCondition:d.shiftKeyOnly,n.multi_=!!s.multi&&s.multi,n.filter_=s.filter?s.filter:o.TRUE,n.hitTolerance_=s.hitTolerance?s.hitTolerance:0,n.style_=void 0!==s.style?s.style:v(),n.features_=s.features||new e.default,s.layers)if("function"==typeof s.layers)i=s.layers;else{var a=s.layers;i=function(e){return(0,u.includes)(a,e)}}else i=o.TRUE;return n.layerFilter_=i,n.featureLayerAssociation_={},n}return f(i,r),i.prototype.addFeatureLayerAssociation_=function(e,t){this.featureLayerAssociation_[(0,l.getUid)(e)]=t},i.prototype.getFeatures=function(){return this.features_},i.prototype.getHitTolerance=function(){return this.hitTolerance_},i.prototype.getLayer=function(e){return this.featureLayerAssociation_[(0,l.getUid)(e)]},i.prototype.setHitTolerance=function(e){this.hitTolerance_=e},i.prototype.setMap=function(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),r.prototype.setMap.call(this,e),e?(this.features_.addEventListener(t.default.ADD,this.boundAddFeature_),this.features_.addEventListener(t.default.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(t.default.ADD,this.boundAddFeature_),this.features_.removeEventListener(t.default.REMOVE,this.boundRemoveFeature_))},i.prototype.addFeature_=function(e){var t=e.element;this.style_&&this.applySelectedStyle_(t)},i.prototype.removeFeature_=function(e){var t=e.element;this.style_&&this.restorePreviousStyle_(t)},i.prototype.getStyle=function(){return this.style_},i.prototype.applySelectedStyle_=function(e){var t=(0,l.getUid)(e);t in _||(_[t]=e.getStyle()),e.setStyle(this.style_)},i.prototype.restorePreviousStyle_=function(e){var t=(0,l.getUid)(e),r=this.getMap().getInteractions().getArray().filter(function(t){return t instanceof i&&t.getStyle()&&-1!==t.getFeatures().getArray().indexOf(e)});r.length>0?e.setStyle(r[r.length-1].getStyle()):(e.setStyle(_[t]),delete _[t])},i.prototype.removeFeatureLayerAssociation_=function(e){delete this.featureLayerAssociation_[(0,l.getUid)(e)]},i.prototype.handleEvent=function(e){if(!this.condition_(e))return!0;var t=this.addCondition_(e),r=this.removeCondition_(e),i=this.toggleCondition_(e),n=!t&&!r&&!i,o=e.map,a=this.getFeatures(),l=[],d=[];if(n){(0,s.clear)(this.featureLayerAssociation_),o.forEachFeatureAtPixel(e.pixel,function(e,t){if(this.filter_(e,t))return d.push(e),this.addFeatureLayerAssociation_(e,t),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var c=a.getLength()-1;c>=0;--c){var f=a.item(c),_=d.indexOf(f);_>-1?d.splice(_,1):(a.remove(f),l.push(f))}0!==d.length&&a.extend(d)}else{o.forEachFeatureAtPixel(e.pixel,function(e,n){if(this.filter_(e,n))return!t&&!i||(0,u.includes)(a.getArray(),e)?(r||i)&&(0,u.includes)(a.getArray(),e)&&(l.push(e),this.removeFeatureLayerAssociation_(e)):(d.push(e),this.addFeatureLayerAssociation_(e,n)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var p=l.length-1;p>=0;--p)a.remove(l[p]);a.extend(d)}return(d.length>0||l.length>0)&&this.dispatchEvent(new y(h.SELECT,d,l,e)),!0},i}(n.default);function v(){var e=(0,a.createEditingStyle)();return(0,u.extend)(e[i.default.POLYGON],e[i.default.LINE_STRING]),(0,u.extend)(e[i.default.GEOMETRY_COLLECTION],e[i.default.LINE_STRING]),function(t){return t.getGeometry()?e[t.getGeometry().getType()]:null}}var g=p;exports.default=g; },{"../Collection.js":"FnDa","../CollectionEventType.js":"BTrx","../events/Event.js":"fKNg","../geom/GeometryType.js":"lmV0","./Interaction.js":"jB2p","../functions.js":"RgA2","../obj.js":"mH6q","../style/Style.js":"he4w","../array.js":"luEr","../util.js":"KniQ","../events/condition.js":"YcID"}],"NnGW":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=p(require("../CollectionEventType.js")),t=p(require("../events/EventType.js")),r=p(require("../geom/GeometryType.js")),n=p(require("./Pointer.js")),i=p(require("../structs/RBush.js")),o=p(require("../source/VectorEventType.js")),s=require("../functions.js"),a=require("../extent.js"),u=require("../coordinate.js"),l=require("../geom/Polygon.js"),h=require("../proj.js"),d=require("../util.js"),f=require("../obj.js"),g=require("../events.js");function p(e){return e&&e.__esModule?e:{default:e}}var c=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function _(e){return e.feature?e.feature:e.element?e.element:void 0}var v=[],y=function(n){function p(e){var t=this,r=e||{},o=r;return o.handleDownEvent||(o.handleDownEvent=s.TRUE),o.stopDown||(o.stopDown=s.FALSE),(t=n.call(this,o)||this).source_=r.source?r.source:null,t.vertex_=void 0===r.vertex||r.vertex,t.edge_=void 0===r.edge||r.edge,t.features_=r.features?r.features:null,t.featuresListenerKeys_=[],t.featureChangeListenerKeys_={},t.indexedFeaturesExtents_={},t.pendingFeatures_={},t.pixelTolerance_=void 0!==r.pixelTolerance?r.pixelTolerance:10,t.rBush_=new i.default,t.SEGMENT_WRITERS_={Point:t.writePointGeometry_.bind(t),LineString:t.writeLineStringGeometry_.bind(t),LinearRing:t.writeLineStringGeometry_.bind(t),Polygon:t.writePolygonGeometry_.bind(t),MultiPoint:t.writeMultiPointGeometry_.bind(t),MultiLineString:t.writeMultiLineStringGeometry_.bind(t),MultiPolygon:t.writeMultiPolygonGeometry_.bind(t),GeometryCollection:t.writeGeometryCollectionGeometry_.bind(t),Circle:t.writeCircleGeometry_.bind(t)},t}return c(p,n),p.prototype.addFeature=function(e,r){var n=void 0===r||r,i=(0,d.getUid)(e),o=e.getGeometry();if(o){var s=this.SEGMENT_WRITERS_[o.getType()];s&&(this.indexedFeaturesExtents_[i]=o.getExtent((0,a.createEmpty)()),s(e,o))}n&&(this.featureChangeListenerKeys_[i]=(0,g.listen)(e,t.default.CHANGE,this.handleFeatureChange_,this))},p.prototype.forEachFeatureAdd_=function(e){this.addFeature(e)},p.prototype.forEachFeatureRemove_=function(e){this.removeFeature(e)},p.prototype.getFeatures_=function(){var e;return this.features_?e=this.features_:this.source_&&(e=this.source_.getFeatures()),e},p.prototype.handleEvent=function(e){var t=this.snapTo(e.pixel,e.coordinate,e.map);return t.snapped&&(e.coordinate=t.vertex.slice(0,2),e.pixel=t.vertexPixel),n.prototype.handleEvent.call(this,e)},p.prototype.handleFeatureAdd_=function(e){var t=_(e);this.addFeature(t)},p.prototype.handleFeatureRemove_=function(e){var t=_(e);this.removeFeature(t)},p.prototype.handleFeatureChange_=function(e){var t=e.target;if(this.handlingDownUpSequence){var r=(0,d.getUid)(t);r in this.pendingFeatures_||(this.pendingFeatures_[r]=t)}else this.updateFeature_(t)},p.prototype.handleUpEvent=function(e){var t=(0,f.getValues)(this.pendingFeatures_);return t.length&&(t.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},p.prototype.removeFeature=function(e,t){var r=void 0===t||t,n=(0,d.getUid)(e),i=this.indexedFeaturesExtents_[n];if(i){var o=this.rBush_,s=[];o.forEachInExtent(i,function(t){e===t.feature&&s.push(t)});for(var a=s.length-1;a>=0;--a)o.remove(s[a])}r&&((0,g.unlistenByKey)(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])},p.prototype.setMap=function(t){var r=this.getMap(),i=this.featuresListenerKeys_,s=this.getFeatures_();r&&(i.forEach(g.unlistenByKey),i.length=0,s.forEach(this.forEachFeatureRemove_.bind(this))),n.prototype.setMap.call(this,t),t&&(this.features_?i.push((0,g.listen)(this.features_,e.default.ADD,this.handleFeatureAdd_,this),(0,g.listen)(this.features_,e.default.REMOVE,this.handleFeatureRemove_,this)):this.source_&&i.push((0,g.listen)(this.source_,o.default.ADDFEATURE,this.handleFeatureAdd_,this),(0,g.listen)(this.source_,o.default.REMOVEFEATURE,this.handleFeatureRemove_,this)),s.forEach(this.forEachFeatureAdd_.bind(this)))},p.prototype.snapTo=function(e,t,n){var i=n.getCoordinateFromPixel([e[0]-this.pixelTolerance_,e[1]+this.pixelTolerance_]),o=n.getCoordinateFromPixel([e[0]+this.pixelTolerance_,e[1]-this.pixelTolerance_]),s=(0,a.boundingExtent)([i,o]),l=this.rBush_.getInExtent(s);this.vertex_&&!this.edge_&&(l=l.filter(function(e){return e.feature.getGeometry().getType()!==r.default.CIRCLE}));var d=!1,f=null,g=null;if(0===l.length)return{snapped:d,vertex:f,vertexPixel:g};for(var p,c=n.getView().getProjection(),_=(0,h.fromUserCoordinate)(t,c),y=1/0,m=0;m<l.length;++m){var x=l[m];v[0]=(0,h.fromUserCoordinate)(x.segment[0],c),v[1]=(0,h.fromUserCoordinate)(x.segment[1],c);var E=(0,u.squaredDistanceToSegment)(_,v);E<y&&(p=x,y=E)}var F=p.segment;if(this.vertex_&&!this.edge_){var C=n.getPixelFromCoordinate(F[0]),P=n.getPixelFromCoordinate(F[1]),G=(0,u.squaredDistance)(e,C),T=(0,u.squaredDistance)(e,P);Math.sqrt(Math.min(G,T))<=this.pixelTolerance_&&(d=!0,f=G>T?F[1]:F[0],g=n.getPixelFromCoordinate(f))}else if(this.edge_){var w=p.feature.getGeometry().getType()===r.default.CIRCLE;if(w){var M=p.feature.getGeometry(),j=(0,h.getUserProjection)();j&&(M=M.clone().transform(j,c)),f=(0,h.toUserCoordinate)((0,u.closestOnCircle)(_,M),c)}else v[0]=(0,h.fromUserCoordinate)(F[0],c),v[1]=(0,h.fromUserCoordinate)(F[1],c),f=(0,h.toUserCoordinate)((0,u.closestOnSegment)(_,v),c);if(g=n.getPixelFromCoordinate(f),(0,u.distance)(e,g)<=this.pixelTolerance_&&(d=!0,this.vertex_&&!w)){C=n.getPixelFromCoordinate(F[0]),P=n.getPixelFromCoordinate(F[1]),G=(0,u.squaredDistance)(g,C),T=(0,u.squaredDistance)(g,P);Math.sqrt(Math.min(G,T))<=this.pixelTolerance_&&(f=G>T?F[1]:F[0],g=n.getPixelFromCoordinate(f))}}return d&&(g=[Math.round(g[0]),Math.round(g[1])]),{snapped:d,vertex:f,vertexPixel:g}},p.prototype.updateFeature_=function(e){this.removeFeature(e,!1),this.addFeature(e,!1)},p.prototype.writeCircleGeometry_=function(e,t){var r=this.getMap().getView().getProjection(),n=t,i=(0,h.getUserProjection)();i&&(n=n.clone().transform(i,r));var o=(0,l.fromCircle)(n);i&&o.transform(r,i);for(var s=o.getCoordinates()[0],u=0,d=s.length-1;u<d;++u){var f=s.slice(u,u+2),g={feature:e,segment:f};this.rBush_.insert((0,a.boundingExtent)(f),g)}},p.prototype.writeGeometryCollectionGeometry_=function(e,t){for(var r=t.getGeometriesArray(),n=0;n<r.length;++n){var i=this.SEGMENT_WRITERS_[r[n].getType()];i&&i(e,r[n])}},p.prototype.writeLineStringGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),s={feature:e,segment:o};this.rBush_.insert((0,a.boundingExtent)(o),s)}},p.prototype.writeMultiLineStringGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],s=0,u=o.length-1;s<u;++s){var l=o.slice(s,s+2),h={feature:e,segment:l};this.rBush_.insert((0,a.boundingExtent)(l),h)}},p.prototype.writeMultiPointGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,i=r.length;n<i;++n){var o=r[n],s={feature:e,segment:[o,o]};this.rBush_.insert(t.getExtent(),s)}},p.prototype.writeMultiPolygonGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],s=0,u=o.length;s<u;++s)for(var l=o[s],h=0,d=l.length-1;h<d;++h){var f=l.slice(h,h+2),g={feature:e,segment:f};this.rBush_.insert((0,a.boundingExtent)(f),g)}},p.prototype.writePointGeometry_=function(e,t){var r=t.getCoordinates(),n={feature:e,segment:[r,r]};this.rBush_.insert(t.getExtent(),n)},p.prototype.writePolygonGeometry_=function(e,t){for(var r=t.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],s=0,u=o.length-1;s<u;++s){var l=o.slice(s,s+2),h={feature:e,segment:l};this.rBush_.insert((0,a.boundingExtent)(l),h)}},p}(n.default),m=y;exports.default=m; },{"../CollectionEventType.js":"BTrx","../events/EventType.js":"C8cu","../geom/GeometryType.js":"lmV0","./Pointer.js":"dnA2","../structs/RBush.js":"MiUH","../source/VectorEventType.js":"s8Fc","../functions.js":"RgA2","../extent.js":"QDir","../coordinate.js":"nGsj","../geom/Polygon.js":"Nwwk","../proj.js":"Diht","../util.js":"KniQ","../obj.js":"mH6q","../events.js":"UqnM"}],"dAAZ":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.TranslateEvent=void 0;var t=s(require("../Collection.js")),e=s(require("../events/Event.js")),r=s(require("./Property.js")),a=s(require("./Pointer.js")),n=require("../functions.js"),i=require("../Object.js"),o=require("../array.js");function s(t){return t&&t.__esModule?t:{default:t}}var l=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),u={TRANSLATESTART:"translatestart",TRANSLATING:"translating",TRANSLATEEND:"translateend"},h=function(t){function e(e,r,a,n,i){var o=t.call(this,e)||this;return o.features=r,o.coordinate=a,o.startCoordinate=n,o.mapBrowserEvent=i,o}return l(e,t),e}(e.default);exports.TranslateEvent=h;var c=function(e){function a(t){var a,s=this,l=t||{};if((s=e.call(this,l)||this).lastCoordinate_=null,s.startCoordinate_=null,s.features_=void 0!==l.features?l.features:null,l.layers)if("function"==typeof l.layers)a=l.layers;else{var u=l.layers;a=function(t){return(0,o.includes)(u,t)}}else a=n.TRUE;return s.layerFilter_=a,s.filter_=l.filter?l.filter:n.TRUE,s.hitTolerance_=l.hitTolerance?l.hitTolerance:0,s.lastFeature_=null,s.addEventListener((0,i.getChangeEventType)(r.default.ACTIVE),s.handleActiveChanged_),s}return l(a,e),a.prototype.handleDownEvent=function(e){if(this.lastFeature_=this.featuresAtPixel_(e.pixel,e.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=e.coordinate,this.lastCoordinate_=e.coordinate,this.handleMoveEvent(e);var r=this.features_||new t.default([this.lastFeature_]);return this.dispatchEvent(new h(u.TRANSLATESTART,r,e.coordinate,this.startCoordinate_,e)),!0}return!1},a.prototype.handleUpEvent=function(e){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(e);var r=this.features_||new t.default([this.lastFeature_]);return this.dispatchEvent(new h(u.TRANSLATEEND,r,e.coordinate,this.startCoordinate_,e)),this.startCoordinate_=null,!0}return!1},a.prototype.handleDragEvent=function(e){if(this.lastCoordinate_){var r=e.coordinate,a=r[0]-this.lastCoordinate_[0],n=r[1]-this.lastCoordinate_[1],i=this.features_||new t.default([this.lastFeature_]);i.forEach(function(t){var e=t.getGeometry();e.translate(a,n),t.setGeometry(e)}),this.lastCoordinate_=r,this.dispatchEvent(new h(u.TRANSLATING,i,r,this.startCoordinate_,e))}},a.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},a.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||(0,o.includes)(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},a.prototype.getHitTolerance=function(){return this.hitTolerance_},a.prototype.setHitTolerance=function(t){this.hitTolerance_=t},a.prototype.setMap=function(t){var r=this.getMap();e.prototype.setMap.call(this,t),this.updateState_(r)},a.prototype.handleActiveChanged_=function(){this.updateState_(null)},a.prototype.updateState_=function(t){var e=this.getMap(),r=this.getActive();e&&r||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},a}(a.default),f=c;exports.default=f; },{"../Collection.js":"FnDa","../events/Event.js":"fKNg","./Property.js":"caOi","./Pointer.js":"dnA2","../functions.js":"RgA2","../Object.js":"PhPh","../array.js":"luEr"}],"aMDX":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.defaults=O,Object.defineProperty(exports,"DoubleClickZoom",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"DragPan",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"DragRotate",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"DragZoom",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(exports,"KeyboardPan",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"KeyboardZoom",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"MouseWheelZoom",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(exports,"PinchRotate",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(exports,"PinchZoom",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"DragAndDrop",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(exports,"DragBox",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(exports,"DragRotateAndZoom",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(exports,"Draw",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(exports,"Extent",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(exports,"Interaction",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(exports,"Modify",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(exports,"Pointer",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(exports,"Select",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(exports,"Snap",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(exports,"Translate",{enumerable:!0,get:function(){return x.default}});var e=h(require("./Collection.js")),t=h(require("./interaction/DoubleClickZoom.js")),r=h(require("./interaction/DragPan.js")),n=h(require("./interaction/DragRotate.js")),o=h(require("./interaction/DragZoom.js")),u=h(require("./interaction/KeyboardPan.js")),i=h(require("./interaction/KeyboardZoom.js")),a=h(require("./Kinetic.js")),c=h(require("./interaction/MouseWheelZoom.js")),d=h(require("./interaction/PinchRotate.js")),l=h(require("./interaction/PinchZoom.js")),f=h(require("./interaction/DragAndDrop.js")),s=h(require("./interaction/DragBox.js")),p=h(require("./interaction/DragRotateAndZoom.js")),b=h(require("./interaction/Draw.js")),m=h(require("./interaction/Extent.js")),j=h(require("./interaction/Interaction.js")),g=h(require("./interaction/Modify.js")),y=h(require("./interaction/Pointer.js")),P=h(require("./interaction/Select.js")),D=h(require("./interaction/Snap.js")),x=h(require("./interaction/Translate.js"));function h(e){return e&&e.__esModule?e:{default:e}}function O(f){var s=f||{},p=new e.default,b=new a.default(-.005,.05,100);return(void 0===s.altShiftDragRotate||s.altShiftDragRotate)&&p.push(new n.default),(void 0===s.doubleClickZoom||s.doubleClickZoom)&&p.push(new t.default({delta:s.zoomDelta,duration:s.zoomDuration})),(void 0===s.dragPan||s.dragPan)&&p.push(new r.default({onFocusOnly:s.onFocusOnly,kinetic:b})),(void 0===s.pinchRotate||s.pinchRotate)&&p.push(new d.default),(void 0===s.pinchZoom||s.pinchZoom)&&p.push(new l.default({duration:s.zoomDuration})),(void 0===s.keyboard||s.keyboard)&&(p.push(new u.default),p.push(new i.default({delta:s.zoomDelta,duration:s.zoomDuration}))),(void 0===s.mouseWheelZoom||s.mouseWheelZoom)&&p.push(new c.default({onFocusOnly:s.onFocusOnly,duration:s.zoomDuration})),(void 0===s.shiftDragZoom||s.shiftDragZoom)&&p.push(new o.default({duration:s.zoomDuration})),p} },{"./Collection.js":"FnDa","./interaction/DoubleClickZoom.js":"NSa4","./interaction/DragPan.js":"N4gU","./interaction/DragRotate.js":"PgBj","./interaction/DragZoom.js":"pTqW","./interaction/KeyboardPan.js":"CFRo","./interaction/KeyboardZoom.js":"S8wR","./Kinetic.js":"gAnK","./interaction/MouseWheelZoom.js":"kPt6","./interaction/PinchRotate.js":"hbGN","./interaction/PinchZoom.js":"rcXm","./interaction/DragAndDrop.js":"IYO6","./interaction/DragBox.js":"AQRw","./interaction/DragRotateAndZoom.js":"ITeC","./interaction/Draw.js":"e7i2","./interaction/Extent.js":"o7b8","./interaction/Interaction.js":"jB2p","./interaction/Modify.js":"qrxo","./interaction/Pointer.js":"dnA2","./interaction/Select.js":"SMGe","./interaction/Snap.js":"NnGW","./interaction/Translate.js":"dAAZ"}],"kYy5":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=u(require("./renderer/Composite.js")),e=u(require("./PluggableMap.js")),r=require("./obj.js"),o=require("./control.js"),n=require("./interaction.js");function u(t){return t&&t.__esModule?t:{default:t}}var i=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),s=function(e){function u(t){return(t=(0,r.assign)({},t)).controls||(t.controls=(0,o.defaults)()),t.interactions||(t.interactions=(0,n.defaults)({onFocusOnly:!0})),e.call(this,t)||this}return i(u,e),u.prototype.createRenderer=function(){return new t.default(this)},u}(e.default),c=s;exports.default=c; },{"./renderer/Composite.js":"MHsB","./PluggableMap.js":"kRwz","./obj.js":"mH6q","./control.js":"ucqx","./interaction.js":"aMDX"}],"IWZI":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=o(require("./events/Target.js")),e=o(require("./events/EventType.js")),i=o(require("./TileState.js")),r=require("./util.js"),n=require("./easing.js");function o(t){return t&&t.__esModule?t:{default:t}}var s=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),a=function(t){function o(e,i,r){var n=t.call(this)||this,o=r||{};return n.tileCoord=e,n.state=i,n.interimTile=null,n.hifi=!0,n.key="",n.transition_=void 0===o.transition?250:o.transition,n.transitionStarts_={},n}return s(o,t),o.prototype.changed=function(){this.dispatchEvent(e.default.CHANGE)},o.prototype.release=function(){},o.prototype.getKey=function(){return this.key+"/"+this.tileCoord},o.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==i.default.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this},o.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==i.default.LOADED){t.interimTile=null;break}t.getState()==i.default.LOADING?e=t:t.getState()==i.default.IDLE?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},o.prototype.getTileCoord=function(){return this.tileCoord},o.prototype.getState=function(){return this.state},o.prototype.setState=function(t){if(this.state!==i.default.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},o.prototype.load=function(){(0,r.abstract)()},o.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var r=e-i+1e3/60;return r>=this.transition_?1:(0,n.easeIn)(r/this.transition_)},o.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},o.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},o}(t.default),u=a;exports.default=u; },{"./events/Target.js":"CR4Y","./events/EventType.js":"C8cu","./TileState.js":"u3kG","./util.js":"KniQ","./easing.js":"IeCz"}],"TOsW":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("./Tile.js")),e=r(require("./TileState.js")),i=require("./dom.js"),n=require("./Image.js");function r(t){return t&&t.__esModule?t:{default:t}}var s=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),a=function(t){function i(e,i,n,r,s,a){var o=t.call(this,e,i,a)||this;return o.crossOrigin_=r,o.src_=n,o.image_=new Image,null!==r&&(o.image_.crossOrigin=r),o.unlisten_=null,o.tileLoadFunction_=s,o}return s(i,t),i.prototype.getImage=function(){return this.image_},i.prototype.getKey=function(){return this.src_},i.prototype.handleImageError_=function(){this.state=e.default.ERROR,this.unlistenImage_(),this.image_=o(),this.changed()},i.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=e.default.LOADED:this.state=e.default.EMPTY,this.unlistenImage_(),this.changed()},i.prototype.load=function(){this.state==e.default.ERROR&&(this.state=e.default.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==e.default.IDLE&&(this.state=e.default.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=(0,n.listenImage)(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},i.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},i}(t.default);function o(){var t=(0,i.createCanvasContext2D)(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var u=a;exports.default=u; },{"./Tile.js":"IWZI","./TileState.js":"u3kG","./dom.js":"Xno5","./Image.js":"DHWK"}],"fF5X":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ENABLE_RASTER_REPROJECTION=exports.ERROR_THRESHOLD=void 0;var R=.5;exports.ERROR_THRESHOLD=R;var E=!0;exports.ENABLE_RASTER_REPROJECTION=E; },{}],"BiRY":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=require("../extent.js"),i=require("../proj.js"),r=require("../math.js"),e=10,s=.25,o=function(){function o(s,o,n,a,h,u){this.sourceProj_=s,this.targetProj_=o;var d={},c=(0,i.getTransform)(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var i=t[0]+"/"+t[1];return d[i]||(d[i]=c(t)),d[i]},this.maxSourceExtent_=a,this.errorThresholdSquared_=h*h,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!a&&!!this.sourceProj_.getExtent()&&(0,t.getWidth)(a)==(0,t.getWidth)(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?(0,t.getWidth)(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?(0,t.getWidth)(this.targetProj_.getExtent()):null;var _=(0,t.getTopLeft)(n),l=(0,t.getTopRight)(n),g=(0,t.getBottomRight)(n),f=(0,t.getBottomLeft)(n),W=this.transformInv_(_),v=this.transformInv_(l),m=this.transformInv_(g),x=this.transformInv_(f),p=e+(u?Math.max(0,Math.ceil((0,r.log2)((0,t.getArea)(n)/(u*u*256*256)))):0);if(this.addQuad_(_,l,g,f,W,v,m,x,p),this.wrapsXInSource_){var F=1/0;this.triangles_.forEach(function(t,i,r){F=Math.min(F,t.source[0][0],t.source[1][0],t.source[2][0])}),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-F>this.sourceWorldWidth_/2){var i=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];i[0][0]-F>this.sourceWorldWidth_/2&&(i[0][0]-=this.sourceWorldWidth_),i[1][0]-F>this.sourceWorldWidth_/2&&(i[1][0]-=this.sourceWorldWidth_),i[2][0]-F>this.sourceWorldWidth_/2&&(i[2][0]-=this.sourceWorldWidth_);var r=Math.min(i[0][0],i[1][0],i[2][0]);Math.max(i[0][0],i[1][0],i[2][0])-r<this.sourceWorldWidth_/2&&(t.source=i)}}.bind(this))}d={}}return o.prototype.addTriangle_=function(t,i,r,e,s,o){this.triangles_.push({source:[e,s,o],target:[t,i,r]})},o.prototype.addQuad_=function(i,e,o,n,a,h,u,d,c){var _=(0,t.boundingExtent)([a,h,u,d]),l=this.sourceWorldWidth_?(0,t.getWidth)(_)/this.sourceWorldWidth_:null,g=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&l>.5&&l<1,W=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var v=(0,t.boundingExtent)([i,e,o,n]);W=(0,t.getWidth)(v)/this.targetWorldWidth_>s||W}!f&&this.sourceProj_.isGlobal()&&l&&(W=l>s||W)}if(!(!W&&this.maxSourceExtent_&&isFinite(_[0])&&isFinite(_[1])&&isFinite(_[2])&&isFinite(_[3]))||(0,t.intersects)(_,this.maxSourceExtent_)){var m=0;if(!(W||isFinite(a[0])&&isFinite(a[1])&&isFinite(h[0])&&isFinite(h[1])&&isFinite(u[0])&&isFinite(u[1])&&isFinite(d[0])&&isFinite(d[1])))if(c>0)W=!0;else if(1!=(m=(isFinite(a[0])&&isFinite(a[1])?0:8)+(isFinite(h[0])&&isFinite(h[1])?0:4)+(isFinite(u[0])&&isFinite(u[1])?0:2)+(isFinite(d[0])&&isFinite(d[1])?0:1))&&2!=m&&4!=m&&8!=m)return;if(c>0){if(!W){var x=[(i[0]+o[0])/2,(i[1]+o[1])/2],p=this.transformInv_(x),F=void 0;if(f)F=((0,r.modulo)(a[0],g)+(0,r.modulo)(u[0],g))/2-(0,r.modulo)(p[0],g);else F=(a[0]+u[0])/2-p[0];var j=(a[1]+u[1])/2-p[1];W=F*F+j*j>this.errorThresholdSquared_}if(W){if(Math.abs(i[0]-o[0])<=Math.abs(i[1]-o[1])){var E=[(e[0]+o[0])/2,(e[1]+o[1])/2],I=this.transformInv_(E),P=[(n[0]+i[0])/2,(n[1]+i[1])/2],S=this.transformInv_(P);this.addQuad_(i,e,E,P,a,h,I,S,c-1),this.addQuad_(P,E,o,n,S,I,u,d,c-1)}else{var T=[(i[0]+e[0])/2,(i[1]+e[1])/2],M=this.transformInv_(T),b=[(o[0]+n[0])/2,(o[1]+n[1])/2],X=this.transformInv_(b);this.addQuad_(i,T,b,n,a,M,X,d,c-1),this.addQuad_(T,e,o,b,M,h,u,X,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&m)&&this.addTriangle_(i,o,n,a,u,d),0==(14&m)&&this.addTriangle_(i,o,e,a,u,h),m&&(0==(13&m)&&this.addTriangle_(e,n,i,h,d,a),0==(7&m)&&this.addTriangle_(e,n,o,h,d,u))}},o.prototype.calculateSourceExtent=function(){var i=(0,t.createEmpty)();return this.triangles_.forEach(function(r,e,s){var o=r.source;(0,t.extendCoordinate)(i,o[0]),(0,t.extendCoordinate)(i,o[1]),(0,t.extendCoordinate)(i,o[2])}),i},o.prototype.getTriangles=function(){return this.triangles_},o}(),n=o;exports.default=n; },{"../extent.js":"QDir","../proj.js":"Diht","../math.js":"B96G"}],"a8mu":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IMAGE_SMOOTHING_DISABLED=exports.DEFAULT_WMS_VERSION=void 0;var e="1.3.0";exports.DEFAULT_WMS_VERSION=e;var o={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};exports.IMAGE_SMOOTHING_DISABLED=o; },{}],"U255":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.calculateSourceResolution=u,exports.calculateSourceExtentResolution=g,exports.render=v;var e,t=require("./source/common.js"),r=require("./obj.js"),a=require("./extent.js"),n=require("./dom.js"),o=require("./proj.js"),i=require("./math.js");function s(e,t,r,a,n){e.beginPath(),e.moveTo(0,0),e.lineTo(t,r),e.lineTo(a,n),e.closePath(),e.save(),e.clip(),e.fillRect(0,0,Math.max(t,a)+1,Math.max(r,n)),e.restore()}function l(e,t){return Math.abs(e[4*t]-210)>2||Math.abs(e[4*t+3]-191.25)>2}function c(){if(void 0===e){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",s(t,4,5,4,0),s(t,4,5,0,5);var r=t.getImageData(0,0,3,3).data;e=l(r,0)||l(r,4)||l(r,8)}return e}function u(e,t,r,n){var i=(0,o.transform)(r,t,e),s=(0,o.getPointResolution)(t,n,r),l=t.getMetersPerUnit();void 0!==l&&(s*=l);var c=e.getMetersPerUnit();void 0!==c&&(s/=c);var u=e.getExtent();if(!u||(0,a.containsCoordinate)(u,i)){var g=(0,o.getPointResolution)(e,s,i)/s;isFinite(g)&&g>0&&(s/=g)}return s}function g(e,t,r,n){var o=(0,a.getCenter)(r),i=u(e,t,o,n);return(!isFinite(i)||i<=0)&&(0,a.forEachCorner)(r,function(r){return i=u(e,t,r,n),isFinite(i)&&i>0}),i}function v(e,o,s,l,u,g,v,h,f,m,d,x){var T=(0,n.createCanvasContext2D)(Math.round(s*e),Math.round(s*o));if((0,r.assign)(T,x),0===f.length)return T.canvas;function p(e){return Math.round(e*s)/s}T.scale(s,s),T.globalCompositeOperation="lighter";var M=(0,a.createEmpty)();f.forEach(function(e,t,r){(0,a.extend)(M,e.extent)});var b=(0,a.getWidth)(M),C=(0,a.getHeight)(M),E=(0,n.createCanvasContext2D)(Math.round(s*b/l),Math.round(s*C/l));(0,r.assign)(E,x);var P=s/l;f.forEach(function(e,t,r){var n=e.extent[0]-M[0],o=-(e.extent[3]-M[3]),i=(0,a.getWidth)(e.extent),s=(0,a.getHeight)(e.extent);e.image.width>0&&e.image.height>0&&E.drawImage(e.image,m,m,e.image.width-2*m,e.image.height-2*m,n*P,o*P,i*P,s*P)});var j=(0,a.getTopLeft)(v);return h.getTriangles().forEach(function(e,r,a){var n=e.source,o=e.target,u=n[0][0],v=n[0][1],h=n[1][0],f=n[1][1],m=n[2][0],d=n[2][1],b=p((o[0][0]-j[0])/g),C=p(-(o[0][1]-j[1])/g),P=p((o[1][0]-j[0])/g),S=p(-(o[1][1]-j[1])/g),q=p((o[2][0]-j[0])/g),I=p(-(o[2][1]-j[1])/g),O=u,y=v;u=0,v=0;var D=[[h-=O,f-=y,0,0,P-b],[m-=O,d-=y,0,0,q-b],[0,0,h,f,S-C],[0,0,m,d,I-C]],R=(0,i.solveLinearSystem)(D);if(R){if(T.save(),T.beginPath(),c()||x===t.IMAGE_SMOOTHING_DISABLED){T.moveTo(P,S);for(var w=b-P,_=C-S,k=0;k<4;k++)T.lineTo(P+p((k+1)*w/4),S+p(k*_/3)),3!=k&&T.lineTo(P+p((k+1)*w/4),S+p((k+1)*_/3));T.lineTo(q,I)}else T.moveTo(P,S),T.lineTo(b,C),T.lineTo(q,I);T.clip(),T.transform(R[0],R[2],R[1],R[3],b,C),T.translate(M[0]-O,M[3]-y),T.scale(l/s,-l/s),T.drawImage(E.canvas,0,0),T.restore()}}),d&&(T.save(),T.globalCompositeOperation="source-over",T.strokeStyle="black",T.lineWidth=1,h.getTriangles().forEach(function(e,t,r){var a=e.target,n=(a[0][0]-j[0])/g,o=-(a[0][1]-j[1])/g,i=(a[1][0]-j[0])/g,s=-(a[1][1]-j[1])/g,l=(a[2][0]-j[0])/g,c=-(a[2][1]-j[1])/g;T.beginPath(),T.moveTo(i,s),T.lineTo(n,o),T.lineTo(l,c),T.closePath(),T.stroke()}),T.restore()),T.canvas} },{"./source/common.js":"a8mu","./obj.js":"mH6q","./extent.js":"QDir","./dom.js":"Xno5","./proj.js":"Diht","./math.js":"B96G"}],"WlOd":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./common.js"),t=l(require("../events/EventType.js")),r=l(require("../Tile.js")),i=l(require("../TileState.js")),s=l(require("./Triangulation.js")),o=require("../reproj.js"),n=require("../math.js"),u=require("../extent.js"),a=require("../events.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),d=function(r){function l(t,a,l,c,d,_,f,h,g,p,T,E){var v=r.call(this,d,i.default.IDLE)||this;v.renderEdges_=void 0!==T&&T,v.contextOptions_=E,v.pixelRatio_=f,v.gutter_=h,v.canvas_=null,v.sourceTileGrid_=a,v.targetTileGrid_=c,v.wrappedTileCoord_=_||d,v.sourceTiles_=[],v.sourcesListenerKeys_=null,v.sourceZ_=0;var y=c.getTileCoordExtent(v.wrappedTileCoord_),x=v.targetTileGrid_.getExtent(),R=v.sourceTileGrid_.getExtent(),j=x?(0,u.getIntersection)(y,x):y;if(0===(0,u.getArea)(j))return v.state=i.default.EMPTY,v;var O=t.getExtent();O&&(R=R?(0,u.getIntersection)(R,O):O);var m=c.getResolution(v.wrappedTileCoord_[0]),L=(0,o.calculateSourceExtentResolution)(t,l,j,m);if(!isFinite(L)||L<=0)return v.state=i.default.EMPTY,v;var D=void 0!==p?p:e.ERROR_THRESHOLD;if(v.triangulation_=new s.default(t,l,j,R,L*D,m),0===v.triangulation_.getTriangles().length)return v.state=i.default.EMPTY,v;v.sourceZ_=a.getZForResolution(L);var G=v.triangulation_.calculateSourceExtent();if(R&&(t.canWrapX()?(G[1]=(0,n.clamp)(G[1],R[1],R[3]),G[3]=(0,n.clamp)(G[3],R[1],R[3])):G=(0,u.getIntersection)(G,R)),(0,u.getArea)(G)){for(var I=a.getTileRangeForExtentAndZ(G,v.sourceZ_),S=I.minX;S<=I.maxX;S++)for(var A=I.minY;A<=I.maxY;A++){var C=g(v.sourceZ_,S,A,f);C&&v.sourceTiles_.push(C)}0===v.sourceTiles_.length&&(v.state=i.default.EMPTY)}else v.state=i.default.EMPTY;return v}return c(l,r),l.prototype.getImage=function(){return this.canvas_},l.prototype.reproject_=function(){var e=[];if(this.sourceTiles_.forEach(function(t,r,s){t&&t.getState()==i.default.LOADED&&e.push({extent:this.sourceTileGrid_.getTileCoordExtent(t.tileCoord),image:t.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===e.length)this.state=i.default.ERROR;else{var t=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(t),s="number"==typeof r?r:r[0],n="number"==typeof r?r:r[1],u=this.targetTileGrid_.getResolution(t),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=(0,o.render)(s,n,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),u,l,this.triangulation_,e,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=i.default.LOADED}this.changed()},l.prototype.load=function(){if(this.state==i.default.IDLE){this.state=i.default.LOADING,this.changed();var e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(r,s,o){var n=r.getState();if(n==i.default.IDLE||n==i.default.LOADING){e++;var u=(0,a.listen)(r,t.default.CHANGE,function(t){var s=r.getState();s!=i.default.LOADED&&s!=i.default.ERROR&&s!=i.default.EMPTY||((0,a.unlistenByKey)(u),0===--e&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(u)}}.bind(this)),this.sourceTiles_.forEach(function(e,t,r){e.getState()==i.default.IDLE&&e.load()}),0===e&&setTimeout(this.reproject_.bind(this),0)}},l.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(a.unlistenByKey),this.sourcesListenerKeys_=null},l}(r.default),_=d;exports.default=_; },{"./common.js":"fF5X","../events/EventType.js":"C8cu","../Tile.js":"IWZI","../TileState.js":"u3kG","./Triangulation.js":"BiRY","../reproj.js":"U255","../math.js":"B96G","../extent.js":"QDir","../events.js":"UqnM"}],"oMDz":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("../asserts.js"),t=function(){function t(e){this.highWaterMark=void 0!==e?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},t.prototype.forEach=function(e){for(var t=this.oldest_;t;)e(t.value_,t.key_,this),t=t.newer},t.prototype.get=function(t,s){var r=this.entries_[t];return(0,e.assert)(void 0!==r,15),r===this.newest_?r.value_:(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r,r.value_)},t.prototype.remove=function(t){var s=this.entries_[t];return(0,e.assert)(void 0!==s,15),s===this.newest_?(this.newest_=s.older,this.newest_&&(this.newest_.newer=null)):s===this.oldest_?(this.oldest_=s.newer,this.oldest_&&(this.oldest_.older=null)):(s.newer.older=s.older,s.older.newer=s.newer),delete this.entries_[t],--this.count_,s.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var e,t=new Array(this.count_),s=0;for(e=this.newest_;e;e=e.older)t[s++]=e.key_;return t},t.prototype.getValues=function(){var e,t=new Array(this.count_),s=0;for(e=this.newest_;e;e=e.older)t[s++]=e.value_;return t},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},t.prototype.replace=function(e,t){this.get(e),this.entries_[e].value_=t},t.prototype.set=function(t,s){(0,e.assert)(!(t in this.entries_),16);var r={key_:t,newer:null,older:this.newest_,value_:s};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[t]=r,++this.count_},t.prototype.setSize=function(e){this.highWaterMark=e},t}(),s=t;exports.default=s; },{"../asserts.js":"fLG6"}],"faTr":[function(require,module,exports) { "use strict";function e(e,t,n,r){return void 0!==r?(r[0]=e,r[1]=t,r[2]=n,r):[e,t,n]}function t(e,t,n){return e+"/"+t+"/"+n}function n(e){return t(e[0],e[1],e[2])}function r(e){return e.split("/").map(Number)}function o(e){return(e[1]<<e[0])+e[2]}function u(e,t){var n=e[0],r=e[1],o=e[2];if(t.getMinZoom()>n||n>t.getMaxZoom())return!1;var u,i=t.getExtent();return!(u=i?t.getTileRangeForExtentAndZ(i,n):t.getFullTileRange(n))||u.containsXY(r,o)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.createOrUpdate=e,exports.getKeyZXY=t,exports.getKey=n,exports.fromKey=r,exports.hash=o,exports.withinExtentAndZ=u; },{}],"YFDe":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("./structs/LRUCache.js")),e=require("./tilecoord.js");function r(t){return t&&t.__esModule?t:{default:t}}var o=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),n=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return o(r,t),r.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},r.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=this.peekFirstKey(),r=(0,e.fromKey)(t)[0];this.forEach(function(t){t.tileCoord[0]!==r&&(this.remove((0,e.getKey)(t.tileCoord)),t.release())}.bind(this))}},r}(t.default),i=n;exports.default=i; },{"./structs/LRUCache.js":"oMDz","./tilecoord.js":"faTr"}],"KXhD":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};exports.default=e; },{}],"snev":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createOrUpdate=i,exports.default=void 0;var t=function(){function t(t,i,n,m){this.minX=t,this.maxX=i,this.minY=n,this.maxY=m}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function i(i,n,m,e,s){return void 0!==s?(s.minX=i,s.maxX=n,s.minY=m,s.maxY=e,s):new t(i,n,m,e)}var n=t;exports.default=n; },{}],"dpZ6":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=h(require("../TileRange.js")),e=require("./common.js"),i=require("../asserts.js"),o=require("../math.js"),r=require("../extent.js"),n=require("../tilecoord.js"),s=require("../array.js"),l=require("../size.js");function u(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return u=function(){return t},t}function h(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=u();if(e&&e.has(t))return e.get(t);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=o?Object.getOwnPropertyDescriptor(t,r):null;n&&(n.get||n.set)?Object.defineProperty(i,r,n):i[r]=t[r]}return i.default=t,e&&e.set(t,i),i}var a=[0,0,0],g=function(){function u(o){var n;if(this.minZoom=void 0!==o.minZoom?o.minZoom:0,this.resolutions_=o.resolutions,(0,i.assert)((0,s.isSorted)(this.resolutions_,function(t,e){return e-t},!0),17),!o.origins)for(var l=0,u=this.resolutions_.length-1;l<u;++l)if(n){if(this.resolutions_[l]/this.resolutions_[l+1]!==n){n=void 0;break}}else n=this.resolutions_[l]/this.resolutions_[l+1];this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==o.origin?o.origin:null,this.origins_=null,void 0!==o.origins&&(this.origins_=o.origins,(0,i.assert)(this.origins_.length==this.resolutions_.length,20));var h=o.extent;void 0===h||this.origin_||this.origins_||(this.origin_=(0,r.getTopLeft)(h)),(0,i.assert)(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==o.tileSizes&&(this.tileSizes_=o.tileSizes,(0,i.assert)(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==o.tileSize?o.tileSize:this.tileSizes_?null:e.DEFAULT_TILE_SIZE,(0,i.assert)(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==h?h:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==o.sizes?this.fullTileRanges_=o.sizes.map(function(e,i){return new t.default(Math.min(0,e[0]),Math.max(e[0]-1,-1),Math.min(0,e[1]),Math.max(e[1]-1,-1))},this):h&&this.calculateTileRanges_(h)}return u.prototype.forEachTileCoord=function(t,e,i){for(var o=this.getTileRangeForExtentAndZ(t,e),r=o.minX,n=o.maxX;r<=n;++r)for(var s=o.minY,l=o.maxY;s<=l;++s)i([e,r,s])},u.prototype.forEachTileCoordParentTileRange=function(e,i,o,r){var n,s,l,u=null,h=e[0]-1;for(2===this.zoomFactor_?(s=e[1],l=e[2]):u=this.getTileCoordExtent(e,r);h>=this.minZoom;){if(2===this.zoomFactor_?(s=Math.floor(s/2),l=Math.floor(l/2),n=(0,t.createOrUpdate)(s,s,l,l,o)):n=this.getTileRangeForExtentAndZ(u,h,o),i(h,n))return!0;--h}return!1},u.prototype.getExtent=function(){return this.extent_},u.prototype.getMaxZoom=function(){return this.maxZoom},u.prototype.getMinZoom=function(){return this.minZoom},u.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},u.prototype.getResolution=function(t){return this.resolutions_[t]},u.prototype.getResolutions=function(){return this.resolutions_},u.prototype.getTileCoordChildTileRange=function(e,i,o){if(e[0]<this.maxZoom){if(2===this.zoomFactor_){var r=2*e[1],n=2*e[2];return(0,t.createOrUpdate)(r,r+1,n,n+1,i)}var s=this.getTileCoordExtent(e,o);return this.getTileRangeForExtentAndZ(s,e[0]+1,i)}return null},u.prototype.getTileRangeExtent=function(t,e,i){var o=this.getOrigin(t),n=this.getResolution(t),s=(0,l.toSize)(this.getTileSize(t),this.tmpSize_),u=o[0]+e.minX*s[0]*n,h=o[0]+(e.maxX+1)*s[0]*n,a=o[1]+e.minY*s[1]*n,g=o[1]+(e.maxY+1)*s[1]*n;return(0,r.createOrUpdate)(u,a,h,g,i)},u.prototype.getTileRangeForExtentAndZ=function(e,i,o){var r=a;this.getTileCoordForXYAndZ_(e[0],e[3],i,!1,r);var n=r[1],s=r[2];return this.getTileCoordForXYAndZ_(e[2],e[1],i,!0,r),(0,t.createOrUpdate)(n,r[1],s,r[2],o)},u.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),o=(0,l.toSize)(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*o[0]*i,e[1]-(t[2]+.5)*o[1]*i]},u.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),o=this.getResolution(t[0]),n=(0,l.toSize)(this.getTileSize(t[0]),this.tmpSize_),s=i[0]+t[1]*n[0]*o,u=i[1]-(t[2]+1)*n[1]*o,h=s+n[0]*o,a=u+n[1]*o;return(0,r.createOrUpdate)(s,u,h,a,e)},u.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},u.prototype.getTileCoordForXYAndResolution_=function(t,e,i,o,r){var s=this.getZForResolution(i),u=i/this.getResolution(s),h=this.getOrigin(s),a=(0,l.toSize)(this.getTileSize(s),this.tmpSize_),g=o?.5:0,p=o?.5:0,f=Math.floor((t-h[0])/i+g),_=Math.floor((h[1]-e)/i+p),c=u*f/a[0],d=u*_/a[1];return o?(c=Math.ceil(c)-1,d=Math.ceil(d)-1):(c=Math.floor(c),d=Math.floor(d)),(0,n.createOrUpdate)(s,c,d,r)},u.prototype.getTileCoordForXYAndZ_=function(t,e,i,o,r){var s=this.getOrigin(i),u=this.getResolution(i),h=(0,l.toSize)(this.getTileSize(i),this.tmpSize_),a=o?.5:0,g=o?.5:0,p=Math.floor((t-s[0])/u+a),f=Math.floor((s[1]-e)/u+g),_=p/h[0],c=f/h[1];return o?(_=Math.ceil(_)-1,c=Math.ceil(c)-1):(_=Math.floor(_),c=Math.floor(c)),(0,n.createOrUpdate)(i,_,c,r)},u.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},u.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},u.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},u.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},u.prototype.getZForResolution=function(t,e){var i=(0,s.linearFindNearest)(this.resolutions_,t,e||0);return(0,o.clamp)(i,this.minZoom,this.maxZoom)},u.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),o=this.minZoom;o<e;++o)i[o]=this.getTileRangeForExtentAndZ(t,o);this.fullTileRanges_=i},u}(),p=g;exports.default=p; },{"../TileRange.js":"snev","./common.js":"mOEX","../asserts.js":"fLG6","../math.js":"B96G","../extent.js":"QDir","../tilecoord.js":"faTr","../array.js":"luEr","../size.js":"TAHd"}],"ExRx":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getForProjection=s,exports.wrapX=l,exports.createForExtent=d,exports.createXYZ=c,exports.createForProjection=x,exports.extentFromProjection=g;var e=a(require("./extent/Corner.js")),t=a(require("./tilegrid/TileGrid.js")),r=a(require("./proj/Units.js")),o=require("./tilegrid/common.js"),i=require("./proj.js"),n=require("./extent.js"),u=require("./size.js");function a(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=e.getDefaultTileGrid();return t||(t=x(e),e.setDefaultTileGrid(t)),t}function l(e,t,r){var o=t[0],i=e.getTileCoordCenter(t),u=g(r);if((0,n.containsCoordinate)(u,i))return t;var a=(0,n.getWidth)(u),s=Math.ceil((u[0]-i[0])/a);return i[0]+=a*s,e.getTileCoordForCoordAndZ(i,o)}function d(r,o,i,u){var a=void 0!==u?u:e.default.TOP_LEFT,s=f(r,o,i);return new t.default({extent:r,origin:(0,n.getCorner)(r,a),resolutions:s,tileSize:i})}function c(e){var r=e||{},o=r.extent||(0,i.get)("EPSG:3857").getExtent(),n={extent:o,minZoom:r.minZoom,tileSize:r.tileSize,resolutions:f(o,r.maxZoom,r.tileSize,r.maxResolution)};return new t.default(n)}function f(e,t,r,i){for(var a=void 0!==t?t:o.DEFAULT_MAX_ZOOM,s=(0,n.getHeight)(e),l=(0,n.getWidth)(e),d=(0,u.toSize)(void 0!==r?r:o.DEFAULT_TILE_SIZE),c=i>0?i:Math.max(l/d[0],s/d[1]),f=a+1,x=new Array(f),g=0;g<f;++g)x[g]=c/Math.pow(2,g);return x}function x(e,t,r,o){return d(g(e),t,r,o)}function g(e){var t=(e=(0,i.get)(e)).getExtent();if(!t){var o=180*i.METERS_PER_UNIT[r.default.DEGREES]/e.getMetersPerUnit();t=(0,n.createOrUpdate)(-o,-o,o,o)}return t} },{"./extent/Corner.js":"urGY","./tilegrid/TileGrid.js":"dpZ6","./proj/Units.js":"yZx6","./tilegrid/common.js":"mOEX","./proj.js":"Diht","./extent.js":"QDir","./size.js":"TAHd"}],"JECm":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.TileSourceEvent=void 0;var t=c(require("../events/Event.js")),e=c(require("./Source.js")),i=c(require("../TileCache.js")),r=c(require("../TileState.js")),o=require("../util.js"),n=require("../proj.js"),u=require("../tilecoord.js"),a=require("../tilegrid.js"),l=require("../size.js");function c(t){return t&&t.__esModule?t:{default:t}}var p=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),s=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;r.opaque_=void 0!==e.opaque&&e.opaque,r.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,r.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var o=e.tileGrid;return o&&(0,l.toSize)(o.getTileSize(o.getMinZoom()),[256,256]),r.tileCache=new i.default(e.cacheSize||0),r.tmpSize=[0,0],r.key_=e.key||"",r.tileOptions={transition:e.transition},r.zDirection=e.zDirection?e.zDirection:0,r}return p(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,i,o){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var a,l,c,p=!0,s=i.minX;s<=i.maxX;++s)for(var h=i.minY;h<=i.maxY;++h)l=(0,u.getKeyZXY)(e,s,h),c=!1,n.containsKey(l)&&(c=(a=n.get(l)).getState()===r.default.LOADED)&&(c=!1!==o(a)),c||(p=!1);return p},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,i,r,n){return(0,o.abstract)()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:(0,a.getForProjection)(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return e&&!(0,n.equivalent)(e,t)?null:this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var r=this.getTileGridForProjection(i),o=this.getTilePixelRatio(e),n=(0,l.toSize)(r.getTileSize(t),this.tmpSize);return 1==o?n:(0,l.scale)(n,o,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),r=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=(0,a.wrapX)(r,t,i)),(0,u.withinExtentAndZ)(t,r)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,r){},e}(e.default),h=function(t){function e(e,i){var r=t.call(this,e)||this;return r.tile=i,r}return p(e,t),e}(t.default);exports.TileSourceEvent=h;var f=s;exports.default=f; },{"../events/Event.js":"fKNg","./Source.js":"H38a","../TileCache.js":"YFDe","../TileState.js":"u3kG","../util.js":"KniQ","../proj.js":"Diht","../tilecoord.js":"faTr","../tilegrid.js":"ExRx","../size.js":"TAHd"}],"p1vZ":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createFromTemplate=n,exports.createFromTemplates=o,exports.createFromTileUrlFunctions=a,exports.nullTileUrlFunction=i,exports.expandUrl=u;var r=require("./asserts.js"),e=require("./math.js"),t=require("./tilecoord.js");function n(e,t){var n=/\{z\}/g,o=/\{x\}/g,a=/\{y\}/g,i=/\{-y\}/g;return function(u,c,l){return u?e.replace(n,u[0].toString()).replace(o,u[1].toString()).replace(a,u[2].toString()).replace(i,function(){var e=u[0],n=t.getFullTileRange(e);return(0,r.assert)(n,55),(n.getHeight()-u[2]-1).toString()}):void 0}}function o(r,e){for(var t=r.length,o=new Array(t),i=0;i<t;++i)o[i]=n(r[i],e);return a(o)}function a(r){return 1===r.length?r[0]:function(n,o,a){if(n){var i=(0,t.hash)(n),u=(0,e.modulo)(i,r.length);return r[u](n,o,a)}}}function i(r,e,t){}function u(r){var e=[],t=/\{([a-z])-([a-z])\}/.exec(r);if(t){var n=t[1].charCodeAt(0),o=t[2].charCodeAt(0),a=void 0;for(a=n;a<=o;++a)e.push(r.replace(t[0],String.fromCharCode(a)));return e}if(t=/\{(\d+)-(\d+)\}/.exec(r)){for(var i=parseInt(t[2],10),u=parseInt(t[1],10);u<=i;u++)e.push(r.replace(t[0],u.toString()));return e}return e.push(r),e} },{"./asserts.js":"fLG6","./math.js":"B96G","./tilecoord.js":"faTr"}],"uv9E":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=s(require("./TileEventType.js")),e=u(require("./Tile.js")),i=s(require("../TileState.js")),n=require("../tileurlfunction.js"),r=require("../tilecoord.js"),o=require("../util.js");function l(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return l=function(){return t},t}function u(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=l();if(e&&e.has(t))return e.get(t);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var o=n?Object.getOwnPropertyDescriptor(t,r):null;o&&(o.get||o.set)?Object.defineProperty(i,r,o):i[r]=t[r]}return i.default=t,e&&e.set(t,i),i}function s(t){return t&&t.__esModule?t:{default:t}}var a=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),c=function(l){function u(t){var e=l.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection})||this;return e.generateTileUrlFunction_=e.tileUrlFunction===u.prototype.tileUrlFunction,e.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(e.tileUrlFunction=t.tileUrlFunction.bind(e)),e.urls=null,t.urls?e.setUrls(t.urls):t.url&&e.setUrl(t.url),e.tileLoadingKeys_={},e}return a(u,l),u.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},u.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},u.prototype.getUrls=function(){return this.urls},u.prototype.handleTileChange=function(n){var r,l=n.target,u=(0,o.getUid)(l),s=l.getState();s==i.default.LOADING?(this.tileLoadingKeys_[u]=!0,r=t.default.TILELOADSTART):u in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[u],r=s==i.default.ERROR?t.default.TILELOADERROR:s==i.default.LOADED?t.default.TILELOADEND:void 0),null!=r&&this.dispatchEvent(new e.TileSourceEvent(r,l))},u.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},u.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},u.prototype.setUrl=function(t){var e=(0,n.expandUrl)(t);this.urls=e,this.setUrls(e)},u.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction((0,n.createFromTemplates)(t,this.tileGrid),e):this.setKey(e)},u.prototype.tileUrlFunction=function(t,e,i){},u.prototype.useTile=function(t,e,i){var n=(0,r.getKeyZXY)(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)},u}(e.default),p=c;exports.default=p; },{"./TileEventType.js":"KXhD","./Tile.js":"JECm","../TileState.js":"u3kG","../tileurlfunction.js":"p1vZ","../tilecoord.js":"faTr","../util.js":"KniQ"}],"udAI":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=p(require("../events/EventType.js")),t=p(require("../ImageTile.js")),i=p(require("../reproj/Tile.js")),r=p(require("../TileCache.js")),o=p(require("../TileState.js")),n=p(require("./UrlTile.js")),c=require("../reproj/common.js"),s=require("./common.js"),l=require("../proj.js"),a=require("../tilecoord.js"),h=require("../tilegrid.js"),u=require("../util.js");function p(e){return e&&e.__esModule?e:{default:e}}var d=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),E=function(n){function p(e){var i=n.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:g,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:t.default,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?s.IMAGE_SMOOTHING_DISABLED:void 0,i.renderReprojectionEdges_=!1,i}return d(p,n),p.prototype.canExpireCache=function(){if(!c.ENABLE_RASTER_REPROJECTION)return n.prototype.canExpireCache.call(this);if(this.tileCache.canExpireCache())return!0;for(var e in this.tileCacheForProjection)if(this.tileCacheForProjection[e].canExpireCache())return!0;return!1},p.prototype.expireCache=function(e,t){if(c.ENABLE_RASTER_REPROJECTION){var i=this.getTileCacheForProjection(e);for(var r in this.tileCache.expireCache(this.tileCache==i?t:{}),this.tileCacheForProjection){var o=this.tileCacheForProjection[r];o.expireCache(o==i?t:{})}}else n.prototype.expireCache.call(this,e,t)},p.prototype.getContextOptions=function(){return this.contextOptions_},p.prototype.getGutterForProjection=function(e){return c.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&e&&!(0,l.equivalent)(this.getProjection(),e)?0:this.getGutter()},p.prototype.getGutter=function(){return 0},p.prototype.getKey=function(){return n.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},p.prototype.getOpaque=function(e){return!(c.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&e&&!(0,l.equivalent)(this.getProjection(),e))&&n.prototype.getOpaque.call(this,e)},p.prototype.getTileGridForProjection=function(e){if(!c.ENABLE_RASTER_REPROJECTION)return n.prototype.getTileGridForProjection.call(this,e);var t=this.getProjection();if(!this.tileGrid||t&&!(0,l.equivalent)(t,e)){var i=(0,u.getUid)(e);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=(0,h.getForProjection)(e)),this.tileGridForProjection[i]}return this.tileGrid},p.prototype.getTileCacheForProjection=function(e){if(!c.ENABLE_RASTER_REPROJECTION)return n.prototype.getTileCacheForProjection.call(this,e);var t=this.getProjection();if(!t||(0,l.equivalent)(t,e))return this.tileCache;var i=(0,u.getUid)(e);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new r.default(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},p.prototype.createTile_=function(t,i,r,n,c,s){var l=[t,i,r],a=this.getTileCoordForTileUrlFunction(l,c),h=a?this.tileUrlFunction(a,n,c):void 0,u=new this.tileClass(l,void 0!==h?o.default.IDLE:o.default.EMPTY,void 0!==h?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=s,u.addEventListener(e.default.CHANGE,this.handleTileChange.bind(this)),u},p.prototype.getTile=function(e,t,r,o,n){var s=this.getProjection();if(c.ENABLE_RASTER_REPROJECTION&&s&&n&&!(0,l.equivalent)(s,n)){var h=this.getTileCacheForProjection(n),u=[e,t,r],p=void 0,d=(0,a.getKey)(u);h.containsKey(d)&&(p=h.get(d));var E=this.getKey();if(p&&p.key==E)return p;var g=this.getTileGridForProjection(s),j=this.getTileGridForProjection(n),f=this.getTileCoordForTileUrlFunction(u,n),T=new i.default(s,g,n,j,u,f,this.getTilePixelRatio(o),this.getGutter(),function(e,t,i,r){return this.getTileInternal(e,t,i,r,s)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return T.key=E,p?(T.interimTile=p,T.refreshInterimChain(),h.replace(d,T)):h.set(d,T),T}return this.getTileInternal(e,t,r,o,s||n)},p.prototype.getTileInternal=function(e,t,i,r,n){var c=null,s=(0,a.getKeyZXY)(e,t,i),l=this.getKey();if(this.tileCache.containsKey(s)){if((c=this.tileCache.get(s)).key!=l){var h=c;c=this.createTile_(e,t,i,r,n,l),h.getState()==o.default.IDLE?c.interimTile=h.interimTile:c.interimTile=h,c.refreshInterimChain(),this.tileCache.replace(s,c)}}else c=this.createTile_(e,t,i,r,n,l),this.tileCache.set(s,c);return c},p.prototype.setRenderReprojectionEdges=function(e){if(c.ENABLE_RASTER_REPROJECTION&&this.renderReprojectionEdges_!=e){for(var t in this.renderReprojectionEdges_=e,this.tileCacheForProjection)this.tileCacheForProjection[t].clear();this.changed()}},p.prototype.setTileGridForProjection=function(e,t){if(c.ENABLE_RASTER_REPROJECTION){var i=(0,l.get)(e);if(i){var r=(0,u.getUid)(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=t)}}},p}(n.default);function g(e,t){e.getImage().src=t}var j=E;exports.default=j; },{"../events/EventType.js":"C8cu","../ImageTile.js":"TOsW","../reproj/Tile.js":"WlOd","../TileCache.js":"YFDe","../TileState.js":"u3kG","./UrlTile.js":"uv9E","../reproj/common.js":"fF5X","./common.js":"a8mu","../proj.js":"Diht","../tilecoord.js":"faTr","../tilegrid.js":"ExRx","../util.js":"KniQ"}],"knlU":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=i(require("./TileImage.js")),o=require("../tilegrid.js");function i(t){return t&&t.__esModule?t:{default:t}}var e=function(){var t=function(o,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var i in o)o.hasOwnProperty(i)&&(t[i]=o[i])})(o,i)};return function(o,i){function e(){this.constructor=o}t(o,i),o.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e)}}(),r=function(t){function i(i){var e=i||{},r=void 0!==e.projection?e.projection:"EPSG:3857",n=void 0!==e.tileGrid?e.tileGrid:(0,o.createXYZ)({extent:(0,o.extentFromProjection)(r),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});return t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,imageSmoothing:e.imageSmoothing,opaque:e.opaque,projection:r,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this}return e(i,t),i}(t.default),n=r;exports.default=n; },{"./TileImage.js":"udAI","../tilegrid.js":"ExRx"}],"Rmo4":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.ATTRIBUTION=void 0;var t=o(require("./XYZ.js"));function o(t){return t&&t.__esModule?t:{default:t}}var r=function(){var t=function(o,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var r in o)o.hasOwnProperty(r)&&(t[r]=o[r])})(o,r)};return function(o,r){function e(){this.constructor=o}t(o,r),o.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}}(),e='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';exports.ATTRIBUTION=e;var n=function(t){function o(o){var r,n=o||{};r=void 0!==n.attributions?n.attributions:[e];var i=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",a=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:r,cacheSize:n.cacheSize,crossOrigin:i,imageSmoothing:n.imageSmoothing,opaque:void 0===n.opaque||n.opaque,maxZoom:void 0!==n.maxZoom?n.maxZoom:19,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,url:a,wrapX:n.wrapX,attributionsCollapsible:!1})||this}return r(o,t),o}(t.default),i=n;exports.default=i; },{"./XYZ.js":"knlU"}],"ehVO":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("./XYZ.js")),o=require("./OSM.js");function n(e){return e&&e.__esModule?e:{default:e}}var t=function(){var e=function(o,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var n in o)o.hasOwnProperty(n)&&(e[n]=o[n])})(o,n)};return function(o,n){function t(){this.constructor=o}e(o,n),o.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}}(),r=['Map tiles by <a href="https://stamen.com/" target="_blank">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>.',o.ATTRIBUTION],a={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},i={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},s=function(e){function o(o){var n=o.layer.indexOf("-"),t=-1==n?o.layer:o.layer.slice(0,n),s=i[t],u=a[o.layer],p=void 0!==o.url?o.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+o.layer+"/{z}/{x}/{y}."+u.extension;return e.call(this,{attributions:r,cacheSize:o.cacheSize,crossOrigin:"anonymous",imageSmoothing:o.imageSmoothing,maxZoom:null!=o.maxZoom?o.maxZoom:s.maxZoom,minZoom:null!=o.minZoom?o.minZoom:s.minZoom,opaque:u.opaque,reprojectionErrorThreshold:o.reprojectionErrorThreshold,tileLoadFunction:o.tileLoadFunction,transition:o.transition,url:p,wrapX:o.wrapX})||this}return t(o,e),o}(e.default),u=s;exports.default=u; },{"./XYZ.js":"knlU","./OSM.js":"Rmo4"}],"M5pz":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};exports.default=e; },{}],"HTO1":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("./Layer.js")),t=o(require("./TileProperty.js")),r=require("../obj.js");function o(e){return e&&e.__esModule?e:{default:e}}var n=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),i=function(e){function o(t){var o=this,n=t||{},i=(0,r.assign)({},n);return delete i.preload,delete i.useInterimTilesOnError,(o=e.call(this,i)||this).setPreload(void 0!==n.preload?n.preload:0),o.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),o}return n(o,e),o.prototype.getPreload=function(){return this.get(t.default.PRELOAD)},o.prototype.setPreload=function(e){this.set(t.default.PRELOAD,e)},o.prototype.getUseInterimTilesOnError=function(){return this.get(t.default.USE_INTERIM_TILES_ON_ERROR)},o.prototype.setUseInterimTilesOnError=function(e){this.set(t.default.USE_INTERIM_TILES_ON_ERROR,e)},o}(e.default),s=i;exports.default=s; },{"./Layer.js":"GCgv","./TileProperty.js":"M5pz","../obj.js":"mH6q"}],"hkMV":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("./Layer.js")),t=u(require("../../TileRange.js")),r=u(require("../../TileState.js")),i=require("../../transform.js"),n=require("../../obj.js"),o=require("../../extent.js"),a=require("../../render/canvas.js"),s=require("../../proj.js"),l=require("../../util.js"),d=require("../../array.js");function u(e){return e&&e.__esModule?e:{default:e}}var h=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),p=function(e){function u(r){var i=e.call(this,r)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=(0,o.createEmpty)(),i.tmpTileRange_=new t.default(0,0,0,0),i}return h(u,e),u.prototype.isDrawableTile=function(e){var t=this.getLayer(),i=e.getState(),n=t.getUseInterimTilesOnError();return i==r.default.LOADED||i==r.default.EMPTY||i==r.default.ERROR&&!n},u.prototype.getTile=function(e,t,i,n){var o=n.pixelRatio,a=n.viewState.projection,s=this.getLayer(),l=s.getSource().getTile(e,t,i,o,a);return l.getState()==r.default.ERROR&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):l.setState(r.default.LOADED)),this.isDrawableTile(l)||(l=l.getInterimTile()),l},u.prototype.loadedTileCallback=function(t,r,i){return!!this.isDrawableTile(i)&&e.prototype.loadedTileCallback.call(this,t,r,i)},u.prototype.prepareFrame=function(e){return!!this.getLayer().getSource()},u.prototype.renderFrame=function(e,t){var u=e.layerStatesArray[e.layerIndex],h=e.viewState,p=h.projection,c=h.resolution,g=h.center,T=h.rotation,f=e.pixelRatio,m=this.getLayer(),v=m.getSource(),x=v.getRevision(),y=v.getTileGridForProjection(p),R=y.getZForResolution(c,v.zDirection),w=y.getResolution(R),C=e.extent,E=u.extent&&(0,s.fromUserExtent)(u.extent,p);E&&(C=(0,o.getIntersection)(C,(0,s.fromUserExtent)(u.extent,p)));var j=v.getTilePixelRatio(f),_=Math.round(e.size[0]*j),P=Math.round(e.size[1]*j);if(T){var S=Math.round(Math.sqrt(_*_+P*P));_=S,P=S}var b=w*_/2/j,O=w*P/2/j,q=[g[0]-b,g[1]-O,g[0]+b,g[1]+O],I=y.getTileRangeForExtentAndZ(C,R),A={};A[R]={};var U=this.createLoadedTileFinder(v,p,A),D=this.tmpExtent,L=this.tmpTileRange_;this.newTiles_=!1;for(var M=I.minX;M<=I.maxX;++M)for(var F=I.minY;F<=I.maxY;++F){var z=this.getTile(R,M,F,e);if(this.isDrawableTile(z)){var Y=(0,l.getUid)(this);if(z.getState()==r.default.LOADED){A[R][z.tileCoord.toString()]=z;var Z=z.inTransition(Y);this.newTiles_||!Z&&-1!==this.renderedTiles.indexOf(z)||(this.newTiles_=!0)}if(1===z.getAlpha(Y,e.time))continue}var k=y.getTileCoordChildTileRange(z.tileCoord,L,D),K=!1;k&&(K=U(R+1,k)),K||y.forEachTileCoordParentTileRange(z.tileCoord,U,L,D)}var X=w/c;(0,i.compose)(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/j,1/j,T,-_/2,-P/2);var G=(0,a.createTransformString)(this.pixelTransform);this.useContainer(t,G,u.opacity);var Q=this.context,N=Q.canvas;(0,i.makeInverse)(this.inversePixelTransform,this.pixelTransform),(0,i.compose)(this.tempTransform,_/2,P/2,X,X,0,-_/2,-P/2),N.width!=_||N.height!=P?(N.width=_,N.height=P):this.containerReused||Q.clearRect(0,0,_,P),E&&this.clipUnrotated(Q,e,E),(0,n.assign)(Q,v.getContextOptions()),this.preRender(Q,e),this.renderedTiles.length=0;var B,H,J,V=Object.keys(A).map(Number);V.sort(d.numberSafeCompareFunction),1!==u.opacity||this.containerReused&&!v.getOpaque(e.viewState.projection)?(B=[],H=[]):V=V.reverse();for(var W=V.length-1;W>=0;--W){var $=V[W],ee=v.getTilePixelSize($,f,p),te=y.getResolution($)/w,re=ee[0]*te*X,ie=ee[1]*te*X,ne=y.getTileCoordForCoordAndZ((0,o.getTopLeft)(q),$),oe=y.getTileCoordExtent(ne),ae=(0,i.apply)(this.tempTransform,[j*(oe[0]-q[0])/w,j*(q[3]-oe[3])/w]),se=j*v.getGutterForProjection(p),le=A[$];for(var de in le){var ue=(z=le[de]).tileCoord,he=ae[0]-(ne[1]-ue[1])*re,pe=Math.round(he+re),ce=ae[1]-(ne[2]-ue[2])*ie,ge=Math.round(ce+ie),Te=pe-(M=Math.round(he)),fe=ge-(F=Math.round(ce)),me=R===$;if(!(Z=me&&1!==z.getAlpha((0,l.getUid)(this),e.time)))if(B){Q.save(),J=[M,F,M+Te,F,M+Te,F+fe,M,F+fe];for(var ve=0,xe=B.length;ve<xe;++ve)if(R!==$&&$<H[ve]){var ye=B[ve];Q.beginPath(),Q.moveTo(J[0],J[1]),Q.lineTo(J[2],J[3]),Q.lineTo(J[4],J[5]),Q.lineTo(J[6],J[7]),Q.moveTo(ye[6],ye[7]),Q.lineTo(ye[4],ye[5]),Q.lineTo(ye[2],ye[3]),Q.lineTo(ye[0],ye[1]),Q.clip()}B.push(J),H.push($)}else Q.clearRect(M,F,Te,fe);this.drawTileImage(z,e,M,F,Te,fe,se,me,u.opacity),B&&!Z&&Q.restore(),this.renderedTiles.push(z),this.updateUsedTiles(e.usedTiles,v,z)}}return this.renderedRevision=x,this.renderedResolution=w,this.extentChanged=!this.renderedExtent_||!(0,o.equals)(this.renderedExtent_,q),this.renderedExtent_=q,this.renderedPixelRatio=f,this.renderedProjection=p,this.manageTilePyramid(e,v,y,f,p,C,R,m.getPreload()),this.scheduleExpireCache(e,v),this.postRender(Q,e),u.extent&&Q.restore(),G!==N.style.transform&&(N.style.transform=G),this.container},u.prototype.drawTileImage=function(e,t,r,i,n,o,a,s,d){var u=this.getTileImage(e);if(u){var h=(0,l.getUid)(this),p=s?e.getAlpha(h,t.time):1,c=d*p,g=c!==this.context.globalAlpha;g&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(u,a,a,u.width-2*a,u.height-2*a,r,i,n,o),g&&this.context.restore(),1!==p?t.animate=!0:s&&e.endTransition(h)}},u.prototype.getImage=function(){var e=this.context;return e?e.canvas:null},u.prototype.getTileImage=function(e){return e.getImage()},u.prototype.scheduleExpireCache=function(e,t){if(t.canExpireCache()){var r=function(e,t,r){var i=(0,l.getUid)(e);i in r.usedTiles&&e.expireCache(r.viewState.projection,r.usedTiles[i])}.bind(null,t);e.postRenderFunctions.push(r)}},u.prototype.updateUsedTiles=function(e,t,r){var i=(0,l.getUid)(t);i in e||(e[i]={}),e[i][r.getKey()]=!0},u.prototype.manageTilePyramid=function(e,t,i,n,o,a,s,d,u){var h=(0,l.getUid)(t);h in e.wantedTiles||(e.wantedTiles[h]={});var p,c,g,T,f,m,v=e.wantedTiles[h],x=e.tileQueue,y=0;for(m=i.getMinZoom();m<=s;++m)for(c=i.getTileRangeForExtentAndZ(a,m,c),g=i.getResolution(m),T=c.minX;T<=c.maxX;++T)for(f=c.minY;f<=c.maxY;++f)s-m<=d?(++y,(p=t.getTile(m,T,f,n,o)).getState()==r.default.IDLE&&(v[p.getKey()]=!0,x.isKeyQueued(p.getKey())||x.enqueue([p,h,i.getTileCoordCenter(p.tileCoord),g])),void 0!==u&&u(p)):t.useTile(m,T,f,o);t.updateCacheSize(y,o)},u}(e.default);p.prototype.getLayer;var c=p;exports.default=c; },{"./Layer.js":"vPfl","../../TileRange.js":"snev","../../TileState.js":"u3kG","../../transform.js":"P4eA","../../obj.js":"mH6q","../../extent.js":"QDir","../../render/canvas.js":"iAG7","../../proj.js":"Diht","../../util.js":"KniQ","../../array.js":"luEr"}],"BUEc":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./BaseTile.js")),t=r(require("../renderer/canvas/TileLayer.js"));function r(e){return e&&e.__esModule?e:{default:e}}var n=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=function(e){function r(t){return e.call(this,t)||this}return n(r,e),r.prototype.createRenderer=function(){return new t.default(this)},r}(e.default),u=o;exports.default=u; },{"./BaseTile.js":"HTO1","../renderer/canvas/TileLayer.js":"hkMV"}],"mXwm":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={CARMENTA_SERVER:"carmentaserver",GEOSERVER:"geoserver",MAPSERVER:"mapserver",QGIS:"qgis"};exports.default=e; },{}],"n7G7":[function(require,module,exports) { "use strict";function e(e,n){var o=[];Object.keys(n).forEach(function(e){null!==n[e]&&void 0!==n[e]&&o.push(e+"="+encodeURIComponent(n[e]))});var r=o.join("&");return(e=-1===(e=e.replace(/[?&]$/,"")).indexOf("?")?e+"?":e+"&")+r}Object.defineProperty(exports,"__esModule",{value:!0}),exports.appendParams=e; },{}],"IcO7":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=require("./common.js"),e=g(require("./TileImage.js")),r=g(require("./WMSServerType.js")),i=require("../uri.js"),o=require("../asserts.js"),s=require("../obj.js"),a=require("../extent.js"),n=require("../size.js"),u=require("../reproj.js"),p=require("../string.js"),h=require("../proj.js"),l=require("../math.js"),_=require("../tilecoord.js");function g(t){return t&&t.__esModule?t:{default:t}}var c=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),S=function(e){function g(t){var r=this,i=t||{},o=i.params||{},s=!("TRANSPARENT"in o)||o.TRANSPARENT;return(r=e.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:!s,projection:i.projection,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileClass:i.tileClass,tileGrid:i.tileGrid,tileLoadFunction:i.tileLoadFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition})||this).gutter_=void 0!==i.gutter?i.gutter:0,r.params_=o,r.v13_=!0,r.serverType_=i.serverType,r.hidpi_=void 0===i.hidpi||i.hidpi,r.tmpExtent_=(0,a.createEmpty)(),r.updateV13_(),r.setKey(r.getKeyForParams_()),r}return c(g,e),g.prototype.getFeatureInfoUrl=function(e,r,i,o){var p=(0,h.get)(i),l=this.getProjection(),_=this.getTileGrid();_||(_=this.getTileGridForProjection(p));var g=_.getZForResolution(r,this.zDirection),c=_.getTileCoordForCoordAndZ(e,g);if(!(_.getResolutions().length<=c[0])){var S=_.getResolution(c[0]),f=_.getTileCoordExtent(c,this.tmpExtent_),d=(0,n.toSize)(_.getTileSize(c[0]),this.tmpSize),E=this.gutter_;0!==E&&(d=(0,n.buffer)(d,E,this.tmpSize),f=(0,a.buffer)(f,S*E,f)),l&&l!==p&&(S=(0,u.calculateSourceResolution)(l,p,e,S),f=(0,h.transformExtent)(f,p,l),e=(0,h.transform)(e,p,l));var R={SERVICE:"WMS",VERSION:t.DEFAULT_WMS_VERSION,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};(0,s.assign)(R,this.params_,o);var T=Math.floor((e[0]-f[0])/S),v=Math.floor((f[3]-e[1])/S);return R[this.v13_?"I":"X"]=T,R[this.v13_?"J":"Y"]=v,this.getRequestUrl_(c,d,f,1,l||p,R)}},g.prototype.getLegendUrl=function(e,r){if(void 0!==this.urls[0]){var o={SERVICE:"WMS",VERSION:t.DEFAULT_WMS_VERSION,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===r||void 0===r.LAYER){var a=this.params_.LAYERS;if(!(!Array.isArray(a)||1===a.length))return;o.LAYER=a}if(void 0!==e){var n=this.getProjection()?this.getProjection().getMetersPerUnit():1;o.SCALE=e*n*39.37*(25.4/.28)}return(0,s.assign)(o,r),(0,i.appendParams)(this.urls[0],o)}},g.prototype.getGutter=function(){return this.gutter_},g.prototype.getParams=function(){return this.params_},g.prototype.getRequestUrl_=function(t,e,s,a,n,u){var p=this.urls;if(p){if(u.WIDTH=e[0],u.HEIGHT=e[1],u[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(u.STYLES=""),1!=a)switch(this.serverType_){case r.default.GEOSERVER:var h=90*a+.5|0;"FORMAT_OPTIONS"in u?u.FORMAT_OPTIONS+=";dpi:"+h:u.FORMAT_OPTIONS="dpi:"+h;break;case r.default.MAPSERVER:u.MAP_RESOLUTION=90*a;break;case r.default.CARMENTA_SERVER:case r.default.QGIS:u.DPI=90*a;break;default:(0,o.assert)(!1,52)}var g,c=n.getAxisOrientation(),S=s;if(this.v13_&&"ne"==c.substr(0,2)){var f=void 0;f=s[0],S[0]=s[1],S[1]=f,f=s[2],S[2]=s[3],S[3]=f}if(u.BBOX=S.join(","),1==p.length)g=p[0];else g=p[(0,l.modulo)((0,_.hash)(t),p.length)];return(0,i.appendParams)(g,u)}},g.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},g.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},g.prototype.updateParams=function(t){(0,s.assign)(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},g.prototype.updateV13_=function(){var e=this.params_.VERSION||t.DEFAULT_WMS_VERSION;this.v13_=(0,p.compareVersions)(e,"1.3")>=0},g.prototype.tileUrlFunction=function(e,r,i){var o=this.getTileGrid();if(o||(o=this.getTileGridForProjection(i)),!(o.getResolutions().length<=e[0])){1==r||this.hidpi_&&void 0!==this.serverType_||(r=1);var u=o.getResolution(e[0]),p=o.getTileCoordExtent(e,this.tmpExtent_),h=(0,n.toSize)(o.getTileSize(e[0]),this.tmpSize),l=this.gutter_;0!==l&&(h=(0,n.buffer)(h,l,this.tmpSize),p=(0,a.buffer)(p,u*l,p)),1!=r&&(h=(0,n.scale)(h,r,this.tmpSize));var _={SERVICE:"WMS",VERSION:t.DEFAULT_WMS_VERSION,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return(0,s.assign)(_,this.params_),this.getRequestUrl_(e,h,p,r,i,_)}},g}(e.default),f=S;exports.default=f; },{"./common.js":"a8mu","./TileImage.js":"udAI","./WMSServerType.js":"mXwm","../uri.js":"n7G7","../asserts.js":"fLG6","../obj.js":"mH6q","../extent.js":"QDir","../size.js":"TAHd","../reproj.js":"U255","../string.js":"AiCK","../proj.js":"Diht","../math.js":"B96G","../tilecoord.js":"faTr"}],"sV2m":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=c(require("../events/EventType.js")),t=c(require("../Feature.js")),r=c(require("../geom/GeometryType.js")),o=c(require("../geom/Point.js")),s=c(require("./Vector.js")),i=require("../coordinate.js"),n=require("../asserts.js"),u=require("../extent.js"),a=require("../util.js");function c(e){return e&&e.__esModule?e:{default:e}}var f=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),h=function(s){function c(e){var t=s.call(this,{attributions:e.attributions,wrapX:e.wrapX})||this;return t.resolution=void 0,t.distance=void 0!==e.distance?e.distance:20,t.features=[],t.geometryFunction=e.geometryFunction||function(e){var t=e.getGeometry();return(0,n.assert)(t.getType()==r.default.POINT,10),t},t.boundRefresh_=t.refresh.bind(t),t.setSource(e.source||null),t}return f(c,s),c.prototype.clear=function(e){this.features.length=0,s.prototype.clear.call(this,e)},c.prototype.getDistance=function(){return this.distance},c.prototype.getSource=function(){return this.source},c.prototype.loadFeatures=function(e,t,r){this.source.loadFeatures(e,t,r),t!==this.resolution&&(this.clear(),this.resolution=t,this.cluster(),this.addFeatures(this.features))},c.prototype.setDistance=function(e){this.distance=e,this.refresh()},c.prototype.setSource=function(t){this.source&&this.source.removeEventListener(e.default.CHANGE,this.boundRefresh_),this.source=t,t&&t.addEventListener(e.default.CHANGE,this.boundRefresh_),this.refresh()},c.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},c.prototype.cluster=function(){if(void 0!==this.resolution&&this.source)for(var e=(0,u.createEmpty)(),t=this.distance*this.resolution,r=this.source.getFeatures(),o={},s=0,i=r.length;s<i;s++){var n=r[s];if(!((0,a.getUid)(n)in o)){var c=this.geometryFunction(n);if(c){var f=c.getCoordinates();(0,u.createOrUpdateFromCoordinate)(f,e),(0,u.buffer)(e,t,e);var h=this.source.getFeaturesInExtent(e);h=h.filter(function(e){var t=(0,a.getUid)(e);return!(t in o)&&(o[t]=!0,!0)}),this.features.push(this.createCluster(h))}}}},c.prototype.createCluster=function(e){for(var r=[0,0],s=e.length-1;s>=0;--s){var n=this.geometryFunction(e[s]);n?(0,i.add)(r,n.getCoordinates()):e.splice(s,1)}(0,i.scale)(r,1/e.length);var u=new t.default(new o.default(r));return u.set("features",e),u},c}(s.default),l=h;exports.default=l; },{"../events/EventType.js":"C8cu","../Feature.js":"mYW9","../geom/GeometryType.js":"lmV0","../geom/Point.js":"gLcY","./Vector.js":"ZS12","../coordinate.js":"nGsj","../asserts.js":"fLG6","../extent.js":"QDir","../util.js":"KniQ"}],"HvLT":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("../events/EventType.js")),t=o(require("./Geometry.js")),r=o(require("./GeometryType.js")),i=require("../extent.js"),n=require("../events.js");function o(e){return e&&e.__esModule?e:{default:e}}var s=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),a=function(t){function o(e){var r=t.call(this)||this;return r.geometries_=e||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return s(o,t),o.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(n.unlistenByKey),this.changeEventsKeys_.length=0},o.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,r=this.geometries_.length;t<r;++t)this.changeEventsKeys_.push((0,n.listen)(this.geometries_[t],e.default.CHANGE,this.changed,this))},o.prototype.clone=function(){var e=new o(null);return e.setGeometries(this.geometries_),e},o.prototype.closestPointXY=function(e,t,r,n){if(n<(0,i.closestSquaredDistanceXY)(this.getExtent(),e,t))return n;for(var o=this.geometries_,s=0,a=o.length;s<a;++s)n=o[s].closestPointXY(e,t,r,n);return n},o.prototype.containsXY=function(e,t){for(var r=this.geometries_,i=0,n=r.length;i<n;++i)if(r[i].containsXY(e,t))return!0;return!1},o.prototype.computeExtent=function(e){(0,i.createOrUpdateEmpty)(e);for(var t=this.geometries_,r=0,n=t.length;r<n;++r)(0,i.extend)(e,t[r].getExtent());return e},o.prototype.getGeometries=function(){return u(this.geometries_)},o.prototype.getGeometriesArray=function(){return this.geometries_},o.prototype.getGeometriesArrayRecursive=function(){for(var e=[],t=this.geometries_,r=0,i=t.length;r<i;++r)t[r].getType()===this.getType()?e=e.concat(t[r].getGeometriesArrayRecursive()):e.push(t[r]);return e},o.prototype.getSimplifiedGeometry=function(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&e<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var t=[],r=this.geometries_,i=!1,n=0,s=r.length;n<s;++n){var a=r[n],u=a.getSimplifiedGeometry(e);t.push(u),u!==a&&(i=!0)}if(i){var h=new o(null);return h.setGeometriesArray(t),h}return this.simplifiedGeometryMaxMinSquaredTolerance=e,this},o.prototype.getType=function(){return r.default.GEOMETRY_COLLECTION},o.prototype.intersectsExtent=function(e){for(var t=this.geometries_,r=0,i=t.length;r<i;++r)if(t[r].intersectsExtent(e))return!0;return!1},o.prototype.isEmpty=function(){return 0===this.geometries_.length},o.prototype.rotate=function(e,t){for(var r=this.geometries_,i=0,n=r.length;i<n;++i)r[i].rotate(e,t);this.changed()},o.prototype.scale=function(e,t,r){var n=r;n||(n=(0,i.getCenter)(this.getExtent()));for(var o=this.geometries_,s=0,a=o.length;s<a;++s)o[s].scale(e,t,n);this.changed()},o.prototype.setGeometries=function(e){this.setGeometriesArray(u(e))},o.prototype.setGeometriesArray=function(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()},o.prototype.applyTransform=function(e){for(var t=this.geometries_,r=0,i=t.length;r<i;++r)t[r].applyTransform(e);this.changed()},o.prototype.translate=function(e,t){for(var r=this.geometries_,i=0,n=r.length;i<n;++i)r[i].translate(e,t);this.changed()},o.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},o}(t.default);function u(e){for(var t=[],r=0,i=e.length;r<i;++r)t.push(e[r].clone());return t}var h=a;exports.default=h; },{"../events/EventType.js":"C8cu","./Geometry.js":"F8sI","./GeometryType.js":"lmV0","../extent.js":"QDir","../events.js":"UqnM"}],"Kylu":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.transformGeometryWithOptions=u,exports.transformExtentWithOptions=c,exports.default=void 0;var t=n(require("../proj/Units.js")),e=require("../util.js"),r=require("../obj.js"),o=require("../proj.js");function n(t){return t&&t.__esModule?t:{default:t}}var a=function(){function n(){this.dataProjection=null,this.defaultFeatureProjection=null}return n.prototype.getReadOptions=function(e,r){var n;if(r){var a=r.dataProjection?(0,o.get)(r.dataProjection):this.readProjection(e);r.extent&&a&&a.getUnits()===t.default.TILE_PIXELS&&(a=(0,o.get)(a)).setWorldExtent(r.extent),n={dataProjection:a,featureProjection:r.featureProjection}}return this.adaptOptions(n)},n.prototype.adaptOptions=function(t){return(0,r.assign)({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},n.prototype.getType=function(){return(0,e.abstract)()},n.prototype.readFeature=function(t,r){return(0,e.abstract)()},n.prototype.readFeatures=function(t,r){return(0,e.abstract)()},n.prototype.readGeometry=function(t,r){return(0,e.abstract)()},n.prototype.readProjection=function(t){return(0,e.abstract)()},n.prototype.writeFeature=function(t,r){return(0,e.abstract)()},n.prototype.writeFeatures=function(t,r){return(0,e.abstract)()},n.prototype.writeGeometry=function(t,r){return(0,e.abstract)()},n}(),i=a;function u(t,e,r){var n,a=r?(0,o.get)(r.featureProjection):null,i=r?(0,o.get)(r.dataProjection):null;if(n=a&&i&&!(0,o.equivalent)(a,i)?(e?t.clone():t).transform(e?a:i,e?i:a):t,e&&r&&void 0!==r.decimals){var u=Math.pow(10,r.decimals);n===t&&(n=t.clone()),n.applyTransform(function(t){for(var e=0,r=t.length;e<r;++e)t[e]=Math.round(t[e]*u)/u;return t})}return n}function c(t,e){var r=e?(0,o.get)(e.featureProjection):null,n=e?(0,o.get)(e.dataProjection):null;return r&&n&&!(0,o.equivalent)(r,n)?(0,o.transformExtent)(t,n,r):t}exports.default=i; },{"../proj/Units.js":"yZx6","../util.js":"KniQ","../obj.js":"mH6q","../proj.js":"Diht"}],"RA7M":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=o(require("./Feature.js")),e=o(require("./FormatType.js")),r=require("../util.js");function o(t){return t&&t.__esModule?t:{default:t}}var n=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),u=function(t){function o(){return t.call(this)||this}return n(o,t),o.prototype.getType=function(){return e.default.JSON},o.prototype.readFeature=function(t,e){return this.readFeatureFromObject(i(t),this.getReadOptions(t,e))},o.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(i(t),this.getReadOptions(t,e))},o.prototype.readFeatureFromObject=function(t,e){return(0,r.abstract)()},o.prototype.readFeaturesFromObject=function(t,e){return(0,r.abstract)()},o.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(i(t),this.getReadOptions(t,e))},o.prototype.readGeometryFromObject=function(t,e){return(0,r.abstract)()},o.prototype.readProjection=function(t){return this.readProjectionFromObject(i(t))},o.prototype.readProjectionFromObject=function(t){return(0,r.abstract)()},o.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},o.prototype.writeFeatureObject=function(t,e){return(0,r.abstract)()},o.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},o.prototype.writeFeaturesObject=function(t,e){return(0,r.abstract)()},o.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},o.prototype.writeGeometryObject=function(t,e){return(0,r.abstract)()},o}(t.default);function i(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var a=u;exports.default=a; },{"./Feature.js":"Kylu","./FormatType.js":"AbO3","../util.js":"KniQ"}],"qBlb":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=y(require("../Feature.js")),t=y(require("../geom/GeometryCollection.js")),r=y(require("../geom/GeometryType.js")),o=y(require("./JSONFeature.js")),n=y(require("../geom/LineString.js")),a=y(require("../geom/MultiLineString.js")),i=y(require("../geom/MultiPoint.js")),u=y(require("../geom/MultiPolygon.js")),s=y(require("../geom/Point.js")),c=y(require("../geom/Polygon.js")),p=require("../asserts.js"),d=require("../obj.js"),f=require("../proj.js"),l=require("./Feature.js");function y(e){return e&&e.__esModule?e:{default:e}}var m=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),g=function(t){function r(e){var r=this,o=e||{};return(r=t.call(this)||this).dataProjection=(0,f.get)(o.dataProjection?o.dataProjection:"EPSG:4326"),o.featureProjection&&(r.defaultFeatureProjection=(0,f.get)(o.featureProjection)),r.geometryName_=o.geometryName,r.extractGeometryName_=o.extractGeometryName,r}return m(r,t),r.prototype.readFeatureFromObject=function(t,r){var o=null,n=O((o="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,r),a=new e.default;return this.geometryName_?a.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in o!==void 0&&a.setGeometryName(o.geometry_name),a.setGeometry(n),"id"in o&&a.setId(o.id),o.properties&&a.setProperties(o.properties,!0),a},r.prototype.readFeaturesFromObject=function(e,t){var r=null;if("FeatureCollection"===e.type){r=[];for(var o=e.features,n=0,a=o.length;n<a;++n)r.push(this.readFeatureFromObject(o[n],t))}else r=[this.readFeatureFromObject(e,t)];return r},r.prototype.readGeometryFromObject=function(e,t){return O(e,t)},r.prototype.readProjectionFromObject=function(e){var t,r=e.crs;return r?"name"==r.type?t=(0,f.get)(r.properties.name):"EPSG"===r.type?t=(0,f.get)("EPSG:"+r.properties.code):(0,p.assert)(!1,36):t=this.dataProjection,t},r.prototype.writeFeatureObject=function(e,t){t=this.adaptOptions(t);var r={type:"Feature",geometry:null,properties:null},o=e.getId();if(void 0!==o&&(r.id=o),!e.hasProperties())return r;var n=e.getProperties(),a=e.getGeometry();return a&&(r.geometry=v(a,t),delete n[e.getGeometryName()]),(0,d.isEmpty)(n)||(r.properties=n),r},r.prototype.writeFeaturesObject=function(e,t){t=this.adaptOptions(t);for(var r=[],o=0,n=e.length;o<n;++o)r.push(this.writeFeatureObject(e[o],t));return{type:"FeatureCollection",features:r}},r.prototype.writeGeometryObject=function(e,t){return v(e,this.adaptOptions(t))},r}(o.default);function O(e,t){if(!e)return null;var o;switch(e.type){case r.default.POINT:o=P(e);break;case r.default.LINE_STRING:o=G(e);break;case r.default.POLYGON:o=h(e);break;case r.default.MULTI_POINT:o=N(e);break;case r.default.MULTI_LINE_STRING:o=_(e);break;case r.default.MULTI_POLYGON:o=b(e);break;case r.default.GEOMETRY_COLLECTION:o=j(e);break;default:throw new Error("Unsupported GeoJSON type: "+e.type)}return(0,l.transformGeometryWithOptions)(o,!1,t)}function j(e,r){var o=e.geometries.map(function(e){return O(e,r)});return new t.default(o)}function P(e){return new s.default(e.coordinates)}function G(e){return new n.default(e.coordinates)}function _(e){return new a.default(e.coordinates)}function N(e){return new i.default(e.coordinates)}function b(e){return new u.default(e.coordinates)}function h(e){return new c.default(e.coordinates)}function v(e,t){var o,n=(e=(0,l.transformGeometryWithOptions)(e,!0,t)).getType();switch(n){case r.default.POINT:o=C(e,t);break;case r.default.LINE_STRING:o=L(e,t);break;case r.default.POLYGON:o=E(e,t);break;case r.default.MULTI_POINT:o=w(e,t);break;case r.default.MULTI_LINE_STRING:o=F(e,t);break;case r.default.MULTI_POLYGON:o=T(e,t);break;case r.default.GEOMETRY_COLLECTION:o=I(e,t);break;case r.default.CIRCLE:o={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+n)}return o}function I(e,t){return{type:"GeometryCollection",geometries:e.getGeometriesArray().map(function(e){var r=(0,d.assign)({},t);return delete r.featureProjection,v(e,r)})}}function L(e,t){return{type:"LineString",coordinates:e.getCoordinates()}}function F(e,t){return{type:"MultiLineString",coordinates:e.getCoordinates()}}function w(e,t){return{type:"MultiPoint",coordinates:e.getCoordinates()}}function T(e,t){var r;return t&&(r=t.rightHanded),{type:"MultiPolygon",coordinates:e.getCoordinates(r)}}function C(e,t){return{type:"Point",coordinates:e.getCoordinates()}}function E(e,t){var r;return t&&(r=t.rightHanded),{type:"Polygon",coordinates:e.getCoordinates(r)}}var M=g;exports.default=M; },{"../Feature.js":"mYW9","../geom/GeometryCollection.js":"HvLT","../geom/GeometryType.js":"lmV0","./JSONFeature.js":"RA7M","../geom/LineString.js":"DfxW","../geom/MultiLineString.js":"fbCo","../geom/MultiPoint.js":"dNu5","../geom/MultiPolygon.js":"ouhF","../geom/Point.js":"gLcY","../geom/Polygon.js":"Nwwk","../asserts.js":"fLG6","../obj.js":"mH6q","../proj.js":"Diht","./Feature.js":"Kylu"}],"yYlP":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createElementNS=r,exports.getAllTextContent=n,exports.getAllTextContent_=o,exports.isDocument=i,exports.getAttributeNS=a,exports.parse=u,exports.makeArrayExtender=l,exports.makeArrayPusher=c,exports.makeReplacer=p,exports.makeObjectPropertyPusher=s,exports.makeObjectPropertySetter=d,exports.makeChildAppender=v,exports.makeArraySerializer=f,exports.makeSimpleNodeFactory=m,exports.makeSequence=h,exports.makeStructureNS=S,exports.parseNode=g,exports.pushParseAndPop=N,exports.serialize=E,exports.pushSerializeAndPop=A,exports.registerXMLSerializer=C,exports.getXMLSerializer=T,exports.registerDocument=y,exports.getDocument=P,exports.OBJECT_PROPERTY_NODE_FACTORY=exports.XML_SCHEMA_INSTANCE_URI=void 0;var e=require("./array.js"),t="http://www.w3.org/2001/XMLSchema-instance";function r(e,t){return P().createElementNS(e,t)}function n(e,t){return o(e,t,[]).join("")}function o(e,t,r){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)t?r.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(e.nodeValue);else{var n=void 0;for(n=e.firstChild;n;n=n.nextSibling)o(n,t,r)}return r}function i(e){return"documentElement"in e}function a(e,t,r){return e.getAttributeNS(t,r)||""}function u(e){return(new DOMParser).parseFromString(e,"application/xml")}function l(t,r){return function(n,o){var i=t.call(void 0!==r?r:this,n,o);if(void 0!==i){var a=o[o.length-1];(0,e.extend)(a,i)}}}function c(e,t){return function(r,n){var o=e.call(void 0!==t?t:this,r,n);void 0!==o&&n[n.length-1].push(o)}}function p(e,t){return function(r,n){var o=e.call(void 0!==t?t:this,r,n);void 0!==o&&(n[n.length-1]=o)}}function s(e,t,r){return function(n,o){var i=e.call(void 0!==r?r:this,n,o);if(void 0!==i){var a=o[o.length-1],u=void 0!==t?t:n.localName,l=void 0;u in a?l=a[u]:(l=[],a[u]=l),l.push(i)}}}function d(e,t,r){return function(n,o){var i=e.call(void 0!==r?r:this,n,o);void 0!==i&&(o[o.length-1][void 0!==t?t:n.localName]=i)}}function v(e,t){return function(r,n,o){e.call(void 0!==t?t:this,r,n,o),o[o.length-1].node.appendChild(r)}}function f(e,t){var r,n;return function(t,o,i){if(void 0===r){r={};var a={};a[t.localName]=e,r[t.namespaceURI]=a,n=m(t.localName)}E(r,n,o,i)}}function m(e,t){var n=e;return function(e,o,i){var a=o[o.length-1].node,u=n;return void 0===u&&(u=i),r(void 0!==t?t:a.namespaceURI,u)}}exports.XML_SCHEMA_INSTANCE_URI=t;var x=m();function h(e,t){for(var r=t.length,n=new Array(r),o=0;o<r;++o)n[o]=e[t[o]];return n}function S(e,t,r){var n,o,i=void 0!==r?r:{};for(n=0,o=e.length;n<o;++n)i[e[n]]=t;return i}function g(e,t,r,n){var o;for(o=t.firstElementChild;o;o=o.nextElementSibling){var i=e[o.namespaceURI];if(void 0!==i){var a=i[o.localName];void 0!==a&&a.call(n,o,r)}}}function N(e,t,r,n,o){return n.push(e),g(t,r,n,o),n.pop()}function E(e,t,r,n,o,i){for(var a,u,l=(void 0!==o?o:r).length,c=0;c<l;++c)void 0!==(a=r[c])&&void 0!==(u=t.call(void 0!==i?i:this,a,n,void 0!==o?o[c]:void 0))&&e[u.namespaceURI][u.localName].call(i,u,a,n)}function A(e,t,r,n,o,i,a){return o.push(e),E(t,r,n,o,i,a),o.pop()}exports.OBJECT_PROPERTY_NODE_FACTORY=x;var _=void 0;function C(e){_=e}function T(){return void 0===_&&"undefined"!=typeof XMLSerializer&&(_=new XMLSerializer),_}var O=void 0;function y(e){O=e}function P(){return void 0===O&&"undefined"!=typeof document&&(O=document.implementation.createDocument("","",null)),O} },{"./array.js":"luEr"}],"CXRz":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("../format/Feature.js")),r=u(require("../format/FormatType.js")),t=require("../util.js"),o=require("../array.js"),n=require("../xml.js");function u(e){return e&&e.__esModule?e:{default:e}}var i=function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function o(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}}(),a=function(e){function u(){var r=e.call(this)||this;return r.xmlSerializer_=(0,n.getXMLSerializer)(),r}return i(u,e),u.prototype.getType=function(){return r.default.XML},u.prototype.readFeature=function(e,r){if(e){if("string"==typeof e){var t=(0,n.parse)(e);return this.readFeatureFromDocument(t,r)}return(0,n.isDocument)(e)?this.readFeatureFromDocument(e,r):this.readFeatureFromNode(e,r)}return null},u.prototype.readFeatureFromDocument=function(e,r){var t=this.readFeaturesFromDocument(e,r);return t.length>0?t[0]:null},u.prototype.readFeatureFromNode=function(e,r){return null},u.prototype.readFeatures=function(e,r){if(e){if("string"==typeof e){var t=(0,n.parse)(e);return this.readFeaturesFromDocument(t,r)}return(0,n.isDocument)(e)?this.readFeaturesFromDocument(e,r):this.readFeaturesFromNode(e,r)}return[]},u.prototype.readFeaturesFromDocument=function(e,r){for(var t=[],n=e.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&(0,o.extend)(t,this.readFeaturesFromNode(n,r));return t},u.prototype.readFeaturesFromNode=function(e,r){return(0,t.abstract)()},u.prototype.readGeometry=function(e,r){if(e){if("string"==typeof e){var t=(0,n.parse)(e);return this.readGeometryFromDocument(t,r)}return(0,n.isDocument)(e)?this.readGeometryFromDocument(e,r):this.readGeometryFromNode(e,r)}return null},u.prototype.readGeometryFromDocument=function(e,r){return null},u.prototype.readGeometryFromNode=function(e,r){return null},u.prototype.readProjection=function(e){if(e){if("string"==typeof e){var r=(0,n.parse)(e);return this.readProjectionFromDocument(r)}return(0,n.isDocument)(e)?this.readProjectionFromDocument(e):this.readProjectionFromNode(e)}return null},u.prototype.readProjectionFromDocument=function(e){return this.dataProjection},u.prototype.readProjectionFromNode=function(e){return this.dataProjection},u.prototype.writeFeature=function(e,r){var t=this.writeFeatureNode(e,r);return this.xmlSerializer_.serializeToString(t)},u.prototype.writeFeatureNode=function(e,r){return null},u.prototype.writeFeatures=function(e,r){var t=this.writeFeaturesNode(e,r);return this.xmlSerializer_.serializeToString(t)},u.prototype.writeFeaturesNode=function(e,r){return null},u.prototype.writeGeometry=function(e,r){var t=this.writeGeometryNode(e,r);return this.xmlSerializer_.serializeToString(t)},u.prototype.writeGeometryNode=function(e,r){return null},u}(e.default),s=a;exports.default=s; },{"../format/Feature.js":"Kylu","../format/FormatType.js":"AbO3","../util.js":"KniQ","../array.js":"luEr","../xml.js":"yYlP"}],"jdp5":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.readBoolean=r,exports.readBooleanString=n,exports.readDateTime=o,exports.readDecimal=i,exports.readDecimalString=a,exports.readNonNegativeInteger=d,exports.readNonNegativeIntegerString=u,exports.readString=c,exports.writeBooleanTextNode=s,exports.writeCDATASection=p,exports.writeDateTimeTextNode=x,exports.writeDecimalTextNode=g,exports.writeNonNegativeIntegerTextNode=l,exports.writeStringTextNode=T;var e=require("../xml.js"),t=require("../string.js");function r(t){return n((0,e.getAllTextContent)(t,!1))}function n(e){var t=/^\s*(true|1)|(false|0)\s*$/.exec(e);return t?void 0!==t[1]||!1:void 0}function o(t){var r=(0,e.getAllTextContent)(t,!1),n=Date.parse(r);return isNaN(n)?void 0:n/1e3}function i(t){return a((0,e.getAllTextContent)(t,!1))}function a(e){var t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(e);return t?parseFloat(t[1]):void 0}function d(t){return u((0,e.getAllTextContent)(t,!1))}function u(e){var t=/^\s*(\d+)\s*$/.exec(e);return t?parseInt(t[1],10):void 0}function c(t){return(0,e.getAllTextContent)(t,!1).trim()}function s(e,t){T(e,t?"1":"0")}function p(t,r){t.appendChild((0,e.getDocument)().createCDATASection(r))}function x(r,n){var o=new Date(1e3*n),i=o.getUTCFullYear()+"-"+(0,t.padNumber)(o.getUTCMonth()+1,2)+"-"+(0,t.padNumber)(o.getUTCDate(),2)+"T"+(0,t.padNumber)(o.getUTCHours(),2)+":"+(0,t.padNumber)(o.getUTCMinutes(),2)+":"+(0,t.padNumber)(o.getUTCSeconds(),2)+"Z";r.appendChild((0,e.getDocument)().createTextNode(i))}function g(t,r){var n=r.toPrecision();t.appendChild((0,e.getDocument)().createTextNode(n))}function l(t,r){var n=r.toString();t.appendChild((0,e.getDocument)().createTextNode(n))}function T(t,r){t.appendChild((0,e.getDocument)().createTextNode(r))} },{"../xml.js":"yYlP","../string.js":"AiCK"}],"DiYy":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDefaultFillStyle=J,exports.getDefaultImageStyle=W,exports.getDefaultStrokeStyle=Q,exports.getDefaultTextStyle=ee,exports.getDefaultStyle=re,exports.getDefaultStyleArray=oe,exports.readFlatCoordinates=me,exports.default=void 0;var e=x(require("../Feature.js")),t=x(require("../style/Fill.js")),r=x(require("../geom/GeometryCollection.js")),a=x(require("../geom/GeometryLayout.js")),n=x(require("../geom/GeometryType.js")),o=x(require("../style/Icon.js")),i=x(require("../style/IconAnchorUnits.js")),l=x(require("../style/IconOrigin.js")),u=x(require("../geom/LineString.js")),d=x(require("../geom/MultiLineString.js")),s=x(require("../geom/MultiPoint.js")),c=x(require("../geom/MultiPolygon.js")),m=x(require("../geom/Point.js")),p=x(require("../geom/Polygon.js")),S=x(require("../style/Stroke.js")),f=x(require("../style/Style.js")),y=x(require("../style/Text.js")),g=x(require("./XMLFeature.js")),h=require("../xml.js"),v=require("../color.js"),k=require("../asserts.js"),P=require("../array.js"),N=require("../proj.js"),O=require("./xsd.js"),A=require("../math.js"),T=require("./Feature.js");function x(e){return e&&e.__esModule?e:{default:e}}var L,C,E,I,b,_,w,R=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),F=["http://www.google.com/kml/ext/2.2"],j=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],D="http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd",M={fraction:i.default.FRACTION,pixels:i.default.PIXELS,insetPixels:i.default.PIXELS},G=(0,h.makeStructureNS)(j,{ExtendedData:Ke,Region:Qe,MultiGeometry:(0,h.makeObjectPropertySetter)(Ue,"geometry"),LineString:(0,h.makeObjectPropertySetter)(Me,"geometry"),LinearRing:(0,h.makeObjectPropertySetter)(Ge,"geometry"),Point:(0,h.makeObjectPropertySetter)(Be,"geometry"),Polygon:(0,h.makeObjectPropertySetter)(ze,"geometry"),Style:(0,h.makeObjectPropertySetter)(Je),StyleMap:tt,address:(0,h.makeObjectPropertySetter)(O.readString),description:(0,h.makeObjectPropertySetter)(O.readString),name:(0,h.makeObjectPropertySetter)(O.readString),open:(0,h.makeObjectPropertySetter)(O.readBoolean),phoneNumber:(0,h.makeObjectPropertySetter)(O.readString),styleUrl:(0,h.makeObjectPropertySetter)(pe),visibility:(0,h.makeObjectPropertySetter)(O.readBoolean)},(0,h.makeStructureNS)(F,{MultiTrack:(0,h.makeObjectPropertySetter)(Ie,"geometry"),Track:(0,h.makeObjectPropertySetter)(_e,"geometry")})),Y=(0,h.makeStructureNS)(j,{ExtendedData:Ke,Region:Qe,Link:pt,address:(0,h.makeObjectPropertySetter)(O.readString),description:(0,h.makeObjectPropertySetter)(O.readString),name:(0,h.makeObjectPropertySetter)(O.readString),open:(0,h.makeObjectPropertySetter)(O.readBoolean),phoneNumber:(0,h.makeObjectPropertySetter)(O.readString),visibility:(0,h.makeObjectPropertySetter)(O.readBoolean)}),U=(0,h.makeStructureNS)(j,{href:(0,h.makeObjectPropertySetter)(pe)}),B=(0,h.makeStructureNS)(j,{LatLonAltBox:it,Lod:ut}),q=(0,h.makeStructureNS)(j,["Document","Placemark"]),z=(0,h.makeStructureNS)(j,{Document:(0,h.makeChildAppender)(Ot),Placemark:(0,h.makeChildAppender)(Qt)}),X=null;function J(){return X}var Z,H=null;function W(){return H}var $,K=null;function Q(){return K}var V=null;function ee(){return V}var te=null;function re(){return te}var ae,ne=null;function oe(){return ne}function ie(){L=[255,255,255,1],X=new t.default({color:L}),C=[20,2],E=i.default.PIXELS,I=i.default.PIXELS,b=[64,64],_="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",w=.5,H=new o.default({anchor:C,anchorOrigin:l.default.BOTTOM_LEFT,anchorXUnits:E,anchorYUnits:I,crossOrigin:"anonymous",rotation:0,scale:w,size:b,src:_}),Z="NO_IMAGE",K=new S.default({color:L,width:1}),$=new S.default({color:[51,51,51,1],width:2}),V=new y.default({font:"bold 16px Helvetica",fill:X,stroke:$,scale:.8}),te=new f.default({fill:X,image:H,text:V,stroke:K,zIndex:0}),ne=[te]}var le=function(t){function r(e){var r=t.call(this)||this,a=e||{};return ne||ie(),r.dataProjection=(0,N.get)("EPSG:4326"),r.defaultStyle_=a.defaultStyle?a.defaultStyle:ne,r.extractStyles_=void 0===a.extractStyles||a.extractStyles,r.writeStyles_=void 0===a.writeStyles||a.writeStyles,r.sharedStyles_={},r.showPointNames_=void 0===a.showPointNames||a.showPointNames,r.crossOrigin_=void 0!==a.crossOrigin?a.crossOrigin:"anonymous",r}return R(r,t),r.prototype.readDocumentOrFolder_=function(e,t){var r=(0,h.makeStructureNS)(j,{Document:(0,h.makeArrayExtender)(this.readDocumentOrFolder_,this),Folder:(0,h.makeArrayExtender)(this.readDocumentOrFolder_,this),Placemark:(0,h.makeArrayPusher)(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),a=(0,h.pushParseAndPop)([],r,e,t,this);return a||void 0},r.prototype.readPlacemark_=function(t,r){var a=(0,h.pushParseAndPop)({geometry:null},G,t,r,this);if(a){var n=new e.default,o=t.getAttribute("id");null!==o&&n.setId(o);var i=r[0],l=a.geometry;if(l&&(0,T.transformGeometryWithOptions)(l,!1,i),n.setGeometry(l),delete a.geometry,this.extractStyles_){var u=de(a.Style,a.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);n.setStyle(u)}return delete a.Style,n.setProperties(a,!0),n}},r.prototype.readSharedStyle_=function(e,t){var r=e.getAttribute("id");if(null!==r){var a=Je.call(this,e,t);if(a){var n=void 0,o=e.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)n=new URL("#"+r,o).href;else n="#"+r;this.sharedStyles_[n]=a}}},r.prototype.readSharedStyleMap_=function(e,t){var r=e.getAttribute("id");if(null!==r){var a=ge.call(this,e,t);if(a){var n,o=e.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)n=new URL("#"+r,o).href;else n="#"+r;this.sharedStyles_[n]=a}}},r.prototype.readFeatureFromNode=function(e,t){if(!(0,P.includes)(j,e.namespaceURI))return null;var r=this.readPlacemark_(e,[this.getReadOptions(e,t)]);return r||null},r.prototype.readFeaturesFromNode=function(e,t){if(!(0,P.includes)(j,e.namespaceURI))return[];var r,a=e.localName;if("Document"==a||"Folder"==a)return(r=this.readDocumentOrFolder_(e,[this.getReadOptions(e,t)]))||[];if("Placemark"==a){var n=this.readPlacemark_(e,[this.getReadOptions(e,t)]);return n?[n]:[]}if("kml"==a){r=[];for(var o=e.firstElementChild;o;o=o.nextElementSibling){var i=this.readFeaturesFromNode(o,t);i&&(0,P.extend)(r,i)}return r}return[]},r.prototype.readName=function(e){if(e){if("string"==typeof e){var t=(0,h.parse)(e);return this.readNameFromDocument(t)}return(0,h.isDocument)(e)?this.readNameFromDocument(e):this.readNameFromNode(e)}},r.prototype.readNameFromDocument=function(e){for(var t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE){var r=this.readNameFromNode(t);if(r)return r}},r.prototype.readNameFromNode=function(e){for(var t=e.firstElementChild;t;t=t.nextElementSibling)if((0,P.includes)(j,t.namespaceURI)&&"name"==t.localName)return(0,O.readString)(t);for(t=e.firstElementChild;t;t=t.nextElementSibling){var r=t.localName;if((0,P.includes)(j,t.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var a=this.readNameFromNode(t);if(a)return a}}},r.prototype.readNetworkLinks=function(e){var t=[];if("string"==typeof e){var r=(0,h.parse)(e);(0,P.extend)(t,this.readNetworkLinksFromDocument(r))}else(0,h.isDocument)(e)?(0,P.extend)(t,this.readNetworkLinksFromDocument(e)):(0,P.extend)(t,this.readNetworkLinksFromNode(e));return t},r.prototype.readNetworkLinksFromDocument=function(e){for(var t=[],r=e.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&(0,P.extend)(t,this.readNetworkLinksFromNode(r));return t},r.prototype.readNetworkLinksFromNode=function(e){for(var t=[],r=e.firstElementChild;r;r=r.nextElementSibling)if((0,P.includes)(j,r.namespaceURI)&&"NetworkLink"==r.localName){var a=(0,h.pushParseAndPop)({},Y,r,[]);t.push(a)}for(r=e.firstElementChild;r;r=r.nextElementSibling){var n=r.localName;!(0,P.includes)(j,r.namespaceURI)||"Document"!=n&&"Folder"!=n&&"kml"!=n||(0,P.extend)(t,this.readNetworkLinksFromNode(r))}return t},r.prototype.readRegion=function(e){var t=[];if("string"==typeof e){var r=(0,h.parse)(e);(0,P.extend)(t,this.readRegionFromDocument(r))}else(0,h.isDocument)(e)?(0,P.extend)(t,this.readRegionFromDocument(e)):(0,P.extend)(t,this.readRegionFromNode(e));return t},r.prototype.readRegionFromDocument=function(e){for(var t=[],r=e.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&(0,P.extend)(t,this.readRegionFromNode(r));return t},r.prototype.readRegionFromNode=function(e){for(var t=[],r=e.firstElementChild;r;r=r.nextElementSibling)if((0,P.includes)(j,r.namespaceURI)&&"Region"==r.localName){var a=(0,h.pushParseAndPop)({},B,r,[]);t.push(a)}for(r=e.firstElementChild;r;r=r.nextElementSibling){var n=r.localName;!(0,P.includes)(j,r.namespaceURI)||"Document"!=n&&"Folder"!=n&&"kml"!=n||(0,P.extend)(t,this.readRegionFromNode(r))}return t},r.prototype.writeFeaturesNode=function(e,t){t=this.adaptOptions(t);var r=(0,h.createElementNS)(j[4],"kml"),a="http://www.w3.org/2000/xmlns/";r.setAttributeNS(a,"xmlns:gx",F[0]),r.setAttributeNS(a,"xmlns:xsi",h.XML_SCHEMA_INSTANCE_URI),r.setAttributeNS(h.XML_SCHEMA_INSTANCE_URI,"xsi:schemaLocation",D);var n={node:r},o={};e.length>1?o.Document=e:1==e.length&&(o.Placemark=e[0]);var i=q[r.namespaceURI],l=(0,h.makeSequence)(o,i);return(0,h.pushSerializeAndPop)(n,z,h.OBJECT_PROPERTY_NODE_FACTORY,l,[t],i,this),r},r}(g.default);function ue(e,t){var r=[0,0],a="start",n=e.getImage();if(n){var o=n.getImageSize();if(null===o&&(o=b),2==o.length){var i=n.getScaleArray();r[0]=i[0]*o[0]/2,r[1]=-i[1]*o[1]/2,a="left"}}var l=e.getText();return l?((l=l.clone()).setFont(l.getFont()||V.getFont()),l.setScale(l.getScale()||V.getScale()),l.setFill(l.getFill()||V.getFill()),l.setStroke(l.getStroke()||$)):l=V.clone(),l.setText(t),l.setOffsetX(r[0]),l.setOffsetY(r[1]),l.setTextAlign(a),new f.default({image:n,text:l})}function de(e,t,a,o,i){return function(l,u){var d=i,s="",c=[];if(d){var m=l.getGeometry();if(m){var p=m.getType();d=p===n.default.GEOMETRY_COLLECTION?(c=m.getGeometriesArrayRecursive().filter(function(e){var t=e.getType();return t===n.default.POINT||t===n.default.MULTI_POINT})).length>0:p===n.default.POINT||p===n.default.MULTI_POINT}}d&&(s=l.get("name"),(d=d&&!!s)&&s.search(/&[^&]+;/)>-1&&(ae||(ae=document.createElement("textarea")),ae.innerHTML=s,s=ae.value));var S=a;if(e?S=e:t&&(S=se(t,a,o)),d){var y=ue(S[0],s);return c.length>0?(y.setGeometry(new r.default(c)),[y,new f.default({geometry:S[0].getGeometry(),image:null,fill:S[0].getFill(),stroke:S[0].getStroke(),text:null})].concat(S.slice(1))):y}return S}}function se(e,t,r){return Array.isArray(e)?e:"string"==typeof e?(!(e in r)&&"#"+e in r&&(e="#"+e),se(r[e],t,r)):t}function ce(e){var t=(0,h.getAllTextContent)(e,!1),r=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(t);if(r){var a=r[1];return[parseInt(a.substr(6,2),16),parseInt(a.substr(4,2),16),parseInt(a.substr(2,2),16),parseInt(a.substr(0,2),16)/255]}}function me(e){for(var t,r=(0,h.getAllTextContent)(e,!1),a=[],n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i;t=n.exec(r);){var o=parseFloat(t[1]),i=parseFloat(t[2]),l=t[3]?parseFloat(t[3]):0;a.push(o,i,l),r=r.substr(t[0].length)}if(""===r)return a}function pe(e){var t=(0,h.getAllTextContent)(e,!1).trim(),r=e.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(t,r).href:t}function Se(e){var t,r=e.getAttribute("xunits"),a=e.getAttribute("yunits");return t="insetPixels"!==r?"insetPixels"!==a?l.default.BOTTOM_LEFT:l.default.TOP_LEFT:"insetPixels"!==a?l.default.BOTTOM_RIGHT:l.default.TOP_RIGHT,{x:parseFloat(e.getAttribute("x")),xunits:M[r],y:parseFloat(e.getAttribute("y")),yunits:M[a],origin:t}}function fe(e){return(0,O.readDecimal)(e)}var ye=(0,h.makeStructureNS)(j,{Pair:et});function ge(e,t){return(0,h.pushParseAndPop)(void 0,ye,e,t,this)}var he=(0,h.makeStructureNS)(j,{Icon:(0,h.makeObjectPropertySetter)(Re),color:(0,h.makeObjectPropertySetter)(ce),heading:(0,h.makeObjectPropertySetter)(O.readDecimal),hotSpot:(0,h.makeObjectPropertySetter)(Se),scale:(0,h.makeObjectPropertySetter)(fe)});function ve(e,t){var r=(0,h.pushParseAndPop)({},he,e,t);if(r){var a,n,u,d,s=t[t.length-1],c="Icon"in r?r.Icon:{},m=!("Icon"in r)||Object.keys(c).length>0,p=c.href;p?a=p:m&&(a=_);var S,f=l.default.BOTTOM_LEFT,y=r.hotSpot;y?(n=[y.x,y.y],u=y.xunits,d=y.yunits,f=y.origin):a===_?(n=C,u=E,d=I):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(a)&&(n=[.5,0],u=i.default.FRACTION,d=i.default.FRACTION);var g,v=c.x,k=c.y;void 0!==v&&void 0!==k&&(S=[v,k]);var P,N=c.w,O=c.h;void 0!==N&&void 0!==O&&(g=[N,O]);var T=r.heading;void 0!==T&&(P=(0,A.toRadians)(T));var x=r.scale,L=r.color;if(m){a==_&&(g=b,void 0===x&&(x=w));var R=new o.default({anchor:n,anchorOrigin:f,anchorXUnits:u,anchorYUnits:d,crossOrigin:this.crossOrigin_,offset:S,offsetOrigin:l.default.BOTTOM_LEFT,rotation:P,scale:x,size:g,src:a,color:L});s.imageStyle=R}else s.imageStyle=Z}}var ke=(0,h.makeStructureNS)(j,{color:(0,h.makeObjectPropertySetter)(ce),scale:(0,h.makeObjectPropertySetter)(fe)});function Pe(e,r){var a=(0,h.pushParseAndPop)({},ke,e,r);if(a){var n=r[r.length-1],o=new y.default({fill:new t.default({color:"color"in a?a.color:L}),scale:a.scale});n.textStyle=o}}var Ne=(0,h.makeStructureNS)(j,{color:(0,h.makeObjectPropertySetter)(ce),width:(0,h.makeObjectPropertySetter)(O.readDecimal)});function Oe(e,t){var r=(0,h.pushParseAndPop)({},Ne,e,t);if(r){var a=t[t.length-1],n=new S.default({color:"color"in r?r.color:L,width:"width"in r?r.width:1});a.strokeStyle=n}}var Ae=(0,h.makeStructureNS)(j,{color:(0,h.makeObjectPropertySetter)(ce),fill:(0,h.makeObjectPropertySetter)(O.readBoolean),outline:(0,h.makeObjectPropertySetter)(O.readBoolean)});function Te(e,r){var a=(0,h.pushParseAndPop)({},Ae,e,r);if(a){var n=r[r.length-1],o=new t.default({color:"color"in a?a.color:L});n.fillStyle=o;var i=a.fill;void 0!==i&&(n.fill=i);var l=a.outline;void 0!==l&&(n.outline=l)}}var xe=(0,h.makeStructureNS)(j,{coordinates:(0,h.makeReplacer)(me)});function Le(e,t){return(0,h.pushParseAndPop)(null,xe,e,t)}function Ce(e,t){var r=t[t.length-1].flatCoordinates,a=(0,h.getAllTextContent)(e,!1),n=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(a);if(n){var o=parseFloat(n[1]),i=parseFloat(n[2]),l=parseFloat(n[3]);r.push(o,i,l,0)}else r.push(0,0,0,0)}var Ee=(0,h.makeStructureNS)(F,{Track:(0,h.makeArrayPusher)(_e)});function Ie(e,t){var r=(0,h.pushParseAndPop)([],Ee,e,t);if(r)return new d.default(r)}var be=(0,h.makeStructureNS)(j,{when:St},(0,h.makeStructureNS)(F,{coord:Ce}));function _e(e,t){var r=(0,h.pushParseAndPop)({flatCoordinates:[],whens:[]},be,e,t);if(r){for(var n=r.flatCoordinates,o=r.whens,i=0,l=Math.min(n.length,o.length);i<l;++i)n[4*i+3]=o[i];return new u.default(n,a.default.XYZM)}}var we=(0,h.makeStructureNS)(j,{href:(0,h.makeObjectPropertySetter)(pe)},(0,h.makeStructureNS)(F,{x:(0,h.makeObjectPropertySetter)(O.readDecimal),y:(0,h.makeObjectPropertySetter)(O.readDecimal),w:(0,h.makeObjectPropertySetter)(O.readDecimal),h:(0,h.makeObjectPropertySetter)(O.readDecimal)}));function Re(e,t){var r=(0,h.pushParseAndPop)({},we,e,t);return r||null}var Fe=(0,h.makeStructureNS)(j,{coordinates:(0,h.makeReplacer)(me)});function je(e,t){return(0,h.pushParseAndPop)(null,Fe,e,t)}var De=(0,h.makeStructureNS)(j,{extrude:(0,h.makeObjectPropertySetter)(O.readBoolean),tessellate:(0,h.makeObjectPropertySetter)(O.readBoolean),altitudeMode:(0,h.makeObjectPropertySetter)(O.readString)});function Me(e,t){var r=(0,h.pushParseAndPop)({},De,e,t),n=je(e,t);if(n){var o=new u.default(n,a.default.XYZ);return o.setProperties(r,!0),o}}function Ge(e,t){var r=(0,h.pushParseAndPop)({},De,e,t),n=je(e,t);if(n){var o=new p.default(n,a.default.XYZ,[n.length]);return o.setProperties(r,!0),o}}var Ye=(0,h.makeStructureNS)(j,{LineString:(0,h.makeArrayPusher)(Me),LinearRing:(0,h.makeArrayPusher)(Ge),MultiGeometry:(0,h.makeArrayPusher)(Ue),Point:(0,h.makeArrayPusher)(Be),Polygon:(0,h.makeArrayPusher)(ze)});function Ue(e,t){var a,o=(0,h.pushParseAndPop)([],Ye,e,t);if(!o)return null;if(0===o.length)return new r.default(o);for(var i,l=!0,u=o[0].getType(),m=1,p=o.length;m<p;++m)if((i=o[m]).getType()!=u){l=!1;break}if(l){var S=void 0,f=void 0;if(u==n.default.POINT){var y=o[0];S=y.getLayout(),f=y.getFlatCoordinates();for(m=1,p=o.length;m<p;++m)i=o[m],(0,P.extend)(f,i.getFlatCoordinates());Ze(a=new s.default(f,S),o)}else u==n.default.LINE_STRING?Ze(a=new d.default(o),o):u==n.default.POLYGON?Ze(a=new c.default(o),o):u==n.default.GEOMETRY_COLLECTION?a=new r.default(o):(0,k.assert)(!1,37)}else a=new r.default(o);return a}function Be(e,t){var r=(0,h.pushParseAndPop)({},De,e,t),n=je(e,t);if(n){var o=new m.default(n,a.default.XYZ);return o.setProperties(r,!0),o}}var qe=(0,h.makeStructureNS)(j,{innerBoundaryIs:st,outerBoundaryIs:mt});function ze(e,t){var r=(0,h.pushParseAndPop)({},De,e,t),n=(0,h.pushParseAndPop)([null],qe,e,t);if(n&&n[0]){for(var o=n[0],i=[o.length],l=1,u=n.length;l<u;++l)(0,P.extend)(o,n[l]),i.push(o.length);var d=new p.default(o,a.default.XYZ,i);return d.setProperties(r,!0),d}}var Xe=(0,h.makeStructureNS)(j,{IconStyle:ve,LabelStyle:Pe,LineStyle:Oe,PolyStyle:Te});function Je(e,t){var a=(0,h.pushParseAndPop)({},Xe,e,t,this);if(!a)return null;var o,i="fillStyle"in a?a.fillStyle:X,l=a.fill;void 0===l||l||(i=null),"imageStyle"in a?a.imageStyle!=Z&&(o=a.imageStyle):o=H;var u="textStyle"in a?a.textStyle:V,d="strokeStyle"in a?a.strokeStyle:K,s=a.outline;return void 0===s||s?[new f.default({fill:i,image:o,stroke:d,text:u,zIndex:void 0})]:[new f.default({geometry:function(e){var t=e.getGeometry(),a=t.getType();return a===n.default.GEOMETRY_COLLECTION?new r.default(t.getGeometriesArrayRecursive().filter(function(e){var t=e.getType();return t!==n.default.POLYGON&&t!==n.default.MULTI_POLYGON})):a!==n.default.POLYGON&&a!==n.default.MULTI_POLYGON?t:void 0},fill:i,image:o,stroke:d,text:u,zIndex:void 0}),new f.default({geometry:function(e){var t=e.getGeometry(),a=t.getType();return a===n.default.GEOMETRY_COLLECTION?new r.default(t.getGeometriesArrayRecursive().filter(function(e){var t=e.getType();return t===n.default.POLYGON||t===n.default.MULTI_POLYGON})):a===n.default.POLYGON||a===n.default.MULTI_POLYGON?t:void 0},fill:i,stroke:null,zIndex:void 0})]}function Ze(e,t){var r,a,n,o=t.length,i=new Array(t.length),l=new Array(t.length),u=new Array(t.length);r=!1,a=!1,n=!1;for(var d=0;d<o;++d){var s=t[d];i[d]=s.get("extrude"),l[d]=s.get("tessellate"),u[d]=s.get("altitudeMode"),r=r||void 0!==i[d],a=a||void 0!==l[d],n=n||u[d]}r&&e.set("extrude",i),a&&e.set("tessellate",l),n&&e.set("altitudeMode",u)}var He=(0,h.makeStructureNS)(j,{displayName:(0,h.makeObjectPropertySetter)(O.readString),value:(0,h.makeObjectPropertySetter)(O.readString)});function We(e,t){var r=e.getAttribute("name");(0,h.parseNode)(He,e,t);var a=t[t.length-1];r&&a.displayName?a[r]={value:a.value,displayName:a.displayName,toString:function(){return a.value}}:null!==r?a[r]=a.value:null!==a.displayName&&(a[a.displayName]=a.value),delete a.value}var $e=(0,h.makeStructureNS)(j,{Data:We,SchemaData:at});function Ke(e,t){(0,h.parseNode)($e,e,t)}function Qe(e,t){(0,h.parseNode)(B,e,t)}var Ve=(0,h.makeStructureNS)(j,{Style:(0,h.makeObjectPropertySetter)(Je),key:(0,h.makeObjectPropertySetter)(O.readString),styleUrl:(0,h.makeObjectPropertySetter)(pe)});function et(e,t){var r=(0,h.pushParseAndPop)({},Ve,e,t,this);if(r){var a=r.key;if(a&&"normal"==a){var n=r.styleUrl;n&&(t[t.length-1]=n);var o=r.Style;o&&(t[t.length-1]=o)}}}function tt(e,t){var r=ge.call(this,e,t);if(r){var a=t[t.length-1];Array.isArray(r)?a.Style=r:"string"==typeof r?a.styleUrl=r:(0,k.assert)(!1,38)}}var rt=(0,h.makeStructureNS)(j,{SimpleData:nt});function at(e,t){(0,h.parseNode)(rt,e,t)}function nt(e,t){var r=e.getAttribute("name");if(null!==r){var a=(0,O.readString)(e);t[t.length-1][r]=a}}var ot=(0,h.makeStructureNS)(j,{altitudeMode:(0,h.makeObjectPropertySetter)(O.readString),minAltitude:(0,h.makeObjectPropertySetter)(O.readDecimal),maxAltitude:(0,h.makeObjectPropertySetter)(O.readDecimal),north:(0,h.makeObjectPropertySetter)(O.readDecimal),south:(0,h.makeObjectPropertySetter)(O.readDecimal),east:(0,h.makeObjectPropertySetter)(O.readDecimal),west:(0,h.makeObjectPropertySetter)(O.readDecimal)});function it(e,t){var r=(0,h.pushParseAndPop)({},ot,e,t);if(r){var a=t[t.length-1],n=[parseFloat(r.west),parseFloat(r.south),parseFloat(r.east),parseFloat(r.north)];a.extent=n,a.altitudeMode=r.altitudeMode,a.minAltitude=parseFloat(r.minAltitude),a.maxAltitude=parseFloat(r.maxAltitude)}}var lt=(0,h.makeStructureNS)(j,{minLodPixels:(0,h.makeObjectPropertySetter)(O.readDecimal),maxLodPixels:(0,h.makeObjectPropertySetter)(O.readDecimal),minFadeExtent:(0,h.makeObjectPropertySetter)(O.readDecimal),maxFadeExtent:(0,h.makeObjectPropertySetter)(O.readDecimal)});function ut(e,t){var r=(0,h.pushParseAndPop)({},lt,e,t);if(r){var a=t[t.length-1];a.minLodPixels=parseFloat(r.minLodPixels),a.maxLodPixels=parseFloat(r.maxLodPixels),a.minFadeExtent=parseFloat(r.minFadeExtent),a.maxFadeExtent=parseFloat(r.maxFadeExtent)}}var dt=(0,h.makeStructureNS)(j,{LinearRing:(0,h.makeReplacer)(Le)});function st(e,t){var r=(0,h.pushParseAndPop)(void 0,dt,e,t);r&&t[t.length-1].push(r)}var ct=(0,h.makeStructureNS)(j,{LinearRing:(0,h.makeReplacer)(Le)});function mt(e,t){var r=(0,h.pushParseAndPop)(void 0,ct,e,t);r&&(t[t.length-1][0]=r)}function pt(e,t){(0,h.parseNode)(U,e,t)}function St(e,t){var r=t[t.length-1].whens,a=(0,h.getAllTextContent)(e,!1),n=Date.parse(a);r.push(isNaN(n)?0:n)}function ft(e,t){for(var r=(0,v.asArray)(t),a=[255*(4==r.length?r[3]:1),r[2],r[1],r[0]],n=0;n<4;++n){var o=Math.floor(a[n]).toString(16);a[n]=1==o.length?"0"+o:o}(0,O.writeStringTextNode)(e,a.join(""))}function yt(e,t,r){var n,o=r[r.length-1],i=o.layout,l=o.stride;i==a.default.XY||i==a.default.XYM?n=2:i==a.default.XYZ||i==a.default.XYZM?n=3:(0,k.assert)(!1,34);var u=t.length,d="";if(u>0){d+=t[0];for(var s=1;s<n;++s)d+=","+t[s];for(var c=l;c<u;c+=l){d+=" "+t[c];for(s=1;s<n;++s)d+=","+t[c+s]}}(0,O.writeStringTextNode)(e,d)}var gt=(0,h.makeStructureNS)(j,{Data:(0,h.makeChildAppender)(ht),value:(0,h.makeChildAppender)(kt),displayName:(0,h.makeChildAppender)(vt)});function ht(e,t,r){e.setAttribute("name",t.name);var a={node:e},n=t.value;"object"==typeof n?(null!==n&&n.displayName&&(0,h.pushSerializeAndPop)(a,gt,h.OBJECT_PROPERTY_NODE_FACTORY,[n.displayName],r,["displayName"]),null!==n&&n.value&&(0,h.pushSerializeAndPop)(a,gt,h.OBJECT_PROPERTY_NODE_FACTORY,[n.value],r,["value"])):(0,h.pushSerializeAndPop)(a,gt,h.OBJECT_PROPERTY_NODE_FACTORY,[n],r,["value"])}function vt(e,t){(0,O.writeCDATASection)(e,t)}function kt(e,t){(0,O.writeStringTextNode)(e,t)}var Pt=(0,h.makeStructureNS)(j,{Placemark:(0,h.makeChildAppender)(Qt)}),Nt=function(e,t,r){var a=t[t.length-1].node;return(0,h.createElementNS)(a.namespaceURI,"Placemark")};function Ot(e,t,r){var a={node:e};(0,h.pushSerializeAndPop)(a,Pt,Nt,t,r,void 0,this)}var At=(0,h.makeSimpleNodeFactory)("Data");function Tt(e,t,r){for(var a={node:e},n=t.names,o=t.values,i=n.length,l=0;l<i;l++)(0,h.pushSerializeAndPop)(a,gt,At,[{name:n[l],value:o[l]}],r)}var xt=(0,h.makeStructureNS)(j,["href"],(0,h.makeStructureNS)(F,["x","y","w","h"])),Lt=(0,h.makeStructureNS)(j,{href:(0,h.makeChildAppender)(O.writeStringTextNode)},(0,h.makeStructureNS)(F,{x:(0,h.makeChildAppender)(O.writeDecimalTextNode),y:(0,h.makeChildAppender)(O.writeDecimalTextNode),w:(0,h.makeChildAppender)(O.writeDecimalTextNode),h:(0,h.makeChildAppender)(O.writeDecimalTextNode)})),Ct=function(e,t,r){return(0,h.createElementNS)(F[0],"gx:"+r)};function Et(e,t,r){var a={node:e},n=r[r.length-1].node,o=xt[n.namespaceURI],i=(0,h.makeSequence)(t,o);(0,h.pushSerializeAndPop)(a,Lt,h.OBJECT_PROPERTY_NODE_FACTORY,i,r,o),o=xt[F[0]],i=(0,h.makeSequence)(t,o),(0,h.pushSerializeAndPop)(a,Lt,Ct,i,r,o)}var It=(0,h.makeStructureNS)(j,["scale","heading","Icon","color","hotSpot"]),bt=(0,h.makeStructureNS)(j,{Icon:(0,h.makeChildAppender)(Et),color:(0,h.makeChildAppender)(ft),heading:(0,h.makeChildAppender)(O.writeDecimalTextNode),hotSpot:(0,h.makeChildAppender)(pr),scale:(0,h.makeChildAppender)(dr)});function _t(e,t,r){var a={node:e},n={},o=t.getSrc(),l=t.getSize(),u=t.getImageSize(),d={href:o};if(l){d.w=l[0],d.h=l[1];var s=t.getAnchor(),c=t.getOrigin();if(c&&u&&0!==c[0]&&c[1]!==l[1]&&(d.x=c[0],d.y=u[1]-(c[1]+l[1])),s&&(s[0]!==l[0]/2||s[1]!==l[1]/2)){var m={x:s[0],xunits:i.default.PIXELS,y:l[1]-s[1],yunits:i.default.PIXELS};n.hotSpot=m}}n.Icon=d;var p=t.getScale();1!==p&&(n.scale=p);var S=t.getRotation();0!==S&&(n.heading=S);var f=t.getColor();f&&(n.color=f);var y=r[r.length-1].node,g=It[y.namespaceURI],v=(0,h.makeSequence)(n,g);(0,h.pushSerializeAndPop)(a,bt,h.OBJECT_PROPERTY_NODE_FACTORY,v,r,g)}var wt=(0,h.makeStructureNS)(j,["color","scale"]),Rt=(0,h.makeStructureNS)(j,{color:(0,h.makeChildAppender)(ft),scale:(0,h.makeChildAppender)(dr)});function Ft(e,t,r){var a={node:e},n={},o=t.getFill();o&&(n.color=o.getColor());var i=t.getScale();i&&1!==i&&(n.scale=i);var l=r[r.length-1].node,u=wt[l.namespaceURI],d=(0,h.makeSequence)(n,u);(0,h.pushSerializeAndPop)(a,Rt,h.OBJECT_PROPERTY_NODE_FACTORY,d,r,u)}var jt=(0,h.makeStructureNS)(j,["color","width"]),Dt=(0,h.makeStructureNS)(j,{color:(0,h.makeChildAppender)(ft),width:(0,h.makeChildAppender)(O.writeDecimalTextNode)});function Mt(e,t,r){var a={node:e},n={color:t.getColor(),width:Number(t.getWidth())||1},o=r[r.length-1].node,i=jt[o.namespaceURI],l=(0,h.makeSequence)(n,i);(0,h.pushSerializeAndPop)(a,Dt,h.OBJECT_PROPERTY_NODE_FACTORY,l,r,i)}var Gt={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},Yt=function(e,t,r){if(e){var a=t[t.length-1].node;return(0,h.createElementNS)(a.namespaceURI,Gt[e.getType()])}},Ut=(0,h.makeSimpleNodeFactory)("Point"),Bt=(0,h.makeSimpleNodeFactory)("LineString"),qt=(0,h.makeSimpleNodeFactory)("LinearRing"),zt=(0,h.makeSimpleNodeFactory)("Polygon"),Xt=(0,h.makeStructureNS)(j,{LineString:(0,h.makeChildAppender)(tr),Point:(0,h.makeChildAppender)(tr),Polygon:(0,h.makeChildAppender)(ir),GeometryCollection:(0,h.makeChildAppender)(Jt)});function Jt(e,t,r){var a,o={node:e},i=t.getType(),l=[];i===n.default.GEOMETRY_COLLECTION?(t.getGeometriesArrayRecursive().forEach(function(e){var t=e.getType();t===n.default.MULTI_POINT?l=l.concat(e.getPoints()):t===n.default.MULTI_LINE_STRING?l=l.concat(e.getLineStrings()):t===n.default.MULTI_POLYGON?l=l.concat(e.getPolygons()):t===n.default.POINT||t===n.default.LINE_STRING||t===n.default.POLYGON?l.push(e):(0,k.assert)(!1,39)}),a=Yt):i===n.default.MULTI_POINT?(l=t.getPoints(),a=Ut):i===n.default.MULTI_LINE_STRING?(l=t.getLineStrings(),a=Bt):i===n.default.MULTI_POLYGON?(l=t.getPolygons(),a=zt):(0,k.assert)(!1,39),(0,h.pushSerializeAndPop)(o,Xt,a,l,r)}var Zt=(0,h.makeStructureNS)(j,{LinearRing:(0,h.makeChildAppender)(tr)});function Ht(e,t,r){var a={node:e};(0,h.pushSerializeAndPop)(a,Zt,qt,[t],r)}var Wt=(0,h.makeStructureNS)(j,{ExtendedData:(0,h.makeChildAppender)(Tt),MultiGeometry:(0,h.makeChildAppender)(Jt),LineString:(0,h.makeChildAppender)(tr),LinearRing:(0,h.makeChildAppender)(tr),Point:(0,h.makeChildAppender)(tr),Polygon:(0,h.makeChildAppender)(ir),Style:(0,h.makeChildAppender)(mr),address:(0,h.makeChildAppender)(O.writeStringTextNode),description:(0,h.makeChildAppender)(O.writeStringTextNode),name:(0,h.makeChildAppender)(O.writeStringTextNode),open:(0,h.makeChildAppender)(O.writeBooleanTextNode),phoneNumber:(0,h.makeChildAppender)(O.writeStringTextNode),styleUrl:(0,h.makeChildAppender)(O.writeStringTextNode),visibility:(0,h.makeChildAppender)(O.writeBooleanTextNode)}),$t=(0,h.makeStructureNS)(j,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Kt=(0,h.makeSimpleNodeFactory)("ExtendedData");function Qt(e,t,r){var a={node:e};t.getId()&&e.setAttribute("id",t.getId());var o=t.getProperties(),i={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};i[t.getGeometryName()]=1;var l=Object.keys(o||{}).sort().filter(function(e){return!i[e]}),u=t.getStyleFunction();if(u){var d=u(t,0);if(d){var s=Array.isArray(d)?d:[d],c=s;if(t.getGeometry()&&(c=s.filter(function(e){var r=e.getGeometryFunction()(t);if(r){var a=r.getType();return a===n.default.GEOMETRY_COLLECTION?r.getGeometriesArrayRecursive().filter(function(e){var t=e.getType();return t===n.default.POINT||t===n.default.MULTI_POINT}).length:a===n.default.POINT||a===n.default.MULTI_POINT}})),this.writeStyles_){var m=s,p=s;t.getGeometry()&&(m=s.filter(function(e){var r=e.getGeometryFunction()(t);if(r){var a=r.getType();return a===n.default.GEOMETRY_COLLECTION?r.getGeometriesArrayRecursive().filter(function(e){var t=e.getType();return t===n.default.LINE_STRING||t===n.default.MULTI_LINE_STRING}).length:a===n.default.LINE_STRING||a===n.default.MULTI_LINE_STRING}}),p=s.filter(function(e){var r=e.getGeometryFunction()(t);if(r){var a=r.getType();return a===n.default.GEOMETRY_COLLECTION?r.getGeometriesArrayRecursive().filter(function(e){var t=e.getType();return t===n.default.POLYGON||t===n.default.MULTI_POLYGON}).length:a===n.default.POLYGON||a===n.default.MULTI_POLYGON}})),o.Style={pointStyles:c,lineStyles:m,polyStyles:p}}if(c.length&&void 0===o.name){var S=c[0].getText();S&&(o.name=S.getText())}}}var f=r[r.length-1].node,y=$t[f.namespaceURI],g=(0,h.makeSequence)(o,y);if((0,h.pushSerializeAndPop)(a,Wt,h.OBJECT_PROPERTY_NODE_FACTORY,g,r,y),l.length>0){var v={names:l,values:(0,h.makeSequence)(o,l)};(0,h.pushSerializeAndPop)(a,Wt,Kt,[v],r)}var k=r[0],P=t.getGeometry();P&&(P=(0,T.transformGeometryWithOptions)(P,!0,k)),(0,h.pushSerializeAndPop)(a,Wt,Yt,[P],r)}var Vt=(0,h.makeStructureNS)(j,["extrude","tessellate","altitudeMode","coordinates"]),er=(0,h.makeStructureNS)(j,{extrude:(0,h.makeChildAppender)(O.writeBooleanTextNode),tessellate:(0,h.makeChildAppender)(O.writeBooleanTextNode),altitudeMode:(0,h.makeChildAppender)(O.writeStringTextNode),coordinates:(0,h.makeChildAppender)(yt)});function tr(e,t,r){var a=t.getFlatCoordinates(),n={node:e};n.layout=t.getLayout(),n.stride=t.getStride();var o=t.getProperties();o.coordinates=a;var i=r[r.length-1].node,l=Vt[i.namespaceURI],u=(0,h.makeSequence)(o,l);(0,h.pushSerializeAndPop)(n,er,h.OBJECT_PROPERTY_NODE_FACTORY,u,r,l)}var rr=(0,h.makeStructureNS)(j,["color","fill","outline"]),ar=(0,h.makeStructureNS)(j,{outerBoundaryIs:(0,h.makeChildAppender)(Ht),innerBoundaryIs:(0,h.makeChildAppender)(Ht)}),nr=(0,h.makeSimpleNodeFactory)("innerBoundaryIs"),or=(0,h.makeSimpleNodeFactory)("outerBoundaryIs");function ir(e,t,r){var a=t.getLinearRings(),n=a.shift(),o={node:e};(0,h.pushSerializeAndPop)(o,ar,nr,a,r),(0,h.pushSerializeAndPop)(o,ar,or,[n],r)}var lr=(0,h.makeStructureNS)(j,{color:(0,h.makeChildAppender)(ft),fill:(0,h.makeChildAppender)(O.writeBooleanTextNode),outline:(0,h.makeChildAppender)(O.writeBooleanTextNode)});function ur(e,t,r){var a={node:e},n=t.getFill(),o=t.getStroke(),i={color:n?n.getColor():void 0,fill:!!n&&void 0,outline:!!o&&void 0},l=r[r.length-1].node,u=rr[l.namespaceURI],d=(0,h.makeSequence)(i,u);(0,h.pushSerializeAndPop)(a,lr,h.OBJECT_PROPERTY_NODE_FACTORY,d,r,u)}function dr(e,t){(0,O.writeDecimalTextNode)(e,Math.round(1e6*t)/1e6)}var sr=(0,h.makeStructureNS)(j,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),cr=(0,h.makeStructureNS)(j,{IconStyle:(0,h.makeChildAppender)(_t),LabelStyle:(0,h.makeChildAppender)(Ft),LineStyle:(0,h.makeChildAppender)(Mt),PolyStyle:(0,h.makeChildAppender)(ur)});function mr(e,t,r){var a,n={node:e},o={};if(t.pointStyles.length){var i=t.pointStyles[0].getText();i&&(o.LabelStyle=i);var l=t.pointStyles[0].getImage();l&&"function"==typeof l.getSrc&&(o.IconStyle=l)}t.lineStyles.length&&((a=t.lineStyles[0].getStroke())&&(o.LineStyle=a));t.polyStyles.length&&((a=t.polyStyles[0].getStroke())&&!o.LineStyle&&(o.LineStyle=a),o.PolyStyle=t.polyStyles[0]);var u=r[r.length-1].node,d=sr[u.namespaceURI],s=(0,h.makeSequence)(o,d);(0,h.pushSerializeAndPop)(n,cr,h.OBJECT_PROPERTY_NODE_FACTORY,s,r,d)}function pr(e,t){e.setAttribute("x",String(t.x)),e.setAttribute("y",String(t.y)),e.setAttribute("xunits",t.xunits),e.setAttribute("yunits",t.yunits)}var Sr=le;exports.default=Sr; },{"../Feature.js":"mYW9","../style/Fill.js":"AFcg","../geom/GeometryCollection.js":"HvLT","../geom/GeometryLayout.js":"Utvi","../geom/GeometryType.js":"lmV0","../style/Icon.js":"z2xv","../style/IconAnchorUnits.js":"Rlas","../style/IconOrigin.js":"urGY","../geom/LineString.js":"DfxW","../geom/MultiLineString.js":"fbCo","../geom/MultiPoint.js":"dNu5","../geom/MultiPolygon.js":"ouhF","../geom/Point.js":"gLcY","../geom/Polygon.js":"Nwwk","../style/Stroke.js":"TXDt","../style/Style.js":"he4w","../style/Text.js":"RPsG","./XMLFeature.js":"CXRz","../xml.js":"yYlP","../color.js":"eucy","../asserts.js":"fLG6","../array.js":"luEr","../proj.js":"Diht","./xsd.js":"jdp5","../math.js":"B96G","./Feature.js":"Kylu"}],"w0c6":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.greatCircleArc=n,exports.meridian=e,exports.parallel=o;var t=require("../../proj.js"),a=require("../../math.js");function r(t,r,n){for(var e,o,s,i,u,p,h=[],c=t(0),M=t(1),f=r(c),g=r(M),d=[M,c],l=[g,f],v=[1,0],R={},m=1e5;--m>0&&v.length>0;)s=v.pop(),c=d.pop(),f=l.pop(),(p=s.toString())in R||(h.push(f[0],f[1]),R[p]=!0),i=v.pop(),M=d.pop(),g=l.pop(),o=r(e=t(u=(s+i)/2)),(0,a.squaredSegmentDistance)(o[0],o[1],f[0],f[1],g[0],g[1])<n?(h.push(g[0],g[1]),R[p=i.toString()]=!0):(v.push(i,u,u,s),l.push(g,o,o,f),d.push(M,e,e,c));return h}function n(n,e,o,s,i,u){var p=(0,t.get)("EPSG:4326"),h=Math.cos((0,a.toRadians)(e)),c=Math.sin((0,a.toRadians)(e)),M=Math.cos((0,a.toRadians)(s)),f=Math.sin((0,a.toRadians)(s)),g=Math.cos((0,a.toRadians)(o-n)),d=Math.sin((0,a.toRadians)(o-n)),l=c*f+h*M*g;return r(function(t){if(1<=l)return[o,s];var r=t*Math.acos(l),e=Math.cos(r),i=Math.sin(r),u=d*M,p=h*f-c*M*g,v=Math.atan2(u,p),R=Math.asin(c*e+h*i*Math.cos(v)),m=(0,a.toRadians)(n)+Math.atan2(Math.sin(v)*i*h,e-c*Math.sin(R));return[(0,a.toDegrees)(m),(0,a.toDegrees)(R)]},(0,t.getTransform)(p,i),u)}function e(a,n,e,o,s){var i=(0,t.get)("EPSG:4326");return r(function(t){return[a,n+(e-n)*t]},(0,t.getTransform)(i,o),s)}function o(a,n,e,o,s){var i=(0,t.get)("EPSG:4326");return r(function(t){return[n+(e-n)*t,a]},(0,t.getTransform)(i,o),s)} },{"../../proj.js":"Diht","../../math.js":"B96G"}],"wXs0":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=b(require("../Collection.js")),e=b(require("../render/EventType.js")),a=b(require("../Feature.js")),i=b(require("../style/Fill.js")),r=b(require("../geom/GeometryLayout.js")),s=b(require("../geom/LineString.js")),n=b(require("../geom/Point.js")),l=b(require("../style/Stroke.js")),o=b(require("../style/Style.js")),h=b(require("../style/Text.js")),_=b(require("./Vector.js")),m=b(require("../source/Vector.js")),L=require("../extent.js"),d=require("../obj.js"),u=require("../math.js"),p=require("../coordinate.js"),f=require("../proj.js"),c=require("../render.js"),g=require("../geom/flat/geodesic.js");function b(t){return t&&t.__esModule?t:{default:t}}var x=function(){var t=function(e,a){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a])})(e,a)};return function(e,a){function i(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(i.prototype=a.prototype,new i)}}(),v=new l.default({color:"rgba(0,0,0,0.2)"}),y=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],S=function(_){function b(a){var r=this,s=a||{},n=(0,d.assign)({updateWhileAnimating:!0,updateWhileInteracting:!0,renderBuffer:0},s);return delete n.maxLines,delete n.strokeStyle,delete n.targetSize,delete n.showLabels,delete n.lonLabelFormatter,delete n.latLabelFormatter,delete n.lonLabelPosition,delete n.latLabelPosition,delete n.lonLabelStyle,delete n.latLabelStyle,delete n.intervals,(r=_.call(this,n)||this).projection_=null,r.maxLat_=1/0,r.maxLon_=1/0,r.minLat_=-1/0,r.minLon_=-1/0,r.maxX_=1/0,r.maxY_=1/0,r.minX_=-1/0,r.minY_=-1/0,r.targetSize_=void 0!==s.targetSize?s.targetSize:100,r.maxLines_=void 0!==s.maxLines?s.maxLines:100,r.meridians_=[],r.parallels_=[],r.strokeStyle_=void 0!==s.strokeStyle?s.strokeStyle:v,r.fromLonLatTransform_=void 0,r.toLonLatTransform_=void 0,r.projectionCenterLonLat_=null,r.bottomLeft_=null,r.bottomRight_=null,r.topLeft_=null,r.topRight_=null,r.meridiansLabels_=null,r.parallelsLabels_=null,s.showLabels&&(r.lonLabelFormatter_=null==s.lonLabelFormatter?p.degreesToStringHDMS.bind(r,"EW"):s.lonLabelFormatter,r.latLabelFormatter_=null==s.latLabelFormatter?p.degreesToStringHDMS.bind(r,"NS"):s.latLabelFormatter,r.lonLabelPosition_=null==s.lonLabelPosition?0:s.lonLabelPosition,r.latLabelPosition_=null==s.latLabelPosition?1:s.latLabelPosition,r.lonLabelStyleBase_=new o.default({text:void 0!==s.lonLabelStyle?s.lonLabelStyle.clone():new h.default({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new i.default({color:"rgba(0,0,0,1)"}),stroke:new l.default({color:"rgba(255,255,255,1)",width:3})})}),r.lonLabelStyle_=function(t){var e=t.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(e),this.lonLabelStyleBase_}.bind(r),r.latLabelStyleBase_=new o.default({text:void 0!==s.latLabelStyle?s.latLabelStyle.clone():new h.default({font:"12px Calibri,sans-serif",textAlign:"right",fill:new i.default({color:"rgba(0,0,0,1)"}),stroke:new l.default({color:"rgba(255,255,255,1)",width:3})})}),r.latLabelStyle_=function(t){var e=t.get("graticule_label");return this.latLabelStyleBase_.getText().setText(e),this.latLabelStyleBase_}.bind(r),r.meridiansLabels_=[],r.parallelsLabels_=[],r.addEventListener(e.default.POSTRENDER,r.drawLabels_.bind(r))),r.intervals_=void 0!==s.intervals?s.intervals:y,r.setSource(new m.default({loader:r.loaderFunction.bind(r),strategy:r.strategyFunction.bind(r),features:new t.default,overlaps:!1,useSpatialIndex:!1,wrapX:s.wrapX})),r.featurePool_=[],r.lineStyle_=new o.default({stroke:r.strokeStyle_}),r.loadedExtent_=null,r.renderedExtent_=null,r.setRenderOrder(null),r}return x(b,_),b.prototype.strategyFunction=function(t,e){var a=t.slice();return this.projection_&&this.getSource().getWrapX()&&(0,L.wrapX)(a,this.projection_),this.loadedExtent_&&((0,L.approximatelyEquals)(this.loadedExtent_,a,e)?a=this.loadedExtent_.slice():this.getSource().removeLoadedExtent(this.loadedExtent_)),[a]},b.prototype.loaderFunction=function(t,e,i){this.loadedExtent_=t;var r=this.getSource(),s=this.getExtent()||[-1/0,-1/0,1/0,1/0],n=(0,L.getIntersection)(s,t);if(!(this.renderedExtent_&&(0,L.equals)(this.renderedExtent_,n)||(this.renderedExtent_=n,(0,L.isEmpty)(n)))){var l=(0,L.getCenter)(n),o=e*e/4;(!this.projection_||!(0,f.equivalent)(this.projection_,i))&&this.updateProjectionInfo_(i),this.createGraticule_(n,l,e,o);var h,_=this.meridians_.length+this.parallels_.length;for(this.meridiansLabels_&&(_+=this.meridians_.length),this.parallelsLabels_&&(_+=this.parallels_.length);_>this.featurePool_.length;)h=new a.default,this.featurePool_.push(h);var m=r.getFeaturesCollection();m.clear();var d,u,p=0;for(d=0,u=this.meridians_.length;d<u;++d)(h=this.featurePool_[p++]).setGeometry(this.meridians_[d]),h.setStyle(this.lineStyle_),m.push(h);for(d=0,u=this.parallels_.length;d<u;++d)(h=this.featurePool_[p++]).setGeometry(this.parallels_[d]),h.setStyle(this.lineStyle_),m.push(h)}},b.prototype.addMeridian_=function(t,e,a,i,r,s){var l=this.getMeridian_(t,e,a,i,s);if((0,L.intersects)(l.getExtent(),r)){if(this.meridiansLabels_){var o=this.lonLabelFormatter_(t);s in this.meridiansLabels_?this.meridiansLabels_[s].text=o:this.meridiansLabels_[s]={geom:new n.default([]),text:o}}this.meridians_[s++]=l}return s},b.prototype.addParallel_=function(t,e,a,i,r,s){var l=this.getParallel_(t,e,a,i,s);if((0,L.intersects)(l.getExtent(),r)){if(this.parallelsLabels_){var o=this.latLabelFormatter_(t);s in this.parallelsLabels_?this.parallelsLabels_[s].text=o:this.parallelsLabels_[s]={geom:new n.default([]),text:o}}this.parallels_[s++]=l}return s},b.prototype.drawLabels_=function(t){var e=t.frameState.viewState.rotation,a=t.frameState.extent,i=(0,L.getCenter)(a),r=a;if(e){var s=(0,L.getWidth)(a),n=(0,L.getHeight)(a),l=Math.abs(Math.cos(e)),o=Math.abs(Math.sin(e)),h=(o*n-l*s)/(o*o-l*l),_=(o*s-l*n)/(o*o-l*l);r=[i[0]-h/2,i[1]-_/2,i[0]+h/2,i[1]+_/2]}var m=0,d=0,u=this.latLabelPosition_<.5,p=this.projection_.getExtent(),f=(0,L.getWidth)(p);this.getSource().getWrapX()&&this.projection_.canWrapX()&&!(0,L.containsExtent)(p,a)&&(m=Math.floor((a[0]-p[0])/f),d=Math.ceil((a[2]-p[2])/f),u=u!==Math.abs(e)>Math.PI/2);for(var g=(0,c.getVectorContext)(t),b=m;b<=d;++b){var x=this.meridians_.length+this.parallels_.length,v=void 0,y=void 0,S=void 0,j=void 0;if(this.meridiansLabels_)for(y=0,S=this.meridiansLabels_.length;y<S;++y){var M=this.meridians_[y];if(e||0!==b)(P=M.clone()).translate(b*f,0),P.rotate(-e,i),(j=this.getMeridianPoint_(P,r,y)).rotate(e,i);else j=this.getMeridianPoint_(M,a,y);(v=this.featurePool_[x++]).setGeometry(j),v.set("graticule_label",this.meridiansLabels_[y].text),g.drawFeature(v,this.lonLabelStyle_(v))}if(this.parallelsLabels_&&(b===m&&u||b===d&&!u))for(y=0,S=this.parallels_.length;y<S;++y){var P;M=this.parallels_[y];if(e||0!==b)(P=M.clone()).translate(b*f,0),P.rotate(-e,i),(j=this.getParallelPoint_(P,r,y)).rotate(e,i);else j=this.getParallelPoint_(M,a,y);(v=this.featurePool_[x++]).setGeometry(j),v.set("graticule_label",this.parallelsLabels_[y].text),g.drawFeature(v,this.latLabelStyle_(v))}}},b.prototype.createGraticule_=function(t,e,a,i){var r=this.getInterval_(a);if(-1==r)return this.meridians_.length=0,this.parallels_.length=0,this.meridiansLabels_&&(this.meridiansLabels_.length=0),void(this.parallelsLabels_&&(this.parallelsLabels_.length=0));var s=!1,n=this.projection_.getExtent(),l=(0,L.getWidth)(n);this.getSource().getWrapX()&&this.projection_.canWrapX()&&!(0,L.containsExtent)(n,t)&&((0,L.getWidth)(t)>=l?(t[0]=n[0],t[2]=n[2]):s=!0);var o=[(0,u.clamp)(e[0],this.minX_,this.maxX_),(0,u.clamp)(e[1],this.minY_,this.maxY_)],h=this.toLonLatTransform_(o);isNaN(h[1])&&(h[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);var _,m,d,p,f=(0,u.clamp)(h[0],this.minLon_,this.maxLon_),c=(0,u.clamp)(h[1],this.minLat_,this.maxLat_),g=this.maxLines_,b=t;s||(b=[(0,u.clamp)(t[0],this.minX_,this.maxX_),(0,u.clamp)(t[1],this.minY_,this.maxY_),(0,u.clamp)(t[2],this.minX_,this.maxX_),(0,u.clamp)(t[3],this.minY_,this.maxY_)]);var x=(0,L.applyTransform)(b,this.toLonLatTransform_,void 0,8),v=x[3],y=x[2],S=x[1],j=x[0];if(s||((0,L.containsCoordinate)(b,this.bottomLeft_)&&(j=this.minLon_,S=this.minLat_),(0,L.containsCoordinate)(b,this.bottomRight_)&&(y=this.maxLon_,S=this.minLat_),(0,L.containsCoordinate)(b,this.topLeft_)&&(j=this.minLon_,v=this.maxLat_),(0,L.containsCoordinate)(b,this.topRight_)&&(y=this.maxLon_,v=this.maxLat_),v=(0,u.clamp)(v,c,this.maxLat_),y=(0,u.clamp)(y,f,this.maxLon_),S=(0,u.clamp)(S,this.minLat_,c),j=(0,u.clamp)(j,this.minLon_,f)),f=Math.floor(f/r)*r,p=(0,u.clamp)(f,this.minLon_,this.maxLon_),m=this.addMeridian_(p,S,v,i,t,0),_=0,s)for(;(p-=r)>=j&&_++<g;)m=this.addMeridian_(p,S,v,i,t,m);else for(;p!=this.minLon_&&_++<g;)p=Math.max(p-r,this.minLon_),m=this.addMeridian_(p,S,v,i,t,m);if(p=(0,u.clamp)(f,this.minLon_,this.maxLon_),_=0,s)for(;(p+=r)<=y&&_++<g;)m=this.addMeridian_(p,S,v,i,t,m);else for(;p!=this.maxLon_&&_++<g;)p=Math.min(p+r,this.maxLon_),m=this.addMeridian_(p,S,v,i,t,m);for(this.meridians_.length=m,this.meridiansLabels_&&(this.meridiansLabels_.length=m),c=Math.floor(c/r)*r,d=(0,u.clamp)(c,this.minLat_,this.maxLat_),m=this.addParallel_(d,j,y,i,t,0),_=0;d!=this.minLat_&&_++<g;)d=Math.max(d-r,this.minLat_),m=this.addParallel_(d,j,y,i,t,m);for(d=(0,u.clamp)(c,this.minLat_,this.maxLat_),_=0;d!=this.maxLat_&&_++<g;)d=Math.min(d+r,this.maxLat_),m=this.addParallel_(d,j,y,i,t,m);this.parallels_.length=m,this.parallelsLabels_&&(this.parallelsLabels_.length=m)},b.prototype.getInterval_=function(t){for(var e=this.projectionCenterLonLat_[0],a=this.projectionCenterLonLat_[1],i=-1,r=Math.pow(this.targetSize_*t,2),s=[],n=[],l=0,o=this.intervals_.length;l<o;++l){var h=(0,u.clamp)(this.intervals_[l]/2,0,90),_=(0,u.clamp)(a,-90+h,90-h);if(s[0]=e-h,s[1]=_-h,n[0]=e+h,n[1]=_+h,this.fromLonLatTransform_(s,s),this.fromLonLatTransform_(n,n),Math.pow(n[0]-s[0],2)+Math.pow(n[1]-s[1],2)<=r)break;i=this.intervals_[l]}return i},b.prototype.getMeridian_=function(t,e,a,i,n){var l=(0,g.meridian)(t,e,a,this.projection_,i),o=this.meridians_[n];return o?(o.setFlatCoordinates(r.default.XY,l),o.changed()):(o=new s.default(l,r.default.XY),this.meridians_[n]=o),o},b.prototype.getMeridianPoint_=function(t,e,a){var i=t.getFlatCoordinates(),r=1,s=i.length-1;i[r]>i[s]&&(r=s,s=1);var n=Math.max(e[1],i[r]),l=Math.min(e[3],i[s]),o=(0,u.clamp)(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,n,l),h=[i[r-1]+(i[s-1]-i[r-1])*(o-i[r])/(i[s]-i[r]),o],_=this.meridiansLabels_[a].geom;return _.setCoordinates(h),_},b.prototype.getMeridians=function(){return this.meridians_},b.prototype.getParallel_=function(t,e,a,i,n){var l=(0,g.parallel)(t,e,a,this.projection_,i),o=this.parallels_[n];return o?(o.setFlatCoordinates(r.default.XY,l),o.changed()):o=new s.default(l,r.default.XY),o},b.prototype.getParallelPoint_=function(t,e,a){var i=t.getFlatCoordinates(),r=0,s=i.length-2;i[r]>i[s]&&(r=s,s=0);var n=Math.max(e[0],i[r]),l=Math.min(e[2],i[s]),o=(0,u.clamp)(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,n,l),h=[o,i[r+1]+(i[s+1]-i[r+1])*(o-i[r])/(i[s]-i[r])],_=this.parallelsLabels_[a].geom;return _.setCoordinates(h),_},b.prototype.getParallels=function(){return this.parallels_},b.prototype.updateProjectionInfo_=function(t){var e=(0,f.get)("EPSG:4326"),a=t.getWorldExtent();this.maxLat_=a[3],this.maxLon_=a[2],this.minLat_=a[1],this.minLon_=a[0];var i=(0,f.getTransform)(t,e);if(this.minLon_<this.maxLon_)this.toLonLatTransform_=i;else{var r=this.minLon_+this.maxLon_/2;this.maxLon_+=360,this.toLonLatTransform_=function(t,e,a){for(var s=a||2,n=i(t,e,s),l=0,o=n.length;l<o;l+=s)n[l]<r&&(n[l]+=360);return n}}this.fromLonLatTransform_=(0,f.getTransform)(e,t);var s=(0,L.applyTransform)([this.minLon_,this.minLat_,this.maxLon_,this.maxLat_],this.fromLonLatTransform_,void 0,8);this.minX_=s[0],this.maxX_=s[2],this.minY_=s[1],this.maxY_=s[3],this.bottomLeft_=this.fromLonLatTransform_([this.minLon_,this.minLat_]),this.bottomRight_=this.fromLonLatTransform_([this.maxLon_,this.minLat_]),this.topLeft_=this.fromLonLatTransform_([this.minLon_,this.maxLat_]),this.topRight_=this.fromLonLatTransform_([this.maxLon_,this.maxLat_]),this.projectionCenterLonLat_=this.toLonLatTransform_((0,L.getCenter)(t.getExtent())),isNaN(this.projectionCenterLonLat_[1])&&(this.projectionCenterLonLat_[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=t},b}(_.default),j=S;exports.default=j; },{"../Collection.js":"FnDa","../render/EventType.js":"z39m","../Feature.js":"mYW9","../style/Fill.js":"AFcg","../geom/GeometryLayout.js":"Utvi","../geom/LineString.js":"DfxW","../geom/Point.js":"gLcY","../style/Stroke.js":"TXDt","../style/Style.js":"he4w","../style/Text.js":"RPsG","./Vector.js":"dflx","../source/Vector.js":"ZS12","../extent.js":"QDir","../obj.js":"mH6q","../math.js":"B96G","../coordinate.js":"nGsj","../proj.js":"Diht","../render.js":"RvU2","../geom/flat/geodesic.js":"w0c6"}],"SCyv":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getContext=_,exports.getSupportedExtensions=a,exports.FLOAT=exports.UNSIGNED_INT=exports.UNSIGNED_SHORT=exports.UNSIGNED_BYTE=exports.DYNAMIC_DRAW=exports.STATIC_DRAW=exports.STREAM_DRAW=exports.ELEMENT_ARRAY_BUFFER=exports.ARRAY_BUFFER=void 0;var e=34962;exports.ARRAY_BUFFER=e;var t=34963;exports.ELEMENT_ARRAY_BUFFER=t;var r=35040;exports.STREAM_DRAW=r;var o=35044;exports.STATIC_DRAW=o;var s=35048;exports.DYNAMIC_DRAW=s;var p=5121;exports.UNSIGNED_BYTE=p;var x=5123;exports.UNSIGNED_SHORT=x;var E=5125;exports.UNSIGNED_INT=E;var A=5126;exports.FLOAT=A;var R,n=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function _(e,t){for(var r=n.length,o=0;o<r;++o)try{var s=e.getContext(n[o],t);if(s)return s}catch(p){}return null}function a(){if(!R){var e=_(document.createElement("canvas"));e&&(R=e.getSupportedExtensions())}return R} },{}],"zsRd":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getArrayClassForType=a,exports.default=exports.BufferUsage=void 0;var r=require("../webgl.js"),t=require("../asserts.js"),e={STATIC_DRAW:r.STATIC_DRAW,STREAM_DRAW:r.STREAM_DRAW,DYNAMIC_DRAW:r.DYNAMIC_DRAW};exports.BufferUsage=e;var o=function(){function o(o,a){this.array=null,this.type=o,(0,t.assert)(o===r.ARRAY_BUFFER||o===r.ELEMENT_ARRAY_BUFFER,62),this.usage=void 0!==a?a:e.STATIC_DRAW}return o.prototype.ofSize=function(r){this.array=new(a(this.type))(r)},o.prototype.fromArray=function(r){this.array=a(this.type).from(r)},o.prototype.fromArrayBuffer=function(r){this.array=new(a(this.type))(r)},o.prototype.getType=function(){return this.type},o.prototype.getArray=function(){return this.array},o.prototype.getUsage=function(){return this.usage},o.prototype.getSize=function(){return this.array?this.array.length:0},o}();function a(t){switch(t){case r.ARRAY_BUFFER:return Float32Array;case r.ELEMENT_ARRAY_BUFFER:return Uint32Array;default:return Float32Array}}var s=o;exports.default=s; },{"../webgl.js":"SCyv","../asserts.js":"fLG6"}],"HqWy":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};exports.default=e; },{}],"glXL":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e="\n precision mediump float;\n \n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n \n uniform vec2 u_screenSize;\n \n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n",r="\n precision mediump float;\n \n uniform sampler2D u_image;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord);\n }\n",t=function(){function t(t){this.gl_=t.webGlContext;var i=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=i.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=i.createFramebuffer();var a=i.createShader(i.VERTEX_SHADER);i.shaderSource(a,t.vertexShader||e),i.compileShader(a);var n=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(n,t.fragmentShader||r),i.compileShader(n),this.renderTargetProgram_=i.createProgram(),i.attachShader(this.renderTargetProgram_,a),i.attachShader(this.renderTargetProgram_,n),i.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),i.STATIC_DRAW),this.renderTargetAttribLocation_=i.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=i.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetTextureLocation_=i.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(e){this.uniforms_.push({value:t.uniforms[e],location:i.getUniformLocation(this.renderTargetProgram_,e)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(e){var r=this.getGL(),t=[r.drawingBufferWidth*this.scaleRatio_,r.drawingBufferHeight*this.scaleRatio_];if(r.bindFramebuffer(r.FRAMEBUFFER,this.getFrameBuffer()),r.viewport(0,0,t[0],t[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==t[0]||this.renderTargetTextureSize_[1]!==t[1]){this.renderTargetTextureSize_=t;var i=r.RGBA,a=r.RGBA,n=r.UNSIGNED_BYTE;r.bindTexture(r.TEXTURE_2D,this.renderTargetTexture_),r.texImage2D(r.TEXTURE_2D,0,i,t[0],t[1],0,a,n,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,this.renderTargetTexture_,0)}},t.prototype.apply=function(e,r){var t=this.getGL(),i=e.size;t.bindFramebuffer(t.FRAMEBUFFER,r?r.getFrameBuffer():null),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,this.renderTargetTexture_),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight),t.bindBuffer(t.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),t.useProgram(this.renderTargetProgram_),t.enableVertexAttribArray(this.renderTargetAttribLocation_),t.vertexAttribPointer(this.renderTargetAttribLocation_,2,t.FLOAT,!1,0,0),t.uniform2f(this.renderTargetUniformLocation_,i[0],i[1]),t.uniform1i(this.renderTargetTextureLocation_,0),this.applyUniforms(e),t.drawArrays(t.TRIANGLES,0,6)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(e){var r,t=this.getGL(),i=1;this.uniforms_.forEach(function(a){if((r="function"==typeof a.value?a.value(e):a.value)instanceof HTMLCanvasElement||r instanceof ImageData)a.texture||(a.texture=t.createTexture()),t.activeTexture(t["TEXTURE"+i]),t.bindTexture(t.TEXTURE_2D,a.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r instanceof ImageData?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,r.width,r.height,0,t.UNSIGNED_BYTE,new Uint8Array(r.data)):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r),t.uniform1i(a.location,i++);else if(Array.isArray(r))switch(r.length){case 2:return void t.uniform2f(a.location,r[0],r[1]);case 3:return void t.uniform3f(a.location,r[0],r[1],r[2]);case 4:return void t.uniform4f(a.location,r[0],r[1],r[2],r[3]);default:return}else"number"==typeof r&&t.uniform1f(a.location,r)})},t}(),i=t;exports.default=i; },{}],"UkOi":[function(require,module,exports) { "use strict";function e(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function r(e,r){return e[0]=r[0],e[1]=r[1],e[4]=r[2],e[5]=r[3],e[12]=r[4],e[13]=r[5],e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.create=e,exports.fromTransform=r; },{}],"w1WE":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.computeAttributesStride=m,exports.default=exports.AttributeType=exports.DefaultUniform=exports.ShaderType=void 0;var e=_(require("../webgl/ContextEventType.js")),t=_(require("../Disposable.js")),r=_(require("./PostProcessingPass.js")),o=require("../webgl.js"),a=require("../asserts.js"),i=require("../obj.js"),n=require("../transform.js"),s=require("../vec/mat4.js"),u=require("../util.js"),f=require("../array.js");function _(e){return e&&e.__esModule?e:{default:e}}var c=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),l={FRAGMENT_SHADER:35632,VERTEX_SHADER:35633};exports.ShaderType=l;var E={PROJECTION_MATRIX:"u_projectionMatrix",OFFSET_SCALE_MATRIX:"u_offsetScaleMatrix",OFFSET_ROTATION_MATRIX:"u_offsetRotateMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution"};exports.DefaultUniform=E;var h={UNSIGNED_BYTE:o.UNSIGNED_BYTE,UNSIGNED_SHORT:o.UNSIGNED_SHORT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT};exports.AttributeType=h;var p=function(t){function _(i){var u=t.call(this)||this,_=i||{};u.boundHandleWebGLContextLost_=u.handleWebGLContextLost.bind(u),u.boundHandleWebGLContextRestored_=u.handleWebGLContextRestored.bind(u),u.canvas_=document.createElement("canvas"),u.canvas_.style.position="absolute",u.canvas_.style.left="0",u.gl_=(0,o.getContext)(u.canvas_);var c=u.getGL();if(u.bufferCache_={},u.currentProgram_=null,(0,a.assert)((0,f.includes)((0,o.getSupportedExtensions)(),"OES_element_index_uint"),63),c.getExtension("OES_element_index_uint"),u.canvas_.addEventListener(e.default.LOST,u.boundHandleWebGLContextLost_),u.canvas_.addEventListener(e.default.RESTORED,u.boundHandleWebGLContextRestored_),u.offsetRotateMatrix_=(0,n.create)(),u.offsetScaleMatrix_=(0,n.create)(),u.tmpMat4_=(0,s.create)(),u.uniformLocations_={},u.attribLocations_={},u.uniforms_=[],_.uniforms)for(var l in _.uniforms)u.uniforms_.push({name:l,value:_.uniforms[l]});return u.postProcessPasses_=_.postProcesses?_.postProcesses.map(function(e){return new r.default({webGlContext:c,scaleRatio:e.scaleRatio,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms})}):[new r.default({webGlContext:c})],u.shaderCompileErrors_=null,u.startTime_=Date.now(),u}return c(_,t),_.prototype.bindBuffer=function(e){var t=this.getGL(),r=(0,u.getUid)(e),o=this.bufferCache_[r];o||(o={buffer:e,webGlBuffer:t.createBuffer()},this.bufferCache_[r]=o);t.bindBuffer(e.getType(),o.webGlBuffer)},_.prototype.flushBufferData=function(e){var t=this.getGL();this.bindBuffer(e),t.bufferData(e.getType(),e.getArray(),e.getUsage())},_.prototype.deleteBuffer=function(e){var t=this.getGL(),r=(0,u.getUid)(e),o=this.bufferCache_[r];t.isContextLost()||t.deleteBuffer(o.buffer),delete this.bufferCache_[r]},_.prototype.disposeInternal=function(){this.canvas_.removeEventListener(e.default.LOST,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(e.default.RESTORED,this.boundHandleWebGLContextRestored_)},_.prototype.prepareDraw=function(e){var t=this.getGL(),r=this.getCanvas(),o=e.size,a=e.pixelRatio;r.width=o[0]*a,r.height=o[1]*a,r.style.width=o[0]+"px",r.style.height=o[1]+"px",t.useProgram(this.currentProgram_);for(var i=this.postProcessPasses_.length-1;i>=0;i--)this.postProcessPasses_[i].init(e);t.bindTexture(t.TEXTURE_2D,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.useProgram(this.currentProgram_),this.applyFrameState(e),this.applyUniforms(e)},_.prototype.prepareDrawToRenderTarget=function(e,t,r){var o=this.getGL(),a=t.getSize();o.bindFramebuffer(o.FRAMEBUFFER,t.getFramebuffer()),o.viewport(0,0,a[0],a[1]),o.bindTexture(o.TEXTURE_2D,t.getTexture()),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.enable(o.BLEND),o.blendFunc(o.ONE,r?o.ZERO:o.ONE_MINUS_SRC_ALPHA),o.useProgram(this.currentProgram_),this.applyFrameState(e),this.applyUniforms(e)},_.prototype.drawElements=function(e,t){var r=this.getGL(),o=r.UNSIGNED_INT,a=t-e,i=4*e;r.drawElements(r.TRIANGLES,a,o,i)},_.prototype.finalizeDraw=function(e){for(var t=0;t<this.postProcessPasses_.length;t++)this.postProcessPasses_[t].apply(e,this.postProcessPasses_[t+1]||null)},_.prototype.getCanvas=function(){return this.canvas_},_.prototype.getGL=function(){return this.gl_},_.prototype.applyFrameState=function(e){var t=e.size,r=e.viewState.rotation,o=(0,n.reset)(this.offsetScaleMatrix_);(0,n.scale)(o,2/t[0],2/t[1]);var a=(0,n.reset)(this.offsetRotateMatrix_);0!==r&&(0,n.rotate)(a,-r),this.setUniformMatrixValue(E.OFFSET_SCALE_MATRIX,(0,s.fromTransform)(this.tmpMat4_,o)),this.setUniformMatrixValue(E.OFFSET_ROTATION_MATRIX,(0,s.fromTransform)(this.tmpMat4_,a)),this.setUniformFloatValue(E.TIME,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(E.ZOOM,e.viewState.zoom),this.setUniformFloatValue(E.RESOLUTION,e.viewState.resolution)},_.prototype.applyUniforms=function(e){var t,r=this.getGL(),o=0;this.uniforms_.forEach(function(a){if((t="function"==typeof a.value?a.value(e):a.value)instanceof HTMLCanvasElement||t instanceof HTMLImageElement||t instanceof ImageData)a.texture||(a.prevValue=void 0,a.texture=r.createTexture()),r.activeTexture(r["TEXTURE"+o]),r.bindTexture(r.TEXTURE_2D,a.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(!(t instanceof HTMLImageElement)||t.complete)&&a.prevValue!==t&&(a.prevValue=t,r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t)),r.uniform1i(this.getUniformLocation(a.name),o++);else if(Array.isArray(t)&&6===t.length)this.setUniformMatrixValue(a.name,(0,s.fromTransform)(this.tmpMat4_,t));else if(Array.isArray(t)&&t.length<=4)switch(t.length){case 2:return void r.uniform2f(this.getUniformLocation(a.name),t[0],t[1]);case 3:return void r.uniform3f(this.getUniformLocation(a.name),t[0],t[1],t[2]);case 4:return void r.uniform4f(this.getUniformLocation(a.name),t[0],t[1],t[2],t[3]);default:return}else"number"==typeof t&&r.uniform1f(this.getUniformLocation(a.name),t)}.bind(this))},_.prototype.useProgram=function(e){return e!=this.currentProgram_&&(this.getGL().useProgram(e),this.currentProgram_=e,this.uniformLocations_={},this.attribLocations_={},!0)},_.prototype.compileShader=function(e,t){var r=this.getGL(),o=r.createShader(t);return r.shaderSource(o,e),r.compileShader(o),o},_.prototype.getProgram=function(e,t){var r=this.getGL(),o=this.compileShader(e,r.FRAGMENT_SHADER),a=this.compileShader(t,r.VERTEX_SHADER);this.shaderCompileErrors_=null,r.getShaderInfoLog(o)&&(this.shaderCompileErrors_="Fragment shader compilation failed:\n"+r.getShaderInfoLog(o)),r.getShaderInfoLog(a)&&(this.shaderCompileErrors_=(this.shaderCompileErrors_||"")+"Vertex shader compilation failed:\n"+r.getShaderInfoLog(a));var i=r.createProgram();return r.attachShader(i,o),r.attachShader(i,a),r.linkProgram(i),i},_.prototype.getShaderCompileErrors=function(){return this.shaderCompileErrors_},_.prototype.getUniformLocation=function(e){return void 0===this.uniformLocations_[e]&&(this.uniformLocations_[e]=this.getGL().getUniformLocation(this.currentProgram_,e)),this.uniformLocations_[e]},_.prototype.getAttributeLocation=function(e){return void 0===this.attribLocations_[e]&&(this.attribLocations_[e]=this.getGL().getAttribLocation(this.currentProgram_,e)),this.attribLocations_[e]},_.prototype.makeProjectionTransform=function(e,t){var r=e.size,o=e.viewState.rotation,a=e.viewState.resolution,i=e.viewState.center;return(0,n.reset)(t),(0,n.compose)(t,0,0,2/(a*r[0]),2/(a*r[1]),-o,-i[0],-i[1]),t},_.prototype.setUniformFloatValue=function(e,t){this.getGL().uniform1f(this.getUniformLocation(e),t)},_.prototype.setUniformMatrixValue=function(e,t){this.getGL().uniformMatrix4fv(this.getUniformLocation(e),!1,t)},_.prototype.enableAttributeArray_=function(e,t,r,o,a){var i=this.getAttributeLocation(e);i<0||(this.getGL().enableVertexAttribArray(i),this.getGL().vertexAttribPointer(i,t,r,!1,o,a))},_.prototype.enableAttributes=function(e){for(var t=m(e),r=0,a=0;a<e.length;a++){var i=e[a];this.enableAttributeArray_(i.name,i.size,i.type||o.FLOAT,t,r),r+=i.size*T(i.type)}},_.prototype.handleWebGLContextLost=function(){(0,i.clear)(this.bufferCache_),this.currentProgram_=null},_.prototype.handleWebGLContextRestored=function(){},_.prototype.createTexture=function(e,t,r){var o=this.getGL(),a=r||o.createTexture(),i=o.RGBA,n=o.RGBA,s=o.UNSIGNED_BYTE;return o.bindTexture(o.TEXTURE_2D,a),t?o.texImage2D(o.TEXTURE_2D,0,i,n,s,t):o.texImage2D(o.TEXTURE_2D,0,i,e[0],e[1],0,n,s,null),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),a},_}(t.default);function m(e){for(var t=0,r=0;r<e.length;r++){var o=e[r];t+=o.size*T(o.type)}return t}function T(e){switch(e){case h.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case h.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case h.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case h.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var d=p;exports.default=d; },{"../webgl/ContextEventType.js":"HqWy","../Disposable.js":"DDda","./PostProcessingPass.js":"glXL","../webgl.js":"SCyv","../asserts.js":"fLG6","../obj.js":"mH6q","../transform.js":"P4eA","../vec/mat4.js":"UkOi","../util.js":"KniQ","../array.js":"luEr"}],"nUxs":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.writePointFeatureToBuffers=p,exports.getBlankImageData=c,exports.colorEncodeId=l,exports.colorDecodeId=f,exports.default=exports.WebGLWorkerMessageType=void 0;var e=r(require("../Layer.js")),t=r(require("../../webgl/Helper.js"));function r(e){return e&&e.__esModule?e:{default:e}}var o=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),n={GENERATE_BUFFERS:"GENERATE_BUFFERS"};exports.WebGLWorkerMessageType=n;var a=function(e){function r(r,o){var n=e.call(this,r)||this,a=o||{};return n.helper=new t.default({postProcesses:a.postProcesses,uniforms:a.uniforms}),n}return o(r,e),r.prototype.disposeInternal=function(){this.helper.dispose(),e.prototype.disposeInternal.call(this)},r.prototype.getShaderCompileErrors=function(){return this.helper.getShaderCompileErrors()},r}(e.default),s=[],i={vertexPosition:0,indexPosition:0};function u(e,t,r,o,n){e[t+0]=r,e[t+1]=o,e[t+2]=n}function p(e,t,r,o,n,a){var p=3+n,c=e[t+0],l=e[t+1],f=s;f.length=n;for(var d=0;d<f.length;d++)f[d]=e[t+2+d];var h=a?a.vertexPosition:0,v=a?a.indexPosition:0,x=h/p;return u(r,h,c,l,0),f.length&&r.set(f,h+3),u(r,h+=p,c,l,1),f.length&&r.set(f,h+3),u(r,h+=p,c,l,2),f.length&&r.set(f,h+3),u(r,h+=p,c,l,3),f.length&&r.set(f,h+3),h+=p,o[v++]=x,o[v++]=x+1,o[v++]=x+3,o[v++]=x+1,o[v++]=x+2,o[v++]=x+3,i.vertexPosition=h,i.indexPosition=v,i}function c(){var e=document.createElement("canvas").getContext("2d").createImageData(1,1);return e.data[0]=255,e.data[1]=255,e.data[2]=255,e.data[3]=255,e}function l(e,t){var r=t||[];return r[0]=Math.floor(e/256/256/256)/255,r[1]=Math.floor(e/256/256)%256/255,r[2]=Math.floor(e/256)%256/255,r[3]=e%256/255,r}function f(e){var t=0;return t+=Math.round(256*e[0]*256*256*255),t+=Math.round(256*e[1]*256*255),t+=Math.round(256*e[2]*255),t+=Math.round(255*e[3])}var d=a;exports.default=d; },{"../Layer.js":"fpOz","../../webgl/Helper.js":"w1WE"}],"KkPv":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=require("../array.js"),e=new Uint8Array(4),r=function(){function r(t,e){this.helper_=t;var r=t.getGL();this.texture_=r.createTexture(),this.framebuffer_=r.createFramebuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}return r.prototype.setSize=function(e){(0,t.equals)(e,this.size_)||(this.size_[0]=e[0],this.size_[1]=e[1],this.updateSize_())},r.prototype.getSize=function(){return this.size_},r.prototype.clearCachedData=function(){this.dataCacheDirty_=!0},r.prototype.readAll=function(){if(this.dataCacheDirty_){var t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_},r.prototype.readPixel=function(t,r){if(t<0||r<0||t>this.size_[0]||r>=this.size_[1])return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e;this.readAll();var i=Math.floor(t)+(this.size_[1]-Math.floor(r)-1)*this.size_[0];return e[0]=this.data_[4*i],e[1]=this.data_[4*i+1],e[2]=this.data_[4*i+2],e[3]=this.data_[4*i+3],e},r.prototype.getTexture=function(){return this.texture_},r.prototype.getFramebuffer=function(){return this.framebuffer_},r.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)},r}(),i=r;exports.default=i; },{"../array.js":"luEr"}],"z0A1":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.create=n;var e='var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,u){var a=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=u?u.vertexPosition:0,h=u?u.indexPosition:0,d=b/a;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=a,l,v,1),c.length&&i.set(c,b+3),o(i,b+=a,l,v,2),c.length&&i.set(c,b+3),o(i,b+=a,l,v,3),c.length&&i.set(c,b+3),b+=a,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o=r.customAttributesCount,s=2+o,u=new Float32Array(r.renderInstructions),a=u.length/s,l=4*a*(o+3),v=new Uint32Array(6*a),c=new Float32Array(l),g=null,b=0;b<u.length;b+=s)g=i(u,b,c,v,o,g);var h=e({vertexBuffer:c.buffer,indexBuffer:v.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[c.buffer,v.buffer,u.buffer])}};',r=new Blob([e],{type:"application/javascript"}),t=URL.createObjectURL(r);function n(){return new Worker(t)} },{}],"m8cI":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=g(require("../../layer/BaseVector.js")),t=g(require("../../geom/GeometryType.js")),r=g(require("../../source/VectorEventType.js")),i=g(require("../../ViewHint.js")),n=g(require("../../webgl/Buffer.js")),s=y(require("./Layer.js")),o=g(require("../../webgl/RenderTarget.js")),a=require("../../webgl.js"),u=require("../../webgl/Helper.js"),h=require("../../transform.js"),f=require("../../asserts.js"),c=require("../../extent.js"),d=require("../../worker/webgl.js"),l=require("../../util.js"),_=require("../../events.js");function p(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return p=function(){return e},e}function y(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=p();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var s=i?Object.getOwnPropertyDescriptor(e,n):null;s&&(s.get||s.set)?Object.defineProperty(r,n,s):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function g(e){return e&&e.__esModule?e:{default:e}}var m=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),b=function(p){function y(e,t){var i=this,f=t.uniforms||{},y=(0,h.create)();f[u.DefaultUniform.PROJECTION_MATRIX]=y,(i=p.call(this,e,{uniforms:f,postProcesses:t.postProcesses})||this).sourceRevision_=-1,i.verticesBuffer_=new n.default(a.ARRAY_BUFFER,a.DYNAMIC_DRAW),i.hitVerticesBuffer_=new n.default(a.ARRAY_BUFFER,a.DYNAMIC_DRAW),i.indicesBuffer_=new n.default(a.ELEMENT_ARRAY_BUFFER,a.DYNAMIC_DRAW),i.program_=i.helper.getProgram(t.fragmentShader,t.vertexShader),i.hitDetectionEnabled_=!(!t.hitFragmentShader||!t.hitVertexShader),i.hitProgram_=i.hitDetectionEnabled_&&i.helper.getProgram(t.hitFragmentShader,t.hitVertexShader);var g=t.attributes?t.attributes.map(function(e){return{name:"a_"+e.name,size:1,type:u.AttributeType.FLOAT}}):[];i.attributes=[{name:"a_position",size:2,type:u.AttributeType.FLOAT},{name:"a_index",size:1,type:u.AttributeType.FLOAT}].concat(g),i.hitDetectionAttributes=[{name:"a_position",size:2,type:u.AttributeType.FLOAT},{name:"a_index",size:1,type:u.AttributeType.FLOAT},{name:"a_hitColor",size:4,type:u.AttributeType.FLOAT},{name:"a_featureUid",size:1,type:u.AttributeType.FLOAT}].concat(g),i.customAttributes=t.attributes?t.attributes:[],i.previousExtent_=(0,c.createEmpty)(),i.currentTransform_=y,i.renderTransform_=(0,h.create)(),i.invertRenderTransform_=(0,h.create)(),i.renderInstructions_=new Float32Array(0),i.hitRenderInstructions_=new Float32Array(0),i.hitRenderTarget_=i.hitDetectionEnabled_&&new o.default(i.helper),i.worker_=(0,d.create)(),i.worker_.addEventListener("message",function(e){var t=e.data;if(t.type===s.WebGLWorkerMessageType.GENERATE_BUFFERS){var r=t.projectionTransform;t.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(t.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(t.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(t.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=r,(0,h.makeInverse)(this.invertRenderTransform_,this.renderTransform_),t.hitDetection?this.hitRenderInstructions_=new Float32Array(e.data.renderInstructions):this.renderInstructions_=new Float32Array(e.data.renderInstructions),this.getLayer().changed()}}.bind(i)),i.featureCache_={},i.featureCount_=0;var m=i.getLayer().getSource();return i.sourceListenKeys_=[(0,_.listen)(m,r.default.ADDFEATURE,i.handleSourceFeatureAdded_,i),(0,_.listen)(m,r.default.CHANGEFEATURE,i.handleSourceFeatureChanged_,i),(0,_.listen)(m,r.default.REMOVEFEATURE,i.handleSourceFeatureDelete_,i),(0,_.listen)(m,r.default.CLEAR,i.handleSourceFeatureClear_,i)],m.forEachFeature(function(e){this.featureCache_[(0,l.getUid)(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++}.bind(i)),i}return m(y,p),y.prototype.handleSourceFeatureAdded_=function(e){var t=e.feature;this.featureCache_[(0,l.getUid)(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++},y.prototype.handleSourceFeatureChanged_=function(e){var t=e.feature;this.featureCache_[(0,l.getUid)(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()}},y.prototype.handleSourceFeatureDelete_=function(e){var t=e.feature;delete this.featureCache_[(0,l.getUid)(t)],this.featureCount_--},y.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},y.prototype.renderFrame=function(e){var t=this.indicesBuffer_.getSize();this.helper.drawElements(0,t),this.helper.finalizeDraw(e);var r=this.helper.getCanvas(),i=e.layerStatesArray[e.layerIndex].opacity;return i!==parseFloat(r.style.opacity)&&(r.style.opacity=String(i)),this.hitDetectionEnabled_&&(this.renderHitDetection(e),this.hitRenderTarget_.clearCachedData()),r},y.prototype.prepareFrame=function(t){var r=this.getLayer(),n=r.getSource(),s=t.viewState,o=!t.viewHints[i.default.ANIMATING]&&!t.viewHints[i.default.INTERACTING],a=!(0,c.equals)(this.previousExtent_,t.extent),u=this.sourceRevision_<n.getRevision();if(u&&(this.sourceRevision_=n.getRevision()),o&&(a||u)){var f=s.projection,d=s.resolution,l=r instanceof e.default?r.getRenderBuffer():0,_=(0,c.buffer)(t.extent,l*d);n.loadFeatures(_,d,f),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),(0,h.multiply)(this.currentTransform_,this.invertRenderTransform_),this.helper.useProgram(this.program_),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0},y.prototype.rebuildBuffers_=function(e){var r=(0,h.create)();this.helper.makeProjectionTransform(e,r);var i,n,o=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===o||(this.renderInstructions_=new Float32Array(o)),this.hitDetectionEnabled_){var a=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===a||(this.hitRenderInstructions_=new Float32Array(a))}var u,f=[],c=[],d=0,l=0;for(var _ in this.featureCache_)if((n=(i=this.featureCache_[_]).geometry)&&n.getType()===t.default.POINT){f[0]=n.getFlatCoordinates()[0],f[1]=n.getFlatCoordinates()[1],(0,h.apply)(r,f),u=(0,s.colorEncodeId)(l+6,c),this.renderInstructions_[d++]=f[0],this.renderInstructions_[d++]=f[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[l++]=f[0],this.hitRenderInstructions_[l++]=f[1],this.hitRenderInstructions_[l++]=u[0],this.hitRenderInstructions_[l++]=u[1],this.hitRenderInstructions_[l++]=u[2],this.hitRenderInstructions_[l++]=u[3],this.hitRenderInstructions_[l++]=Number(_));for(var p=void 0,y=0;y<this.customAttributes.length;y++)p=this.customAttributes[y].callback(i.feature,i.properties),this.renderInstructions_[d++]=p,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[l++]=p)}var g={type:s.WebGLWorkerMessageType.GENERATE_BUFFERS,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(g.projectionTransform=r,this.worker_.postMessage(g,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var m={type:s.WebGLWorkerMessageType.GENERATE_BUFFERS,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};m.projectionTransform=r,m.hitDetection=!0,this.worker_.postMessage(m,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},y.prototype.forEachFeatureAtCoordinate=function(e,t,r,i,n){if((0,f.assert)(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=(0,h.apply)(t.coordinateToPixelTransform,e.slice()),a=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),u=[a[0]/255,a[1]/255,a[2]/255,a[3]/255],c=(0,s.colorDecodeId)(u),d=this.hitRenderInstructions_[c],l=Math.floor(d).toString(),_=this.getLayer().getSource().getFeatureByUid(l);return _?i(_,this.getLayer()):void 0}},y.prototype.renderHitDetection=function(e){if(this.hitVerticesBuffer_.getSize()){this.hitRenderTarget_.setSize([Math.floor(e.size[0]/2),Math.floor(e.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(e,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);var t=this.indicesBuffer_.getSize();this.helper.drawElements(0,t)}},y.prototype.disposeInternal=function(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach(function(e){(0,_.unlistenByKey)(e)}),this.sourceListenKeys_=null,p.prototype.disposeInternal.call(this)},y}(s.default),A=b;exports.default=A; },{"../../layer/BaseVector.js":"pskK","../../geom/GeometryType.js":"lmV0","../../source/VectorEventType.js":"s8Fc","../../ViewHint.js":"cuLW","../../webgl/Buffer.js":"zsRd","./Layer.js":"nUxs","../../webgl/RenderTarget.js":"KkPv","../../webgl.js":"SCyv","../../webgl/Helper.js":"w1WE","../../transform.js":"P4eA","../../asserts.js":"fLG6","../../extent.js":"QDir","../../worker/webgl.js":"z0A1","../../util.js":"KniQ","../../events.js":"UqnM"}],"I4BI":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=a(require("./Vector.js")),e=a(require("../renderer/webgl/PointsLayer.js")),n=require("../obj.js"),o=require("../math.js"),i=require("../dom.js"),r=require("../Object.js");function a(t){return t&&t.__esModule?t:{default:t}}var u=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),s={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},f=["#00f","#0ff","#0f0","#ff0","#f00"],l=function(t){function i(e){var o=this,i=e||{},a=(0,n.assign)({},i);delete a.gradient,delete a.radius,delete a.blur,delete a.weight,(o=t.call(this,a)||this).gradient_=null,o.addEventListener((0,r.getChangeEventType)(s.GRADIENT),o.handleGradientChanged_),o.setGradient(i.gradient?i.gradient:f),o.setBlur(void 0!==i.blur?i.blur:15),o.setRadius(void 0!==i.radius?i.radius:8);var u=i.weight?i.weight:"weight";return o.weightFunction_="string"==typeof u?function(t){return t.get(u)}:u,o.setRenderOrder(null),o}return u(i,t),i.prototype.getBlur=function(){return this.get(s.BLUR)},i.prototype.getGradient=function(){return this.get(s.GRADIENT)},i.prototype.getRadius=function(){return this.get(s.RADIUS)},i.prototype.handleGradientChanged_=function(){this.gradient_=d(this.getGradient())},i.prototype.setBlur=function(t){this.set(s.BLUR,t)},i.prototype.setGradient=function(t){this.set(s.GRADIENT,t)},i.prototype.setRadius=function(t){this.set(s.RADIUS,t)},i.prototype.createRenderer=function(){return new e.default(this,{attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?(0,o.clamp)(e,0,1):1}.bind(this)}],vertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_weight = a_weight;\n }",fragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n }",hitVertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n attribute vec4 a_hitColor;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_hitColor = a_hitColor;\n v_weight = a_weight;\n }",hitFragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n if (alpha < 0.05) {\n discard;\n }\n\n gl_FragColor = v_hitColor;\n }",uniforms:{u_size:function(){return 2*(this.get(s.RADIUS)+this.get(s.BLUR))}.bind(this),u_blurSlope:function(){return this.get(s.RADIUS)/Math.max(1,this.get(s.BLUR))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this)}}]})},i}(t.default);function d(t){for(var e=(0,i.createCanvasContext2D)(1,256),n=e.createLinearGradient(0,0,1,256),o=1/(t.length-1),r=0,a=t.length;r<a;++r)n.addColorStop(r*o,t[r]);return e.fillStyle=n,e.fillRect(0,0,1,256),e.canvas}var _=l;exports.default=_; },{"./Vector.js":"dflx","../renderer/webgl/PointsLayer.js":"m8cI","../obj.js":"mH6q","../math.js":"B96G","../dom.js":"Xno5","../Object.js":"PhPh"}],"ZHEI":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("./Layer.js"));function r(t){return t&&t.__esModule?t:{default:t}}var e=function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),o=function(t){function r(r){var e=r||{};return t.call(this,e)||this}return e(r,t),r}(t.default),n=o;exports.default=n; },{"./Layer.js":"GCgv"}],"rzNj":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("./Layer.js")),t=u(require("../../ViewHint.js")),r=require("../../reproj/common.js"),i=require("../../obj.js"),n=require("../../transform.js"),o=require("../../extent.js"),a=require("../../render/canvas.js"),s=require("../../proj.js");function u(e){return e&&e.__esModule?e:{default:e}}var h=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),c=function(e){function u(t){var r=e.call(this,t)||this;return r.image_=null,r}return h(u,e),u.prototype.getImage=function(){return this.image_?this.image_.getImage():null},u.prototype.prepareFrame=function(e){var i=e.layerStatesArray[e.layerIndex],n=e.pixelRatio,a=e.viewState,u=a.resolution,h=this.getLayer().getSource(),c=e.viewHints,l=e.extent;if(void 0!==i.extent&&(l=(0,o.getIntersection)(l,(0,s.fromUserExtent)(i.extent,a.projection))),!c[t.default.ANIMATING]&&!c[t.default.INTERACTING]&&!(0,o.isEmpty)(l))if(h){var p=a.projection;if(!r.ENABLE_RASTER_REPROJECTION){var f=h.getProjection();f&&(p=f)}var g=h.getImage(l,u,n,p);g&&this.loadImage(g)&&(this.image_=g)}else this.image_=null;return!!this.image_},u.prototype.renderFrame=function(e,t){var r=this.image_,u=r.getExtent(),h=r.getResolution(),c=r.getPixelRatio(),l=e.layerStatesArray[e.layerIndex],p=e.pixelRatio,f=e.viewState,g=f.center,d=f.resolution,m=e.size,x=p*h/(d*c),v=Math.round(m[0]*p),y=Math.round(m[1]*p),_=f.rotation;if(_){var j=Math.round(Math.sqrt(v*v+y*y));v=j,y=j}(0,n.compose)(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/p,1/p,_,-v/2,-y/2),(0,n.makeInverse)(this.inversePixelTransform,this.pixelTransform);var I=(0,a.createTransformString)(this.pixelTransform);this.useContainer(t,I,l.opacity);var R=this.context,w=R.canvas;w.width!=v||w.height!=y?(w.width=v,w.height=y):this.containerReused||R.clearRect(0,0,v,y);var A=!1;if(l.extent){var E=(0,s.fromUserExtent)(l.extent,f.projection);(A=!(0,o.containsExtent)(E,e.extent)&&(0,o.intersects)(E,e.extent))&&this.clipUnrotated(R,e,E)}var M=r.getImage(),T=(0,n.compose)(this.tempTransform,v/2,y/2,x,x,0,c*(u[0]-g[0])/h,c*(g[1]-u[3])/h);this.renderedResolution=h*p/c;var q=T[4],O=T[5],S=M.width*T[0],b=M.height*T[3];if((0,i.assign)(R,this.getLayer().getSource().getContextOptions()),this.preRender(R,e),S>=.5&&b>=.5){var P=l.opacity,N=void 0;1!==P&&(N=this.context.globalAlpha,this.context.globalAlpha=P),this.context.drawImage(M,0,0,+M.width,+M.height,Math.round(q),Math.round(O),Math.round(S),Math.round(b)),1!==P&&(this.context.globalAlpha=N)}return this.postRender(R,e),A&&R.restore(),I!==w.style.transform&&(w.style.transform=I),this.container},u}(e.default),l=c;exports.default=l; },{"./Layer.js":"vPfl","../../ViewHint.js":"cuLW","../../reproj/common.js":"fF5X","../../obj.js":"mH6q","../../transform.js":"P4eA","../../extent.js":"QDir","../../render/canvas.js":"iAG7","../../proj.js":"Diht"}],"KHBf":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./BaseImage.js")),t=r(require("../renderer/canvas/ImageLayer.js"));function r(e){return e&&e.__esModule?e:{default:e}}var n=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=function(e){function r(t){return e.call(this,t)||this}return n(r,e),r.prototype.createRenderer=function(){return new t.default(this)},r}(e.default),u=o;exports.default=u; },{"./BaseImage.js":"ZHEI","../renderer/canvas/ImageLayer.js":"rzNj"}],"Quj6":[function(require,module,exports) { exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l}; },{}],"UzHN":[function(require,module,exports) { "use strict";module.exports=i;var t=require("ieee754");function i(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var e=4294967296,r=1/e,s=12,n="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function o(t,i,e){var r,s,n=e.buf;if(r=(112&(s=n[e.pos++]))>>4,s<128)return a(t,r,i);if(r|=(127&(s=n[e.pos++]))<<3,s<128)return a(t,r,i);if(r|=(127&(s=n[e.pos++]))<<10,s<128)return a(t,r,i);if(r|=(127&(s=n[e.pos++]))<<17,s<128)return a(t,r,i);if(r|=(127&(s=n[e.pos++]))<<24,s<128)return a(t,r,i);if(r|=(1&(s=n[e.pos++]))<<31,s<128)return a(t,r,i);throw new Error("Expected varint not more than 10 bytes")}function h(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function a(t,i,e){return e?4294967296*i+(t>>>0):4294967296*(i>>>0)+(t>>>0)}function u(t,i){var e,r;if(t>=0?(e=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(e=~(-t%4294967296))?e=e+1|0:(e=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),f(e,r,i),d(r,i)}function f(t,i,e){e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos]=127&t}function d(t,i){var e=(7&t)<<4;i.buf[i.pos++]|=e|((t>>>=3)?128:0),t&&(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),t&&(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),t&&(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),t&&(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),t&&(i.buf[i.pos++]=127&t)))))}function p(t,i,e){var r=i<=16383?1:i<=2097151?2:i<=268435455?3:Math.floor(Math.log(i)/(7*Math.LN2));e.realloc(r);for(var s=e.pos-1;s>=t;s--)e.buf[s+r]=e.buf[s]}function l(t,i){for(var e=0;e<t.length;e++)i.writeVarint(t[e])}function c(t,i){for(var e=0;e<t.length;e++)i.writeSVarint(t[e])}function w(t,i){for(var e=0;e<t.length;e++)i.writeFloat(t[e])}function F(t,i){for(var e=0;e<t.length;e++)i.writeDouble(t[e])}function g(t,i){for(var e=0;e<t.length;e++)i.writeBoolean(t[e])}function b(t,i){for(var e=0;e<t.length;e++)i.writeFixed32(t[e])}function x(t,i){for(var e=0;e<t.length;e++)i.writeSFixed32(t[e])}function v(t,i){for(var e=0;e<t.length;e++)i.writeFixed64(t[e])}function y(t,i){for(var e=0;e<t.length;e++)i.writeSFixed64(t[e])}function V(t,i){return(t[i]|t[i+1]<<8|t[i+2]<<16)+16777216*t[i+3]}function S(t,i,e){t[e]=i,t[e+1]=i>>>8,t[e+2]=i>>>16,t[e+3]=i>>>24}function B(t,i){return(t[i]|t[i+1]<<8|t[i+2]<<16)+(t[i+3]<<24)}function k(t,i,e){for(var r="",s=i;s<e;){var n,o,h,a=t[s],u=null,f=a>239?4:a>223?3:a>191?2:1;if(s+f>e)break;1===f?a<128&&(u=a):2===f?128==(192&(n=t[s+1]))&&(u=(31&a)<<6|63&n)<=127&&(u=null):3===f?(n=t[s+1],o=t[s+2],128==(192&n)&&128==(192&o)&&((u=(15&a)<<12|(63&n)<<6|63&o)<=2047||u>=55296&&u<=57343)&&(u=null)):4===f&&(n=t[s+1],o=t[s+2],h=t[s+3],128==(192&n)&&128==(192&o)&&128==(192&h)&&((u=(15&a)<<18|(63&n)<<12|(63&o)<<6|63&h)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,f=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),s+=f}return r}function M(t,i,e){return n.decode(t.subarray(i,e))}function P(t,i,e){for(var r,s,n=0;n<i.length;n++){if((r=i.charCodeAt(n))>55295&&r<57344){if(!s){r>56319||n+1===i.length?(t[e++]=239,t[e++]=191,t[e++]=189):s=r;continue}if(r<56320){t[e++]=239,t[e++]=191,t[e++]=189,s=r;continue}r=s-55296<<10|r-56320|65536,s=null}else s&&(t[e++]=239,t[e++]=191,t[e++]=189,s=null);r<128?t[e++]=r:(r<2048?t[e++]=r>>6|192:(r<65536?t[e++]=r>>12|224:(t[e++]=r>>18|240,t[e++]=r>>12&63|128),t[e++]=r>>6&63|128),t[e++]=63&r|128)}return e}i.prototype={destroy:function(){this.buf=null},readFields:function(t,i,e){for(e=e||this.length;this.pos<e;){var r=this.readVarint(),s=r>>3,n=this.pos;this.type=7&r,t(s,i,this),this.pos===n&&this.skip(r)}return i},readMessage:function(t,i){return this.readFields(t,i,this.readVarint()+this.pos)},readFixed32:function(){var t=V(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=B(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=V(this.buf,this.pos)+V(this.buf,this.pos+4)*e;return this.pos+=8,t},readSFixed64:function(){var t=V(this.buf,this.pos)+B(this.buf,this.pos+4)*e;return this.pos+=8,t},readFloat:function(){var i=t.read(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=t.read(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(t){var i,e,r=this.buf;return i=127&(e=r[this.pos++]),e<128?i:(i|=(127&(e=r[this.pos++]))<<7,e<128?i:(i|=(127&(e=r[this.pos++]))<<14,e<128?i:(i|=(127&(e=r[this.pos++]))<<21,e<128?i:o(i|=(15&(e=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,i=this.pos;return this.pos=t,t-i>=s&&n?M(this.buf,i,t):k(this.buf,i,t)},readBytes:function(){var t=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,t);return this.pos=t,i},readPackedVarint:function(t,e){if(this.type!==i.Bytes)return t.push(this.readVarint(e));var r=h(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==i.Bytes)return t.push(this.readSVarint());var e=h(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==i.Bytes)return t.push(this.readBoolean());var e=h(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==i.Bytes)return t.push(this.readFloat());var e=h(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==i.Bytes)return t.push(this.readDouble());var e=h(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed32());var e=h(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed32());var e=h(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed64());var e=h(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed64());var e=h(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===i.Varint)for(;this.buf[this.pos++]>127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,i){this.writeVarint(t<<3|i)},realloc:function(t){for(var i=this.length||16;i<this.pos+t;)i*=2;if(i!==this.length){var e=new Uint8Array(i);e.set(this.buf),this.buf=e,this.length=i}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),S(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),S(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),S(this.buf,-1&t,this.pos),S(this.buf,Math.floor(t*r),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),S(this.buf,-1&t,this.pos),S(this.buf,Math.floor(t*r),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?u(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var i=this.pos;this.pos=P(this.buf,t,this.pos);var e=this.pos-i;e>=128&&p(i,e,this),this.pos=i-1,this.writeVarint(e),this.pos+=e},writeFloat:function(i){this.realloc(4),t.write(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),t.write(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var i=t.length;this.writeVarint(i),this.realloc(i);for(var e=0;e<i;e++)this.buf[this.pos++]=t[e]},writeRawMessage:function(t,i){this.pos++;var e=this.pos;t(i,this);var r=this.pos-e;r>=128&&p(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,r){this.writeTag(t,i.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,i){i.length&&this.writeMessage(t,l,i)},writePackedSVarint:function(t,i){i.length&&this.writeMessage(t,c,i)},writePackedBoolean:function(t,i){i.length&&this.writeMessage(t,g,i)},writePackedFloat:function(t,i){i.length&&this.writeMessage(t,w,i)},writePackedDouble:function(t,i){i.length&&this.writeMessage(t,F,i)},writePackedFixed32:function(t,i){i.length&&this.writeMessage(t,b,i)},writePackedSFixed32:function(t,i){i.length&&this.writeMessage(t,x,i)},writePackedFixed64:function(t,i){i.length&&this.writeMessage(t,v,i)},writePackedSFixed64:function(t,i){i.length&&this.writeMessage(t,y,i)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,i){this.writeVarintField(t,Boolean(i))}}; },{"ieee754":"Quj6"}],"IFOM":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=f(require("../geom/GeometryType.js")),e=require("../transform.js"),r=require("../extent.js"),i=require("../array.js"),o=require("../geom/flat/interiorpoint.js"),n=require("../proj.js"),s=require("../geom/flat/interpolate.js"),a=require("../geom/flat/center.js"),p=require("../geom/flat/transform.js");function f(t){return t&&t.__esModule?t:{default:t}}var l=(0,e.create)(),d=function(){function f(t,e,r,i,o){this.extent_,this.id_=o,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r,this.properties_=i}return f.prototype.get=function(t){return this.properties_[t]},f.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===t.default.POINT?(0,r.createOrUpdateFromCoordinate)(this.flatCoordinates_):(0,r.createOrUpdateFromFlatCoordinates)(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},f.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=(0,r.getCenter)(this.getExtent());this.flatInteriorPoints_=(0,o.getInteriorPointOfArray)(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},f.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=(0,a.linearRingss)(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=(0,o.getInteriorPointsOfMultiArray)(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},f.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=(0,s.interpolatePoint)(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},f.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,r=this.ends_,o=0,n=r.length;o<n;++o){var a=r[o],p=(0,s.interpolatePoint)(t,e,a,2,.5);(0,i.extend)(this.flatMidpoints_,p),e=a}}return this.flatMidpoints_},f.prototype.getId=function(){return this.id_},f.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},f.prototype.getGeometry=function(){return this},f.prototype.getSimplifiedGeometry=function(t){return this},f.prototype.simplifyTransformed=function(t,e){return this},f.prototype.getProperties=function(){return this.properties_},f.prototype.getStride=function(){return 2},f.prototype.getStyleFunction=function(){},f.prototype.getType=function(){return this.type_},f.prototype.transform=function(t,i){var o=(t=(0,n.get)(t)).getExtent(),s=t.getWorldExtent(),a=(0,r.getHeight)(s)/(0,r.getHeight)(o);(0,e.compose)(l,s[0],s[3],a,-a,0,0,0),(0,p.transform2D)(this.flatCoordinates_,0,this.flatCoordinates_.length,2,l,this.flatCoordinates_)},f.prototype.getEnds=function(){return this.ends_},f}();d.prototype.getEndss=d.prototype.getEnds,d.prototype.getFlatCoordinates=d.prototype.getOrientedFlatCoordinates;var u=d;exports.default=u; },{"../geom/GeometryType.js":"lmV0","../transform.js":"P4eA","../extent.js":"QDir","../array.js":"luEr","../geom/flat/interiorpoint.js":"UDvN","../proj.js":"Diht","../geom/flat/interpolate.js":"rDTq","../geom/flat/center.js":"VjQP","../geom/flat/transform.js":"LGwr"}],"bjcz":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=m(require("./Feature.js")),r=v(require("./FormatType.js")),t=v(require("../geom/GeometryLayout.js")),a=v(require("../geom/GeometryType.js")),n=v(require("../geom/LineString.js")),o=v(require("../geom/MultiLineString.js")),i=v(require("../geom/MultiPoint.js")),u=v(require("../geom/MultiPolygon.js")),s=v(require("pbf")),l=v(require("../geom/Point.js")),f=v(require("../geom/Polygon.js")),d=v(require("../proj/Projection.js")),p=v(require("../render/Feature.js")),y=v(require("../proj/Units.js")),c=require("../asserts.js"),_=require("../proj.js"),h=require("../geom/flat/orient.js");function v(e){return e&&e.__esModule?e:{default:e}}function g(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return g=function(){return e},e}function m(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=g();if(r&&r.has(e))return r.get(e);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=a?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(t,n,o):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}var j=function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function a(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}}(),P=function(v){function g(e){var r=v.call(this)||this,t=e||{};return r.dataProjection=new d.default({code:"",units:y.default.TILE_PIXELS}),r.featureClass_=t.featureClass?t.featureClass:p.default,r.geometryName_=t.geometryName,r.layerName_=t.layerName?t.layerName:"layer",r.layers_=t.layers?t.layers:null,r.idProperty_=t.idProperty,r}return j(g,v),g.prototype.readRawGeometry_=function(e,r,t,a){e.pos=r.geometry;for(var n=e.readVarint()+e.pos,o=1,i=0,u=0,s=0,l=0,f=0;e.pos<n;){if(!i){var d=e.readVarint();o=7&d,i=d>>3}i--,1===o||2===o?(u+=e.readSVarint(),s+=e.readSVarint(),1===o&&l>f&&(a.push(l),f=l),t.push(u,s),l+=2):7===o?l>f&&(t.push(t[f],t[f+1]),l+=2):(0,c.assert)(!1,59)}l>f&&(a.push(l),f=l)},g.prototype.createFeature_=function(r,s,d){var y,c=s.type;if(0===c)return null;var _,v=s.properties;this.idProperty_?(_=v[this.idProperty_],delete v[this.idProperty_]):_=s.id,v[this.layerName_]=s.layer.name;var g=[],m=[];this.readRawGeometry_(r,s,g,m);var j=V(c,m.length);if(this.featureClass_===p.default)(y=new this.featureClass_(j,g,m,v,_)).transform(d.dataProjection,d.featureProjection);else{var P=void 0;if(j==a.default.POLYGON){for(var O=[],N=0,w=0,I=0,q=m.length;I<q;++I){var L=m[I];if((0,h.linearRingIsClockwise)(g,N,L,2)){if(0===O.length)continue;O[O.length-1].push(m[w])}else O.push(m.slice(w,I+1));w=I+1,N=L}P=O.length>1?new u.default(g,t.default.XY,O):new f.default(g,t.default.XY,m)}else P=j===a.default.POINT?new l.default(g,t.default.XY):j===a.default.LINE_STRING?new n.default(g,t.default.XY):j===a.default.POLYGON?new f.default(g,t.default.XY,m):j===a.default.MULTI_POINT?new i.default(g,t.default.XY):j===a.default.MULTI_LINE_STRING?new o.default(g,t.default.XY,m):null;y=new(0,this.featureClass_),this.geometryName_&&y.setGeometryName(this.geometryName_);var T=(0,e.transformGeometryWithOptions)(P,!1,d);y.setGeometry(T),y.setId(_),y.setProperties(v,!0)}return y},g.prototype.getType=function(){return r.default.ARRAY_BUFFER},g.prototype.readFeatures=function(e,r){var t=this.layers_,a=this.adaptOptions(r),n=(0,_.get)(a.dataProjection);n.setWorldExtent(a.extent),a.dataProjection=n;var o=new s.default(e),i=o.readFields(O,{}),u=[];for(var l in i)if(!t||-1!=t.indexOf(l)){var f=i[l],d=f?[0,0,f.extent,f.extent]:null;n.setExtent(d);for(var p=0,y=f.length;p<y;++p){var c=I(o,f,p);u.push(this.createFeature_(o,c,a))}}return u},g.prototype.readProjection=function(e){return this.dataProjection},g.prototype.setLayers=function(e){this.layers_=e},g}(e.default);function O(e,r,t){if(3===e){var a={keys:[],values:[],features:[]},n=t.readVarint()+t.pos;t.readFields(N,a,n),a.length=a.features.length,a.length&&(r[a.name]=a)}}function N(e,r,t){if(15===e)r.version=t.readVarint();else if(1===e)r.name=t.readString();else if(5===e)r.extent=t.readVarint();else if(2===e)r.features.push(t.pos);else if(3===e)r.keys.push(t.readString());else if(4===e){for(var a=null,n=t.readVarint()+t.pos;t.pos<n;)a=1===(e=t.readVarint()>>3)?t.readString():2===e?t.readFloat():3===e?t.readDouble():4===e?t.readVarint64():5===e?t.readVarint():6===e?t.readSVarint():7===e?t.readBoolean():null;r.values.push(a)}}function w(e,r,t){if(1==e)r.id=t.readVarint();else if(2==e)for(var a=t.readVarint()+t.pos;t.pos<a;){var n=r.layer.keys[t.readVarint()],o=r.layer.values[t.readVarint()];r.properties[n]=o}else 3==e?r.type=t.readVarint():4==e&&(r.geometry=t.pos)}function I(e,r,t){e.pos=r.features[t];var a=e.readVarint()+e.pos,n={layer:r,type:0,properties:{}};return e.readFields(w,n,a),n}function V(e,r){var t;return 1===e?t=1===r?a.default.POINT:a.default.MULTI_POINT:2===e?t=1===r?a.default.LINE_STRING:a.default.MULTI_LINE_STRING:3===e&&(t=a.default.POLYGON),t}var q=P;exports.default=q; },{"./Feature.js":"Kylu","./FormatType.js":"AbO3","../geom/GeometryLayout.js":"Utvi","../geom/GeometryType.js":"lmV0","../geom/LineString.js":"DfxW","../geom/MultiLineString.js":"fbCo","../geom/MultiPoint.js":"dNu5","../geom/MultiPolygon.js":"ouhF","pbf":"UzHN","../geom/Point.js":"gLcY","../geom/Polygon.js":"Nwwk","../proj/Projection.js":"WUar","../render/Feature.js":"IFOM","../proj/Units.js":"yZx6","../asserts.js":"fLG6","../proj.js":"Diht","../geom/flat/orient.js":"cJkE"}],"Q2C4":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"};exports.default=e; },{}],"UST7":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=R(require("../../render/canvas/BuilderGroup.js")),t=y(require("../../render/canvas/ExecutorGroup.js")),r=R(require("./TileLayer.js")),i=R(require("../../events/EventType.js")),n=R(require("../../render/canvas/BuilderType.js")),o=R(require("../../TileState.js")),a=R(require("../../layer/VectorTileRenderType.js")),d=R(require("../../ViewHint.js")),l=require("../../transform.js"),u=require("../../extent.js"),s=require("../../obj.js"),g=require("../../render/canvas/hitdetect.js"),c=require("../vector.js"),f=require("../../util.js"),p=require("../../events.js"),h=require("../../size.js"),T=require("../../coordinate.js");function v(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return v=function(){return e},e}function y(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=v();if(t&&t.has(e))return t.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function R(e){return e&&e.__esModule?e:{default:e}}var _=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),m={image:[n.default.POLYGON,n.default.CIRCLE,n.default.LINE_STRING,n.default.IMAGE,n.default.TEXT],hybrid:[n.default.POLYGON,n.default.LINE_STRING],vector:[]},C={image:[n.default.DEFAULT],hybrid:[n.default.IMAGE,n.default.TEXT,n.default.DEFAULT],vector:[n.default.POLYGON,n.default.CIRCLE,n.default.LINE_STRING,n.default.IMAGE,n.default.TEXT,n.default.DEFAULT]},I=function(r){function n(e){var t=r.call(this,e)||this;return t.boundHandleStyleImageChange_=t.handleStyleImageChange_.bind(t),t.dirty_=!1,t.renderedLayerRevision_,t.renderedPixelToCoordinateTransform_=null,t.renderedRotation_,t.renderTileImageQueue_={},t.tileListenerKeys_={},t.tmpTransform_=(0,l.create)(),t}return _(n,r),n.prototype.prepareTile=function(e,t,r,i){var n,a=(0,f.getUid)(e),d=e.getState();return(d===o.default.LOADED&&e.hifi||d===o.default.ERROR)&&a in this.tileListenerKeys_&&((0,p.unlistenByKey)(this.tileListenerKeys_[a]),delete this.tileListenerKeys_[a]),d!==o.default.LOADED&&d!==o.default.ERROR||(this.updateExecutorGroup_(e,t,r),this.tileImageNeedsRender_(e,t,r)&&(n=!0,i&&(this.renderTileImageQueue_[a]=e))),n},n.prototype.getTile=function(e,t,n,l){var u=l.pixelRatio,s=l.viewState,g=s.resolution,c=s.projection,h=this.getLayer(),T=h.getSource().getTile(e,t,n,u,c);if(T.getState()<o.default.LOADED){T.wantedResolution=g;var v=(0,f.getUid)(T);if(!(v in this.tileListenerKeys_)){var y=(0,p.listen)(T,i.default.CHANGE,this.prepareTile.bind(this,T,u,c,!0));this.tileListenerKeys_[v]=y}}else{var R=l.viewHints;!!(R[d.default.ANIMATING]||R[d.default.INTERACTING])&&T.wantedResolution||(T.wantedResolution=g),this.prepareTile(T,u,c,!1)&&h.getRenderMode()!==a.default.VECTOR&&this.renderTileImage_(T,l)}return r.prototype.getTile.call(this,e,t,n,l)},n.prototype.isDrawableTile=function(e){var t=this.getLayer();return r.prototype.isDrawableTile.call(this,e)&&(t.getRenderMode()===a.default.VECTOR?(0,f.getUid)(t)in e.executorGroups:e.hasContext(t))},n.prototype.getTileImage=function(e){return e.getImage(this.getLayer())},n.prototype.prepareFrame=function(e){var t=this.getLayer().getRevision();return this.renderedLayerRevision_!=t&&(this.renderedTiles.length=0),this.renderedLayerRevision_=t,r.prototype.prepareFrame.call(this,e)},n.prototype.updateExecutorGroup_=function(r,i,n){var d=this.getLayer(),l=d.getRevision(),s=d.getRenderOrder()||null,g=r.wantedResolution,p=r.getReplayState(d);if(p.dirty||p.renderedResolution!==g||p.renderedRevision!=l||p.renderedRenderOrder!=s||p.renderedZ!==r.sourceZ){var h=d.getSource(),T=h.getTileGrid(),v=h.getTileGridForProjection(n).getTileCoordExtent(r.wrappedTileCoord),y=h.getSourceTiles(i,n,r),R=(0,f.getUid)(d);delete r.hitDetectionImageData[R],r.executorGroups[R]=[];for(var _=function(n,l){var f=y[n];if(f.getState()!=o.default.LOADED)return"continue";var _=f.tileCoord,C=T.getTileCoordExtent(_),I=(0,u.getIntersection)(v,C),E=(0,u.equals)(C,I)?null:(0,u.buffer)(I,d.getRenderBuffer()*g,m.tmpExtent);p.dirty=!1;var x=new e.default(0,I,g,i,d.getDeclutter()),S=(0,c.getSquaredTolerance)(g,i),w=function(e){var t,r=e.getStyleFunction()||d.getStyleFunction();if(r&&(t=r(e,g)),t){var i=this.renderFeature(e,S,t,x);this.dirty_=this.dirty_||i,p.dirty=p.dirty||i}},L=f.getFeatures();s&&s!==p.renderedRenderOrder&&L.sort(s);for(var j=0,O=L.length;j<O;++j){var D=L[j];E&&!(0,u.intersects)(E,D.getGeometry().getExtent())||w.call(m,D)}var G=x.finish(),A=d.getRenderMode()!==a.default.VECTOR&&d.getDeclutter()&&1===y.length?null:I,F=new t.default(A,g,i,h.getOverlaps(),G,d.getRenderBuffer());r.executorGroups[R].push(F)},m=this,C=0,I=y.length;C<I;++C)_(C);p.renderedRevision=l,p.renderedZ=r.sourceZ,p.renderedRenderOrder=s,p.renderedResolution=g}},n.prototype.forEachFeatureAtCoordinate=function(e,t,r,i,n){var o=t.viewState.resolution,a=t.viewState.rotation;r=null==r?0:r;var d,l,s,g=this.getLayer(),c=g.getDeclutter(),p=g.getSource().getTileGridForProjection(t.viewState.projection),h={},T=this.renderedTiles,v=function(){var t=T[l],s=p.getTileCoordExtent(t.wrappedTileCoord),v=(0,u.containsCoordinate)(s,e);if(!c&&!v)return"continue";for(var y=t.executorGroups[(0,f.getUid)(g)],R=0,_=y.length;R<_;++R){var m=y[R];d=d||m.forEachFeatureAtCoordinate(e,o,a,r,function(e){if(v||n&&-1!==n.indexOf(e)){var t=e.getId();if(void 0===t&&(t=(0,f.getUid)(e)),!(t in h))return h[t]=!0,i(e,g)}},g.getDeclutter()?n:null)}};for(l=0,s=T.length;l<s;++l)v();return d},n.prototype.getFeatures=function(e){return new Promise(function(t,r){for(var i,n=this.getLayer(),a=(0,f.getUid)(n),d=n.getSource(),s=this.renderedProjection,c=s.getExtent(),p=this.renderedResolution,v=d.getTileGridForProjection(s),y=(0,l.apply)(this.renderedPixelToCoordinateTransform_,e.slice()),R=v.getTileCoordForCoordAndResolution(y,p),_=0,m=this.renderedTiles.length;_<m;++_)if(R.toString()===this.renderedTiles[_].tileCoord.toString()){if((i=this.renderedTiles[_]).getState()===o.default.LOADED&&i.hifi){var C=v.getTileCoordExtent(i.tileCoord);d.getWrapX()&&s.canWrapX()&&!(0,u.containsExtent)(c,C)&&(0,T.wrapX)(y,s);break}i=void 0}if(!i||i.loadingSourceTiles>0)t([]);else{var I=v.getTileCoordExtent(i.wrappedTileCoord),E=(0,u.getTopLeft)(I),x=[(y[0]-E[0])/p,(E[1]-y[1])/p],S=i.getSourceTiles().reduce(function(e,t){return e.concat(t.getFeatures())},[]),w=i.hitDetectionImageData[a];if(!w&&!this.animatingOrInteracting_){var L=(0,h.toSize)(v.getTileSize(v.getZForResolution(p))),j=[L[0]/2,L[1]/2],O=this.renderedRotation_,D=[this.getRenderTransform(v.getTileCoordCenter(i.wrappedTileCoord),p,0,.5,j[0],j[1],0)];w=(0,g.createHitDetectionImageData)(L,D,S,n.getStyleFunction(),v.getTileCoordExtent(i.wrappedTileCoord),i.getReplayState(n).renderedResolution,O),i.hitDetectionImageData[a]=w}t((0,g.hitDetect)(x,S,w))}}.bind(this))},n.prototype.handleFontsChanged=function(){(0,s.clear)(this.renderTileImageQueue_);var e=this.getLayer();e.getVisible()&&void 0!==this.renderedLayerRevision_&&e.changed()},n.prototype.handleStyleImageChange_=function(e){this.renderIfReadyAndVisible()},n.prototype.renderFrame=function(e,i){var n=e.viewHints,o=!(n[d.default.ANIMATING]||n[d.default.INTERACTING]);this.renderQueuedTileImages_(o,e),r.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var u=this.getLayer(),s=u.getRenderMode();if(s===a.default.IMAGE)return this.container;var g=u.getSource(),c=e.usedTiles[(0,f.getUid)(g)];for(var p in this.renderTileImageQueue_)c&&p in c||delete this.renderTileImageQueue_[p];for(var h=this.context,T=u.getDeclutter()?{}:null,v=C[s],y=e.pixelRatio,R=e.viewState,_=R.center,m=R.resolution,I=R.rotation,E=e.size,x=Math.round(E[0]*y),S=Math.round(E[1]*y),w=this.renderedTiles,L=g.getTileGridForProjection(e.viewState.projection),j=[],O=[],D=w.length-1;D>=0;--D)for(var G=w[D],A=G.tileCoord,F=L.getTileCoordExtent(G.wrappedTileCoord),b=L.getTileCoordExtent(A,this.tmpExtent)[0]-F[0],P=(0,l.multiply)((0,l.scale)(this.inversePixelTransform.slice(),1/y,1/y),this.getRenderTransform(_,m,I,y,x,S,b)),N=G.executorGroups[(0,f.getUid)(u)],q=!1,M=0,U=N.length;M<U;++M){var Q=N[M];if(Q.hasExecutors(v)){var Z=G.tileCoord[0],H=void 0;if(!T&&!q){H=Q.getClipCoords(P),h.save();for(var K=0,V=j.length;K<V;++K){var X=j[K];Z<O[K]&&(h.beginPath(),h.moveTo(H[0],H[1]),h.lineTo(H[2],H[3]),h.lineTo(H[4],H[5]),h.lineTo(H[6],H[7]),h.moveTo(X[6],X[7]),h.lineTo(X[4],X[5]),h.lineTo(X[2],X[3]),h.lineTo(X[0],X[1]),h.clip())}}Q.execute(h,1,P,I,o,v,T),T||q||(h.restore(),j.push(H),O.push(Z),q=!0)}}if(T){var z=e.layerStatesArray[e.layerIndex];(0,t.replayDeclutter)(T,h,I,z.opacity,o,e.declutterItems)}return this.container},n.prototype.renderQueuedTileImages_=function(e,t){for(var r in this.renderTileImageQueue_){if(!e&&Date.now()-t.time>8){t.animate=!0;break}var i=this.renderTileImageQueue_[r];delete this.renderTileImageQueue_[r],this.renderTileImage_(i,t)}},n.prototype.renderFeature=function(e,t,r,i){if(!r)return!1;var n=!1;if(Array.isArray(r))for(var o=0,a=r.length;o<a;++o)n=(0,c.renderFeature)(i,e,r[o],t,this.boundHandleStyleImageChange_)||n;else n=(0,c.renderFeature)(i,e,r,t,this.boundHandleStyleImageChange_);return n},n.prototype.tileImageNeedsRender_=function(e,t,r){var i=this.getLayer(),n=e.getReplayState(i),o=i.getRevision(),a=e.sourceZ,d=e.wantedResolution;return n.renderedTileResolution!==d||n.renderedTileRevision!==o||n.renderedTileZ!==a},n.prototype.renderTileImage_=function(e,t){var r=this.getLayer(),i=e.getReplayState(r),n=r.getRevision(),o=e.executorGroups[(0,f.getUid)(r)];i.renderedTileRevision=n,i.renderedTileZ=e.sourceZ;var a=e.wrappedTileCoord,d=a[0],u=r.getSource(),s=t.pixelRatio,g=t.viewState.projection,c=u.getTileGridForProjection(g),p=c.getResolution(e.tileCoord[0]),h=t.pixelRatio/e.wantedResolution*p,T=c.getResolution(d),v=e.getContext(r);s=Math.max(s,h/s);var y=u.getTilePixelSize(d,s,g);v.canvas.width=y[0],v.canvas.height=y[1];var R=s/h;if(1!==R){var _=(0,l.reset)(this.tmpTransform_);(0,l.scale)(_,R,R),v.setTransform.apply(v,_)}var C=c.getTileCoordExtent(a,this.tmpExtent),I=h/T,E=(0,l.reset)(this.tmpTransform_);(0,l.scale)(E,I,-I),(0,l.translate)(E,-C[0],-C[3]);for(var x=0,S=o.length;x<S;++x){o[x].execute(v,R,E,0,!0,m[r.getRenderMode()])}i.renderedTileResolution=e.wantedResolution},n}(r.default),E=I;exports.default=E; },{"../../render/canvas/BuilderGroup.js":"vqHd","../../render/canvas/ExecutorGroup.js":"ngEc","./TileLayer.js":"hkMV","../../events/EventType.js":"C8cu","../../render/canvas/BuilderType.js":"irm1","../../TileState.js":"u3kG","../../layer/VectorTileRenderType.js":"Q2C4","../../ViewHint.js":"cuLW","../../transform.js":"P4eA","../../extent.js":"QDir","../../obj.js":"mH6q","../../render/canvas/hitdetect.js":"MrCe","../vector.js":"UCah","../../util.js":"KniQ","../../events.js":"UqnM","../../size.js":"TAHd","../../coordinate.js":"nGsj"}],"zOJv":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("./BaseVector.js")),t=u(require("../renderer/canvas/VectorTileLayer.js")),r=u(require("./TileProperty.js")),o=u(require("./VectorTileRenderType.js")),n=require("../asserts.js"),s=require("../obj.js");function u(e){return e&&e.__esModule?e:{default:e}}var i=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),a=function(e){function u(t){var r=this,u=t||{},i=(0,s.assign)({},u);delete i.preload,delete i.useInterimTilesOnError,r=e.call(this,i)||this;var a=u.renderMode||o.default.HYBRID;return(0,n.assert)(null==a||a==o.default.IMAGE||a==o.default.HYBRID||a==o.default.VECTOR,28),r.renderMode_=a,r.setPreload(u.preload?u.preload:0),r.setUseInterimTilesOnError(void 0===u.useInterimTilesOnError||u.useInterimTilesOnError),r}return i(u,e),u.prototype.createRenderer=function(){return new t.default(this)},u.prototype.getFeatures=function(t){return e.prototype.getFeatures.call(this,t)},u.prototype.getRenderMode=function(){return this.renderMode_},u.prototype.getPreload=function(){return this.get(r.default.PRELOAD)},u.prototype.getUseInterimTilesOnError=function(){return this.get(r.default.USE_INTERIM_TILES_ON_ERROR)},u.prototype.setPreload=function(e){this.set(r.default.PRELOAD,e)},u.prototype.setUseInterimTilesOnError=function(e){this.set(r.default.USE_INTERIM_TILES_ON_ERROR,e)},u}(e.default),l=a;exports.default=l; },{"./BaseVector.js":"pskK","../renderer/canvas/VectorTileLayer.js":"UST7","./TileProperty.js":"M5pz","./VectorTileRenderType.js":"Q2C4","../asserts.js":"fLG6","../obj.js":"mH6q"}],"yj80":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=o(require("./Tile.js")),e=o(require("./TileState.js"));function o(t){return t&&t.__esModule?t:{default:t}}var r=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),n=function(t){function o(e,o,r,n,u,i){var s=t.call(this,e,o,i)||this;return s.extent=null,s.format_=n,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=u,s.url_=r,s}return r(o,t),o.prototype.getFormat=function(){return this.format_},o.prototype.getFeatures=function(){return this.features_},o.prototype.getKey=function(){return this.url_},o.prototype.load=function(){this.state==e.default.IDLE&&(this.setState(e.default.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},o.prototype.onLoad=function(t,e){this.setFeatures(t)},o.prototype.onError=function(){this.setState(e.default.ERROR)},o.prototype.setFeatures=function(t){this.features_=t,this.setState(e.default.LOADED)},o.prototype.setLoader=function(t){this.loader_=t},o}(t.default),u=n;exports.default=u; },{"./Tile.js":"IWZI","./TileState.js":"u3kG"}],"C8Du":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("./Tile.js")),t=require("./dom.js"),r=require("./util.js");function o(e){return e&&e.__esModule?e:{default:e}}var n=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),i=[],u=function(e){function o(t,r,o,n){var i=e.call(this,t,r,{transition:0})||this;return i.context_={},i.executorGroups={},i.loadingSourceTiles=0,i.errorSourceTileKeys={},i.hitDetectionImageData={},i.replayState_={},i.sourceTiles=null,i.wantedResolution,i.getSourceTiles=n.bind(void 0,i),i.sourceZ=-1,i.hifi=!1,i.wrappedTileCoord=o,i}return n(o,e),o.prototype.getContext=function(e){var o=(0,r.getUid)(e);return o in this.context_||(this.context_[o]=(0,t.createCanvasContext2D)(1,1,i)),this.context_[o]},o.prototype.hasContext=function(e){return(0,r.getUid)(e)in this.context_},o.prototype.getImage=function(e){return this.hasContext(e)?this.getContext(e).canvas:null},o.prototype.getReplayState=function(e){var t=(0,r.getUid)(e);return t in this.replayState_||(this.replayState_[t]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedZ:-1,renderedTileZ:-1}),this.replayState_[t]},o.prototype.load=function(){this.getSourceTiles()},o.prototype.release=function(){for(var t in this.context_)i.push(this.context_[t].canvas);e.prototype.release.call(this)},o}(e.default),s=u;exports.default=s; },{"./Tile.js":"IWZI","./dom.js":"Xno5","./util.js":"KniQ"}],"A6uo":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.defaultLoadFunction=v,exports.default=void 0;var e=f(require("../events/EventType.js")),t=f(require("../VectorTile.js")),i=f(require("../TileCache.js")),r=f(require("../TileState.js")),o=f(require("./UrlTile.js")),n=f(require("../VectorRenderTile.js")),l=require("../extent.js"),a=require("../tilegrid.js"),s=require("../array.js"),u=require("../tilecoord.js"),c=require("../featureloader.js"),d=require("../size.js");function f(e){return e&&e.__esModule?e:{default:e}}var h=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),p=function(o){function c(e){var r=this,n=e.projection||"EPSG:3857",l=e.extent||(0,a.extentFromProjection)(n),s=e.tileGrid||(0,a.createXYZ)({extent:l,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(r=o.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:n,state:e.state,tileGrid:s,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:v,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,r.loadingTiles_={},r.sourceTileCache=new i.default(r.tileCache.highWaterMark),r.overlaps_=null==e.overlaps||e.overlaps,r.tileClass=e.tileClass?e.tileClass:t.default,r.tileGrids_={},r}return h(c,o),c.prototype.getFeaturesInExtent=function(e){var t=[],i=this.tileCache;if(0===i.getCount())return t;var o=(0,u.fromKey)(i.peekFirstKey())[0],n=this.tileGrid;return i.forEach(function(i){if(i.tileCoord[0]===o&&i.getState()===r.default.LOADED)for(var a=i.getSourceTiles(),s=0,u=a.length;s<u;++s){var c=a[s],d=c.tileCoord;if((0,l.intersects)(e,n.getTileCoordExtent(d))){var f=c.getFeatures();if(f)for(var h=0,p=f.length;h<p;++h){var g=f[h],v=g.getGeometry();(0,l.intersects)(e,v.getExtent())&&t.push(g)}}}}),t},c.prototype.getOverlaps=function(){return this.overlaps_},c.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},c.prototype.expireCache=function(e,t){o.prototype.expireCache.call(this,e,t),this.sourceTileCache.expireCache({})},c.prototype.getSourceTiles=function(t,i,o){var n=o.wrappedTileCoord,a=this.getTileGridForProjection(i),u=a.getTileCoordExtent(n),c=n[0],d=a.getResolution(c);(0,l.buffer)(u,-d,u);var f=this.tileGrid,h=f.getExtent();h&&(0,l.getIntersection)(u,h,u);var p,g,v,T=f.getZForResolution(d,1),C=f.getMinZoom(),E=o.sourceTiles;if(E&&E.length>0&&E[0].tileCoord[0]===T)p=E,g=!0,v=T;else{p=[],v=T+1;do{--v,g=!0,f.forEachTileCoord(u,v,function(n){var l,a=this.tileUrlFunction(n,t,i);if(void 0!==a)if(this.sourceTileCache.containsKey(a)){var s=(l=this.sourceTileCache.get(a)).getState();if(s===r.default.LOADED||s===r.default.ERROR||s===r.default.EMPTY)return void p.push(l)}else v===T&&((l=new this.tileClass(n,r.default.IDLE,a,this.format_,this.tileLoadFunction)).extent=f.getTileCoordExtent(n),l.projection=i,l.resolution=f.getResolution(n[0]),this.sourceTileCache.set(a,l),l.addEventListener(e.default.CHANGE,this.handleTileChange.bind(this)),l.load());g=g&&l&&l.getState()===r.default.LOADED,l&&l.getState()!==r.default.EMPTY&&o.getState()===r.default.IDLE&&(o.loadingSourceTiles++,l.addEventListener(e.default.CHANGE,function t(){var i=l.getState(),n=l.getKey();if(i===r.default.LOADED||i===r.default.ERROR){i===r.default.LOADED?(l.removeEventListener(e.default.CHANGE,t),o.loadingSourceTiles--,delete o.errorSourceTileKeys[n]):i===r.default.ERROR&&(o.errorSourceTileKeys[n]=!0);var a=Object.keys(o.errorSourceTileKeys).length;o.loadingSourceTiles-a==0&&(o.hifi=0===a,o.sourceZ=T,o.setState(r.default.LOADED))}}))}.bind(this)),g||(p.length=0)}while(!g&&v>C)}return o.getState()===r.default.IDLE&&o.setState(r.default.LOADING),g&&(o.hifi=T===v,o.sourceZ=v,o.getState()<r.default.LOADED?o.setState(r.default.LOADED):E&&(0,s.equals)(p,E)||(o.sourceTiles=p)),p},c.prototype.getTile=function(e,t,i,o,a){var s,c=(0,u.getKeyZXY)(e,t,i),d=this.getKey();if(this.tileCache.containsKey(c)&&(s=this.tileCache.get(c)).key===d)return s;var f=[e,t,i],h=this.getTileCoordForTileUrlFunction(f,a),p=this.getTileGrid().getExtent(),g=this.getTileGridForProjection(a);if(h&&p){var v=g.getTileCoordExtent(h);(0,l.buffer)(v,-g.getResolution(e),v),(0,l.intersects)(p,v)||(h=null)}var T=!0;if(null!==h){var C=this.tileGrid,E=g.getResolution(e),y=C.getZForResolution(E,1),S=g.getTileCoordExtent(h);(0,l.buffer)(S,-E,S),C.forEachTileCoord(S,y,function(e){T=T&&!this.tileUrlFunction(e,o,a)}.bind(this))}var x=new n.default(f,T?r.default.EMPTY:r.default.IDLE,h,this.getSourceTiles.bind(this,o,a));return x.key=d,s?(x.interimTile=s,x.refreshInterimChain(),this.tileCache.replace(c,x)):this.tileCache.set(c,x),x},c.prototype.getTileGridForProjection=function(e){var t=e.getCode(),i=this.tileGrids_[t];if(!i){var r=this.tileGrid;i=(0,a.createForProjection)(e,void 0,r?r.getTileSize(r.getMinZoom()):void 0),this.tileGrids_[t]=i}return i},c.prototype.getTilePixelRatio=function(e){return e},c.prototype.getTilePixelSize=function(e,t,i){var r=this.getTileGridForProjection(i),o=(0,d.toSize)(r.getTileSize(e),this.tmpSize);return[Math.round(o[0]*t),Math.round(o[1]*t)]},c.prototype.updateCacheSize=function(e,t){o.prototype.updateCacheSize.call(this,2*e,t)},c}(o.default),g=p;function v(e,t){var i=(0,c.loadFeaturesXhr)(t,e.getFormat(),e.onLoad.bind(e),e.onError.bind(e));e.setLoader(i)}exports.default=g; },{"../events/EventType.js":"C8cu","../VectorTile.js":"yj80","../TileCache.js":"YFDe","../TileState.js":"u3kG","./UrlTile.js":"uv9E","../VectorRenderTile.js":"C8Du","../extent.js":"QDir","../tilegrid.js":"ExRx","../array.js":"luEr","../tilecoord.js":"faTr","../featureloader.js":"U3JP","../size.js":"TAHd"}],"pt6h":[function(require,module,exports) { var a={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},e=" ",r=/(italic|oblique)$/i,l={};module.exports=function(o,t,i){var n=l[o];if(!n){Array.isArray(o)||(o=[o]);for(var p=400,b="normal",c=[],h=0,s=o.length;h<s;++h){var u=o[h].split(" "),d=u[u.length-1].toLowerCase();for(var m in"normal"==d||"italic"==d||"oblique"==d?(b=d,u.pop(),d=u[u.length-1].toLowerCase()):r.test(d)&&(d=d.replace(r,""),b=u[u.length-1].replace(d,"")),a)if(d==m||d==m.replace("-","")||d==m.replace("-",e)){p=a[m],u.pop();break}"number"==typeof d&&(p=d);var f=u.join(e).replace("Klokantech Noto Sans","Noto Sans");-1!==f.indexOf(e)&&(f='"'+f+'"'),c.push(f)}n=l[o]=[b,p,c]}return n[0]+e+n[1]+e+t+"px"+(i?"/"+i:"")+e+n[2]}; },{}],"FRly":[function(require,module,exports) { "use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){var n,o,a=h(r),u=a[0],i=a[1],f=new e(c(r,u,i)),A=0,d=i>0?u-4:u;for(o=0;o<d;o+=4)n=t[r.charCodeAt(o)]<<18|t[r.charCodeAt(o+1)]<<12|t[r.charCodeAt(o+2)]<<6|t[r.charCodeAt(o+3)],f[A++]=n>>16&255,f[A++]=n>>8&255,f[A++]=255&n;return 2===i&&(n=t[r.charCodeAt(o)]<<2|t[r.charCodeAt(o+1)]>>4,f[A++]=255&n),1===i&&(n=t[r.charCodeAt(o)]<<10|t[r.charCodeAt(o+1)]<<4|t[r.charCodeAt(o+2)]>>2,f[A++]=n>>8&255,f[A++]=255&n),f}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));return o.join("")}function d(t){for(var e,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63; },{}],"aqZJ":[function(require,module,exports) { var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}; },{}],"aMB2":[function(require,module,exports) { var global = arguments[3]; var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.isBuffer(r))return 0===r.length?-1:_(t,r,e,n,i);if("number"==typeof r)return r&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function A(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function m(t,r,e,n){return Q($(r,t.length-e),t,e,n)}function P(t,r,e,n){return Q(G(r),t,e,n)}function T(t,r,e,n){return P(t,r,e,n)}function B(t,r,e,n){return Q(K(r),t,e,n)}function U(t,r,e,n){return Q(H(r,t.length-e),t,e,n)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function Y(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return O(n)}exports.Buffer=f,exports.SlowBuffer=d,exports.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,r,e){return s(null,t,r,e)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,r,e){return a(null,t,r,e)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,r){if(!f.isBuffer(t)||!f.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,r){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=f.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!f.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i},f.byteLength=v,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)b(this,r,r+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)b(this,r,r+3),b(this,r+1,r+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)b(this,r,r+7),b(this,r+1,r+6),b(this,r+2,r+5),b(this,r+3,r+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Y(this,0,t):E.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=exports.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,r,e,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),s=Math.min(o,u),h=this.slice(n,i),a=t.slice(r,e),c=0;c<s;++c)if(h[c]!==a[c]){o=h[c],u=a[c];break}return o<u?-1:u<o?1:0},f.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},f.prototype.indexOf=function(t,r,e){return R(this,t,r,e,!0)},f.prototype.lastIndexOf=function(t,r,e){return R(this,t,r,e,!1)},f.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return m(this,t,r,e);case"ascii":return P(this,t,r,e);case"latin1":case"binary":return T(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function O(t){var r=t.length;if(r<=I)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=I));return e}function L(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function x(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Z(t[o]);return i}function C(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function k(t,r,e,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function N(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function F(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,n,i,o){return o||F(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function q(t,r,n,i,o){return o||F(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}f.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),f.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=f.prototype;else{var i=r-t;e=new f(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},f.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},f.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},f.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},f.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},f.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},f.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},f.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):z(this,t,r,!0),r+4},f.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},f.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):z(this,t,r,!0),r+4},f.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},f.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},f.prototype.writeDoubleLE=function(t,r,e){return q(this,t,r,!0,e)},f.prototype.writeDoubleBE=function(t,r,e){return q(this,t,r,!1,e)},f.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},f.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=f.isBuffer(t)?t:$(new f(t,n).toString()),s=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function X(t){if((t=J(t).replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function G(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function H(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}function K(t){return r.toByteArray(X(t))}function Q(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function W(t){return t!=t} },{"base64-js":"FRly","ieee754":"Quj6","isarray":"aqZJ","buffer":"aMB2"}],"Prd1":[function(require,module,exports) { var global = arguments[3]; var Buffer = require("buffer").Buffer; var e=arguments[3],t=require("buffer").Buffer;Object.defineProperty(exports,"__esModule",{value:!0}),exports.composite=_n,exports.convertFilter=bn,exports.derefLayers=On,exports.diff=Un,exports.featureFilter=pn,exports.format=G,exports.migrate=Tn,exports.validate=Ti,exports.validateMapboxApiSupported=Ni,exports.visit=exports.v8=exports.latest=exports.function=exports.expression=exports.ValidationError=exports.ParsingError=exports.Color=void 0;var r=8,o={version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},n={"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},i=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],a={type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},s={type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},l={type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},u={type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},p={type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},c={type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},d={id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},h=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],f={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},y={"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},m={"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},v={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},g={"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},b={"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},x={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},w={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},k={type:"array",value:"*",doc:"A filter selects specific features from a layer."},j={type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},z={type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},S={type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},T={type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},_={doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n - a single literal value; or\n - an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the `"in"` operator.\nEach label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},A={anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},I=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],O={"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},C={"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},q={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},E={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},M={"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},N={"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},P={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},R={"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},L={duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},D={"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}},F={$version:r,$root:o,sources:n,source:i,source_vector:a,source_raster:s,source_raster_dem:l,source_geojson:u,source_video:p,source_image:c,layer:d,layout:h,layout_background:f,layout_fill:y,layout_circle:m,layout_heatmap:v,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:g,layout_symbol:b,layout_raster:x,layout_hillshade:w,filter:k,filter_operator:j,geometry_type:z,function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:S,expression:T,expression_name:_,light:A,paint:I,paint_fill:O,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:C,paint_circle:q,paint_heatmap:E,paint_symbol:M,paint_raster:N,paint_hillshade:P,paint_background:R,transition:L,"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:D};exports.v8=exports.latest=F;var $=/("(?:[^\\"]|\\.)*")|[:,]/g,U=function(e,t){var r,o,n;return t=t||{},r=JSON.stringify([1],void 0,void 0===t.indent?2:t.indent).slice(2,-3),o=""===r?1/0:void 0===t.maxLength?80:t.maxLength,n=t.replacer,function e(t,i,a){var s,l,u,p,c,d,h,f,y,m,v,g;if(t&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===(v=JSON.stringify(t,n)))return v;if(h=o-i.length-a,v.length<=h&&(y=v.replace($,function(e,t){return t||e+" "})).length<=h)return y;if(null!=n&&(t=JSON.parse(v),n=void 0),"object"==typeof t&&null!==t){if(f=i+r,u=[],l=0,Array.isArray(t))for(m="[",s="]",h=t.length;l<h;l++)u.push(e(t[l],f,l===h-1?0:1)||"null");else for(m="{",s="}",h=(d=Object.keys(t)).length;l<h;l++)p=d[l],c=JSON.stringify(p)+": ",void 0!==(g=e(t[p],f,c.length+(l===h-1?0:1)))&&u.push(c+g);if(u.length>0)return[m,r+u.join(",\n"+f),s].join("\n"+i)}return v}(e,"",0)};function J(e,t){var r={};for(var o in t)void 0!==e[o]&&(r[o]=e[o]);for(var n in e)void 0===r[n]&&(r[n]=e[n]);return r}function G(e,t){return void 0===t&&(t=2),(e=J(e,F.$root)).layers&&(e.layers=e.layers.map(function(e){return J(e,F.layer)})),U(e,{indent:t})}var W="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};function B(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function V(e,t){return e(t={exports:{}},t.exports),t.exports}var H=V(function(e,t){!function(r){var o=t&&!t.nodeType&&t,n=e&&!e.nodeType&&e,i="object"==typeof W&&W;i.global!==i&&i.window!==i&&i.self!==i||(r=i);var a,s,l=2147483647,u=36,p=1,c=26,d=38,h=700,f=72,y=128,m="-",v=/^xn--/,g=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=u-p,k=Math.floor,j=String.fromCharCode;function z(e){throw RangeError(x[e])}function S(e,t){for(var r=e.length,o=[];r--;)o[r]=t(e[r]);return o}function T(e,t){var r=e.split("@"),o="";return r.length>1&&(o=r[0]+"@",e=r[1]),o+S((e=e.replace(b,".")).split("."),t).join(".")}function _(e){for(var t,r,o=[],n=0,i=e.length;n<i;)(t=e.charCodeAt(n++))>=55296&&t<=56319&&n<i?56320==(64512&(r=e.charCodeAt(n++)))?o.push(((1023&t)<<10)+(1023&r)+65536):(o.push(t),n--):o.push(t);return o}function A(e){return S(e,function(e){var t="";return e>65535&&(t+=j((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function I(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var o=0;for(e=r?k(e/h):e>>1,e+=k(e/t);e>w*c>>1;o+=u)e=k(e/w);return k(o+(w+1)*e/(e+d))}function C(e){var t,r,o,n,i,a,s,d,h,v,g,b=[],x=e.length,w=0,j=y,S=f;for((r=e.lastIndexOf(m))<0&&(r=0),o=0;o<r;++o)e.charCodeAt(o)>=128&&z("not-basic"),b.push(e.charCodeAt(o));for(n=r>0?r+1:0;n<x;){for(i=w,a=1,s=u;n>=x&&z("invalid-input"),((d=(g=e.charCodeAt(n++))-48<10?g-22:g-65<26?g-65:g-97<26?g-97:u)>=u||d>k((l-w)/a))&&z("overflow"),w+=d*a,!(d<(h=s<=S?p:s>=S+c?c:s-S));s+=u)a>k(l/(v=u-h))&&z("overflow"),a*=v;S=O(w-i,t=b.length+1,0==i),k(w/t)>l-j&&z("overflow"),j+=k(w/t),w%=t,b.splice(w++,0,j)}return A(b)}function q(e){var t,r,o,n,i,a,s,d,h,v,g,b,x,w,S,T=[];for(b=(e=_(e)).length,t=y,r=0,i=f,a=0;a<b;++a)(g=e[a])<128&&T.push(j(g));for(o=n=T.length,n&&T.push(m);o<b;){for(s=l,a=0;a<b;++a)(g=e[a])>=t&&g<s&&(s=g);for(s-t>k((l-r)/(x=o+1))&&z("overflow"),r+=(s-t)*x,t=s,a=0;a<b;++a)if((g=e[a])<t&&++r>l&&z("overflow"),g==t){for(d=r,h=u;!(d<(v=h<=i?p:h>=i+c?c:h-i));h+=u)S=d-v,w=u-v,T.push(j(I(v+S%w,0))),d=k(S/w);T.push(j(I(d,0))),i=O(r,x,o==n),r=0,++o}++r,++t}return T.join("")}if(a={version:"1.3.2",ucs2:{decode:_,encode:A},decode:C,encode:q,toASCII:function(e){return T(e,function(e){return g.test(e)?"xn--"+q(e):e})},toUnicode:function(e){return T(e,function(e){return v.test(e)?C(e.slice(4).toLowerCase()):e})}},o&&n)if(e.exports==o)n.exports=a;else for(s in a)a.hasOwnProperty(s)&&(o[s]=a[s]);else r.punycode=a}(W)}),Z={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}};function X(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var K=function(e,t,r,o){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var i=/\+/g;e=e.split(t);var a=1e3;o&&"number"==typeof o.maxKeys&&(a=o.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var l=0;l<s;++l){var u,p,c,d,h=e[l].replace(i,"%20"),f=h.indexOf(r);f>=0?(u=h.substr(0,f),p=h.substr(f+1)):(u=h,p=""),c=decodeURIComponent(u),d=decodeURIComponent(p),X(n,c)?Array.isArray(n[c])?n[c].push(d):n[c]=[n[c],d]:n[c]=d}return n},Y=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},Q=function(e,t,r,o){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(o){var n=encodeURIComponent(Y(o))+r;return Array.isArray(e[o])?e[o].map(function(e){return n+encodeURIComponent(Y(e))}).join(t):n+encodeURIComponent(Y(e[o]))}).join(t):o?encodeURIComponent(Y(o))+r+encodeURIComponent(Y(e)):""},ee=V(function(e,t){t.decode=t.parse=K,t.encode=t.stringify=Q}),te=ee.decode,re=ee.parse,oe=ee.encode,ne=ee.stringify,ie=Se,ae=_e,se=Ae,le=Te,ue=pe;function pe(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var ce=/^([a-z0-9.+-]+:)/i,de=/:[0-9]*$/,he=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,fe=["<",">",'"',"`"," ","\r","\n","\t"],ye=["{","}","|","\\","^","`"].concat(fe),me=["'"].concat(ye),ve=["%","/","?",";","#"].concat(me),ge=["/","?","#"],be=255,xe=/^[+a-z0-9A-Z_-]{0,63}$/,we=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ke={javascript:!0,"javascript:":!0},je={javascript:!0,"javascript:":!0},ze={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Se(e,t,r){if(e&&Z.isObject(e)&&e instanceof pe)return e;var o=new pe;return o.parse(e,t,r),o}function Te(e){return Z.isString(e)&&(e=Se(e)),e instanceof pe?e.format():pe.prototype.format.call(e)}function _e(e,t){return Se(e,!1,!0).resolve(t)}function Ae(e,t){return e?Se(e,!1,!0).resolveObject(t):t}pe.prototype.parse=function(e,t,r){if(!Z.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),n=-1!==o&&o<e.indexOf("#")?"?":"#",i=e.split(n);i[0]=i[0].replace(/\\/g,"/");var a=e=i.join(n);if(a=a.trim(),!r&&1===e.split("#").length){var s=he.exec(a);if(s)return this.path=a,this.href=a,this.pathname=s[1],s[2]?(this.search=s[2],this.query=t?ee.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var l=ce.exec(a);if(l){var u=(l=l[0]).toLowerCase();this.protocol=u,a=a.substr(l.length)}if(r||l||a.match(/^\/\/[^@\/]+@[^@\/]+/)){var p="//"===a.substr(0,2);!p||l&&je[l]||(a=a.substr(2),this.slashes=!0)}if(!je[l]&&(p||l&&!ze[l])){for(var c,d,h=-1,f=0;f<ge.length;f++){-1!==(y=a.indexOf(ge[f]))&&(-1===h||y<h)&&(h=y)}-1!==(d=-1===h?a.lastIndexOf("@"):a.lastIndexOf("@",h))&&(c=a.slice(0,d),a=a.slice(d+1),this.auth=decodeURIComponent(c)),h=-1;for(f=0;f<ve.length;f++){var y;-1!==(y=a.indexOf(ve[f]))&&(-1===h||y<h)&&(h=y)}-1===h&&(h=a.length),this.host=a.slice(0,h),a=a.slice(h),this.parseHost(),this.hostname=this.hostname||"";var m="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!m)for(var v=this.hostname.split(/\./),g=(f=0,v.length);f<g;f++){var b=v[f];if(b&&!b.match(xe)){for(var x="",w=0,k=b.length;w<k;w++)b.charCodeAt(w)>127?x+="x":x+=b[w];if(!x.match(xe)){var j=v.slice(0,f),z=v.slice(f+1),S=b.match(we);S&&(j.push(S[1]),z.unshift(S[2])),z.length&&(a="/"+z.join(".")+a),this.hostname=j.join(".");break}}}this.hostname.length>be?this.hostname="":this.hostname=this.hostname.toLowerCase(),m||(this.hostname=H.toASCII(this.hostname));var T=this.port?":"+this.port:"",_=this.hostname||"";this.host=_+T,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!ke[u])for(f=0,g=me.length;f<g;f++){var A=me[f];if(-1!==a.indexOf(A)){var I=encodeURIComponent(A);I===A&&(I=escape(A)),a=a.split(A).join(I)}}var O=a.indexOf("#");-1!==O&&(this.hash=a.substr(O),a=a.slice(0,O));var C=a.indexOf("?");if(-1!==C?(this.search=a.substr(C),this.query=a.substr(C+1),t&&(this.query=ee.parse(this.query)),a=a.slice(0,C)):t&&(this.search="",this.query={}),a&&(this.pathname=a),ze[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){T=this.pathname||"";var q=this.search||"";this.path=T+q}return this.href=this.format(),this},pe.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",o=this.hash||"",n=!1,i="";this.host?n=e+this.host:this.hostname&&(n=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&Z.isObject(this.query)&&Object.keys(this.query).length&&(i=ee.stringify(this.query));var a=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||ze[t])&&!1!==n?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),o&&"#"!==o.charAt(0)&&(o="#"+o),a&&"?"!==a.charAt(0)&&(a="?"+a),t+n+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(a=a.replace("#","%23"))+o},pe.prototype.resolve=function(e){return this.resolveObject(Se(e,!1,!0)).format()},pe.prototype.resolveObject=function(e){if(Z.isString(e)){var t=new pe;t.parse(e,!1,!0),e=t}for(var r=new pe,o=Object.keys(this),n=0;n<o.length;n++){var i=o[n];r[i]=this[i]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),s=0;s<a.length;s++){var l=a[s];"protocol"!==l&&(r[l]=e[l])}return ze[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!ze[e.protocol]){for(var u=Object.keys(e),p=0;p<u.length;p++){var c=u[p];r[c]=e[c]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||je[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var h=r.pathname||"",f=r.search||"";r.path=h+f}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var y=r.pathname&&"/"===r.pathname.charAt(0),m=e.host||e.pathname&&"/"===e.pathname.charAt(0),v=m||y||r.host&&e.pathname,g=v,b=r.pathname&&r.pathname.split("/")||[],x=(d=e.pathname&&e.pathname.split("/")||[],r.protocol&&!ze[r.protocol]);if(x&&(r.hostname="",r.port=null,r.host&&(""===b[0]?b[0]=r.host:b.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),v=v&&(""===d[0]||""===b[0])),m)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,b=d;else if(d.length)b||(b=[]),b.pop(),b=b.concat(d),r.search=e.search,r.query=e.query;else if(!Z.isNullOrUndefined(e.search)){if(x)r.hostname=r.host=b.shift(),(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift());return r.search=e.search,r.query=e.query,Z.isNull(r.pathname)&&Z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!b.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var w=b.slice(-1)[0],k=(r.host||e.host||b.length>1)&&("."===w||".."===w)||""===w,j=0,z=b.length;z>=0;z--)"."===(w=b[z])?b.splice(z,1):".."===w?(b.splice(z,1),j++):j&&(b.splice(z,1),j--);if(!v&&!g)for(;j--;j)b.unshift("..");!v||""===b[0]||b[0]&&"/"===b[0].charAt(0)||b.unshift(""),k&&"/"!==b.join("/").substr(-1)&&b.push("");var S,T=""===b[0]||b[0]&&"/"===b[0].charAt(0);x&&(r.hostname=r.host=T?"":b.length?b.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift()));return(v=v||r.host&&b.length)&&!T&&b.unshift(""),b.length?r.pathname=b.join("/"):(r.pathname=null,r.path=null),Z.isNull(r.pathname)&&Z.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},pe.prototype.parseHost=function(){var e=this.host,t=de.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Ie={parse:ie,resolve:ae,resolveObject:se,format:le,Url:ue};function Oe(e){for(var t=0;t<F.layout.length;t++)for(var r in F[F.layout[t]])if(r===e)return F[F.layout[t]][r];for(var o=0;o<F.paint.length;o++)for(var n in F[F.paint[o]])if(n===e)return F[F.paint[o]][n];return null}function Ce(e,t){for(var r in e.sources)t(e.sources[r])}function qe(e,t){for(var r=0,o=e.layers;r<o.length;r+=1){t(o[r])}}function Ee(e,t,r){function o(e,t){var o=e[t];o&&Object.keys(o).forEach(function(n){r({path:[e.id,t,n],key:n,value:o[n],reference:Oe(n),set:function(e){o[n]=e}})})}qe(e,function(e){t.paint&&o(e,"paint"),t.layout&&o(e,"layout")})}function Me(e,t){for(var r in e)0===r.indexOf("layout")&&t(e[r],r)}function Ne(e,t){for(var r in e)0===r.indexOf("paint")&&t(e[r],r)}function Pe(e,t){return"string"==typeof t&&"@"===t[0]?Pe(e,e.constants[t]):t}function Re(e){return Array.isArray(e.stops)}function Le(e,t,r){e[r]=e[t],delete e[t]}function De(e){var t,r,o;e.version=8,Ce(e,function(e){"video"===e.type&&void 0!==e.url&&Le(e,"url","urls"),"video"===e.type&&e.coordinates.forEach(function(e){return e.reverse()})}),qe(e,function(e){Me(e,function(e){void 0!==e["symbol-min-distance"]&&Le(e,"symbol-min-distance","symbol-spacing")}),Ne(e,function(e){void 0!==e["background-image"]&&Le(e,"background-image","background-pattern"),void 0!==e["line-image"]&&Le(e,"line-image","line-pattern"),void 0!==e["fill-image"]&&Le(e,"fill-image","fill-pattern")})}),Ee(e,{paint:!0,layout:!0},function(t){var r=Pe(e,t.value);Re(r)&&r.stops.forEach(function(t){t[1]=Pe(e,t[1])}),t.set(r)}),delete e.constants,qe(e,function(e){Me(e,function(e){delete e["text-max-size"],delete e["icon-max-size"]}),Ne(e,function(t){t["text-size"]&&(e.layout||(e.layout={}),e.layout["text-size"]=t["text-size"],delete t["text-size"]),t["icon-size"]&&(e.layout||(e.layout={}),e.layout["icon-size"]=t["icon-size"],delete t["icon-size"])})}),e.glyphs&&(e.glyphs=(t=e.glyphs,r=Ie.parse(t),o=r.pathname.split("/"),"mapbox:"!==r.protocol?t:"fontstack"===r.hostname?"mapbox://fonts/mapbox/{fontstack}/{range}.pbf":"fonts"===r.hostname?"mapbox://fonts/"+o[2]+"/{fontstack}/{range}.pbf":void 0)),qe(e,function(e){Me(e,function(e){e["text-font"]&&(e["text-font"]=function(e){function t(e){return e.split(",").map(function(e){return e.trim()})}if(Array.isArray(e))return e;if("string"==typeof e)return t(e);if("object"==typeof e)return e.stops.forEach(function(e){e[1]=t(e[1])}),e;throw new Error("unexpected font value")}(e["text-font"]))})});for(var n=0,i=e.layers.length-1;i>=0;i--){if("symbol"!==e.layers[i].type){n=i+1;break}}var a=e.layers.splice(n);return a.reverse(),e.layers=e.layers.concat(a),e}function Fe(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var o=0,n=t;o<n.length;o+=1){var i=n[o];for(var a in i)e[a]=i[a]}return e}var $e=function(e){function t(t,r){e.call(this,r),this.message=r,this.key=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),Ue=function(e,t){void 0===t&&(t=[]),this.parent=e,this.bindings={};for(var r=0,o=t;r<o.length;r+=1){var n=o[r],i=n[0],a=n[1];this.bindings[i]=a}};Ue.prototype.concat=function(e){return new Ue(this,e)},Ue.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},Ue.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var Je={kind:"null"},Ge={kind:"number"},We={kind:"string"},Be={kind:"boolean"},Ve={kind:"color"},He={kind:"object"},Ze={kind:"value"},Xe={kind:"error"},Ke={kind:"collator"},Ye={kind:"formatted"},Qe={kind:"resolvedImage"};function et(e,t){return{kind:"array",itemType:e,N:t}}function tt(e){if("array"===e.kind){var t=tt(e.itemType);return"number"==typeof e.N?"array<"+t+", "+e.N+">":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var rt=[Je,Ge,We,Be,Ve,Ye,He,et(Ze),Qe];function ot(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!ot(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var r=0,o=rt;r<o.length;r+=1){if(!ot(o[r],t))return null}}return"Expected "+tt(e)+" but found "+tt(t)+" instead."}function nt(e,t){return t.some(function(t){return t.kind===e.kind})}function it(e,t){return t.some(function(t){return"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e})}var at=V(function(e,t){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function o(e){return(e=Math.round(e))<0?0:e>255?255:e}function n(e){return e<0?0:e>1?1:e}function i(e){return"%"===e[e.length-1]?o(parseFloat(e)/100*255):o(parseInt(e))}function a(e){return"%"===e[e.length-1]?n(parseFloat(e)/100):n(parseFloat(e))}function s(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{t.parseCSSColor=function(e){var t,n=e.replace(/ /g,"").toLowerCase();if(n in r)return r[n].slice();if("#"===n[0])return 4===n.length?(t=parseInt(n.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===n.length&&(t=parseInt(n.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=n.indexOf("("),u=n.indexOf(")");if(-1!==l&&u+1===n.length){var p=n.substr(0,l),c=n.substr(l+1,u-(l+1)).split(","),d=1;switch(p){case"rgba":if(4!==c.length)return null;d=a(c.pop());case"rgb":return 3!==c.length?null:[i(c[0]),i(c[1]),i(c[2]),d];case"hsla":if(4!==c.length)return null;d=a(c.pop());case"hsl":if(3!==c.length)return null;var h=(parseFloat(c[0])%360+360)%360/360,f=a(c[1]),y=a(c[2]),m=y<=.5?y*(f+1):y+f-y*f,v=2*y-m;return[o(255*s(v,m,h+1/3)),o(255*s(v,m,h)),o(255*s(v,m,h-1/3)),d];default:return null}}return null}}catch(l){}}),st=at.parseCSSColor,lt=function(e,t,r,o){void 0===o&&(o=1),this.r=e,this.g=t,this.b=r,this.a=o};exports.Color=lt,lt.parse=function(e){if(e){if(e instanceof lt)return e;if("string"==typeof e){var t=st(e);if(t)return new lt(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},lt.prototype.toString=function(){var e=this.toArray(),t=e[0],r=e[1],o=e[2],n=e[3];return"rgba("+Math.round(t)+","+Math.round(r)+","+Math.round(o)+","+n+")"},lt.prototype.toArray=function(){var e=this.r,t=this.g,r=this.b,o=this.a;return 0===o?[0,0,0,0]:[255*e/o,255*t/o,255*r/o,o]},lt.black=new lt(0,0,0,1),lt.white=new lt(1,1,1,1),lt.transparent=new lt(0,0,0,0),lt.red=new lt(1,0,0,1);var ut=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ut.prototype.compare=function(e,t){return this.collator.compare(e,t)},ut.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var pt=function(e,t,r,o,n){this.text=e,this.image=t,this.scale=r,this.fontStack=o,this.textColor=n},ct=function(e){this.sections=e};ct.fromString=function(e){return new ct([new pt(e,null,null,null,null)])},ct.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some(function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length})},ct.factory=function(e){return e instanceof ct?e:ct.fromString(e)},ct.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map(function(e){return e.text}).join("")},ct.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var o=r[t];if(o.image)e.push(["image",o.image.name]);else{e.push(o.text);var n={};o.fontStack&&(n["text-font"]=["literal",o.fontStack.split(",")]),o.scale&&(n["font-scale"]=o.scale),o.textColor&&(n["text-color"]=["rgba"].concat(o.textColor.toArray())),e.push(n)}}return e};var dt=function(e){this.name=e.name,this.available=e.available};function ht(e,t,r,o){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===o||"number"==typeof o&&o>=0&&o<=1?null:"Invalid rgba value ["+[e,t,r,o].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof o?[e,t,r,o]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ft(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof lt)return!0;if(e instanceof ut)return!0;if(e instanceof ct)return!0;if(e instanceof dt)return!0;if(Array.isArray(e)){for(var t=0,r=e;t<r.length;t+=1){if(!ft(r[t]))return!1}return!0}if("object"==typeof e){for(var o in e)if(!ft(e[o]))return!1;return!0}return!1}function yt(e){if(null===e)return Je;if("string"==typeof e)return We;if("boolean"==typeof e)return Be;if("number"==typeof e)return Ge;if(e instanceof lt)return Ve;if(e instanceof ut)return Ke;if(e instanceof ct)return Ye;if(e instanceof dt)return Qe;if(Array.isArray(e)){for(var t,r=e.length,o=0,n=e;o<n.length;o+=1){var i=yt(n[o]);if(t){if(t===i)continue;t=Ze;break}t=i}return et(t||Ze,r)}return He}function mt(e){var t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof lt||e instanceof ct||e instanceof dt?e.toString():JSON.stringify(e)}dt.prototype.toString=function(){return this.name},dt.fromString=function(e){return e?new dt({name:e,available:!1}):null},dt.prototype.serialize=function(){return["image",this.name]};var vt=function(e,t){this.type=e,this.value=t};vt.parse=function(e,t){if(2!==e.length)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!ft(e[1]))return t.error("invalid value");var r=e[1],o=yt(r),n=t.expectedType;return"array"!==o.kind||0!==o.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(o=n),new vt(o,r)},vt.prototype.evaluate=function(){return this.value},vt.prototype.eachChild=function(){},vt.prototype.outputDefined=function(){return!0},vt.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof lt?["rgba"].concat(this.value.toArray()):this.value instanceof ct?this.value.serialize():this.value};var gt=function(e){this.name="ExpressionEvaluationError",this.message=e};gt.prototype.toJSON=function(){return this.message};var bt={string:We,number:Ge,boolean:Be,object:He},xt=function(e,t){this.type=e,this.args=t};xt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,o=1,n=e[0];if("array"===n){var i,a;if(e.length>2){var s=e[1];if("string"!=typeof s||!(s in bt)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=bt[s],o++}else i=Ze;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],o++}r=et(i,a)}else r=bt[n];for(var l=[];o<e.length;o++){var u=t.parse(e[o],o,Ze);if(!u)return null;l.push(u)}return new xt(r,l)},xt.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!ot(this.type,yt(r)))return r;if(t===this.args.length-1)throw new gt("Expected value to be of type "+tt(this.type)+", but found "+tt(yt(r))+" instead.")}return null},xt.prototype.eachChild=function(e){this.args.forEach(e)},xt.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},xt.prototype.serialize=function(){var e=this.type,t=[e.kind];if("array"===e.kind){var r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){t.push(r.kind);var o=e.N;("number"==typeof o||this.args.length>1)&&t.push(o)}}return t.concat(this.args.map(function(e){return e.serialize()}))};var wt=function(e){this.type=Ye,this.sections=e};wt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");for(var o=[],n=!1,i=1;i<=e.length-1;++i){var a=e[i];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;var s=null;if(a["font-scale"]&&!(s=t.parse(a["font-scale"],1,Ge)))return null;var l=null;if(a["text-font"]&&!(l=t.parse(a["text-font"],1,et(We))))return null;var u=null;if(a["text-color"]&&!(u=t.parse(a["text-color"],1,Ve)))return null;var p=o[o.length-1];p.scale=s,p.font=l,p.textColor=u}else{var c=t.parse(e[i],1,Ze);if(!c)return null;var d=c.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,o.push({content:c,scale:null,font:null,textColor:null})}}return new wt(o)},wt.prototype.evaluate=function(e){return new ct(this.sections.map(function(t){var r=t.content.evaluate(e);return yt(r)===Qe?new pt("",r,null,null,null):new pt(mt(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)}))},wt.prototype.eachChild=function(e){for(var t=0,r=this.sections;t<r.length;t+=1){var o=r[t];e(o.content),o.scale&&e(o.scale),o.font&&e(o.font),o.textColor&&e(o.textColor)}},wt.prototype.outputDefined=function(){return!1},wt.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var o=r[t];e.push(o.content.serialize());var n={};o.scale&&(n["font-scale"]=o.scale.serialize()),o.font&&(n["text-font"]=o.font.serialize()),o.textColor&&(n["text-color"]=o.textColor.serialize()),e.push(n)}return e};var kt=function(e){this.type=Qe,this.input=e};kt.parse=function(e,t){if(2!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,We);return r?new kt(r):t.error("No image name provided.")},kt.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=dt.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},kt.prototype.eachChild=function(e){e(this.input)},kt.prototype.outputDefined=function(){return!1},kt.prototype.serialize=function(){return["image",this.input.serialize()]};var jt={"to-boolean":Be,"to-color":Ve,"to-number":Ge,"to-string":We},zt=function(e,t){this.type=e,this.args=t};zt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");for(var o=jt[r],n=[],i=1;i<e.length;i++){var a=t.parse(e[i],i,Ze);if(!a)return null;n.push(a)}return new zt(o,n)},zt.prototype.evaluate=function(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){for(var t,r,o=0,n=this.args;o<n.length;o+=1){if(r=null,(t=n[o].evaluate(e))instanceof lt)return t;if("string"==typeof t){var i=e.parseColor(t);if(i)return i}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":ht(t[0],t[1],t[2],t[3])))return new lt(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new gt(r||"Could not parse color from value '"+("string"==typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s<l.length;s+=1){if(null===(a=l[s].evaluate(e)))return 0;var u=Number(a);if(!isNaN(u))return u}throw new gt("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?ct.fromString(mt(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?dt.fromString(mt(this.args[0].evaluate(e))):mt(this.args[0].evaluate(e))},zt.prototype.eachChild=function(e){this.args.forEach(e)},zt.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},zt.prototype.serialize=function(){if("formatted"===this.type.kind)return new wt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new kt(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild(function(t){e.push(t.serialize())}),e};var St=["Unknown","Point","LineString","Polygon"],Tt=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Tt.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Tt.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?St[this.feature.type]:this.feature.type:null},Tt.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Tt.prototype.canonicalID=function(){return this.canonical},Tt.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Tt.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=lt.parse(e)),t};var _t=function(e,t,r,o){this.name=e,this.type=t,this._evaluate=r,this.args=o};function At(e){return Array.isArray(e)?"("+e.map(tt).join(", ")+")":"("+tt(e.type)+"...)"}_t.prototype.evaluate=function(e){return this._evaluate(e,this.args)},_t.prototype.eachChild=function(e){this.args.forEach(e)},_t.prototype.outputDefined=function(){return!1},_t.prototype.serialize=function(){return[this.name].concat(this.args.map(function(e){return e.serialize()}))},_t.parse=function(e,t){var r,o=e[0],n=_t.definitions[o];if(!n)return t.error('Unknown expression "'+o+'". If you wanted a literal array, use ["literal", [...]].',0);for(var i=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=a.filter(function(t){var r=t[0];return!Array.isArray(r)||r.length===e.length-1}),l=null,u=0,p=s;u<p.length;u+=1){var c=p[u],d=c[0],h=c[1];l=new ir(t.registry,t.path,null,t.scope);for(var f=[],y=!1,m=1;m<e.length;m++){var v=e[m],g=Array.isArray(d)?d[m-1]:d.type,b=l.parse(v,1+f.length,g);if(!b){y=!0;break}f.push(b)}if(!y)if(Array.isArray(d)&&d.length!==f.length)l.error("Expected "+d.length+" arguments, but found "+f.length+" instead.");else{for(var x=0;x<f.length;x++){var w=Array.isArray(d)?d[x]:d.type,k=f[x];l.concat(x+1).checkSubtype(w,k.type)}if(0===l.errors.length)return new _t(o,i,h,f)}}if(1===s.length)(r=t.errors).push.apply(r,l.errors);else{for(var j=(s.length?s:a).map(function(e){return At(e[0])}).join(" | "),z=[],S=1;S<e.length;S++){var T=t.parse(e[S],1+z.length);if(!T)return null;z.push(tt(T.type))}t.error("Expected arguments of type "+j+", but found ("+z.join(", ")+") instead.")}return null},_t.register=function(e,t){for(var r in _t.definitions=t,t)e[r]=_t};var It=function(e,t,r){this.type=Ke,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t};It.parse=function(e,t){if(2!==e.length)return t.error("Expected one argument.");var r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");var o=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Be);if(!o)return null;var n=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Be);if(!n)return null;var i=null;return r.locale&&!(i=t.parse(r.locale,1,We))?null:new It(o,n,i)},It.prototype.evaluate=function(e){return new ut(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},It.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},It.prototype.outputDefined=function(){return!1},It.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var Ot=8192;function Ct(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function qt(e){return(180+e)/360}function Et(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Mt(e,t){return!(e[0]<=t[0])&&(!(e[2]>=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function Nt(e,t){var r=qt(e[0]),o=Et(e[1]),n=Math.pow(2,t.z);return[Math.round(r*n*Ot),Math.round(o*n*Ot)]}function Pt(e,t,r){var o=e[0]-t[0],n=e[1]-t[1],i=e[0]-r[0],a=e[1]-r[1];return o*a-i*n==0&&o*i<=0&&n*a<=0}function Rt(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Lt(e,t){for(var r=!1,o=0,n=t.length;o<n;o++)for(var i=t[o],a=0,s=i.length;a<s-1;a++){if(Pt(e,i[a],i[a+1]))return!1;Rt(e,i[a],i[a+1])&&(r=!r)}return r}function Dt(e,t){for(var r=0;r<t.length;r++)if(Lt(e,t[r]))return!0;return!1}function Ft(e,t){return e[0]*t[1]-e[1]*t[0]}function $t(e,t,r,o){var n=e[0]-r[0],i=e[1]-r[1],a=t[0]-r[0],s=t[1]-r[1],l=o[0]-r[0],u=o[1]-r[1],p=n*u-l*i,c=a*u-l*s;return p>0&&c<0||p<0&&c>0}function Ut(e,t,r,o){var n=[t[0]-e[0],t[1]-e[1]];return 0!==Ft([o[0]-r[0],o[1]-r[1]],n)&&!(!$t(e,t,r,o)||!$t(r,o,e,t))}function Jt(e,t,r){for(var o=0,n=r;o<n.length;o+=1)for(var i=n[o],a=0;a<i.length-1;++a)if(Ut(e,t,i[a],i[a+1]))return!0;return!1}function Gt(e,t){for(var r=0;r<e.length;++r)if(!Lt(e[r],t))return!1;for(var o=0;o<e.length-1;++o)if(Jt(e[o],e[o+1],t))return!1;return!0}function Wt(e,t){for(var r=0;r<t.length;r++)if(Gt(e,t[r]))return!0;return!1}function Bt(e,t,r){for(var o=[],n=0;n<e.length;n++){for(var i=[],a=0;a<e[n].length;a++){var s=Nt(e[n][a],r);Ct(t,s),i.push(s)}o.push(i)}return o}function Vt(e,t,r){for(var o=[],n=0;n<e.length;n++){var i=Bt(e[n],t,r);o.push(i)}return o}function Ht(e,t,r,o){if(e[0]<r[0]||e[0]>r[2]){var n=.5*o,i=e[0]-r[0]>n?-o:r[0]-e[0]>n?o:0;0===i&&(i=e[0]-r[2]>n?-o:r[2]-e[0]>n?o:0),e[0]+=i}Ct(t,e)}function Zt(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function Xt(e,t,r,o){for(var n=Math.pow(2,o.z)*Ot,i=[o.x*Ot,o.y*Ot],a=[],s=0,l=e;s<l.length;s+=1)for(var u=0,p=l[s];u<p.length;u+=1){var c=p[u],d=[c.x+i[0],c.y+i[1]];Ht(d,t,r,n),a.push(d)}return a}function Kt(e,t,r,o){for(var n=Math.pow(2,o.z)*Ot,i=[o.x*Ot,o.y*Ot],a=[],s=0,l=e;s<l.length;s+=1){for(var u=[],p=0,c=l[s];p<c.length;p+=1){var d=c[p],h=[d.x+i[0],d.y+i[1]];Ct(t,h),u.push(h)}a.push(u)}if(t[2]-t[0]<=n/2){Zt(t);for(var f=0,y=a;f<y.length;f+=1)for(var m=0,v=y[f];m<v.length;m+=1){Ht(v[m],t,r,n)}}return a}function Yt(e,t){var r=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){var i=Bt(t.coordinates,o,n),a=Xt(e.geometry(),r,o,n);if(!Mt(r,o))return!1;for(var s=0,l=a;s<l.length;s+=1){if(!Lt(l[s],i))return!1}}if("MultiPolygon"===t.type){var u=Vt(t.coordinates,o,n),p=Xt(e.geometry(),r,o,n);if(!Mt(r,o))return!1;for(var c=0,d=p;c<d.length;c+=1){if(!Dt(d[c],u))return!1}}return!0}function Qt(e,t){var r=[1/0,1/0,-1/0,-1/0],o=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){var i=Bt(t.coordinates,o,n),a=Kt(e.geometry(),r,o,n);if(!Mt(r,o))return!1;for(var s=0,l=a;s<l.length;s+=1){if(!Gt(l[s],i))return!1}}if("MultiPolygon"===t.type){var u=Vt(t.coordinates,o,n),p=Kt(e.geometry(),r,o,n);if(!Mt(r,o))return!1;for(var c=0,d=p;c<d.length;c+=1){if(!Wt(d[c],u))return!1}}return!0}var er=function(e,t){this.type=Be,this.geojson=e,this.geometries=t};function tr(e){if(e instanceof _t){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof er)return!1;var t=!0;return e.eachChild(function(e){t&&!tr(e)&&(t=!1)}),t}function rr(e){if(e instanceof _t&&"feature-state"===e.name)return!1;var t=!0;return e.eachChild(function(e){t&&!rr(e)&&(t=!1)}),t}function or(e,t){if(e instanceof _t&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild(function(e){r&&!or(e,t)&&(r=!1)}),r}er.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(ft(e[1])){var r=e[1];if("FeatureCollection"===r.type)for(var o=0;o<r.features.length;++o){var n=r.features[o].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new er(r,r.features[o].geometry)}else if("Feature"===r.type){var i=r.geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new er(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new er(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},er.prototype.evaluate=function(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return Yt(e,this.geometries);if("LineString"===e.geometryType())return Qt(e,this.geometries)}return!1},er.prototype.eachChild=function(){},er.prototype.outputDefined=function(){return!0},er.prototype.serialize=function(){return["within",this.geojson]};var nr=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};nr.parse=function(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new nr(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},nr.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},nr.prototype.eachChild=function(){},nr.prototype.outputDefined=function(){return!1},nr.prototype.serialize=function(){return["var",this.name]};var ir=function(e,t,r,o,n){void 0===t&&(t=[]),void 0===o&&(o=new Ue),void 0===n&&(n=[]),this.registry=e,this.path=t,this.key=t.map(function(e){return"["+e+"]"}).join(""),this.scope=o,this.errors=n,this.expectedType=r};function ar(e){if(e instanceof nr)return ar(e.boundExpression);if(e instanceof _t&&"error"===e.name)return!1;if(e instanceof It)return!1;if(e instanceof er)return!1;var t=e instanceof zt||e instanceof xt,r=!0;return e.eachChild(function(e){r=t?r&&ar(e):r&&e instanceof vt}),!!r&&(tr(e)&&or(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]))}function sr(e,t){for(var r,o,n=e.length-1,i=0,a=n,s=0;i<=a;)if(r=e[s=Math.floor((i+a)/2)],o=e[s+1],r<=t){if(s===n||t<o)return s;i=s+1}else{if(!(r>t))throw new gt("Input is not a number.");a=s-1}return 0}ir.prototype.parse=function(e,t,r,o,n){return void 0===n&&(n={}),t?this.concat(t,r,o)._parse(e,n):this._parse(e,n)},ir.prototype._parse=function(e,t){function r(e,t,r){return"assert"===r?new xt(t,[e]):"coerce"===r?new zt(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var o=e[0];if("string"!=typeof o)return this.error("Expression name must be a string, but found "+typeof o+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[o];if(n){var i=n.parse(e,this);if(!i)return null;if(this.expectedType){var a=this.expectedType,s=i.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else i=r(i,a,t.typeAnnotation||"coerce");else i=r(i,a,t.typeAnnotation||"assert")}if(!(i instanceof vt)&&"resolvedImage"!==i.type.kind&&ar(i)){var l=new Tt;try{i=new vt(i.type,i.evaluate(l))}catch(u){return this.error(u.message),null}}return i}return this.error('Unknown expression "'+o+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},ir.prototype.concat=function(e,t,r){var o="number"==typeof e?this.path.concat(e):this.path,n=r?this.scope.concat(r):this.scope;return new ir(this.registry,o,t||null,n,this.errors)},ir.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var o=""+this.key+t.map(function(e){return"["+e+"]"}).join("");this.errors.push(new $e(o,e))},ir.prototype.checkSubtype=function(e,t){var r=ot(e,t);return r&&this.error(r),r};var lr=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var o=0,n=r;o<n.length;o+=1){var i=n[o],a=i[0],s=i[1];this.labels.push(a),this.outputs.push(s)}};lr.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var r=t.parse(e[1],1,Ge);if(!r)return null;var o=[],n=null;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var i=1;i<e.length;i+=2){var a=1===i?-1/0:e[i],s=e[i+1],l=i,u=i+1;if("number"!=typeof a)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(o.length&&o[o.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var p=t.parse(s,u,n);if(!p)return null;n=n||p.type,o.push([a,p])}return new lr(n,r,o)},lr.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var o=this.input.evaluate(e);if(o<=t[0])return r[0].evaluate(e);var n=t.length;return o>=t[n-1]?r[n-1].evaluate(e):r[sr(t,o)].evaluate(e)},lr.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1){e(r[t])}},lr.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},lr.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var ur=pr;function pr(e,t,r,o){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(o-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=o,this.p2x=r,this.p2y=o}function cr(e,t,r){return e*(1-r)+t*r}function dr(e,t,r){return new lt(cr(e.r,t.r,r),cr(e.g,t.g,r),cr(e.b,t.b,r),cr(e.a,t.a,r))}function hr(e,t,r){return e.map(function(e,o){return cr(e,t[o],r)})}pr.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},pr.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},pr.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},pr.prototype.solveCurveX=function(e,t){var r,o,n,i,a;for(void 0===t&&(t=1e-6),n=e,a=0;a<8;a++){if(i=this.sampleCurveX(n)-e,Math.abs(i)<t)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=i/s}if((n=e)<(r=0))return r;if(n>(o=1))return o;for(;r<o;){if(i=this.sampleCurveX(n),Math.abs(i-e)<t)return n;e>i?r=n:o=n,n=.5*(o-r)+r}return n},pr.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var fr=Object.freeze({__proto__:null,number:cr,color:dr,array:hr}),yr=.95047,mr=1,vr=1.08883,gr=4/29,br=6/29,xr=3*br*br,wr=br*br*br,kr=Math.PI/180,jr=180/Math.PI;function zr(e){return e>wr?Math.pow(e,1/3):e/xr+gr}function Sr(e){return e>br?e*e*e:xr*(e-gr)}function Tr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function _r(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ar(e){var t=_r(e.r),r=_r(e.g),o=_r(e.b),n=zr((.4124564*t+.3575761*r+.1804375*o)/yr),i=zr((.2126729*t+.7151522*r+.072175*o)/mr);return{l:116*i-16,a:500*(n-i),b:200*(i-zr((.0193339*t+.119192*r+.9503041*o)/vr)),alpha:e.a}}function Ir(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,o=isNaN(e.b)?t:t-e.b/200;return t=mr*Sr(t),r=yr*Sr(r),o=vr*Sr(o),new lt(Tr(3.2404542*r-1.5371385*t-.4985314*o),Tr(-.969266*r+1.8760108*t+.041556*o),Tr(.0556434*r-.2040259*t+1.0572252*o),e.alpha)}function Or(e,t,r){return{l:cr(e.l,t.l,r),a:cr(e.a,t.a,r),b:cr(e.b,t.b,r),alpha:cr(e.alpha,t.alpha,r)}}function Cr(e){var t=Ar(e),r=t.l,o=t.a,n=t.b,i=Math.atan2(n,o)*jr;return{h:i<0?i+360:i,c:Math.sqrt(o*o+n*n),l:r,alpha:e.a}}function qr(e){var t=e.h*kr,r=e.c;return Ir({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})}function Er(e,t,r){var o=t-e;return e+r*(o>180||o<-180?o-360*Math.round(o/360):o)}function Mr(e,t,r){return{h:Er(e.h,t.h,r),c:cr(e.c,t.c,r),l:cr(e.l,t.l,r),alpha:cr(e.alpha,t.alpha,r)}}var Nr={forward:Ar,reverse:Ir,interpolate:Or},Pr={forward:Cr,reverse:qr,interpolate:Mr},Rr=Object.freeze({__proto__:null,lab:Nr,hcl:Pr}),Lr=function(e,t,r,o,n){this.type=e,this.operator=t,this.interpolation=r,this.input=o,this.labels=[],this.outputs=[];for(var i=0,a=n;i<a.length;i+=1){var s=a[i],l=s[0],u=s[1];this.labels.push(l),this.outputs.push(u)}};function Dr(e,t,r,o){var n=o-r,i=e-r;return 0===n?0:1===t?i/n:(Math.pow(t,i)-1)/(Math.pow(t,n)-1)}Lr.interpolationFactor=function(e,t,r,o){var n=0;if("exponential"===e.name)n=Dr(t,e.base,r,o);else if("linear"===e.name)n=Dr(t,1,r,o);else if("cubic-bezier"===e.name){var i=e.controlPoints;n=new ur(i[0],i[1],i[2],i[3]).solve(Dr(t,1,r,o))}return n},Lr.parse=function(e,t){var r=e[0],o=e[1],n=e[2],i=e.slice(3);if(!Array.isArray(o)||0===o.length)return t.error("Expected an interpolation type expression.",1);if("linear"===o[0])o={name:"linear"};else if("exponential"===o[0]){var a=o[1];if("number"!=typeof a)return t.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:a}}else{if("cubic-bezier"!==o[0])return t.error("Unknown interpolation type "+String(o[0]),1,0);var s=o.slice(1);if(4!==s.length||s.some(function(e){return"number"!=typeof e||e<0||e>1}))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(n=t.parse(n,2,Ge)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=Ve:t.expectedType&&"value"!==t.expectedType.kind&&(u=t.expectedType);for(var p=0;p<i.length;p+=2){var c=i[p],d=i[p+1],h=p+3,f=p+4;if("number"!=typeof c)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',h);if(l.length&&l[l.length-1][0]>=c)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);var y=t.parse(d,f,u);if(!y)return null;u=u||y.type,l.push([c,y])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new Lr(u,r,o,n,l):t.error("Type "+tt(u)+" is not interpolatable.")},Lr.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var o=this.input.evaluate(e);if(o<=t[0])return r[0].evaluate(e);var n=t.length;if(o>=t[n-1])return r[n-1].evaluate(e);var i=sr(t,o),a=t[i],s=t[i+1],l=Lr.interpolationFactor(this.interpolation,o,a,s),u=r[i].evaluate(e),p=r[i+1].evaluate(e);return"interpolate"===this.operator?fr[this.type.kind.toLowerCase()](u,p,l):"interpolate-hcl"===this.operator?Pr.reverse(Pr.interpolate(Pr.forward(u),Pr.forward(p),l)):Nr.reverse(Nr.interpolate(Nr.forward(u),Nr.forward(p),l))},Lr.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1){e(r[t])}},Lr.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},Lr.prototype.serialize=function(){var e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],r=0;r<this.labels.length;r++)t.push(this.labels[r],this.outputs[r].serialize());return t};var Fr=function(e,t){this.type=e,this.args=t};Fr.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null,o=t.expectedType;o&&"value"!==o.kind&&(r=o);for(var n=[],i=0,a=e.slice(1);i<a.length;i+=1){var s=a[i],l=t.parse(s,1+n.length,r,void 0,{typeAnnotation:"omit"});if(!l)return null;r=r||l.type,n.push(l)}var u=o&&n.some(function(e){return ot(o,e.type)});return new Fr(u?Ze:r,n)},Fr.prototype.evaluate=function(e){for(var t,r=null,o=0,n=0,i=this.args;n<i.length;n+=1){if(o++,(r=i[n].evaluate(e))&&r instanceof dt&&!r.available&&(t||(t=r.name),r=null,o===this.args.length&&(r=t)),null!==r)break}return r},Fr.prototype.eachChild=function(e){this.args.forEach(e)},Fr.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},Fr.prototype.serialize=function(){var e=["coalesce"];return this.eachChild(function(t){e.push(t.serialize())}),e};var $r=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};$r.prototype.evaluate=function(e){return this.result.evaluate(e)},$r.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1){e(r[t][1])}e(this.result)},$r.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var r=[],o=1;o<e.length-1;o+=2){var n=e[o];if("string"!=typeof n)return t.error("Expected string, but found "+typeof n+" instead.",o);if(/[^a-zA-Z0-9_]/.test(n))return t.error("Variable names must contain only alphanumeric characters or '_'.",o);var i=t.parse(e[o+1],o+1);if(!i)return null;r.push([n,i])}var a=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return a?new $r(r,a):null},$r.prototype.outputDefined=function(){return this.result.outputDefined()},$r.prototype.serialize=function(){for(var e=["let"],t=0,r=this.bindings;t<r.length;t+=1){var o=r[t],n=o[0],i=o[1];e.push(n,i.serialize())}return e.push(this.result.serialize()),e};var Ur=function(e,t,r){this.type=e,this.index=t,this.input=r};Ur.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ge),o=t.parse(e[2],2,et(t.expectedType||Ze));if(!r||!o)return null;var n=o.type;return new Ur(n.itemType,r,o)},Ur.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new gt("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new gt("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new gt("Array index must be an integer, but found "+t+" instead.");return r[t]},Ur.prototype.eachChild=function(e){e(this.index),e(this.input)},Ur.prototype.outputDefined=function(){return!1},Ur.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Jr=function(e,t){this.type=Be,this.needle=e,this.haystack=t};Jr.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ze),o=t.parse(e[2],2,Ze);return r&&o?nt(r.type,[Be,We,Ge,Je,Ze])?new Jr(r,o):t.error("Expected first argument to be of type boolean, string, number or null, but found "+tt(r.type)+" instead"):null},Jr.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!it(t,["boolean","string","number","null"]))throw new gt("Expected first argument to be of type boolean, string, number or null, but found "+tt(yt(t))+" instead.");if(!it(r,["string","array"]))throw new gt("Expected second argument to be of type array or string, but found "+tt(yt(r))+" instead.");return r.indexOf(t)>=0},Jr.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},Jr.prototype.outputDefined=function(){return!0},Jr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Gr=function(e,t,r){this.type=Ge,this.needle=e,this.haystack=t,this.fromIndex=r};Gr.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ze),o=t.parse(e[2],2,Ze);if(!r||!o)return null;if(!nt(r.type,[Be,We,Ge,Je,Ze]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+tt(r.type)+" instead");if(4===e.length){var n=t.parse(e[3],3,Ge);return n?new Gr(r,o,n):null}return new Gr(r,o)},Gr.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!it(t,["boolean","string","number","null"]))throw new gt("Expected first argument to be of type boolean, string, number or null, but found "+tt(yt(t))+" instead.");if(!it(r,["string","array"]))throw new gt("Expected second argument to be of type array or string, but found "+tt(yt(r))+" instead.");if(this.fromIndex){var o=this.fromIndex.evaluate(e);return r.indexOf(t,o)}return r.indexOf(t)},Gr.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Gr.prototype.outputDefined=function(){return!1},Gr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Wr=function(e,t,r,o,n,i){this.inputType=e,this.type=t,this.input=r,this.cases=o,this.outputs=n,this.otherwise=i};Wr.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var r,o;t.expectedType&&"value"!==t.expectedType.kind&&(o=t.expectedType);for(var n={},i=[],a=2;a<e.length-1;a+=2){var s=e[a],l=e[a+1];Array.isArray(s)||(s=[s]);var u=t.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var p=0,c=s;p<c.length;p+=1){var d=c[p];if("number"!=typeof d&&"string"!=typeof d)return u.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,yt(d)))return null}else r=yt(d);if(void 0!==n[String(d)])return u.error("Branch labels must be unique.");n[String(d)]=i.length}var h=t.parse(l,a,o);if(!h)return null;o=o||h.type,i.push(h)}var f=t.parse(e[1],1,Ze);if(!f)return null;var y=t.parse(e[e.length-1],e.length-1,o);return y?"value"!==f.type.kind&&t.concat(1).checkSubtype(r,f.type)?null:new Wr(r,o,f,n,i,y):null},Wr.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(yt(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},Wr.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},Wr.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})&&this.otherwise.outputDefined()},Wr.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],o={},n=0,i=Object.keys(this.cases).sort();n<i.length;n+=1){var a=i[n];void 0===(c=o[this.cases[a]])?(o[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[c][1].push(a)}for(var s=function(t){return"number"===e.inputType.kind?Number(t):t},l=0,u=r;l<u.length;l+=1){var p=u[l],c=p[0],d=p[1];1===d.length?t.push(s(d[0])):t.push(d.map(s)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var Br=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};Br.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(var o=[],n=1;n<e.length-1;n+=2){var i=t.parse(e[n],n,Be);if(!i)return null;var a=t.parse(e[n+1],n+1,r);if(!a)return null;o.push([i,a]),r=r||a.type}var s=t.parse(e[e.length-1],e.length-1,r);return s?new Br(r,o,s):null},Br.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var o=r[t],n=o[0],i=o[1];if(n.evaluate(e))return i.evaluate(e)}return this.otherwise.evaluate(e)},Br.prototype.eachChild=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var o=r[t],n=o[0],i=o[1];e(n),e(i)}e(this.otherwise)},Br.prototype.outputDefined=function(){return this.branches.every(function(e){e[0];return e[1].outputDefined()})&&this.otherwise.outputDefined()},Br.prototype.serialize=function(){var e=["case"];return this.eachChild(function(t){e.push(t.serialize())}),e};var Vr=function(e,t,r,o){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=o};function Hr(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Zr(e,t,r){return t===r}function Xr(e,t,r){return t!==r}function Kr(e,t,r){return t<r}function Yr(e,t,r){return t>r}function Qr(e,t,r){return t<=r}function eo(e,t,r){return t>=r}function to(e,t,r,o){return 0===o.compare(t,r)}function ro(e,t,r,o){return!to(e,t,r,o)}function oo(e,t,r,o){return o.compare(t,r)<0}function no(e,t,r,o){return o.compare(t,r)>0}function io(e,t,r,o){return o.compare(t,r)<=0}function ao(e,t,r,o){return o.compare(t,r)>=0}function so(e,t,r){var o="=="!==e&&"!="!==e;return function(){function n(e,t,r){this.type=Be,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return n.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var r=e[0],i=t.parse(e[1],1,Ze);if(!i)return null;if(!Hr(r,i.type))return t.concat(1).error('"'+r+"\" comparisons are not supported for type '"+tt(i.type)+"'.");var a=t.parse(e[2],2,Ze);if(!a)return null;if(!Hr(r,a.type))return t.concat(2).error('"'+r+"\" comparisons are not supported for type '"+tt(a.type)+"'.");if(i.type.kind!==a.type.kind&&"value"!==i.type.kind&&"value"!==a.type.kind)return t.error("Cannot compare types '"+tt(i.type)+"' and '"+tt(a.type)+"'.");o&&("value"===i.type.kind&&"value"!==a.type.kind?i=new xt(a.type,[i]):"value"!==i.type.kind&&"value"===a.type.kind&&(a=new xt(i.type,[a])));var s=null;if(4===e.length){if("string"!==i.type.kind&&"string"!==a.type.kind&&"value"!==i.type.kind&&"value"!==a.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,Ke)))return null}return new n(i,a,s)},n.prototype.evaluate=function(n){var i=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(o&&this.hasUntypedArgument){var s=yt(i),l=yt(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new gt('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!o&&this.hasUntypedArgument){var u=yt(i),p=yt(a);if("string"!==u.kind||"string"!==p.kind)return t(n,i,a)}return this.collator?r(n,i,a,this.collator.evaluate(n)):t(n,i,a)},n.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},n.prototype.outputDefined=function(){return!0},n.prototype.serialize=function(){var t=[e];return this.eachChild(function(e){t.push(e.serialize())}),t},n}()}Vr.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ze),o=t.parse(e[2],2,Ge);if(!r||!o)return null;if(!nt(r.type,[et(Ze),We,Ze]))return t.error("Expected first argument to be of type array or string, but found "+tt(r.type)+" instead");if(4===e.length){var n=t.parse(e[3],3,Ge);return n?new Vr(r.type,r,o,n):null}return new Vr(r.type,r,o)},Vr.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!it(t,["string","array"]))throw new gt("Expected first argument to be of type array or string, but found "+tt(yt(t))+" instead.");if(this.endIndex){var o=this.endIndex.evaluate(e);return t.slice(r,o)}return t.slice(r)},Vr.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Vr.prototype.outputDefined=function(){return!1},Vr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var lo=so("==",Zr,to),uo=so("!=",Xr,ro),po=so("<",Kr,oo),co=so(">",Yr,no),ho=so("<=",Qr,io),fo=so(">=",eo,ao),yo=function(e,t,r,o,n){this.type=We,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=o,this.maxFractionDigits=n};yo.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Ge);if(!r)return null;var o=e[2];if("object"!=typeof o||Array.isArray(o))return t.error("NumberFormat options argument must be an object.");var n=null;if(o.locale&&!(n=t.parse(o.locale,1,We)))return null;var i=null;if(o.currency&&!(i=t.parse(o.currency,1,We)))return null;var a=null;if(o["min-fraction-digits"]&&!(a=t.parse(o["min-fraction-digits"],1,Ge)))return null;var s=null;return o["max-fraction-digits"]&&!(s=t.parse(o["max-fraction-digits"],1,Ge))?null:new yo(r,n,i,a,s)},yo.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},yo.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},yo.prototype.outputDefined=function(){return!1},yo.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var mo=function(e){this.type=Ge,this.input=e};mo.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error("Expected argument of type string or array, but found "+tt(r.type)+" instead."):new mo(r):null},mo.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new gt("Expected value to be of type string or array, but found "+tt(yt(t))+" instead.")},mo.prototype.eachChild=function(e){e(this.input)},mo.prototype.outputDefined=function(){return!1},mo.prototype.serialize=function(){var e=["length"];return this.eachChild(function(t){e.push(t.serialize())}),e};var vo={"==":lo,"!=":uo,">":co,"<":po,">=":fo,"<=":ho,array:xt,at:Ur,boolean:xt,case:Br,coalesce:Fr,collator:It,format:wt,image:kt,in:Jr,"index-of":Gr,interpolate:Lr,"interpolate-hcl":Lr,"interpolate-lab":Lr,length:mo,let:$r,literal:vt,match:Wr,number:xt,"number-format":yo,object:xt,slice:Vr,step:lr,string:xt,"to-boolean":zt,"to-color":zt,"to-number":zt,"to-string":zt,var:nr,within:er};function go(e,t){var r=t[0],o=t[1],n=t[2],i=t[3];r=r.evaluate(e),o=o.evaluate(e),n=n.evaluate(e);var a=i?i.evaluate(e):1,s=ht(r,o,n,a);if(s)throw new gt(s);return new lt(r/255*a,o/255*a,n/255*a,a)}function bo(e,t){return e in t}function xo(e,t){var r=t[e];return void 0===r?null:r}function wo(e,t,r,o){for(;r<=o;){var n=r+o>>1;if(t[n]===e)return!0;t[n]>e?o=n-1:r=n+1}return!1}function ko(e){return{type:e}}function jo(e){return{result:"success",value:e}}function zo(e){return{result:"error",value:e}}function So(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function To(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function _o(e){return!!e.expression&&e.expression.interpolated}function Ao(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Io(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Oo(e){return e}function Co(e,t){var r,o,n,i="color"===t.type,a=e.stops&&"object"==typeof e.stops[0][0],s=a||void 0!==e.property,l=a||!s,u=e.type||(_o(t)?"exponential":"interval");if(i&&((e=Fe({},e)).stops&&(e.stops=e.stops.map(function(e){return[e[0],lt.parse(e[1])]})),e.default?e.default=lt.parse(e.default):e.default=lt.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Rr[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===u)r=No;else if("interval"===u)r=Mo;else if("categorical"===u){r=Eo,o=Object.create(null);for(var p=0,c=e.stops;p<c.length;p+=1){var d=c[p];o[d[0]]=d[1]}n=typeof e.stops[0][0]}else{if("identity"!==u)throw new Error('Unknown function type "'+u+'"');r=Po}if(a){for(var h={},f=[],y=0;y<e.stops.length;y++){var m=e.stops[y],v=m[0].zoom;void 0===h[v]&&(h[v]={zoom:v,type:e.type,property:e.property,default:e.default,stops:[]},f.push(v)),h[v].stops.push([m[0].value,m[1]])}for(var g=[],b=0,x=f;b<x.length;b+=1){var w=x[b];g.push([h[w].zoom,Co(h[w],t)])}var k={name:"linear"};return{kind:"composite",interpolationType:k,interpolationFactor:Lr.interpolationFactor.bind(void 0,k),zoomStops:g.map(function(e){return e[0]}),evaluate:function(r,o){var n=r.zoom;return No({stops:g,base:e.base},t,n).evaluate(n,o)}}}if(l){var j="exponential"===u?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:j,interpolationFactor:Lr.interpolationFactor.bind(void 0,j),zoomStops:e.stops.map(function(e){return e[0]}),evaluate:function(i){var a=i.zoom;return r(e,t,a,o,n)}}}return{kind:"source",evaluate:function(i,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?qo(e.default,t.default):r(e,t,s,o,n)}}}function qo(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function Eo(e,t,r,o,n){return qo(typeof r===n?o[r]:void 0,e.default,t.default)}function Mo(e,t,r){if("number"!==Ao(r))return qo(e.default,t.default);var o=e.stops.length;if(1===o)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[o-1][0])return e.stops[o-1][1];var n=sr(e.stops.map(function(e){return e[0]}),r);return e.stops[n][1]}function No(e,t,r){var o=void 0!==e.base?e.base:1;if("number"!==Ao(r))return qo(e.default,t.default);var n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];var i=sr(e.stops.map(function(e){return e[0]}),r),a=Ro(r,o,e.stops[i][0],e.stops[i+1][0]),s=e.stops[i][1],l=e.stops[i+1][1],u=fr[t.type]||Oo;if(e.colorSpace&&"rgb"!==e.colorSpace){var p=Rr[e.colorSpace];u=function(e,t){return p.reverse(p.interpolate(p.forward(e),p.forward(t),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=s.evaluate.apply(void 0,e),o=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==o)return u(r,o,a)}}:u(s,l,a)}function Po(e,t,r){return"color"===t.type?r=lt.parse(r):"formatted"===t.type?r=ct.fromString(r.toString()):"resolvedImage"===t.type?r=dt.fromString(r.toString()):Ao(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),qo(r,e.default,t.default)}function Ro(e,t,r,o){var n=o-r,i=e-r;return 0===n?0:1===t?i/n:(Math.pow(t,i)-1)/(Math.pow(t,n)-1)}_t.register(vo,{error:[Xe,[We],function(e,t){var r=t[0];throw new gt(r.evaluate(e))}],typeof:[We,[Ze],function(e,t){return tt(yt(t[0].evaluate(e)))}],"to-rgba":[et(Ge,4),[Ve],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Ve,[Ge,Ge,Ge],go],rgba:[Ve,[Ge,Ge,Ge,Ge],go],has:{type:Be,overloads:[[[We],function(e,t){return bo(t[0].evaluate(e),e.properties())}],[[We,He],function(e,t){var r=t[0],o=t[1];return bo(r.evaluate(e),o.evaluate(e))}]]},get:{type:Ze,overloads:[[[We],function(e,t){return xo(t[0].evaluate(e),e.properties())}],[[We,He],function(e,t){var r=t[0],o=t[1];return xo(r.evaluate(e),o.evaluate(e))}]]},"feature-state":[Ze,[We],function(e,t){return xo(t[0].evaluate(e),e.featureState||{})}],properties:[He,[],function(e){return e.properties()}],"geometry-type":[We,[],function(e){return e.geometryType()}],id:[Ze,[],function(e){return e.id()}],zoom:[Ge,[],function(e){return e.globals.zoom}],"heatmap-density":[Ge,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[Ge,[],function(e){return e.globals.lineProgress||0}],accumulated:[Ze,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[Ge,ko(Ge),function(e,t){for(var r=0,o=0,n=t;o<n.length;o+=1){r+=n[o].evaluate(e)}return r}],"*":[Ge,ko(Ge),function(e,t){for(var r=1,o=0,n=t;o<n.length;o+=1){r*=n[o].evaluate(e)}return r}],"-":{type:Ge,overloads:[[[Ge,Ge],function(e,t){var r=t[0],o=t[1];return r.evaluate(e)-o.evaluate(e)}],[[Ge],function(e,t){return-t[0].evaluate(e)}]]},"/":[Ge,[Ge,Ge],function(e,t){var r=t[0],o=t[1];return r.evaluate(e)/o.evaluate(e)}],"%":[Ge,[Ge,Ge],function(e,t){var r=t[0],o=t[1];return r.evaluate(e)%o.evaluate(e)}],ln2:[Ge,[],function(){return Math.LN2}],pi:[Ge,[],function(){return Math.PI}],e:[Ge,[],function(){return Math.E}],"^":[Ge,[Ge,Ge],function(e,t){var r=t[0],o=t[1];return Math.pow(r.evaluate(e),o.evaluate(e))}],sqrt:[Ge,[Ge],function(e,t){var r=t[0];return Math.sqrt(r.evaluate(e))}],log10:[Ge,[Ge],function(e,t){var r=t[0];return Math.log(r.evaluate(e))/Math.LN10}],ln:[Ge,[Ge],function(e,t){var r=t[0];return Math.log(r.evaluate(e))}],log2:[Ge,[Ge],function(e,t){var r=t[0];return Math.log(r.evaluate(e))/Math.LN2}],sin:[Ge,[Ge],function(e,t){var r=t[0];return Math.sin(r.evaluate(e))}],cos:[Ge,[Ge],function(e,t){var r=t[0];return Math.cos(r.evaluate(e))}],tan:[Ge,[Ge],function(e,t){var r=t[0];return Math.tan(r.evaluate(e))}],asin:[Ge,[Ge],function(e,t){var r=t[0];return Math.asin(r.evaluate(e))}],acos:[Ge,[Ge],function(e,t){var r=t[0];return Math.acos(r.evaluate(e))}],atan:[Ge,[Ge],function(e,t){var r=t[0];return Math.atan(r.evaluate(e))}],min:[Ge,ko(Ge),function(e,t){return Math.min.apply(Math,t.map(function(t){return t.evaluate(e)}))}],max:[Ge,ko(Ge),function(e,t){return Math.max.apply(Math,t.map(function(t){return t.evaluate(e)}))}],abs:[Ge,[Ge],function(e,t){var r=t[0];return Math.abs(r.evaluate(e))}],round:[Ge,[Ge],function(e,t){var r=t[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ge,[Ge],function(e,t){var r=t[0];return Math.floor(r.evaluate(e))}],ceil:[Ge,[Ge],function(e,t){var r=t[0];return Math.ceil(r.evaluate(e))}],"filter-==":[Be,[We,Ze],function(e,t){var r=t[0],o=t[1];return e.properties()[r.value]===o.value}],"filter-id-==":[Be,[Ze],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[Be,[We],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[Be,[We,Ze],function(e,t){var r=t[0],o=t[1],n=e.properties()[r.value],i=o.value;return typeof n==typeof i&&n<i}],"filter-id-<":[Be,[Ze],function(e,t){var r=t[0],o=e.id(),n=r.value;return typeof o==typeof n&&o<n}],"filter->":[Be,[We,Ze],function(e,t){var r=t[0],o=t[1],n=e.properties()[r.value],i=o.value;return typeof n==typeof i&&n>i}],"filter-id->":[Be,[Ze],function(e,t){var r=t[0],o=e.id(),n=r.value;return typeof o==typeof n&&o>n}],"filter-<=":[Be,[We,Ze],function(e,t){var r=t[0],o=t[1],n=e.properties()[r.value],i=o.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[Be,[Ze],function(e,t){var r=t[0],o=e.id(),n=r.value;return typeof o==typeof n&&o<=n}],"filter->=":[Be,[We,Ze],function(e,t){var r=t[0],o=t[1],n=e.properties()[r.value],i=o.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[Be,[Ze],function(e,t){var r=t[0],o=e.id(),n=r.value;return typeof o==typeof n&&o>=n}],"filter-has":[Be,[Ze],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Be,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[Be,[et(We)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Be,[et(Ze)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Be,[We,et(Ze)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[Be,[We,et(Ze)],function(e,t){var r=t[0],o=t[1];return wo(e.properties()[r.value],o.value,0,o.value.length-1)}],all:{type:Be,overloads:[[[Be,Be],function(e,t){var r=t[0],o=t[1];return r.evaluate(e)&&o.evaluate(e)}],[ko(Be),function(e,t){for(var r=0,o=t;r<o.length;r+=1){if(!o[r].evaluate(e))return!1}return!0}]]},any:{type:Be,overloads:[[[Be,Be],function(e,t){var r=t[0],o=t[1];return r.evaluate(e)||o.evaluate(e)}],[ko(Be),function(e,t){for(var r=0,o=t;r<o.length;r+=1){if(o[r].evaluate(e))return!0}return!1}]]},"!":[Be,[Be],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[Be,[We],function(e,t){var r=t[0],o=e.globals&&e.globals.isSupportedScript;return!o||o(r.evaluate(e))}],upcase:[We,[We],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[We,[We],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[We,ko(Ze),function(e,t){return t.map(function(t){return mt(t.evaluate(e))}).join("")}],"resolved-locale":[We,[Ke],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var Lo=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Tt,this._defaultValue=t?Ho(t):null,this._enumValues=t&&"enum"===t.type?t.values:null};function Do(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in vo}function Fo(e,t){var r=new ir(vo,[],t?Vo(t):void 0),o=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?jo(new Lo(o,t)):zo(r.errors)}Lo.prototype.evaluateWithoutErrorHandling=function(e,t,r,o,n,i){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=o,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=i,this.expression.evaluate(this._evaluator)},Lo.prototype.evaluate=function(e,t,r,o,n,i){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=o,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=i||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new gt("Expected value to be one of "+Object.keys(this._enumValues).map(function(e){return JSON.stringify(e)}).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!=typeof console&&console.warn(s.message)),this._defaultValue}};var $o=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!rr(t.expression)};$o.prototype.evaluateWithoutErrorHandling=function(e,t,r,o,n,i){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,o,n,i)},$o.prototype.evaluate=function(e,t,r,o,n,i){return this._styleExpression.evaluate(e,t,r,o,n,i)};var Uo=function(e,t,r,o){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!rr(t.expression),this.interpolationType=o};function Jo(e,t){if("error"===(e=Fo(e,t)).result)return e;var r=e.value.expression,o=tr(r);if(!o&&!So(t))return zo([new $e("","data expressions not supported")]);var n=or(r,["zoom"]);if(!n&&!To(t))return zo([new $e("","zoom expressions not supported")]);var i=Bo(r);if(!i&&!n)return zo([new $e("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(i instanceof $e)return zo([i]);if(i instanceof Lr&&!_o(t))return zo([new $e("",'"interpolate" expressions cannot be used with this property')]);if(!i)return jo(new $o(o?"constant":"source",e.value));var a=i instanceof Lr?i.interpolation:void 0;return jo(new Uo(o?"camera":"composite",e.value,i.labels,a))}Uo.prototype.evaluateWithoutErrorHandling=function(e,t,r,o,n,i){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,o,n,i)},Uo.prototype.evaluate=function(e,t,r,o,n,i){return this._styleExpression.evaluate(e,t,r,o,n,i)},Uo.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?Lr.interpolationFactor(this.interpolationType,e,t,r):0};var Go=function(e,t){this._parameters=e,this._specification=t,Fe(this,Co(this._parameters,this._specification))};function Wo(e,t){if(Io(e))return new Go(e,t);if(Do(e)){var r=Jo(e,t);if("error"===r.result)throw new Error(r.value.map(function(e){return e.key+": "+e.message}).join(", "));return r.value}var o=e;return"string"==typeof e&&"color"===t.type&&(o=lt.parse(e)),{kind:"constant",evaluate:function(){return o}}}function Bo(e){var t=null;if(e instanceof $r)t=Bo(e.result);else if(e instanceof Fr)for(var r=0,o=e.args;r<o.length;r+=1){var n=o[r];if(t=Bo(n))break}else(e instanceof lr||e instanceof Lr)&&e.input instanceof _t&&"zoom"===e.input.name&&(t=e);return t instanceof $e?t:(e.eachChild(function(e){var r=Bo(e);r instanceof $e?t=r:!t&&r?t=new $e("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new $e("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t)}function Vo(e){var t={color:Ve,string:We,number:Ge,enum:We,boolean:Be,formatted:Ye,resolvedImage:Qe};return"array"===e.type?et(t[e.value]||Ze,e.length):t[e.type]}function Ho(e){return"color"===e.type&&Io(e.default)?new lt(0,0,0,0):"color"===e.type?lt.parse(e.default)||null:void 0===e.default?null:e.default}function Zo(e){return"object"==typeof e?["literal",e]:e}function Xo(e,t){var r=e.stops;if(!r)return Ko(e,t);var o=r&&"object"==typeof r[0][0],n=o||void 0!==e.property,i=o||!n;return r=r.map(function(e){return!n&&t.tokens&&"string"==typeof e[1]?[e[0],sn(e[1])]:[e[0],Zo(e[1])]}),o?Qo(e,t,r):i?rn(e,t,r):tn(e,t,r)}function Ko(e,t){var r=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",r]:r;if("enum"===t.type)return["match",r,Object.keys(t.values),r,e.default];var o=["color"===t.type?"to-color":t.type,r,Zo(e.default)];return"array"===t.type&&o.splice(1,0,t.value,t.length||null),o}function Yo(e){switch(e.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Qo(e,t,r){for(var o={},n={},i=[],a=0;a<r.length;a++){var s=r[a],l=s[0].zoom;void 0===o[l]&&(o[l]={zoom:l,type:e.type,property:e.property,default:e.default},n[l]=[],i.push(l)),n[l].push([s[0].value,s[1]])}if("exponential"===an({},t)){for(var u=[Yo(e),["linear"],["zoom"]],p=0,c=i;p<c.length;p+=1){var d=c[p];nn(u,d,tn(o[d],t,n[d]),!1)}return u}for(var h=["step",["zoom"]],f=0,y=i;f<y.length;f+=1){var m=y[f];nn(h,m,tn(o[m],t,n[m]),!0)}return on(h),h}function en(e,t){return void 0!==e?e:void 0!==t?t:void 0}function tn(e,t,r){var o=an(e,t),n=["get",e.property];if("categorical"===o&&"boolean"==typeof r[0][0]){for(var i=["case"],a=0,s=r;a<s.length;a+=1){var l=s[a];i.push(["==",n,l[0]],l[1])}return i.push(Zo(en(e.default,t.default))),i}if("categorical"===o){for(var u=["match",n],p=0,c=r;p<c.length;p+=1){var d=c[p];nn(u,d[0],d[1],!1)}return u.push(Zo(en(e.default,t.default))),u}if("interval"===o){for(var h=["step",["number",n]],f=0,y=r;f<y.length;f+=1){var m=y[f];nn(h,m[0],m[1],!0)}return on(h),void 0===e.default?h:["case",["==",["typeof",n],"number"],h,Zo(e.default)]}if("exponential"===o){for(var v=void 0!==e.base?e.base:1,g=[Yo(e),1===v?["linear"]:["exponential",v],["number",n]],b=0,x=r;b<x.length;b+=1){var w=x[b];nn(g,w[0],w[1],!1)}return void 0===e.default?g:["case",["==",["typeof",n],"number"],g,Zo(e.default)]}throw new Error("Unknown property function type "+o)}function rn(e,t,r,o){void 0===o&&(o=["zoom"]);var n,i=an(e,t),a=!1;if("interval"===i)n=["step",o],a=!0;else{if("exponential"!==i)throw new Error('Unknown zoom function type "'+i+'"');var s=void 0!==e.base?e.base:1;n=[Yo(e),1===s?["linear"]:["exponential",s],o]}for(var l=0,u=r;l<u.length;l+=1){var p=u[l];nn(n,p[0],p[1],a)}return on(n),n}function on(e){"step"===e[0]&&3===e.length&&(e.push(0),e.push(e[3]))}function nn(e,t,r,o){e.length>3&&t===e[e.length-2]||(o&&2===e.length||e.push(t),e.push(r))}function an(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function sn(e){for(var t=["concat"],r=/{([^{}]+)}/g,o=0,n=r.exec(e);null!==n;n=r.exec(e)){var i=e.slice(o,r.lastIndex-n[0].length);o=r.lastIndex,i.length>0&&t.push(i),t.push(["get",n[1]])}if(1===t.length)return e;if(o<e.length)t.push(e.slice(o));else if(2===t.length)return["to-string",t[1]];return t}function ln(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t<r.length;t+=1){var o=r[t];if(!ln(o)&&"boolean"!=typeof o)return!1}return!0;default:return!0}}Go.deserialize=function(e){return new Go(e._parameters,e._specification)},Go.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var un={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function pn(e){if(null==e)return{filter:function(){return!0},needGeometry:!1};ln(e)||(e=hn(e));var t=Fo(e,un);if("error"===t.result)throw new Error(t.value.map(function(e){return e.key+": "+e.message}).join(", "));return{filter:function(e,r,o){return t.value.evaluate(e,r,{},o)},needGeometry:dn(e)}}function cn(e,t){return e<t?-1:e>t?1:0}function dn(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var t=1;t<e.length;t++)if(dn(e[t]))return!0;return!1}function hn(e){if(!e)return!0;var t=e[0];return e.length<=1?"any"!==t:"=="===t?fn(e[1],e[2],"=="):"!="===t?gn(fn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?fn(e[1],e[2],t):"any"===t?yn(e.slice(1)):"all"===t?["all"].concat(e.slice(1).map(hn)):"none"===t?["all"].concat(e.slice(1).map(hn).map(gn)):"in"===t?mn(e[1],e.slice(2)):"!in"===t?gn(mn(e[1],e.slice(2))):"has"===t?vn(e[1]):"!has"===t?gn(vn(e[1])):"within"!==t||e}function fn(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function yn(e){return["any"].concat(e.map(hn))}function mn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(function(e){return typeof e!=typeof t[0]})?["filter-in-large",e,["literal",t.sort(cn)]]:["filter-in-small",e,["literal",t]]}}function vn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function gn(e){return["!",e]}function bn(e){return xn(e,{})}function xn(e,t){var r;if(ln(e))return e;if(!e)return!0;var o,n=e[0];if(e.length<=1)return"any"!==n;if("=="===n||"!="===n||"<"===n||">"===n||"<="===n||">="===n){var i=e;o=kn(i[1],i[2],n,t)}else{if("any"===n){var a=e.slice(1).map(function(e){var t={},r=xn(e,t),o=wn(t);return!0===o?r:["case",o,r,!1]});return["any"].concat(a)}if("all"===n){var s=e.slice(1).map(function(e){return xn(e,t)});return s.length>1?["all"].concat(s):(r=[]).concat.apply(r,s)}if("none"===n)return["!",xn(["any"].concat(e.slice(1)),{})];o="in"===n?jn(e[1],e.slice(2)):"!in"===n?jn(e[1],e.slice(2),!0):"has"===n?zn(e[1]):"!has"!==n||["!",zn(e[1])]}return o}function wn(e){var t=[];for(var r in e){var o="$id"===r?["id"]:["get",r];t.push(["==",["typeof",o],e[r]])}return 0===t.length||(1===t.length?t[0]:["all"].concat(t))}function kn(e,t,r,o){var n;if("$type"===e)return[r,["geometry-type"],t];if(n="$id"===e?["id"]:["get",e],o&&null!==t){var i=typeof t;o[e]=i}return"=="===r&&"$id"!==e&&null===t?["all",["has",e],["==",n,null]]:"!="===r&&"$id"!==e&&null===t?["any",["!",["has",e]],["!=",n,null]]:[r,n,t]}function jn(e,t,r){if(void 0===r&&(r=!1),0===t.length)return r;var o;o="$type"===e?["geometry-type"]:"$id"===e?["id"]:["get",e];for(var n=!0,i=typeof t[0],a=0,s=t;a<s.length;a+=1){if(typeof s[a]!==i){n=!1;break}}if(n&&("string"===i||"number"===i)){var l=t.sort().filter(function(e,r){return 0===r||t[r-1]!==e});return["match",o,l,!r,r]}return[r?"all":"any"].concat(t.map(function(e){return[r?"!=":"==",o,e]}))}function zn(e){return"$type"===e||("$id"===e?["!=",["id"],null]:["has",e])}function Sn(e){var t=[];return qe(e,function(e){e.filter&&(e.filter=bn(e.filter))}),Ee(e,{paint:!0,layout:!0},function(e){var r=e.path,o=e.value,n=e.reference,i=e.set;Do(o)||("object"!=typeof o||Array.isArray(o)?n.tokens&&"string"==typeof o&&i(sn(o)):(i(Xo(o,n)),t.push(r.join("."))))}),e}function Tn(e){var t=!1;if(7===e.version&&(e=De(e),t=!0),8===e.version&&(t=Sn(e),t=!0),!t)throw new Error("cannot migrate from",e.version);return e}function _n(e){var t=[],r=[],o=[];for(var n in e.sources){var i=e.sources[n];if("vector"===i.type){var a=/^mapbox:\/\/(.*)/.exec(i.url);a&&(t.push(n),r.push(a[1]))}}if(t.length<2)return e;t.forEach(function(t){delete e.sources[t]});var s=r.join(",");return e.sources[s]={type:"vector",url:"mapbox://"+s},e.layers.forEach(function(e){if(t.indexOf(e.source)>=0&&(e.source=s,"source-layer"in e)){if(o.indexOf(e["source-layer"])>=0)throw new Error("Conflicting source layer names");o.push(e["source-layer"])}}),e}var An=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function In(e,t){var r={};for(var o in e)"ref"!==o&&(r[o]=e[o]);return An.forEach(function(e){e in t&&(r[e]=t[e])}),r}function On(e){e=e.slice();for(var t=Object.create(null),r=0;r<e.length;r++)t[e[r].id]=e[r];for(var o=0;o<e.length;o++)"ref"in e[o]&&(e[o]=In(e[o],t[e[o].ref]));return e}function Cn(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!Cn(e[r],t[r]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==t){if("object"!=typeof t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var o in e)if(!Cn(e[o],t[o]))return!1;return!0}return e===t}var qn={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function En(e,t,r){r.push({command:qn.addSource,args:[e,t[e]]})}function Mn(e,t,r){t.push({command:qn.removeSource,args:[e]}),r[e]=!0}function Nn(e,t,r,o){Mn(e,r,o),En(e,t,r)}function Pn(e,t,r){var o;for(o in e[r])if(e[r].hasOwnProperty(o)&&"data"!==o&&!Cn(e[r][o],t[r][o]))return!1;for(o in t[r])if(t[r].hasOwnProperty(o)&&"data"!==o&&!Cn(e[r][o],t[r][o]))return!1;return!0}function Rn(e,t,r,o){var n;for(n in t=t||{},e=e||{})e.hasOwnProperty(n)&&(t.hasOwnProperty(n)||Mn(n,r,o));for(n in t)t.hasOwnProperty(n)&&(e.hasOwnProperty(n)?Cn(e[n],t[n])||("geojson"===e[n].type&&"geojson"===t[n].type&&Pn(e,t,n)?r.push({command:qn.setGeoJSONSourceData,args:[n,t[n].data]}):Nn(n,t,r,o)):En(n,t,r))}function Ln(e,t,r,o,n,i){var a;for(a in t=t||{},e=e||{})e.hasOwnProperty(a)&&(Cn(e[a],t[a])||r.push({command:i,args:[o,a,t[a],n]}));for(a in t)t.hasOwnProperty(a)&&!e.hasOwnProperty(a)&&(Cn(e[a],t[a])||r.push({command:i,args:[o,a,t[a],n]}))}function Dn(e){return e.id}function Fn(e,t){return e[t.id]=t,e}function $n(e,t,r){t=t||[];var o,n,i,a,s,l,u,p=(e=e||[]).map(Dn),c=t.map(Dn),d=e.reduce(Fn,{}),h=t.reduce(Fn,{}),f=p.slice(),y=Object.create(null);for(o=0,n=0;o<p.length;o++)i=p[o],h.hasOwnProperty(i)?n++:(r.push({command:qn.removeLayer,args:[i]}),f.splice(f.indexOf(i,n),1));for(o=0,n=0;o<c.length;o++)i=c[c.length-1-o],f[f.length-1-o]!==i&&(d.hasOwnProperty(i)?(r.push({command:qn.removeLayer,args:[i]}),f.splice(f.lastIndexOf(i,f.length-n),1)):n++,l=f[f.length-o],r.push({command:qn.addLayer,args:[h[i],l]}),f.splice(f.length-o,0,i),y[i]=!0);for(o=0;o<c.length;o++)if(a=d[i=c[o]],s=h[i],!y[i]&&!Cn(a,s))if(Cn(a.source,s.source)&&Cn(a["source-layer"],s["source-layer"])&&Cn(a.type,s.type)){for(u in Ln(a.layout,s.layout,r,i,null,qn.setLayoutProperty),Ln(a.paint,s.paint,r,i,null,qn.setPaintProperty),Cn(a.filter,s.filter)||r.push({command:qn.setFilter,args:[i,s.filter]}),Cn(a.minzoom,s.minzoom)&&Cn(a.maxzoom,s.maxzoom)||r.push({command:qn.setLayerZoomRange,args:[i,s.minzoom,s.maxzoom]}),a)a.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?Ln(a[u],s[u],r,i,u.slice(6),qn.setPaintProperty):Cn(a[u],s[u])||r.push({command:qn.setLayerProperty,args:[i,u,s[u]]}));for(u in s)s.hasOwnProperty(u)&&!a.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?Ln(a[u],s[u],r,i,u.slice(6),qn.setPaintProperty):Cn(a[u],s[u])||r.push({command:qn.setLayerProperty,args:[i,u,s[u]]}))}else r.push({command:qn.removeLayer,args:[i]}),l=f[f.lastIndexOf(i)+1],r.push({command:qn.addLayer,args:[s,l]})}function Un(e,t){if(!e)return[{command:qn.setStyle,args:[t]}];var r=[];try{if(!Cn(e.version,t.version))return[{command:qn.setStyle,args:[t]}];Cn(e.center,t.center)||r.push({command:qn.setCenter,args:[t.center]}),Cn(e.zoom,t.zoom)||r.push({command:qn.setZoom,args:[t.zoom]}),Cn(e.bearing,t.bearing)||r.push({command:qn.setBearing,args:[t.bearing]}),Cn(e.pitch,t.pitch)||r.push({command:qn.setPitch,args:[t.pitch]}),Cn(e.sprite,t.sprite)||r.push({command:qn.setSprite,args:[t.sprite]}),Cn(e.glyphs,t.glyphs)||r.push({command:qn.setGlyphs,args:[t.glyphs]}),Cn(e.transition,t.transition)||r.push({command:qn.setTransition,args:[t.transition]}),Cn(e.light,t.light)||r.push({command:qn.setLight,args:[t.light]});var o={},n=[];Rn(e.sources,t.sources,n,o);var i=[];e.layers&&e.layers.forEach(function(e){o[e.source]?r.push({command:qn.removeLayer,args:[e.id]}):i.push(e)}),r=r.concat(n),$n(i,t.layers,r)}catch(a){console.warn("Unable to compute style diff:",a),r=[{command:qn.setStyle,args:[t]}]}return r}var Jn=function(e,t,r,o){this.message=(e?e+": ":"")+r,o&&(this.identifier=o),null!=t&&t.__line__&&(this.line=t.__line__)};exports.ValidationError=Jn;var Gn=function(e){this.error=e,this.message=e.message;var t=e.message.match(/line (\d+)/);this.line=t?parseInt(t[1],10):0};function Wn(e){var t=e.key,r=e.value;return r?[new Jn(t,r,"constants have been deprecated as of v8")]:[]}function Bn(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Vn(e){if(Array.isArray(e))return e.map(Vn);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=Vn(e[r]);return t}return Bn(e)}function Hn(e){var t=e.key,r=e.value,o=e.valueSpec||{},n=e.objectElementValidators||{},i=e.style,a=e.styleSpec,s=[],l=Ao(r);if("object"!==l)return[new Jn(t,r,"object expected, "+l+" found")];for(var u in r){var p=u.split(".")[0],c=o[p]||o["*"],d=void 0;if(n[p])d=n[p];else if(o[p])d=mi;else if(n["*"])d=n["*"];else{if(!o["*"]){s.push(new Jn(t,r[u],'unknown property "'+u+'"'));continue}d=mi}s=s.concat(d({key:(t?t+".":t)+u,value:r[u],valueSpec:c,style:i,styleSpec:a,object:r,objectKey:u},r))}for(var h in o)n[h]||o[h].required&&void 0===o[h].default&&void 0===r[h]&&s.push(new Jn(t,r,'missing required property "'+h+'"'));return s}function Zn(e){var t=e.value,r=e.valueSpec,o=e.style,n=e.styleSpec,i=e.key,a=e.arrayElementValidator||mi;if("array"!==Ao(t))return[new Jn(i,t,"array expected, "+Ao(t)+" found")];if(r.length&&t.length!==r.length)return[new Jn(i,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new Jn(i,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var s={type:r.value,values:r.values};n.$version<7&&(s.function=r.function),"object"===Ao(r.value)&&(s=r.value);for(var l=[],u=0;u<t.length;u++)l=l.concat(a({array:t,arrayIndex:u,value:t[u],valueSpec:s,style:o,styleSpec:n,key:i+"["+u+"]"}));return l}function Xn(e){var t=e.key,r=e.value,o=e.valueSpec,n=Ao(r);return"number"===n&&r!=r&&(n="NaN"),"number"!==n?[new Jn(t,r,"number expected, "+n+" found")]:"minimum"in o&&r<o.minimum?[new Jn(t,r,r+" is less than the minimum value "+o.minimum)]:"maximum"in o&&r>o.maximum?[new Jn(t,r,r+" is greater than the maximum value "+o.maximum)]:[]}function Kn(e){var t,r,o,n=e.valueSpec,i=Bn(e.value.type),a={},s="categorical"!==i&&void 0===e.value.property,l=!s,u="array"===Ao(e.value.stops)&&"array"===Ao(e.value.stops[0])&&"object"===Ao(e.value.stops[0][0]),p=Hn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===i)return[new Jn(e.key,e.value,'identity function may not have a "stops" property')];var t=[],r=e.value;t=t.concat(Zn({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:c})),"array"===Ao(r)&&0===r.length&&t.push(new Jn(e.key,r,"array must have at least one stop"));return t},default:function(e){return mi({key:e.key,value:e.value,valueSpec:n,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===i&&s&&p.push(new Jn(e.key,e.value,'missing required property "property"')),"identity"===i||e.value.stops||p.push(new Jn(e.key,e.value,'missing required property "stops"')),"exponential"===i&&e.valueSpec.expression&&!_o(e.valueSpec)&&p.push(new Jn(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!So(e.valueSpec)?p.push(new Jn(e.key,e.value,"property functions not supported")):s&&!To(e.valueSpec)&&p.push(new Jn(e.key,e.value,"zoom functions not supported"))),"categorical"!==i&&!u||void 0!==e.value.property||p.push(new Jn(e.key,e.value,'"property" property is required')),p;function c(e){var t=[],i=e.value,s=e.key;if("array"!==Ao(i))return[new Jn(s,i,"array expected, "+Ao(i)+" found")];if(2!==i.length)return[new Jn(s,i,"array length 2 expected, length "+i.length+" found")];if(u){if("object"!==Ao(i[0]))return[new Jn(s,i,"object expected, "+Ao(i[0])+" found")];if(void 0===i[0].zoom)return[new Jn(s,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new Jn(s,i,"object stop key must have value")];if(o&&o>Bn(i[0].zoom))return[new Jn(s,i[0].zoom,"stop zoom values must appear in ascending order")];Bn(i[0].zoom)!==o&&(o=Bn(i[0].zoom),r=void 0,a={}),t=t.concat(Hn({key:s+"[0]",value:i[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Xn,value:d}}))}else t=t.concat(d({key:s+"[0]",value:i[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},i));return Do(Vn(i[1]))?t.concat([new Jn(s+"[1]",i[1],"expressions are not allowed in function stops.")]):t.concat(mi({key:s+"[1]",value:i[1],valueSpec:n,style:e.style,styleSpec:e.styleSpec}))}function d(e,o){var s=Ao(e.value),l=Bn(e.value),u=null!==e.value?e.value:o;if(t){if(s!==t)return[new Jn(e.key,u,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Jn(e.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==i){var p="number expected, "+s+" found";return So(n)&&void 0===i&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Jn(e.key,u,p)]}return"categorical"!==i||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===s&&void 0!==r&&l<r?[new Jn(e.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===i&&l in a?[new Jn(e.key,u,"stop domain values must be unique")]:(a[l]=!0,[])):[new Jn(e.key,u,"integer expected, found "+l)]}}function Yn(e){var t=("property"===e.expressionContext?Jo:Fo)(Vn(e.value),e.valueSpec);if("error"===t.result)return t.value.map(function(t){return new Jn(""+e.key+t.key,e.value,t.message)});var r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new Jn(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===e.expressionContext&&"layout"===e.propertyType&&!rr(r))return[new Jn(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!rr(r))return[new Jn(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!or(r,["zoom","feature-state"]))return[new Jn(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!tr(r))return[new Jn(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Qn(e){var t=e.value,r=e.key,o=Ao(t);return"boolean"!==o?[new Jn(r,t,"boolean expected, "+o+" found")]:[]}function ei(e){var t=e.key,r=e.value,o=Ao(r);return"string"!==o?[new Jn(t,r,"color expected, "+o+" found")]:null===st(r)?[new Jn(t,r,'color expected, "'+r+'" found')]:[]}function ti(e){var t=e.key,r=e.value,o=e.valueSpec,n=[];return Array.isArray(o.values)?-1===o.values.indexOf(Bn(r))&&n.push(new Jn(t,r,"expected one of ["+o.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(o.values).indexOf(Bn(r))&&n.push(new Jn(t,r,"expected one of ["+Object.keys(o.values).join(", ")+"], "+JSON.stringify(r)+" found")),n}function ri(e){return ln(Vn(e.value))?Yn(Fe({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):oi(e)}function oi(e){var t=e.value,r=e.key;if("array"!==Ao(t))return[new Jn(r,t,"array expected, "+Ao(t)+" found")];var o,n=e.styleSpec,i=[];if(t.length<1)return[new Jn(r,t,"filter array must have at least 1 element")];switch(i=i.concat(ti({key:r+"[0]",value:t[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),Bn(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===Bn(t[1])&&i.push(new Jn(r,t,'"$type" cannot be use with operator "'+t[0]+'"'));case"==":case"!=":3!==t.length&&i.push(new Jn(r,t,'filter array for operator "'+t[0]+'" must have 3 elements'));case"in":case"!in":t.length>=2&&"string"!==(o=Ao(t[1]))&&i.push(new Jn(r+"[1]",t[1],"string expected, "+o+" found"));for(var a=2;a<t.length;a++)o=Ao(t[a]),"$type"===Bn(t[1])?i=i.concat(ti({key:r+"["+a+"]",value:t[a],valueSpec:n.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==o&&"number"!==o&&"boolean"!==o&&i.push(new Jn(r+"["+a+"]",t[a],"string, number, or boolean expected, "+o+" found"));break;case"any":case"all":case"none":for(var s=1;s<t.length;s++)i=i.concat(oi({key:r+"["+s+"]",value:t[s],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":o=Ao(t[1]),2!==t.length?i.push(new Jn(r,t,'filter array for "'+t[0]+'" operator must have 2 elements')):"string"!==o&&i.push(new Jn(r+"[1]",t[1],"string expected, "+o+" found"));break;case"within":o=Ao(t[1]),2!==t.length?i.push(new Jn(r,t,'filter array for "'+t[0]+'" operator must have 2 elements')):"object"!==o&&i.push(new Jn(r+"[1]",t[1],"object expected, "+o+" found"))}return i}function ni(e,t){var r=e.key,o=e.style,n=e.styleSpec,i=e.value,a=e.objectKey,s=n[t+"_"+e.layerType];if(!s)return[];var l=a.match(/^(.*)-transition$/);if("paint"===t&&l&&s[l[1]]&&s[l[1]].transition)return mi({key:r,value:i,valueSpec:n.transition,style:o,styleSpec:n});var u,p=e.valueSpec||s[a];if(!p)return[new Jn(r,i,'unknown property "'+a+'"')];if("string"===Ao(i)&&So(p)&&!p.tokens&&(u=/^{([^}]+)}$/.exec(i)))return[new Jn(r,i,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(u[1])+" }`.")];var c=[];return"symbol"===e.layerType&&("text-field"===a&&o&&!o.glyphs&&c.push(new Jn(r,i,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Io(Vn(i))&&"identity"===Bn(i.type)&&c.push(new Jn(r,i,'"text-font" does not support identity functions'))),c.concat(mi({key:e.key,value:i,valueSpec:p,style:o,styleSpec:n,expressionContext:"property",propertyType:t,propertyKey:a}))}function ii(e){return ni(e,"paint")}function ai(e){return ni(e,"layout")}function si(e){var t=[],r=e.value,o=e.key,n=e.style,i=e.styleSpec;r.type||r.ref||t.push(new Jn(o,r,'either "type" or "ref" is required'));var a,s=Bn(r.type),l=Bn(r.ref);if(r.id)for(var u=Bn(r.id),p=0;p<e.arrayIndex;p++){var c=n.layers[p];Bn(c.id)===u&&t.push(new Jn(o,r.id,'duplicate layer id "'+r.id+'", previously used at line '+c.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach(function(e){e in r&&t.push(new Jn(o,r[e],'"'+e+'" is prohibited for ref layers'))}),n.layers.forEach(function(e){Bn(e.id)===l&&(a=e)}),a?a.ref?t.push(new Jn(o,r.ref,"ref cannot reference another ref layer")):s=Bn(a.type):t.push(new Jn(o,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var d=n.sources&&n.sources[r.source],h=d&&Bn(d.type);d?"vector"===h&&"raster"===s?t.push(new Jn(o,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===h&&"raster"!==s?t.push(new Jn(o,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==h||r["source-layer"]?"raster-dem"===h&&"hillshade"!==s?t.push(new Jn(o,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===h&&d.lineMetrics||t.push(new Jn(o,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new Jn(o,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new Jn(o,r.source,'source "'+r.source+'" not found'))}else t.push(new Jn(o,r,'missing required property "source"'));return t=t.concat(Hn({key:o,value:r,valueSpec:i.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return mi({key:o+".type",value:r.type,valueSpec:i.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:ri,layout:function(e){return Hn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return ai(Fe({layerType:s},e))}}})},paint:function(e){return Hn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return ii(Fe({layerType:s},e))}}})}}}))}function li(e){var t=e.value,r=e.key,o=Ao(t);return"string"!==o?[new Jn(r,t,"string expected, "+o+" found")]:[]}exports.ParsingError=Gn;var ui={promoteId:ci};function pi(e){var t=e.value,r=e.key,o=e.styleSpec,n=e.style;if(!t.type)return[new Jn(r,t,'"type" is required')];var i,a=Bn(t.type);switch(a){case"vector":case"raster":case"raster-dem":return i=Hn({key:r,value:t,valueSpec:o["source_"+a.replace("-","_")],style:e.style,styleSpec:o,objectElementValidators:ui});case"geojson":if(i=Hn({key:r,value:t,valueSpec:o.source_geojson,style:n,styleSpec:o,objectElementValidators:ui}),t.cluster)for(var s in t.clusterProperties){var l=t.clusterProperties[s],u=l[0],p=l[1],c="string"==typeof u?[u,["accumulated"],["get",s]]:u;i.push.apply(i,Yn({key:r+"."+s+".map",value:p,expressionContext:"cluster-map"})),i.push.apply(i,Yn({key:r+"."+s+".reduce",value:c,expressionContext:"cluster-reduce"}))}return i;case"video":return Hn({key:r,value:t,valueSpec:o.source_video,style:n,styleSpec:o});case"image":return Hn({key:r,value:t,valueSpec:o.source_image,style:n,styleSpec:o});case"canvas":return[new Jn(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ti({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:o})}}function ci(e){var t=e.key,r=e.value;if("string"===Ao(r))return li({key:t,value:r});var o=[];for(var n in r)o.push.apply(o,li({key:t+"."+n,value:r[n]}));return o}function di(e){var t=e.value,r=e.styleSpec,o=r.light,n=e.style,i=[],a=Ao(t);if(void 0===t)return i;if("object"!==a)return i=i.concat([new Jn("light",t,"object expected, "+a+" found")]);for(var s in t){var l=s.match(/^(.*)-transition$/);i=l&&o[l[1]]&&o[l[1]].transition?i.concat(mi({key:s,value:t[s],valueSpec:r.transition,style:n,styleSpec:r})):o[s]?i.concat(mi({key:s,value:t[s],valueSpec:o[s],style:n,styleSpec:r})):i.concat([new Jn(s,t[s],'unknown property "'+s+'"')])}return i}function hi(e){return 0===li(e).length?[]:Yn(e)}function fi(e){return 0===li(e).length?[]:Yn(e)}var yi={"*":function(){return[]},array:Zn,boolean:Qn,number:Xn,color:ei,constants:Wn,enum:ti,filter:ri,function:Kn,layer:si,object:Hn,source:pi,light:di,string:li,formatted:hi,resolvedImage:fi};function mi(e){var t=e.value,r=e.valueSpec,o=e.styleSpec;return r.expression&&Io(Bn(t))?Kn(e):r.expression&&Do(Vn(t))?Yn(e):r.type&&yi[r.type]?yi[r.type](e):Hn(Fe({},e,{valueSpec:r.type?o[r.type]:r}))}function vi(e){var t=e.value,r=e.key,o=li(e);return o.length?o:(-1===t.indexOf("{fontstack}")&&o.push(new Jn(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&o.push(new Jn(r,t,'"glyphs" url must include a "{range}" token')),o)}function gi(e,t){void 0===t&&(t=F);var r=[];return r=r.concat(mi({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:vi,"*":function(){return[]}}})),e.constants&&(r=r.concat(Wn({key:"constants",value:e.constants,style:e,styleSpec:t}))),bi(r)}function bi(e){return[].concat(e).sort(function(e,t){return e.line-t.line})}function xi(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return bi(e.apply(this,t))}}gi.source=xi(pi),gi.light=xi(di),gi.layer=xi(si),gi.filter=xi(ri),gi.paintProperty=xi(ii),gi.layoutProperty=xi(ai);var wi=V(function(e,t){var r=function(){var e=function(e,t,r,o){for(r=r||{},o=e.length;o--;r[e[o]]=t);return r},t=[1,12],r=[1,13],o=[1,9],n=[1,10],i=[1,11],a=[1,14],s=[1,15],l=[14,18,22,24],u=[18,22],p=[22,24],c={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(e,t,r,o,n,i,a){var s=i.length-1;switch(n){case 1:this.$=new String(e.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(e),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=i[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=i[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[i[s-2],i[s]];break;case 16:this.$={},this.$[i[s][0]]=i[s][1];break;case 17:this.$=i[s-2],i[s-2][i[s][0]]=i[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[i[s]];break;case 21:this.$=i[s-2],i[s-2].push(i[s])}},table:[{3:5,4:t,5:6,6:r,7:3,8:o,9:4,10:n,11:i,12:1,13:2,15:7,16:8,17:a,23:s},{1:[3]},{14:[1,16]},e(l,[2,7]),e(l,[2,8]),e(l,[2,9]),e(l,[2,10]),e(l,[2,11]),e(l,[2,12]),e(l,[2,3]),e(l,[2,4]),e(l,[2,5]),e([14,18,21,22,24],[2,1]),e(l,[2,2]),{3:20,4:t,18:[1,17],19:18,20:19},{3:5,4:t,5:6,6:r,7:3,8:o,9:4,10:n,11:i,13:23,15:7,16:8,17:a,23:s,24:[1,21],25:22},{1:[2,6]},e(l,[2,13]),{18:[1,24],22:[1,25]},e(u,[2,16]),{21:[1,26]},e(l,[2,18]),{22:[1,28],24:[1,27]},e(p,[2,20]),e(l,[2,14]),{3:20,4:t,20:29},{3:5,4:t,5:6,6:r,7:3,8:o,9:4,10:n,11:i,13:30,15:7,16:8,17:a,23:s},e(l,[2,19]),{3:5,4:t,5:6,6:r,7:3,8:o,9:4,10:n,11:i,13:31,15:7,16:8,17:a,23:s},e(u,[2,17]),e(u,[2,15]),e(p,[2,21])],defaultActions:{16:[2,6]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){var t=this,r=[0],o=[null],n=[],i=this.table,a="",s=0,l=0,u=1,p=n.slice.call(arguments,1),c=Object.create(this.lexer),d={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(d.yy[h]=this.yy[h]);c.setInput(e,d.yy),d.yy.lexer=c,d.yy.parser=this,void 0===c.yylloc&&(c.yylloc={});var f=c.yylloc;n.push(f);var y=c.options&&c.options.ranges;"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var m,v,g,b,x,w,k,j,z,S={};;){if(v=r[r.length-1],this.defaultActions[v]?g=this.defaultActions[v]:(null==m&&(z=void 0,"number"!=typeof(z=c.lex()||u)&&(z=t.symbols_[z]||z),m=z),g=i[v]&&i[v][m]),void 0===g||!g.length||!g[0]){var T="";for(x in j=[],i[v])this.terminals_[x]&&x>2&&j.push("'"+this.terminals_[x]+"'");T=c.showPosition?"Parse error on line "+(s+1)+":\n"+c.showPosition()+"\nExpecting "+j.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(s+1)+": Unexpected "+(m==u?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(T,{text:c.match,token:this.terminals_[m]||m,line:c.yylineno,loc:f,expected:j})}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+m);switch(g[0]){case 1:r.push(m),o.push(c.yytext),n.push(c.yylloc),r.push(g[1]),m=null,l=c.yyleng,a=c.yytext,s=c.yylineno,f=c.yylloc;break;case 2:if(w=this.productions_[g[1]][1],S.$=o[o.length-w],S._$={first_line:n[n.length-(w||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(w||1)].first_column,last_column:n[n.length-1].last_column},y&&(S._$.range=[n[n.length-(w||1)].range[0],n[n.length-1].range[1]]),void 0!==(b=this.performAction.apply(S,[a,l,s,d.yy,g[1],o,n].concat(p))))return b;w&&(r=r.slice(0,-1*w*2),o=o.slice(0,-1*w),n=n.slice(0,-1*w)),r.push(this.productions_[g[1]][0]),o.push(S.$),n.push(S._$),k=i[r[r.length-2]][r[r.length-1]],r.push(k);break;case 3:return!0}}return!0}},d={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===o.length?this.yylloc.first_column:0)+o[o.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,o,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(o=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in n)this[i]=n[i];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,r,o;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),i=0;i<n.length;i++)if((r=this._input.match(this.rules[n[i]]))&&(!t||r[0].length>t[0].length)){if(t=r,o=i,this.options.backtrack_lexer){if(!1!==(e=this.test_match(r,n[i])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,n[o]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,r,o){switch(r){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function h(){this.yy={}}return c.lexer=d,h.prototype=c,c.Parser=h,new h}();void 0!==B&&(t.parser=r,t.Parser=r.Parser,t.parse=function(){return r.parse.apply(r,arguments)})}),ki=wi.parser,ji=wi.Parser,zi=wi.parse;function Si(e){if(e instanceof String||"string"==typeof e||e instanceof t)try{return wi.parse(e.toString())}catch(r){throw new Gn(r)}return e}function Ti(e,t){void 0===t&&(t=F);var r=e;try{r=Si(r)}catch(o){return[o]}return gi(r,t)}var _i=8,Ai=15;function Ii(e,t){return!e||"string"!==Ao(e)||!!e.match(t)}function Oi(e){return e.url?e.url.split(",").length:0}function Ci(e,t,r){var o=new Set(t),n=[];return Object.keys(e).forEach(function(t){if(!o.has(t)){var i=r?r+"."+t:null;n.push(new Jn(i,e[t],'Unsupported property "'+t+'"'))}}),n}function qi(e,t){var r=[];r.push.apply(r,Ci(e,["type","url","tileSize"],"source"));return Ii(e.url,/^mapbox:\/\/([^/]*)$/)||r.push(new Jn("sources["+t+"]",e.url,"Source url must be a valid Mapbox tileset url")),r}function Ei(e){var t=[],r=0;return Object.keys(e).forEach(function(o,n){var i=qi(e[o],n);i.length||(r+=Oi(e[o])),t.push.apply(t,i)}),r>Ai&&t.push(new Jn("sources",null,"Styles must contain "+Ai+" or fewer sources")),t}function Mi(e,t){var r=[],o=Ci(e,t.concat(["owner","id","cacheControl","draft","created","modified","visibility"]));r.push.apply(r,o),(e.version>_i||e.version<_i)&&r.push(new Jn("version",e.version,"Style version must be "+_i));Ii(e.glyphs,/^mapbox:\/\/fonts\/([^/]*)\/{fontstack}\/{range}.pbf$/)||r.push(new Jn("glyphs",e.glyphs,"Styles must reference glyphs hosted by Mapbox"));Ii(e.sprite,/^mapbox:\/\/sprites\/([^/]*)\/([^/]*)\/?([^/]*)?$/)||r.push(new Jn("sprite",e.sprite,"Styles must reference sprites hosted by Mapbox"));return Ii(e.visibility,/^(public|private)$/)||r.push(new Jn("visibility",e.visibility,"Style visibility must be public or private")),r}function Ni(e){var t=e;try{t=Si(t)}catch(o){return[o]}var r=gi(t,F).concat(Mi(t,Object.keys(F.$root)));return t.sources&&(r=r.concat(Ei(t.sources))),r}var Pi={StyleExpression:Lo,isExpression:Do,isExpressionFilter:ln,createExpression:Fo,createPropertyExpression:Jo,normalizePropertyExpression:Wo,ZoomConstantExpression:$o,ZoomDependentExpression:Uo,StylePropertyFunction:Go};exports.expression=Pi;var Ri={convertFunction:Xo,createFunction:Co,isFunction:Io};exports.function=Ri;var Li={eachSource:Ce,eachLayer:qe,eachProperty:Ee};exports.visit=Li,Ti.parsed=Ti,Ti.latest=Ti; },{"buffer":"aMB2"}],"N0IJ":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.deg2rad=a,exports.createCanvas=s,exports.getZoomForResolution=u,exports.applyLetterSpacing=p,exports.wrapText=d,exports.defaultResolutions=exports.assign=void 0;var e=require("ol/events"),r=t(require("ol/events/EventType")),n=require("ol/render/canvas");function t(e){return e&&e.__esModule?e:{default:e}}var o="function"==typeof Object.assign?Object.assign:function(e,r){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),t=1,o=arguments.length;t<o;++t){var a=arguments[t];if(null!=a)for(var i in a)a.hasOwnProperty(i)&&(n[i]=a[i])}return n};function a(e){return e*Math.PI/180}exports.assign=o;var i=function(){for(var e=[],r=78271.51696402048;e.length<=24;r/=2)e.push(r);return e}();function s(e,r){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(e,r);var n=document.createElement("canvas");return n.width=e,n.height=r,n}function u(e,r){for(var n=0,t=r.length;n<t;++n){if(r[n]<e&&n+1<t){var o=r[n]/r[n+1];return n+Math.log(r[n]/e)/Math.log(o)}}return t-1}exports.defaultResolutions=i;var l,f=Array(256).join(" ");function p(e,r){if(r>=.05){for(var n="",t=e.split("\n"),o=f.slice(0,Math.round(r/.1)),a=0,i=t.length;a<i;++a)a>0&&(n+="\n"),n+=t[a].split("").join(o);return n}return e}function c(){return l||(l=s(1,1).getContext("2d")),l}function v(e,r){return c().measureText(e).width+(e.length-1)*r}var h={};function d(e,r,n,t){if(-1!==e.indexOf("\n")){for(var o=e.split("\n"),a=[],i=0,s=o.length;i<s;++i)a.push(d(o[i],r,n,t));return a.join("\n")}var u=n+","+r+","+e+","+t,l=h[u];if(!l){var f=e.split(" ");if(f.length>1){var g=c();g.font=r;var x=g.measureText("M").width*n,j="";for(a=[],i=0,s=f.length;i<s;++i){var b=f[i],y=j+(j?" ":"")+b;v(y,t)<=x?j=y:(j&&a.push(j),j=b)}j&&a.push(j);for(i=0,s=a.length;i<s&&s>1;++i){var w=a[i];if(v(w,t)<.35*x){var C=i>0?v(a[i-1],t):1/0,O=i<s-1?v(a[i+1],t):1/0;a.splice(i,1),s-=1,C<O?(a[i-1]+=" "+w,i-=1):a[i]=w+" "+a[i]}}for(i=0,s=a.length-1;i<s;++i){var M=a[i],m=a[i+1];if(v(M,t)>.7*x&&v(m,t)<.6*x){var T=M.split(" "),E=T.pop();v(E,t)<.2*x&&(a[i]=T.join(" "),a[i+1]=E+" "+m),s-=1}}l=a.join("\n")}else l=e;l=p(l,t),h[u]=l}return l}n.labelCache&&(0,e.listen)(n.labelCache,r.default.CLEAR,function(){h={}}); },{"ol/events":"UqnM","ol/events/EventType":"C8cu","ol/render/canvas":"iAG7"}],"Fj7k":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports._getValue=exports.getValue=b,exports.default=O,exports._colorWithOpacity=C,exports._evaluateFilter=k,exports._fromTemplate=I,exports._functionCache=exports._filterCache=void 0;var e=u(require("ol/style/Style")),t=u(require("ol/style/Fill")),i=u(require("ol/style/Stroke")),o=u(require("ol/style/Icon")),a=u(require("ol/style/Text")),r=u(require("ol/style/Circle")),n=u(require("ol/render/Feature")),l=require("@mapbox/mapbox-gl-style-spec"),s=u(require("mapbox-to-css-font")),d=require("./util");function u(e){return e&&e.__esModule?e:{default:e}}var f,g,p=l.function.isFunction,c=l.function.convertFunction,v=l.expression.isExpression,h=l.expression.createPropertyExpression,x={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},y={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},m=function(e,t){var i=h(e,t);if("error"===i.result)throw new Error(i.value.map(function(e){return e.key+": "+e.message}).join(", "));return i.value},w={},S={zoom:0},M={};function b(e,t,i,o,a){var r=e.id;M[r]||(M[r]={});var n=M[r];if(!n[i]){var s=(e[t]||w)[i],d=l.latest[t+"_"+e.type][i];void 0===s&&(s=d.default);var u=v(s);if(!u&&p(s)&&(s=c(s,d),u=!0),u){var f=m(s,d);n[i]=f.evaluate.bind(f)}else"color"==d.type&&(s=l.Color.parse(s)),n[i]=function(){return s}}return S.zoom=o,n[i](S,a)}exports._functionCache=M;var F={};function k(e,t,i,o){return e in F||(F[e]=(0,l.featureFilter)(t).filter),S.zoom=o,F[e](S,i)}function C(e,t){if(e){if(0===e.a||0===t)return;var i=e.a;return t=void 0===t?1:t,"rgba("+Math.round(255*e.r/i)+","+Math.round(255*e.g/i)+","+Math.round(255*e.b/i)+","+i*t+")"}return e}exports._filterCache=F;var T=/^([^]*)\{(.*)\}([^]*)$/;function I(e,t){var i;do{if(i=e.match(T)){var o=t[i[2]]||"";e=i[1]+o+i[3]}}while(i);return e}function O(u,p,c,v,h,m,S){if(void 0===v&&(v=d.defaultResolutions),"string"==typeof p&&(p=JSON.parse(p)),8!=p.version)throw new Error("glStyle version 8 required.");var T,O;if(m)if("undefined"!=typeof Image){var _=new Image;_.crossOrigin="anonymous",_.onload=function(){T=_,O=[_.width,_.height],u.changed(),_.onload=null},_.src=m}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var q=self;q.postMessage({action:"loadImage",src:m}),q.addEventListener("message",function(e){"imageLoaded"===e.data.action&&e.data.src===m&&(T=e.data.image,O=[T.width,T.height])})}for(var z,L=(0,l.derefLayers)(p.layers),P={},W=[],E=0,R=L.length;E<R;++E){var G=L[E],Z=G.id;if("string"==typeof c&&G.source==c||-1!==c.indexOf(Z)){var j=G["source-layer"];if(!z){z=G.source;var A=p.sources[z];if(!A)throw new Error('Source "'+z+'" is not defined');var N=A.type;if("vector"!==N&&"geojson"!==N)throw new Error('Source "'+z+'" is not of type "vector" or "geojson", but "'+N+'"')}var V=P[j];V||(V=P[j]=[]),V.push({layer:G,index:E}),W.push(Z)}delete M[Z],delete F[Z]}var D=new i.default,J=new t.default,B={},U={},X=[],Y=function(l,u){var p=l.getProperties(),c=P[p.layer];if(c){var m=v.indexOf(u);-1==m&&(m=(0,d.getZoomForResolution)(u,v));for(var M=x[l.getGeometry().getType()],F={properties:p,type:M},_=-1,q=function(v,x){var q=c[v],z=q.layer,L=z.id,P=z.layout||w,W=z.paint||w;if("none"===P.visibility||"minzoom"in z&&m<z.minzoom||"maxzoom"in z&&m>=z.maxzoom)return"continue";var E=z.filter;if(!E||k(L,E,F,m)){var R=void 0,G=void 0,Z=void 0,j=void 0,A=void 0,N=void 0,V=q.index;if(3==M&&"fill"==z.type)if(G=b(z,"paint","fill-opacity",m,F),"fill-pattern"in W){var Y=b(z,"paint","fill-pattern",m,F);if(Y){var $="string"==typeof Y?I(Y,p):Y.toString();if(T&&h&&h[$]){(N=X[++_])&&N.getFill()&&!N.getStroke()&&!N.getText()||(N=X[_]=new e.default({fill:new t.default})),Z=N.getFill(),N.setZIndex(V);var H=U[Ce=$+"."+G];if(!H){var K=h[$];(Ie=(Te=(0,d.createCanvas)(K.width,K.height)).getContext("2d")).globalAlpha=G,Ie.drawImage(T,K.x,K.y,K.width,K.height,0,0,K.width,K.height),H=Ie.createPattern(Te,"repeat"),U[Ce]=H}Z.setColor(H)}}}else(R=C(b(z,"paint","fill-color",m,F),G))&&("fill-outline-color"in W&&(A=C(b(z,"paint","fill-outline-color",m,F),G)),A||(A=R),(N=X[++_])&&N.getFill()&&N.getStroke()&&!N.getText()||(N=X[_]=new e.default({fill:new t.default,stroke:new i.default})),(Z=N.getFill()).setColor(R),(j=N.getStroke()).setColor(A),j.setWidth(1),N.setZIndex(V));if(1!=M&&"line"==z.type){R=!("line-pattern"in W)&&"line-color"in W?C(b(z,"paint","line-color",m,F),b(z,"paint","line-opacity",m,F)):void 0;var Q=b(z,"paint","line-width",m,F);R&&Q>0&&((N=X[++_])&&N.getStroke()&&!N.getFill()&&!N.getText()||(N=X[_]=new e.default({stroke:new i.default})),(j=N.getStroke()).setLineCap(b(z,"layout","line-cap",m,F)),j.setLineJoin(b(z,"layout","line-join",m,F)),j.setMiterLimit(b(z,"layout","line-miter-limit",m,F)),j.setColor(R),j.setWidth(Q),j.setLineDash(W["line-dasharray"]?b(z,"paint","line-dasharray",m,F).map(function(e){return e*Q}):null),N.setZIndex(V))}var ee=!1,te=null,ie=0,oe=void 0,ae=void 0,re=void 0;if((1==M||2==M)&&"icon-image"in P){var ne=b(z,"layout","icon-image",m,F);if(ne){oe="string"==typeof ne?I(ne,p):ne.toString();var le=void 0;if(T&&h&&h[oe]){var se=b(z,"layout","icon-rotation-alignment",m,F);if(2==M){var de=l.getGeometry();if(de.getFlatMidpoint||de.getFlatMidpoints){var ue=de.getExtent();if(Math.sqrt(Math.max(Math.pow((ue[2]-ue[0])/u,2),Math.pow((ue[3]-ue[1])/u,2)))>150){var fe="MultiLineString"===de.getType()?de.getFlatMidpoints():de.getFlatMidpoint();if(g||(f=[NaN,NaN],g=new n.default("Point",f,[],{},null)),le=g,f[0]=fe[0],f[1]=fe[1],"line"===(Xe=b(z,"layout","symbol-placement",m,F))&&"map"===se)for(var ge=de.getStride(),pe=de.getFlatCoordinates(),ce=0,ve=pe.length-ge;ce<ve;ce+=ge){var he=pe[ce],xe=pe[ce+1],ye=pe[ce+ge],me=pe[ce+ge+1],we=Math.min(he,ye),Se=Math.min(xe,me),Me=Math.max(he,ye),be=Math.max(xe,me);if(fe[0]>=we&&fe[0]<=Me&&fe[1]>=Se&&fe[1]<=be){ie=Math.atan2(xe-me,ye-he);break}}}}}if(2!==M||le){(N=X[++_])&&N.getImage()&&!N.getFill()&&!N.getStroke()||(N=X[_]=new e.default),N.setGeometry(le);var Fe=b(z,"layout","icon-size",m,F),ke=void 0!==W["icon-color"]?b(z,"paint","icon-color",m,F):null,Ce=oe+"."+Fe;if(null!==ke&&(Ce+="."+ke),!(ae=B[Ce])){K=h[oe];if(null!==ke){var Te,Ie;(Ie=(Te=(0,d.createCanvas)(K.width,K.height)).getContext("2d")).drawImage(T,K.x,K.y,K.width,K.height,0,0,K.width,K.height);for(var Oe=Ie.getImageData(0,0,Te.width,Te.height),_e=0,qe=Oe.data.length;_e<qe;_e+=4){var ze=ke.a;0!==ze&&(Oe.data[_e]=255*ke.r/ze,Oe.data[_e+1]=255*ke.g/ze,Oe.data[_e+2]=255*ke.b/ze),Oe.data[_e+3]=ze}Ie.putImageData(Oe,0,0),ae=B[Ce]=new o.default({img:Te,imgSize:[Te.width,Te.height],scale:Fe/K.pixelRatio})}else ae=B[Ce]=new o.default({img:T,imgSize:O,size:[K.width,K.height],offset:[K.x,K.y],rotateWithView:"map"===se,scale:Fe/K.pixelRatio})}ae.setRotation(ie+(0,d.deg2rad)(b(z,"layout","icon-rotate",m,F))),ae.setOpacity(b(z,"paint","icon-opacity",m,F)),ae.setAnchor(y[b(z,"layout","icon-anchor",m,F)]),N.setImage(ae),te=N.getText(),N.setText(void 0),N.setZIndex(V),ee=!0,re=!1}else re=!0}}}if(1==M&&"circle-radius"in W){(N=X[++_])&&N.getImage()&&!N.getFill()&&!N.getStroke()||(N=X[_]=new e.default);var Le=b(z,"paint","circle-radius",m,F),Pe=C(b(z,"paint","circle-stroke-color",m,F),b(z,"paint","circle-stroke-opacity",m,F)),We=C(b(z,"paint","circle-color",m,F),b(z,"paint","circle-opacity",m,F)),Ee=b(z,"paint","circle-stroke-width",m,F),Re=Le+"."+Pe+"."+We+"."+Ee;(ae=B[Re])||(ae=B[Re]=new r.default({radius:Le,stroke:Pe&&Ee>0?new i.default({width:Ee,color:Pe}):void 0,fill:We?new t.default({color:We}):void 0})),N.setImage(ae),te=N.getText(),N.setText(void 0),N.setGeometry(void 0),N.setZIndex(V),ee=!0}var Ge=void 0;if("text-field"in P)Ge=I(b(z,"layout","text-field",m,F).toString(),p).trim(),G=b(z,"paint","text-opacity",m,F);if(Ge&&G&&!re){ee||((N=X[++_])&&N.getText()&&!N.getFill()&&!N.getStroke()||(N=X[_]=new e.default),N.setImage(void 0),N.setGeometry(void 0)),N.getText()||N.setText(te||new a.default({padding:[2,2,2,2]})),te=N.getText();var Ze=Math.round(b(z,"layout","text-size",m,F)),je=b(z,"layout","text-font",m,F),Ae=b(z,"layout","text-line-height",m,F),Ne=(0,s.default)(S?S(je):je,Ze,Ae),Ve=P["text-transform"];"uppercase"==Ve?Ge=Ge.toUpperCase():"lowercase"==Ve&&(Ge=Ge.toLowerCase());var De=b(z,"layout","text-max-width",m,F),Je=b(z,"layout","text-letter-spacing",m,F),Be=2==M?(0,d.applyLetterSpacing)(Ge,Je):(0,d.wrapText)(Ge,Ne,De,Je);te.setText(Be),te.setFont(Ne),te.setRotation((0,d.deg2rad)(b(z,"layout","text-rotate",m,F)));var Ue=b(z,"layout","text-anchor",m,F),Xe=ee||1==M?"point":b(z,"layout","symbol-placement",m,F);te.setPlacement(Xe);var Ye=b(z,"paint","text-halo-width",m,F),$e=b(z,"layout","text-offset",m,F),He=b(z,"paint","text-translate",m,F),Ke=0,Qe=0;if("point"==Xe){var et="center";-1!==Ue.indexOf("left")?(et="left",Qe=Ye):-1!==Ue.indexOf("right")&&(et="right",Qe=-Ye),te.setTextAlign(et);var tt=b(z,"layout","text-rotation-alignment",m,F);te.setRotateWithView("map"==tt)}else te.setMaxAngle((0,d.deg2rad)(b(z,"layout","text-max-angle",m,F))*Ge.length/Be.length),te.setTextAlign(),te.setRotateWithView(!1);var it="middle";0==Ue.indexOf("bottom")?(it="bottom",Ke=-Ye-.5*(Ae-1)*Ze):0==Ue.indexOf("top")&&(it="top",Ke=Ye+.5*(Ae-1)*Ze),te.setTextBaseline(it),te.setOffsetX($e[0]*Ze+Qe+He[0]),te.setOffsetY($e[1]*Ze+Ke+He[1]),J.setColor(C(b(z,"paint","text-color",m,F),G)),te.setFill(J);var ot=C(b(z,"paint","text-halo-color",m,F),G);if(ot){D.setColor(ot),Ye*=2;var at=.5*Ze;D.setWidth(Ye<=at?Ye:at),te.setStroke(D)}else te.setStroke(void 0);var rt=b(z,"layout","text-padding",m,F),nt=te.getPadding();rt!==nt[0]&&(nt[0]=nt[1]=nt[2]=nt[3]=rt),N.setZIndex(V)}}},z=0,L=c.length;z<L;++z)q(z);return _>-1?(X.length=_+1,X):void 0}};return u.setStyle(Y),u.set("mapbox-source",z),u.set("mapbox-layers",W),Y} },{"ol/style/Style":"he4w","ol/style/Fill":"AFcg","ol/style/Stroke":"TXDt","ol/style/Icon":"z2xv","ol/style/Text":"RPsG","ol/style/Circle":"cdf1","ol/render/Feature":"IFOM","@mapbox/mapbox-gl-style-spec":"Prd1","mapbox-to-css-font":"pt6h","./util":"N0IJ"}],"jVC7":[function(require,module,exports) { (function(){var a;module.exports={icon:"icons/google.svg",name:"google",title:"Google Fonts",link:"google.com/fonts",getNames:function(){return a},getLink:function(a){return"https://fonts.google.com/specimen/"+a.replace(/( )/g,"+")},normalizeName:function(a){return a}},a=["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Alegreya Sans SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Amiri","Amita","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Arya","Asap","Asar","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Biryani","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambay","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Catamaran","Caudex","Caveat","Caveat Brush","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Chonburi","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Dekko","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Dhurjati","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Eczar","Ek Mukta","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Fauna One","Federant","Federo","Felipa","Fenix","Finger Paint","Fira Mono","Fira Sans","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gidugu","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Gurajada","Habibi","Halant","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Hind","Hind Siliguri","Hind Vadodara","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Inknut Antiqua","Irish Grover","Istok Web","Italiana","Italianno","Itim","Jacques Francois","Jacques Francois Shadow","Jaldi","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kadwa","Kalam","Kameron","Kantumruy","Karla","Karma","Kaushan Script","Kavoon","Kdam Thmor","Keania One","Kelly Slab","Kenia","Khand","Khmer","Khula","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","Kurale","La Belle Aurore","Laila","Lakki Reddy","Lancelot","Lateef","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Mallanna","Mandali","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Martel","Martel Sans","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modak","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","NTR","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Palanquin","Palanquin Dark","Paprika","Parisienne","Passero One","Passion One","Pathway Gothic One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peddana","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Rozha One","Rubik","Rubik Mono One","Rubik One","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sahitya","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarala","Sarina","Sarpanch","Satisfy","Scada","Scheherazade","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slabo 13px","Slabo 27px","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Source Serif Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Sree Krushnadevaraya","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sumana","Sunshiney","Supermercado One","Sura","Suranna","Suravaram","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Teko","Telex","Tenali Ramakrishna","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tillana","Timmana","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vesper Libre","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Work Sans","Yanone Kaffeesatz","Yantramanav","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}).call(this); },{}],"SU9K":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.jsonp=t;var e=require("./util.js");function t(t,n,o,i){var c=document.createElement("script"),r="olc_"+(0,e.getUid)(n);function a(){delete window[r],c.parentNode.removeChild(c)}c.async=!0,c.src=t+(-1==t.indexOf("?")?"?":"&")+(i||"callback")+"="+r;var d=setTimeout(function(){a(),o&&o()},1e4);window[r]=function(e){clearTimeout(d),a(),n(e)},document.getElementsByTagName("head")[0].appendChild(c)} },{"./util.js":"KniQ"}],"V9RY":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=l(require("./State.js")),e=l(require("./TileImage.js")),r=require("../extent.js"),i=require("../asserts.js"),o=require("../tileurlfunction.js"),n=require("../tilegrid.js"),s=require("../proj.js"),a=require("../net.js");function l(t){return t&&t.__esModule?t:{default:t}}var u=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),d=function(e){function l(r){var o=e.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,imageSmoothing:r.imageSmoothing,projection:(0,s.get)("EPSG:3857"),reprojectionErrorThreshold:r.reprojectionErrorThreshold,state:t.default.LOADING,tileLoadFunction:r.tileLoadFunction,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition})||this;if(o.tileJSON_=null,o.tileSize_=r.tileSize,r.url)if(r.jsonp)(0,a.jsonp)(r.url,o.handleTileJSONResponse.bind(o),o.handleTileJSONError.bind(o));else{var n=new XMLHttpRequest;n.addEventListener("load",o.onXHRLoad_.bind(o)),n.addEventListener("error",o.onXHRError_.bind(o)),n.open("GET",r.url),n.send()}else r.tileJSON?o.handleTileJSONResponse(r.tileJSON):(0,i.assert)(!1,51);return o}return u(l,e),l.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(i){return void this.handleTileJSONError()}this.handleTileJSONResponse(r)}else this.handleTileJSONError()},l.prototype.onXHRError_=function(t){this.handleTileJSONError()},l.prototype.getTileJSON=function(){return this.tileJSON_},l.prototype.handleTileJSONResponse=function(e){var i,a=(0,s.get)("EPSG:4326"),l=this.getProjection();if(void 0!==e.bounds){var u=(0,s.getTransformFromProjections)(a,l);i=(0,r.applyTransform)(e.bounds,u)}var d=e.minzoom||0,c=e.maxzoom||22,p=(0,n.createXYZ)({extent:(0,n.extentFromProjection)(l),maxZoom:c,minZoom:d,tileSize:this.tileSize_});if(this.tileGrid=p,this.tileUrlFunction=(0,o.createFromTemplates)(e.tiles,p),void 0!==e.attribution&&!this.getAttributions()){var h=void 0!==i?i:a.getExtent();this.setAttributions(function(t){return(0,r.intersects)(h,t.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState(t.default.READY)},l.prototype.handleTileJSONError=function(){this.setState(t.default.ERROR)},l}(e.default),c=d;exports.default=c; },{"./State.js":"iC8j","./TileImage.js":"udAI","../extent.js":"QDir","../asserts.js":"fLG6","../tileurlfunction.js":"p1vZ","../tilegrid.js":"ExRx","../proj.js":"Diht","../net.js":"SU9K"}],"CreQ":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.applyStyle=V,exports.applyBackground=C,exports.default=F,exports.apply=H,exports.getLayer=I,exports.getLayers=X,exports.getSource=Y,exports._finalizeLayer=W,exports._getFonts=L;var e=w(require("mapbox-to-css-font")),t=x(require("./stylefunction")),r=w(require("webfont-matcher/lib/fonts/google")),o=require("ol/proj"),n=require("ol/tilegrid"),i=w(require("ol/tilegrid/TileGrid")),a=w(require("ol/Map")),u=w(require("ol/View")),s=w(require("ol/format/GeoJSON")),l=w(require("ol/format/MVT")),c=require("ol/Observable"),f=w(require("ol/layer/Tile")),g=w(require("ol/layer/Vector")),p=w(require("ol/layer/VectorTile")),d=w(require("ol/source/TileJSON")),y=w(require("ol/source/Vector")),m=w(require("ol/source/VectorTile")),v=require("@mapbox/mapbox-gl-style-spec"),h=require("./util");function b(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return b=function(){return e},e}function x(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=b();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function w(e){return e&&e.__esModule?e:{default:e}}var S,O={},T=/font-family: ?([^;]*);/,q=/("|')/g;function E(e){if(!S){S={};for(var t=document.styleSheets,r=0,o=t.length;r<o;++r){var n=t[r];try{var i=n.rules||n.cssRules;if(i)for(var a=0,u=i.length;a<u;++a){var s=i[a];if(5==s.type){var l=s.cssText.match(T);S[l[1].replace(q,"")]=!0}}}catch(c){}}}return e in S}var j={},z=r.default.getNames();function L(t){var r=t.toString();if(r in j)return t;for(var o=t.map(function(t){var r=(0,e.default)(t,1).split(" ");return[r.slice(3).join(" ").replace(/"/g,""),r[1]+r[0]]}),n=0,i=o.length;n<i;++n){var a=o[n],u=a[0];if(!E(u)&&-1!==z.indexOf(u)){var s="https://fonts.googleapis.com/css?family="+u.replace(/ /g,"+")+":"+a[1];if(!document.querySelector('link[href="'+s+'"]')){var l=document.createElement("link");l.href=s,l.rel="stylesheet",document.head.appendChild(l)}}}return j[r]=!0,t}var k=/^(.*)(\?.*)$/;function M(e,t){return t&&0===e.indexOf(".")&&(e=t+e),e}function P(e,t,r){var o=(e=M(e,t)).match(k);return o?o[1]+r+(o.length>2?o[2]:""):e+r}function V(e,r,o,n,i){return new Promise(function(a,u){if("object"!=typeof r&&(r=JSON.parse(r)),8!=r.version)return u(new Error("glStyle version 8 required."));if(!(e instanceof g.default||e instanceof p.default))return u(new Error("Can only apply to VectorLayer or VectorTileLayer"));var s,l,c;function f(){c||r.sprite&&!s?c?(e.setStyle(c),a()):u(new Error("Something went wrong trying to apply style.")):(c=(0,t.default)(e,r,o,i,s,l,L),e.getStyle()?a():u(new Error("Nothing to show for source ["+o+"]")))}if(r.sprite){var d=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",y=P(r.sprite,n,d+".json");fetch(y,{credentials:"same-origin"}).then(function(e){return e.ok||""===d?e:(y=P(r.sprite,n,".json"),fetch(y,{credentials:"same-origin"}))}).then(function(e){if(e.ok)return e.json();u(new Error("Problem fetching sprite from "+y+": "+e.statusText))}).then(function(e){if(void 0===e||0===Object.keys(e).length)return u(new Error("No sprites found."));s=e,l=P(r.sprite,n,d+".png"),f()}).catch(function(e){u(new Error("Sprites cannot be loaded: "+y+": "+e.message))})}else f()})}var R={};function N(e,r){var o={type:r.type};function n(){var n=e.getTargetElement();if(n){var i=r.layout||{},a=r.paint||{};o.paint=a,o.id="olms-bg-"+a["background-opacity"]+a["background-color"];var u=e.getView().getZoom();if(void 0!==a["background-color"]){var s=(0,t.getValue)(o,"paint","background-color",u,R);n.style.background=v.Color.parse(s).toString()}void 0!==a["background-opacity"]&&(n.style.opacity=(0,t.getValue)(o,"paint","background-opacity",u,R)),"none"==i.visibility&&(n.style.backgroundColor="",n.style.opacity="")}}e.getTargetElement()&&n(),e.on(["change:resolution","change:target"],n)}function C(e,t){t.layers.some(function(t){if("background"==t.type)return N(e,t),!0})}function G(e,t){var r;return e.some(function(e){if(e.id==t)return r=e.source,!0}),r}function Z(e){var t=e.bounds;if(t){var r=(0,o.fromLonLat)([t[0],t[1]]),n=(0,o.fromLonLat)([t[2],t[3]]);return[r[0],r[1],n[0],n[1]]}}function A(e,t,r){e=(0,h.assign)({},e);var o=new p.default({declutter:!0,visible:!1}),n=JSON.stringify(e),a=O[n];a||(a=O[n]=new d.default({url:e.tiles?void 0:r,tileJSON:e.tiles?e:void 0}));var u=a.on("change",function(){var t=a.getState();if("ready"===t){var r=a.getTileJSON(),n=Array.isArray(r.tiles)?r.tiles:[r.tiles];if(e.url)for(var s=0,f=n.length;s<f;++s){var g=n[s];0!=g.indexOf("http")&&(n[s]=e.url+g)}var p=a.getTileGrid(),d=Z(r),y=r.minzoom||0,v=r.maxzoom||22,b=a.get("ol-source");void 0===b&&(b=new m.default({attributions:a.getAttributions(),format:new l.default,tileGrid:new i.default({origin:p.getOrigin(0),extent:d||p.getExtent(),minZoom:y,resolutions:h.defaultResolutions.slice(0,v+1),tileSize:512}),urls:n}),a.set("ol-source",b)),(0,c.unByKey)(u),o.setSource(b)}else"error"===t&&(a.set("ol-source",null),(0,c.unByKey)(u),o.setSource(void 0))});return"ready"===a.getState()&&a.changed(),o}function J(e,t){var r=new f.default,o=new d.default({transition:0,url:e.tiles?void 0:t,tileJSON:e.tiles?e:void 0,crossOrigin:"anonymous"}),a=o.on("change",function(){var t=o.getState();if("ready"===t){(0,c.unByKey)(a);var u=o.getTileJSON(),s=Z(u),l=o.getTileGrid(),f=e.tileSize||u.tileSize||512,g=u.minzoom||0,p=u.maxzoom||22;o.tileGrid=new i.default({origin:l.getOrigin(0),extent:s||l.getExtent(),minZoom:g,resolutions:(0,n.createXYZ)({maxZoom:p,tileSize:f}).getResolutions(),tileSize:f}),r.setSource(o)}else"error"===t&&((0,c.unByKey)(a),r.setSource(void 0))});return o.setTileLoadFunction(function(e,t){if(-1!=t.indexOf("{bbox-epsg-3857}")){var r=o.getTileGrid().getTileCoordExtent(e.getTileCoord());t=t.replace("{bbox-epsg-3857}",r.toString())}e.getImage().src=t}),r}var _=new s.default;function B(e,t){var r,o,n=e.data;return"string"==typeof n?o=M(n,t):r=_.readFeatures(n,{featureProjection:"EPSG:3857"}),new g.default({source:new y.default({attributions:e.attribution,features:r,format:_,url:o}),visible:!1})}function K(e,r,o){var n=o.getZoom(),i=(0,t.getValue)(e,"paint","raster-opacity",n,R);r.setOpacity(i)}function D(e,t,r,n,i,a){var s=[],l=t.getView();l.isDef()||l.getRotation()||l.getResolutions()||(l=new u.default({maxResolution:h.defaultResolutions[0]}),t.setView(l)),"center"in e&&!l.getCenter()&&l.setCenter((0,o.fromLonLat)(e.center)),"zoom"in e&&void 0===l.getZoom()&&l.setResolution(h.defaultResolutions[0]/Math.pow(2,e.zoom)),l.getCenter()&&void 0!==l.getZoom()||l.fit(l.getProjection().getExtent(),{nearest:!0,size:t.getSize()}),e.sprite&&(0==e.sprite.indexOf("mapbox://")?e.sprite=r+"/sprite"+a:0!=e.sprite.indexOf("http")&&(e.sprite=(n?n+i:"")+e.sprite+a));for(var c,f,g,p,d,y,m=e.layers,v=[],b=function(r,o){var n=(c=m[r]).type;if("heatmap"==n||"fill-extrusion"==n||"hillshade"==n);else if("background"==n)N(t,c);else{if((p=c.source||G(m,c.ref))!=g){if(v.length&&(s.push(W(d,v,e,i,t)),v=[]),f=e.sources[p],(y=f.url)&&0==(y=M(y,i)).indexOf("mapbox://")){var u=y.replace("mapbox://","");f.tiles=["a","b","c","d"].map(function(e){return"https://"+e+".tiles.mapbox.com/v4/"+u+"/{z}/{x}/{y}."+("vector"==f.type?"vector.pbf":"png")+a})}"vector"==f.type?d=A(f,a,y):"raster"==f.type?((d=J(f,y)).setVisible(!c.layout||"none"!==c.layout.visibility),l.on("change:resolution",K.bind(x,c,d,l)),K(c,d,l)):"geojson"==f.type&&(d=B(f,i)),g=p,d&&d.set("mapbox-source",g)}v.push(c.id)}},x=this,w=0,S=m.length;w<S;++w)b(w);return s.push(W(d,v,e,i,t)),t.set("mapbox-style",e),Promise.all(s)}function F(e,t){var r,o,n,i,u;if(r=o=n=i="",("string"==typeof e||e instanceof HTMLElement)&&(e=new a.default({target:e})),"string"==typeof t){var s=t.match(k);s&&(o=s[1],r=s.length>2?s[2]:""),u=new Promise(function(a,u){fetch(t,{credentials:"same-origin"}).then(function(e){return e.json()}).then(function(s){var l=document.createElement("A");l.href=t;var c=l.href;i=l.pathname.split("/").slice(0,-1).join("/")+"/",n=c.substr(0,c.indexOf(i)),D(s,e,o,n,i,r).then(function(){a(e)}).catch(u)}).catch(function(e){u(new Error("Could not load "+t+": "+e.message))})})}else u=new Promise(function(r,o){D(t,e).then(function(){r(e)}).catch(o)});return u}function H(e,t){return("string"==typeof e||e instanceof HTMLElement)&&(e=new a.default({target:e})),setTimeout(function(){F(e,t)},0),e}function W(e,t,r,o,n){for(var i=24,a=0,u=r.layers,s=0,l=u.length;s<l;++s){var c=u[s];-1!==t.indexOf(c.id)&&(i=Math.min("minzoom"in c?c.minzoom:0,i),a=Math.max("maxzoom"in c?c.maxzoom:24,a))}return new Promise(function(u,s){var l=function(){var n=e.getSource();if(n&&"error"!==n.getState()){if("function"==typeof n.getTileGrid){var l=n.getTileGrid();if(l){var c=l.getMinZoom();(i>0||c>0)&&e.setMaxResolution(Math.min(h.defaultResolutions[i],l.getResolution(c))+1e-9),a<24&&e.setMinResolution(h.defaultResolutions[a]+1e-9)}}n instanceof y.default||n instanceof m.default?V(e,r,t,o).then(function(){e.setVisible(!0),u()},function(e){s(e)}):u()}else s(new Error("Error accessing data for source "+e.get("mapbox-source")))};e.set("mapbox-layers",t),-1===n.getLayers().getArray().indexOf(e)&&n.addLayer(e),e.getSource()?l():e.once("change:source",l)})}function I(e,t){for(var r=e.getLayers().getArray(),o=0,n=r.length;o<n;++o){var i=r[o].get("mapbox-layers");if(i&&-1!==i.indexOf(t))return r[o]}}function X(e,t){for(var r=[],o=e.getLayers().getArray(),n=0,i=o.length;n<i;++n)o[n].get("mapbox-source")===t&&r.push(o[n]);return r}function Y(e,t){for(var r=e.getLayers().getArray(),o=0,n=r.length;o<n;++o){var i=r[o].getSource();if(r[o].get("mapbox-source")===t)return i}} },{"mapbox-to-css-font":"pt6h","./stylefunction":"Fj7k","webfont-matcher/lib/fonts/google":"jVC7","ol/proj":"Diht","ol/tilegrid":"ExRx","ol/tilegrid/TileGrid":"dpZ6","ol/Map":"kYy5","ol/View":"hNqE","ol/format/GeoJSON":"qBlb","ol/format/MVT":"bjcz","ol/Observable":"IdSm","ol/layer/Tile":"BUEc","ol/layer/Vector":"dflx","ol/layer/VectorTile":"zOJv","ol/source/TileJSON":"V9RY","ol/source/Vector":"ZS12","ol/source/VectorTile":"A6uo","@mapbox/mapbox-gl-style-spec":"Prd1","./util":"N0IJ"}],"VqZN":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMapboxPath=c,exports.normalizeSpriteUrl=f,exports.normalizeGlyphsUrl=p,exports.normalizeStyleUrl=d,exports.normalizeSourceUrl=h,exports.default=void 0;var e=a(require("../events/Event.js")),r=a(require("../events/EventType.js")),t=a(require("../format/MVT.js")),n=a(require("../source/State.js")),o=a(require("../layer/VectorTile.js")),s=a(require("../source/VectorTile.js")),i=require("ol-mapbox-style");function a(e){return e&&e.__esModule?e:{default:e}}var l=function(){var e=function(r,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])})(r,t)};return function(r,t){function n(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),u="https://api.mapbox.com";function c(e){return 0!==e.indexOf("mapbox://")?"":e.slice("mapbox://".length)}function f(e,r){var t=c(e);if(!t)return e;if(0!==t.indexOf("sprites/"))throw new Error("unexpected sprites url: "+e);var n=t.slice("sprites/".length);return u+"/styles/v1/"+n+"/sprite?access_token="+r}function p(e,r){var t=c(e);if(!t)return e;if(0!==t.indexOf("fonts/"))throw new Error("unexpected fonts url: "+e);var n=t.slice("fonts/".length);return u+"/fonts/v1/"+n+"/0-255.pbf?access_token="+r}function d(e,r){var t=c(e);if(!t)return e;if(0!==t.indexOf("styles/"))throw new Error("unexpected style url: "+e);var n=t.slice("styles/".length);return u+"/styles/v1/"+n+"?&access_token="+r}function h(e,r){var t=c(e);return t?"https://{a-d}.tiles.mapbox.com/v4/"+t+"/{z}/{x}/{y}.vector.pbf?access_token="+r:e}var y=function(e){function t(t){var n=e.call(this,r.default.ERROR)||this;return n.error=t,n}return l(t,e),t}(e.default),v={VECTOR:"vector"},m=function(e){function r(r){var o=this,i=!("declutter"in r)||r.declutter,a=new s.default({state:n.default.LOADING,format:new t.default});return(o=e.call(this,{source:a,declutter:i,className:r.className,opacity:r.opacity,visible:r.visible,zIndex:r.zIndex,minResolution:r.minResolution,maxResolution:r.maxResolution,minZoom:r.minZoom,maxZoom:r.maxZoom,renderOrder:r.renderOrder,renderBuffer:r.renderBuffer,renderMode:r.renderMode,map:r.map,updateWhileAnimating:r.updateWhileAnimating,updateWhileInteracting:r.updateWhileInteracting,preload:r.preload,useInterimTilesOnError:r.useInterimTilesOnError})||this).sourceId=r.source,o.layers=r.layers,o.accessToken=r.accessToken,o.fetchStyle(r.styleUrl),o}return l(r,e),r.prototype.fetchStyle=function(e){var r=this,t=d(e,this.accessToken);fetch(t).then(function(e){if(!e.ok)throw new Error("unexpected response when fetching style: "+e.status);return e.json()}).then(function(e){r.onStyleLoad(e)}).catch(function(e){r.handleError(e)})},r.prototype.onStyleLoad=function(e){var r,t,o=this;if(this.layers){for(var s={},a=0;a<e.layers.length;++a){var l=e.layers[a];l.source&&(s[l.id]=l.source)}var u=void 0;for(a=0;a<this.layers.length;++a){var c=s[this.layers[a]];if(!c)return void this.handleError(new Error("could not find source for "+this.layers[a]));if(u){if(u!==c)return void this.handleError(new Error("layers can only use a single source, found "+u+" and "+c))}else u=c}r=u,t=this.layers}else t=r=this.sourceId;t||(t=r=Object.keys(e.sources)[0]),e.sprite&&(e.sprite=f(e.sprite,this.accessToken)),e.glyphs&&(e.glyphs=p(e.glyphs,this.accessToken));var d=e.sources[r];if(d.type===v.VECTOR){var y=this.getSource();y.setUrl(h(d.url,this.accessToken)),(0,i.applyStyle)(this,e,t).then(function(){y.setState(n.default.READY)}).catch(function(e){o.handleError(e)})}else this.handleError(new Error("only works for vector sources, found "+d.type))},r.prototype.handleError=function(e){this.dispatchEvent(new y(e)),this.getSource().setState(n.default.ERROR)},r}(o.default),x=m;exports.default=x; },{"../events/Event.js":"fKNg","../events/EventType.js":"C8cu","../format/MVT.js":"bjcz","../source/State.js":"iC8j","../layer/VectorTile.js":"zOJv","../source/VectorTile.js":"A6uo","ol-mapbox-style":"CreQ"}],"K7j2":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("./ImageBase.js")),e=r(require("./ImageState.js"));function r(t){return t&&t.__esModule?t:{default:t}}var o=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),n=function(t){function r(r,o,n,a,u){var i=this,s=void 0!==u?e.default.IDLE:e.default.LOADED;return(i=t.call(this,r,o,n,s)||this).loader_=void 0!==u?u:null,i.canvas_=a,i.error_=null,i}return o(r,t),r.prototype.getError=function(){return this.error_},r.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=e.default.ERROR):this.state=e.default.LOADED,this.changed()},r.prototype.load=function(){this.state==e.default.IDLE&&(this.state=e.default.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))},r.prototype.getImage=function(){return this.canvas_},r}(t.default),a=n;exports.default=a; },{"./ImageBase.js":"Ojbp","./ImageState.js":"u3kG"}],"GITV":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=l(require("./ImageLayer.js")),t=l(require("./VectorLayer.js")),r=l(require("../../events/EventType.js")),o=l(require("../../ImageCanvas.js")),n=l(require("../../ImageState.js")),i=l(require("../../ViewHint.js")),a=require("../../transform.js"),s=require("../../obj.js"),u=require("../../extent.js"),c=require("../../render.js");function l(e){return e&&e.__esModule?e:{default:e}}var d=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),p=function(e){function l(r){var o=e.call(this,r)||this;return o.vectorRenderer_=new t.default(r),o.layerImageRatio_=r.getImageRatio(),o.coordinateToVectorPixelTransform_=(0,a.create)(),o.renderedPixelToCoordinateTransform_=null,o}return d(l,e),l.prototype.disposeInternal=function(){this.vectorRenderer_.dispose(),e.prototype.disposeInternal.call(this)},l.prototype.getFeatures=function(e){if(this.vectorRenderer_){var t=(0,a.apply)(this.coordinateToVectorPixelTransform_,(0,a.apply)(this.renderedPixelToCoordinateTransform_,e.slice()));return this.vectorRenderer_.getFeatures(t)}return new Promise(function(e,t){e([])})},l.prototype.handleFontsChanged=function(){this.vectorRenderer_.handleFontsChanged()},l.prototype.prepareFrame=function(e){var t=e.pixelRatio,l=e.viewState,d=l.resolution,p=e.viewHints,f=this.vectorRenderer_,h=e.extent;1!==this.layerImageRatio_&&(h=h.slice(0),(0,u.scaleFromCenter)(h,this.layerImageRatio_));var _=(0,u.getWidth)(h)/d,v=(0,u.getHeight)(h)/d;if(!p[i.default.ANIMATING]&&!p[i.default.INTERACTING]&&!(0,u.isEmpty)(h)){f.useContainer(null,null,1);var m=f.context,y=(0,s.assign)({},e,{declutterItems:[],extent:h,size:[_,v],viewState:(0,s.assign)({},e.viewState,{rotation:0})}),g=new o.default(h,d,t,m.canvas,function(e){f.prepareFrame(y)&&f.replayGroupChanged&&(f.clipping=!1,f.renderFrame(y,null),(0,c.renderDeclutterItems)(y,null),e())});g.addEventListener(r.default.CHANGE,function(){if(g.getState()===n.default.LOADED){this.image_=g;var e=g.getResolution(),r=g.getPixelRatio(),o=e*t/r;this.renderedResolution=o,this.coordinateToVectorPixelTransform_=(0,a.compose)(this.coordinateToVectorPixelTransform_,_/2,v/2,1/o,-1/o,0,-l.center[0],-l.center[1])}}.bind(this)),g.load()}return this.image_&&(this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice()),!!this.image_},l.prototype.preRender=function(){},l.prototype.postRender=function(){},l.prototype.forEachFeatureAtCoordinate=function(t,r,o,n,i){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(t,r,o,n,i):e.prototype.forEachFeatureAtCoordinate.call(this,t,r,o,n,i)},l}(e.default),f=p;exports.default=f; },{"./ImageLayer.js":"rzNj","./VectorLayer.js":"F2e3","../../events/EventType.js":"C8cu","../../ImageCanvas.js":"K7j2","../../ImageState.js":"u3kG","../../ViewHint.js":"cuLW","../../transform.js":"P4eA","../../obj.js":"mH6q","../../extent.js":"QDir","../../render.js":"RvU2"}],"VV4h":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("./BaseVector.js")),t=o(require("../renderer/canvas/VectorImageLayer.js")),r=require("../obj.js");function o(e){return e&&e.__esModule?e:{default:e}}var n=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),i=function(e){function o(t){var o=this,n=t||{},i=(0,r.assign)({},n);return delete i.imageRatio,(o=e.call(this,i)||this).imageRatio_=void 0!==n.imageRatio?n.imageRatio:1,o}return n(o,e),o.prototype.getImageRatio=function(){return this.imageRatio_},o.prototype.createRenderer=function(){return new t.default(this)},o}(e.default),a=i;exports.default=a; },{"./BaseVector.js":"pskK","../renderer/canvas/VectorImageLayer.js":"GITV","../obj.js":"mH6q"}],"xlCh":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getValueType=e,exports.isTypeUnique=o,exports.numberToGlsl=u,exports.arrayToGlsl=i,exports.colorToGlsl=l,exports.getStringNumberEquivalent=f,exports.stringToGlsl=a,exports.expressionToGlsl=s,exports.Operators=exports.ValueTypes=void 0;var t=require("../color.js"),r={NUMBER:1,STRING:2,COLOR:4,BOOLEAN:8,NUMBER_ARRAY:16,ANY:31,NONE:0};exports.ValueTypes=r;var n={};function e(e){if("number"==typeof e)return r.NUMBER;if("boolean"==typeof e)return r.BOOLEAN;if("string"==typeof e)return(0,t.isStringColor)(e)?r.COLOR|r.STRING:r.STRING;if(!Array.isArray(e))throw new Error("Unhandled value type: "+JSON.stringify(e));var o=e;if(o.every(function(t){return"number"==typeof t}))return 3===o.length||4===o.length?r.COLOR|r.NUMBER_ARRAY:r.NUMBER_ARRAY;if("string"!=typeof o[0])throw new Error("Expected an expression operator but received: "+JSON.stringify(o));var u=n[o[0]];if(void 0===u)throw new Error("Unrecognized expression operator: "+JSON.stringify(o));return u.getReturnType(o.slice(1))}function o(t){return Math.log2(t)%1==0}function u(t){var r=t.toString();return-1===r.indexOf(".")?r+".0":r}function i(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec"+t.length+"("+t.map(u).join(", ")+")"}function l(r){var n=(0,t.asArray)(r).slice();return n.length<4&&n.push(1),i(n.map(function(t,r){return r<3?t/255:t}))}function f(t,r){return void 0===t.stringLiteralsMap[r]&&(t.stringLiteralsMap[r]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[r]}function a(t,r){return u(f(t,r))}function s(t,o,f){if(Array.isArray(o)&&"string"==typeof o[0]){var s=n[o[0]];if(void 0===s)throw new Error("Unrecognized expression operator: "+JSON.stringify(o));return s.toGlsl(t,o.slice(1),f)}return(e(o)&r.NUMBER)>0?u(o):(e(o)&r.BOOLEAN)>0?o.toString():(e(o)&r.STRING)>0&&(void 0===f||f==r.STRING)?a(t,o.toString()):(e(o)&r.COLOR)>0&&(void 0===f||f==r.COLOR)?l(o):(e(o)&r.NUMBER_ARRAY)>0?i(o):void 0}function c(t){if(!(e(t)&r.NUMBER))throw new Error("A numeric value was expected, got "+JSON.stringify(t)+" instead")}function g(t){for(var r=0;r<t.length;r++)c(t[r])}function p(t){if(!(e(t)&r.STRING))throw new Error("A string value was expected, got "+JSON.stringify(t)+" instead")}function R(t){if(!(e(t)&r.BOOLEAN))throw new Error("A boolean value was expected, got "+JSON.stringify(t)+" instead")}function y(t,r){if(t.length!==r)throw new Error("Exactly "+r+" arguments were expected, got "+t.length+" instead")}function N(t,r){if(t.length<r)throw new Error("At least "+r+" arguments were expected, got "+t.length+" instead")}function v(t,r){if(t.length>r)throw new Error("At most "+r+" arguments were expected, got "+t.length+" instead")}function h(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got "+t+" instead")}function O(t){if(t.length%2==0)throw new Error("An even amount of arguments was expected, got "+t+" instead")}function E(t,r){if(!o(r))throw new Error("Could not infer only one type from the following expression: "+JSON.stringify(t))}function d(t){return{getReturnType:function(t){return r.BOOLEAN},toGlsl:function(n,o){y(o,2);for(var u=r.ANY,i=0;i<o.length;i++)u&=e(o[i]);if(0===u)throw new Error("All arguments should be of compatible type, got "+JSON.stringify(o)+" instead");return"("+s(n,o[0],u)+" "+t+" "+s(n,o[1],u)+")"}}}function w(t){return{getReturnType:function(t){return r.BOOLEAN},toGlsl:function(r,n){N(n,2);for(var e=0;e<n.length;e++)R(n[e]);return"("+n.map(function(t){return s(r,t)}).join(" "+t+" ")+")"}}}exports.Operators=n,n.get={getReturnType:function(t){return r.ANY},toGlsl:function(t,r){y(r,1),p(r[0]);var n=r[0].toString();return-1===t.attributes.indexOf(n)&&t.attributes.push(n),(t.inFragmentShader?"v_":"a_")+n}},n.var={getReturnType:function(t){return r.ANY},toGlsl:function(t,r){y(r,1),p(r[0]);var n=r[0].toString();return-1===t.variables.indexOf(n)&&t.variables.push(n),"u_"+n}},n.time={getReturnType:function(t){return r.NUMBER},toGlsl:function(t,r){return y(r,0),"u_time"}},n.zoom={getReturnType:function(t){return r.NUMBER},toGlsl:function(t,r){return y(r,0),"u_zoom"}},n.resolution={getReturnType:function(t){return r.NUMBER},toGlsl:function(t,r){return y(r,0),"u_resolution"}},n["*"]={getReturnType:function(t){return r.NUMBER},toGlsl:function(t,r){return y(r,2),g(r),"("+s(t,r[0])+" * "+s(t,r[1])+")"}},n["/"]={getReturnType:function(t){return r.NUMBER},toGlsl:function(t,r){return y(r,2),g(r),"("+s(t,r[0])+" / "+s(t,r[1])+")"}},n["+"]={getReturnType:function(t){return r.NUMBER},toGlsl:function(t,r){return y(r,2),g(r),"("+s(t,r[0])+" + "+s(t,r[1])+")"}},n["-"]={getReturnType:function(t){return r.NUMBER},toGlsl:function(t,r){return y(r,2),g(r),"("+s(t,r[0])+" - "+s(t,r[1])+")"}},n.clamp={getReturnType:function(t){return r.NUMBER},toGlsl:function(t,r){y(r,3),g(r);var n=s(t,r[1]),e=s(t,r[2]);return"clamp("+s(t,r[0])+", "+n+", "+e+")"}},n["%"]={getReturnType:function(t){return r.NUMBER},toGlsl:function(t,r){return y(r,2),g(r),"mod("+s(t,r[0])+", "+s(t,r[1])+")"}},n["^"]={getReturnType:function(t){return r.NUMBER},toGlsl:function(t,r){return y(r,2),g(r),"pow("+s(t,r[0])+", "+s(t,r[1])+")"}},n[">"]={getReturnType:function(t){return r.BOOLEAN},toGlsl:function(t,r){return y(r,2),g(r),"("+s(t,r[0])+" > "+s(t,r[1])+")"}},n[">="]={getReturnType:function(t){return r.BOOLEAN},toGlsl:function(t,r){return y(r,2),g(r),"("+s(t,r[0])+" >= "+s(t,r[1])+")"}},n["<"]={getReturnType:function(t){return r.BOOLEAN},toGlsl:function(t,r){return y(r,2),g(r),"("+s(t,r[0])+" < "+s(t,r[1])+")"}},n["<="]={getReturnType:function(t){return r.BOOLEAN},toGlsl:function(t,r){return y(r,2),g(r),"("+s(t,r[0])+" <= "+s(t,r[1])+")"}},n["=="]=d("=="),n["!="]=d("!="),n["!"]={getReturnType:function(t){return r.BOOLEAN},toGlsl:function(t,r){return y(r,1),R(r[0]),"(!"+s(t,r[0])+")"}},n.all=w("&&"),n.any=w("||"),n.between={getReturnType:function(t){return r.BOOLEAN},toGlsl:function(t,r){y(r,3),g(r);var n=s(t,r[1]),e=s(t,r[2]),o=s(t,r[0]);return"("+o+" >= "+n+" && "+o+" <= "+e+")"}},n.array={getReturnType:function(t){return r.NUMBER_ARRAY},toGlsl:function(t,n){N(n,2),v(n,4),g(n);var e=n.map(function(n){return s(t,n,r.NUMBER)});return"vec"+n.length+"("+e.join(", ")+")"}},n.color={getReturnType:function(t){return r.COLOR},toGlsl:function(t,n){N(n,3),v(n,4),g(n);var e=n;3===n.length&&e.push(1);var o=n.map(function(n,e){return s(t,n,r.NUMBER)+(e<3?" / 255.0":"")});return"vec"+n.length+"("+o.join(", ")+")"}},n.interpolate={getReturnType:function(t){for(var n=r.COLOR|r.NUMBER,o=3;o<t.length;o+=2)n&=e(t[o]);return n},toGlsl:function(t,e,o){h(e),N(e,6);var i,l=e[0];switch(l[0]){case"linear":i=1;break;case"exponential":i=l[1];break;default:i=null}if(!i)throw new Error('Invalid interpolation type for "interpolate" operator, received: '+JSON.stringify(l));var f=void 0!==o?o:r.ANY,a=n.interpolate.getReturnType(e)&f;E(e,a);for(var c=s(t,e[1]),g=null,p=2;p<e.length-2;p+=2){var R=s(t,e[p]),y=s(t,e[p+1],a),v=s(t,e[p+2]);g="mix("+(g||y)+", "+s(t,e[p+3],a)+", pow(clamp(("+c+" - "+R+") / ("+v+" - "+R+"), 0.0, 1.0), "+u(i)+"))"}return g}},n.match={getReturnType:function(t){for(var n=r.ANY,o=2;o<t.length;o+=2)n&=e(t[o]);return n&=e(t[t.length-1])},toGlsl:function(t,e,o){h(e),N(e,4);var u=void 0!==o?o:r.ANY,i=n.match.getReturnType(e)&u;E(e,i);for(var l=s(t,e[0]),f=s(t,e[e.length-1],i),a=null,c=e.length-3;c>=1;c-=2){a="("+l+" == "+s(t,e[c])+" ? "+s(t,e[c+1],i)+" : "+(a||f)+")"}return a}},n.case={getReturnType:function(t){for(var n=r.ANY,o=1;o<t.length;o+=2)n&=e(t[o]);return n&=e(t[t.length-1])},toGlsl:function(t,e,o){O(e),N(e,3);var u=void 0!==o?o:r.ANY,i=n.case.getReturnType(e)&u;E(e,i);for(var l=0;l<e.length-1;l+=2)R(e[l]);var f=s(t,e[e.length-1],i),a=null;for(l=e.length-3;l>=0;l-=2){a="("+s(t,e[l])+" ? "+s(t,e[l+1],i)+" : "+(a||f)+")"}return a}}; },{"../color.js":"eucy"}],"iRdz":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseLiteralStyle=o,exports.ShaderBuilder=void 0;var e=require("../style/expressions.js"),t=function(){function e(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return e.prototype.addUniform=function(e){return this.uniforms.push(e),this},e.prototype.addAttribute=function(e){return this.attributes.push(e),this},e.prototype.addVarying=function(e,t,o){return this.varyings.push({name:e,type:t,expression:o}),this},e.prototype.setSizeExpression=function(e){return this.sizeExpression=e,this},e.prototype.setRotationExpression=function(e){return this.rotationExpression=e,this},e.prototype.setSymbolOffsetExpression=function(e){return this.offsetExpression=e,this},e.prototype.setColorExpression=function(e){return this.colorExpression=e,this},e.prototype.setTextureCoordinateExpression=function(e){return this.texCoordExpression=e,this},e.prototype.setFragmentDiscardExpression=function(e){return this.discardExpression=e,this},e.prototype.setSymbolRotateWithView=function(e){return this.rotateWithView=e,this},e.prototype.getSizeExpression=function(){return this.sizeExpression},e.prototype.getOffsetExpression=function(){return this.offsetExpression},e.prototype.getColorExpression=function(){return this.colorExpression},e.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},e.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},e.prototype.getSymbolVertexShader=function(e){var t=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",o=this.attributes,i=this.varyings;return e&&(o=o.concat("vec4 a_hitColor"),i=i.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n"+this.uniforms.map(function(e){return"uniform "+e+";"}).join("\n")+"\nattribute vec2 a_position;\nattribute float a_index;\n"+o.map(function(e){return"attribute "+e+";"}).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+i.map(function(e){return"varying "+e.type+" "+e.name+";"}).join("\n")+"\nvoid main(void) {\n mat4 offsetMatrix = "+t+";\n vec2 halfSize = "+this.sizeExpression+" * 0.5;\n vec2 offset = "+this.offsetExpression+";\n float angle = "+this.rotationExpression+";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = "+this.texCoordExpression+";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n"+i.map(function(e){return" "+e.name+" = "+e.expression+";"}).join("\n")+"\n}"},e.prototype.getSymbolFragmentShader=function(e){var t=e?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",o=this.varyings;return e&&(o=o.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n"+this.uniforms.map(function(e){return"uniform "+e+";"}).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+o.map(function(e){return"varying "+e.type+" "+e.name+";"}).join("\n")+"\nvoid main(void) {\n if ("+this.discardExpression+") { discard; }\n gl_FragColor = "+this.colorExpression+";\n gl_FragColor.rgb *= gl_FragColor.a;\n"+t+"\n}"},e}();function o(o){var i=o.symbol,s=void 0!==i.size?i.size:1,r=i.color||"white",n=i.textureCoord||[0,0,1,1],a=i.offset||[0,0],f=void 0!==i.opacity?i.opacity:1,u=void 0!==i.rotation?i.rotation:0,l={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{}},p=(0,e.expressionToGlsl)(l,s,e.ValueTypes.NUMBER_ARRAY|e.ValueTypes.NUMBER),x=(0,e.expressionToGlsl)(l,a,e.ValueTypes.NUMBER_ARRAY),c=(0,e.expressionToGlsl)(l,n,e.ValueTypes.NUMBER_ARRAY),d=(0,e.expressionToGlsl)(l,u,e.ValueTypes.NUMBER),h={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap},v=(0,e.expressionToGlsl)(h,r,e.ValueTypes.COLOR),y=(0,e.expressionToGlsl)(h,f,e.ValueTypes.NUMBER),m="1.0",g="vec2("+(0,e.expressionToGlsl)(h,s,e.ValueTypes.NUMBER_ARRAY|e.ValueTypes.NUMBER)+").x";switch(i.symbolType){case"square":case"image":break;case"circle":m="(1.0-smoothstep(1.-4./"+g+",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))";break;case"triangle":var _="(v_quadCoord*2.-1.)",E="(atan("+_+".x,"+_+".y))";m="(1.0-smoothstep(.5-3./"+g+",.5,cos(floor(.5+"+E+"/2.094395102)*2.094395102-"+E+")*length("+_+")))";break;default:throw new Error("Unexpected symbol type: "+i.symbolType)}var b=(new t).setSizeExpression("vec2("+p+")").setRotationExpression(d).setSymbolOffsetExpression(x).setTextureCoordinateExpression(c).setSymbolRotateWithView(!!i.rotateWithView).setColorExpression("vec4("+v+".rgb, "+v+".a * "+y+" * "+m+")");if(o.filter){var C=(0,e.expressionToGlsl)(h,o.filter,e.ValueTypes.BOOLEAN);b.setFragmentDiscardExpression("!"+C)}var S={};if(h.variables.forEach(function(t){b.addUniform("float u_"+t),S["u_"+t]=function(){if(!o.variables||void 0===o.variables[t])throw new Error("The following variable is missing from the style: "+t);var i=o.variables[t];return"string"==typeof i&&(i=(0,e.getStringNumberEquivalent)(l,i)),void 0!==i?i:-9999999}}),"image"===i.symbolType&&i.src){var z=new Image;z.src=i.src,b.addUniform("sampler2D u_texture").setColorExpression(b.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),S.u_texture=z}return h.attributes.forEach(function(e){-1===l.attributes.indexOf(e)&&l.attributes.push(e),b.addVarying("v_"+e,"float","a_"+e)}),l.attributes.forEach(function(e){b.addAttribute("float a_"+e)}),{builder:b,attributes:l.attributes.map(function(t){return{name:t,callback:function(o,i){var s=i[t];return"string"==typeof s&&(s=(0,e.getStringNumberEquivalent)(l,s)),void 0!==s?s:-9999999}}}),uniforms:S}}exports.ShaderBuilder=t; },{"../style/expressions.js":"xlCh"}],"sCa7":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=s(require("./Layer.js")),t=s(require("../renderer/webgl/PointsLayer.js")),r=require("../obj.js"),i=require("../webgl/ShaderBuilder.js");function s(e){return e&&e.__esModule?e:{default:e}}var n=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),o=function(e){function s(t){var s=this,n=(0,r.assign)({},t);return(s=e.call(this,n)||this).parseResult_=(0,i.parseLiteralStyle)(t.style),s.hitDetectionDisabled_=!!t.disableHitDetection,s}return n(s,e),s.prototype.createRenderer=function(){return new t.default(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitVertexShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolFragmentShader(!0),uniforms:this.parseResult_.uniforms,attributes:this.parseResult_.attributes})},s.prototype.disposeInternal=function(){this.getRenderer().disposeInternal(),e.prototype.disposeInternal.call(this)},s}(e.default),a=o;exports.default=a; },{"./Layer.js":"GCgv","../renderer/webgl/PointsLayer.js":"m8cI","../obj.js":"mH6q","../webgl/ShaderBuilder.js":"iRdz"}],"ZVaS":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Graticule",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"Group",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"Heatmap",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"Image",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"Layer",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"MapboxVector",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(exports,"Tile",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(exports,"Vector",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"VectorImage",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"VectorTile",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(exports,"WebGLPoints",{enumerable:!0,get:function(){return c.default}});var e=p(require("./layer/Graticule.js")),r=p(require("./layer/Group.js")),t=p(require("./layer/Heatmap.js")),u=p(require("./layer/Image.js")),n=p(require("./layer/Layer.js")),o=p(require("./layer/MapboxVector.js")),a=p(require("./layer/Tile.js")),i=p(require("./layer/Vector.js")),l=p(require("./layer/VectorImage.js")),f=p(require("./layer/VectorTile.js")),c=p(require("./layer/WebGLPoints.js"));function p(e){return e&&e.__esModule?e:{default:e}} },{"./layer/Graticule.js":"wXs0","./layer/Group.js":"q0nK","./layer/Heatmap.js":"I4BI","./layer/Image.js":"KHBf","./layer/Layer.js":"GCgv","./layer/MapboxVector.js":"VqZN","./layer/Tile.js":"BUEc","./layer/Vector.js":"dflx","./layer/VectorImage.js":"VV4h","./layer/VectorTile.js":"zOJv","./layer/WebGLPoints.js":"sCa7"}],"sr95":[function(require,module,exports) { var define; var t;!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("ol/control/Control")):"function"==typeof t&&t.amd?t(["ol/control/Control"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).ContextMenu=n(e.ol.control.Control)}(this,function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),n="ol-ctx-menu",i={namespace:n,container:n+"-container",separator:n+"-separator",submenu:n+"-submenu",hidden:n+"-hidden",icon:n+"-icon",zoomIn:n+"-zoom-in",zoomOut:n+"-zoom-out",unselectable:"ol-unselectable"},o=i,s="contextmenu",a={width:150,scrollAt:4,eventType:s,defaultItems:!0},r=[{text:"Zoom In",classname:i.zoomIn+" "+i.icon,callback:function(t,e){var n=e.getView();n.animate({zoom:+n.getZoom()+1,duration:700,center:t.coordinate})}},{text:"Zoom Out",classname:i.zoomOut+" "+i.icon,callback:function(t,e){var n=e.getView();n.animate({zoom:+n.getZoom()-1,duration:700,center:t.coordinate})}}];function l(t,e){if(void 0===e&&(e="Assertion failed"),!t){if("undefined"!=typeof Error)throw new Error(e);throw e}}function c(t){return/^\d+$/.test(t)}function h(t,e){return t.classList?t.classList.contains(e):m(e).test(t.className)}function p(t,e,n){void 0===e&&(e=window.document);var i=Array.prototype.slice,o=[];if(/^(#?[\w-]+|\.[\w-.]+)$/.test(t))switch(t[0]){case"#":o=[u(t.substr(1))];break;case".":o=i.call(e.getElementsByClassName(t.substr(1).replace(/\./g," ")));break;default:o=i.call(e.getElementsByTagName(t))}else o=i.call(e.querySelectorAll(t));return n?o:o[0]}function u(t){return t="#"===t[0]?t.substr(1,t.length):t,document.getElementById(t)}function d(t){var e=document.createDocumentFragment(),n=document.createElement("div");for(n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild);return e}function m(t){return new RegExp("(^|\\s+) "+t+" (\\s+|$)")}function f(t,e,n){t.classList?t.classList.add(e):t.className=(t.className+" "+e).trim(),n&&c(n)&&window.setTimeout(function(){return y(t,e)},n)}function y(t,e,n){t.classList?t.classList.remove(e):t.className=t.className.replace(m(e)," ").trim(),n&&c(n)&&window.setTimeout(function(){return f(t,e)},n)}var v=function(t){return this.Base=t,this.map=void 0,this.viewport=void 0,this.coordinateClicked=void 0,this.pixelClicked=void 0,this.lineHeight=0,this.items={},this.opened=!1,this.submenu={left:t.options.width-15+"px",lastLeft:""},this.eventHandler=this.handleEvent.bind(this),this.eventMapMoveHandler=this.handleMapMoveEvent.bind(this),this};v.prototype.init=function(t){this.map=t,this.viewport=t.getViewport(),this.setListeners(),this.Base.Html.createMenu(),this.lineHeight=this.getItemsLength()>0?this.Base.container.offsetHeight/this.getItemsLength():this.Base.Html.cloneAndGetLineHeight()},v.prototype.getItemsLength=function(){var t=this,e=0;return Object.keys(this.items).forEach(function(n){t.items[n].submenu||t.items[n].separator||e++}),e},v.prototype.getPixelClicked=function(){return this.pixelClicked},v.prototype.getCoordinateClicked=function(){return this.coordinateClicked},v.prototype.positionContainer=function(t){var e=this,n=this.Base.container,i=this.map.getSize(),s=i[1]-t[1],a=i[0]-t[0],r=n.offsetWidth,l=Math.round(this.lineHeight*this.getItemsLength()),c=p("li."+o.submenu+">div",n,!0);a>=r?(n.style.right="auto",n.style.left=t[0]+5+"px"):(n.style.left="auto",n.style.right="15px"),s>=l?(n.style.bottom="auto",n.style.top=t[1]-10+"px"):(n.style.top="auto",n.style.bottom=0),function t(e,n,i){if(Array.isArray(e))e.forEach(function(e){return t(e,n,i)});else for(var o=Array.isArray(n)?n:n.split(/\s+/),s=o.length;s--;)h(e,o[s])&&y(e,o[s],i)}(n,o.hidden),c.length&&(this.submenu.lastLeft=a<2*r?"-"+r+"px":this.submenu.left,c.forEach(function(t){window.innerWidth||document.documentElement.clientWidth;var n,i,o,a=window.innerHeight||document.documentElement.clientHeight,r=(i=(n=t).getBoundingClientRect(),o=document.documentElement,{left:i.left+window.pageXOffset-o.clientLeft,top:i.top+window.pageYOffset-o.clientTop,width:n.offsetWidth,height:n.offsetHeight}),l=r.height,c=s-l;c<0&&(c=l-(a-r.top),t.style.top="-"+c+"px"),t.style.left=e.submenu.lastLeft}))},v.prototype.openMenu=function(t,e){this.Base.dispatchEvent({type:"open",pixel:t,coordinate:e}),this.opened=!0,this.positionContainer(t)},v.prototype.closeMenu=function(){this.opened=!1,function t(e,n,i){if(Array.isArray(e))e.forEach(function(e){return t(e,n)});else for(var o=Array.isArray(n)?n:n.split(/\s+/),s=o.length;s--;)h(e,o[s])||f(e,o[s],i)}(this.Base.container,o.hidden),this.Base.dispatchEvent({type:"close"})},v.prototype.setListeners=function(){this.viewport.addEventListener(this.Base.options.eventType,this.eventHandler,!1),this.map.on("movestart",this.eventMapMoveHandler)},v.prototype.removeListeners=function(){this.viewport.removeEventListener(this.Base.options.eventType,this.eventHandler,!1),this.map.un("movestart",this.eventMapMoveHandler)},v.prototype.handleEvent=function(t){var e=this;this.coordinateClicked=this.map.getEventCoordinate(t),this.pixelClicked=this.map.getEventPixel(t),this.Base.dispatchEvent({type:"beforeopen",pixel:this.pixelClicked,coordinate:this.coordinateClicked}),this.Base.disabled||(this.Base.options.eventType===s&&(t.stopPropagation(),t.preventDefault()),this.openMenu(this.pixelClicked,this.coordinateClicked),t.target.addEventListener("pointerdown",{handleEvent:function(n){e.opened&&(e.closeMenu(),n.stopPropagation(),t.target.removeEventListener(n.type,this,!1))}},!1))},v.prototype.handleMapMoveEvent=function(t){this.closeMenu()},v.prototype.setItemListener=function(t,e){var n,i=this;t&&"function"==typeof this.items[e].callback&&(n=this.items[e].callback,t.addEventListener("click",function(t){t.preventDefault();var o={coordinate:i.getCoordinateClicked(),data:i.items[e].data||null};i.closeMenu(),n(o,i.map)},!1))};var g=function(t){return this.Base=t,this.Base.container=this.container=this.createContainer(!0),this};return g.prototype.createContainer=function(t){var e=document.createElement("div"),n=document.createElement("ul"),i=[o.container,o.unselectable];return t&&i.push(o.hidden),e.className=i.join(" "),e.style.width=parseInt(this.Base.options.width,10)+"px",e.appendChild(n),e},g.prototype.createMenu=function(){var t=[];if("items"in this.Base.options?t=this.Base.options.defaultItems?this.Base.options.items.concat(r):this.Base.options.items:this.Base.options.defaultItems&&(t=r),0===t.length)return!1;t.forEach(this.addMenuEntry,this)},g.prototype.addMenuEntry=function(t){var e,n=this;if(t.items&&Array.isArray(t.items)){t.classname=t.classname||"",e=o.submenu,~t.classname.indexOf(e)||(t.classname=t.classname.length?" "+o.submenu:o.submenu);var i=this.generateHtmlAndPublish(this.container,t),s=this.createContainer();s.style.left=this.Base.Internal.submenu.lastLeft||this.Base.Internal.submenu.left,i.appendChild(s),t.items.forEach(function(t){n.generateHtmlAndPublish(s,t,!0)})}else this.generateHtmlAndPublish(this.container,t)},g.prototype.generateHtmlAndPublish=function(t,e,n){var i,s,a="_"+Math.random().toString(36).substr(2,9),r=!1;return"string"==typeof e&&"-"===e.trim()?(i=d('<li id="'+a+'" class="'+o.separator+'"><hr></li>'),s=[].slice.call(i.childNodes,0)[0],t.firstChild.appendChild(i),r=!0):(e.classname=e.classname||"",i=d("<span>"+e.text+"</span>"),s=document.createElement("li"),e.icon&&(""===e.classname?e.classname=o.icon:-1===e.classname.indexOf(o.icon)&&(e.classname+=" "+o.icon),s.setAttribute("style","background-image:url("+e.icon+")")),s.id=a,s.className=e.classname,s.appendChild(i),t.firstChild.appendChild(s)),this.Base.Internal.items[a]={id:a,submenu:n||0,separator:r,callback:e.callback,data:e.data||null},this.Base.Internal.setItemListener(s,a),s},g.prototype.removeMenuEntry=function(t){var e=p("#"+t,this.container.firstChild);e&&this.container.firstChild.removeChild(e),delete this.Base.Internal.items[t]},g.prototype.cloneAndGetLineHeight=function(){var t=this.container.cloneNode(),e=d("<span>Foo</span>"),n=d("<span>Foo</span>"),i=document.createElement("li"),o=document.createElement("li");i.appendChild(e),o.appendChild(n),t.appendChild(i),t.appendChild(o),this.container.parentNode.appendChild(t);var s=t.offsetHeight/2;return this.container.parentNode.removeChild(t),s},function(t){function e(e){void 0===e&&(e={}),l("object"==typeof e,"@param `opt_options` should be object type!"),this.options=function(t,e){var n={};for(var i in t)n[i]=t[i];for(var o in e)n[o]=e[o];return n}(a,e),this.disabled=!1,this.Internal=new v(this),this.Html=new g(this),t.call(this,{element:this.container})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clear=function(){Object.keys(this.Internal.items).forEach(this.Html.removeMenuEntry,this.Html)},e.prototype.close=function(){this.Internal.closeMenu()},e.prototype.enable=function(){this.disabled=!1},e.prototype.disable=function(){this.disabled=!0},e.prototype.getDefaultItems=function(){return r},e.prototype.countItems=function(){return Object.keys(this.Internal.items).length},e.prototype.extend=function(t){l(Array.isArray(t),"@param `arr` should be an Array."),t.forEach(this.push,this)},e.prototype.isOpen=function(){return this.Internal.opened},e.prototype.updatePosition=function(t){l(Array.isArray(t),"@param `pixel` should be an Array."),this.isOpen()&&this.Internal.positionContainer(t)},e.prototype.pop=function(){var t=Object.keys(this.Internal.items);this.Html.removeMenuEntry(t[t.length-1])},e.prototype.push=function(t){l(null!=t,"@param `item` must be informed."),this.Html.addMenuEntry(t)},e.prototype.shift=function(){this.Html.removeMenuEntry(Object.keys(this.Internal.items)[0])},e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e?this.Internal.init(e,this):this.Internal.removeListeners()},e}(e.default)}); },{"ol/control/Control":"xxE2"}],"rePj":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.ol_ext_inherits=void 0,window.ol&&!ol.ext&&(ol.ext={});var e=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e};exports.ol_ext_inherits=e,window.ol&&(ol.inherits||(ol.inherits=e)),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),window.Element&&!Element.prototype.remove&&(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)});var t=e;exports.default=t; },{}],"dlS6":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=a(require("../util/ext")),i=a(require("ol/style/RegularShape")),s=a(require("ol/style/Fill")),e=require("ol/color");function a(t){return t&&t.__esModule?t:{default:t}}var o=function(t){var e=t||{},a=0;t.stroke&&(a=t.stroke.getWidth()),i.default.call(this,{radius:e.radius+a,fill:new s.default({color:[0,0,0]}),rotation:e.rotation,snapToPixel:e.snapToPixel}),e.scale&&this.setScale(e.scale),this.stroke_=e.stroke,this.radius_=e.radius||20,this.donutratio_=e.donutRatio||.5,this.type_=e.type,this.offset_=[e.offsetX?e.offsetX:0,e.offsetY?e.offsetY:0],this.animation_="number"==typeof e.animation?{animate:!0,step:e.animation}:this.animation_={animate:!1,step:1},this.max_=e.max,this.data_=e.data,e.colors instanceof Array?this.colors_=e.colors:(this.colors_=o.colors[e.colors],this.colors_||(this.colors_=o.colors.classic)),this.renderChart_()};(0,t.default)(o,i.default),o.colors={classic:["#ffa500","blue","red","green","cyan","magenta","yellow","#0f0"],dark:["#960","#003","#900","#060","#099","#909","#990","#090"],pale:["#fd0","#369","#f64","#3b7","#880","#b5d","#666"],pastel:["#fb4","#79c","#f66","#7d7","#acc","#fdd","#ff9","#b9b"],neon:["#ff0","#0ff","#0f0","#f0f","#f00","#00f"]},o.prototype.clone=function(){var t=new o({type:this.type_,radius:this.radius_,rotation:this.getRotation(),scale:this.getScale(),data:this.getData(),snapToPixel:!!this.getSnapToPixel&&this.getSnapToPixel(),stroke:this.stroke_,colors:this.colors_,offsetX:this.offset_[0],offsetY:this.offset_[1],animation:this.animation_});return t.setScale(this.getScale()),t.setOpacity(this.getOpacity()),t},o.prototype.getData=function(){return this.data_},o.prototype.setData=function(t){this.data_=t,this.renderChart_()},o.prototype.getRadius=function(){return this.radius_},o.prototype.setRadius=function(t,i){this.radius_=t,this.donuratio_=i||this.donuratio_,this.renderChart_()},o.prototype.setAnimation=function(t){if(!1===t){if(0==this.animation_.animate)return;this.animation_.animate=!1}else{if(this.animation_.step==t)return;this.animation_.animate=!0,this.animation_.step=t}this.renderChart_()},o.prototype.renderChart_=function(){var t,i=0;this.stroke_&&(t=(0,e.asString)(this.stroke_.getColor()),i=this.stroke_.getWidth());var s=this.getImage(),a=s.getContext("2d");a.clearRect(0,0,s.width,s.height),a.lineJoin="round";var o,r,h=0;for(o=0;o<this.data_.length;o++)h+=this.data_[o];a.setTransform(1,0,0,1,0,0),a.translate(0,0);var n=this.animation_.animate?this.animation_.step:1;switch(this.type_){case"donut":case"pie3D":case"pie":var l,_=Math.PI*(n-1.5);for(r=s.width/2,a.strokeStyle=t,a.lineWidth=i,a.save(),"pie3D"==this.type_&&(a.translate(0,.3*r),a.scale(1,.7),a.beginPath(),a.fillStyle="#369",a.arc(r,1.4*r,this.radius_*n,0,2*Math.PI),a.fill(),a.stroke()),"donut"==this.type_&&(a.save(),a.beginPath(),a.rect(0,0,2*r,2*r),a.arc(r,r,this.radius_*n*this.donutratio_,0,2*Math.PI),a.clip("evenodd")),o=0;o<this.data_.length;o++)a.beginPath(),a.moveTo(r,r),a.fillStyle=this.colors_[o%this.colors_.length],l=_+2*Math.PI*this.data_[o]/h*n,a.arc(r,r,this.radius_*n,_,l),a.closePath(),a.fill(),a.stroke(),_=l;"donut"==this.type_&&(a.restore(),a.beginPath(),a.strokeStyle=t,a.lineWidth=i,a.arc(r,r,this.radius_*n*this.donutratio_,Math.PI*(n-1.5),_),a.stroke()),a.restore();break;case"bar":default:var d=0;if(this.max_)d=this.max_;else for(o=0;o<this.data_.length;o++)d<this.data_[o]&&(d=this.data_[o]);var c=Math.min(5,2*this.radius_/this.data_.length);r=s.width/2;var f,u=s.width-i,p=r-this.data_.length*c/2;for(a.strokeStyle=t,a.lineWidth=i,o=0;o<this.data_.length;o++){a.beginPath(),a.fillStyle=this.colors_[o%this.colors_.length],f=p+c;var m=this.data_[o]/d*2*this.radius_*n;a.rect(p,u-m,c,m),a.closePath(),a.fill(),a.stroke(),p=f}}var g=this.getAnchor();g[0]=r-this.offset_[0],g[1]=r-this.offset_[1]},o.prototype.getChecksum=function(){var t=null!==this.stroke_?this.stroke_.getChecksum():"-";if(null===this.checksums_||t!=this.checksums_[1]||null!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.data_.join("|")!=this.checksums_[4]){var i="c"+t+void 0+(void 0!==this.radius_?this.radius_.toString():"-")+this.data_.join("|");this.checksums_=[i,t,void 0,this.radius_,this.data_.join("|")]}return this.checksums_[0]};var r=o;exports.default=r; },{"../util/ext":"rePj","ol/style/RegularShape":"il3X","ol/style/Fill":"AFcg","ol/color":"eucy"}],"DiVX":[function(require,module,exports) { "use strict";function o(){var o=new Object;return o.wcagSetContrast=function(o){(jQuery("body").removeClass("we-wcag-contrast-1 we-wcag-contrast-2 we-wcag-contrast-3"),void 0!==o)?((o=parseInt(o))&&jQuery("body").addClass("we-wcag-contrast-"+o),jQuery.cookie("wcagSetContrast",o,{path:"/"})):((o=void 0!==(o=jQuery.cookie("wcagSetContrast"))?(o=parseInt(o)+1)>3?0:o:1)&&jQuery("body").addClass("we-wcag-contrast-"+o),jQuery.cookie("wcagSetContrast",o,{path:"/"}))},o.wcagSetFontSize=function(o){(jQuery("body").removeClass("we-wcag-fontsize-1 we-wcag-fontsize-2 we-wcag-fontsize-3"),void 0!==o)?((o=parseInt(o))&&jQuery("body").addClass("we-wcag-fontsize-"+o),jQuery.cookie("wcagSetFontSize",o,{path:"/"})):((o=void 0!==(o=jQuery.cookie("wcagSetFontSize"))?(o=parseInt(o)+1)>3?0:o:1)&&jQuery("body").addClass("we-wcag-fontsize-"+o),jQuery.cookie("wcagSetFontSize",o,{path:"/"}))},o.wcagSetFontSizeHtml=function(o){void 0!==o&&o&&(jQuery("html").css("font-size",o),jQuery.cookie("wcagSetFontSizeHtml",o,{path:"/"}))},o.WysiwygEditor=function(o){"undefined"!=typeof tinymce&&""!=o&&tinymce.init({selector:"textarea#"+o,language:"pl",plugins:["code","autolink","link","image","lists","advlist","hr","nonbreaking","autoresize","searchreplace","wordcount","visualblocks","visualchars","fullscreen","insertdatetime","paste","table"],autoresize_max_height:500,toolbar:"insertfile undo redo | bold italic underline strikethrough removeformat | link image | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect fontsizeselect",fontsize_formats:"0.5em 0.6em 0.7em 0.8em 0.9em 1.0em 1.1em 1.2em 1.3em 1.4em 1.5em 1.6em 1.7em 1.8em 1.9em 2.0em 2.1em 2.2em 2.3em 2.4em 2.5em 2.6em 2.7em 2.8em 2.9em 3.0em",convert_urls:!1,relative_urls:!1,entity_encoding:"raw"})},o.Get3100FormError=function(o,a){a=a||"wystąpił błąd: #000",o&&(jQuery("#"+o+"Modal .modal-body").html(a),jQuery("#"+o+"Modal").modal("show"))},o.Get3100FormWait=function(o){o&&(jQuery("#"+o+"Modal .modal-body").html('<p class="p-0 m-0">czekaj, wysyłamy dane na serwer....</p>'),jQuery("#"+o+"Modal").modal("show"))},o.Get3100FormNext=function(o,a){o&&(jQuery("#"+o+"Modal .modal-body-message").html(a),jQuery("#"+o+"Modal").modal("show"))},o.Get3100FormModalHide=function(o){o&&jQuery("#"+o+"Modal").modal("hide")},o.Get3100FormSuccess=function(o){o&&(jQuery("#"+o+" .we-structure-div-form").addClass("d-none"),jQuery("#"+o+" .we-structure-div-info").removeClass("d-none").addClass("d-block"),setTimeout(function(){jQuery("#"+o+"Modal").modal("hide")},1e3))},o.Get1190LogIn=function(a){var e=void 0!==a.SERVICE?a.SERVICE:null,l=void 0!==a.IDDOCMOD?a.IDDOCMOD:null,d=void 0!==a.IDDOCUMENT?a.IDDOCUMENT:null,r=void 0!==a.IDMODULE?a.IDMODULE:null,n=void 0!==a.CODE?a.CODE:null;if(null==e||null==l||null==n)jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Błędne wywołanie parametrów - odśwież stronę i spróbuj ponownie.</p>'),jQuery("#Modal"+l).modal("show");else{var s=jQuery("#WEFORMUSERNAME"+l).val(),t=jQuery("#WEFORMPASSWORD"+l).val();""!=s&&""!=t?jQuery.ajax({type:"POST",url:e,data:{IDSERVICE:9050,IDMODULE:1151,IDTOOLS:800,IDDOCMOD:l,IDDOC:d,IDMOD:r,CODE:n},beforeSend:function(){jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Czekaj, pobieram token...</p>'),jQuery("#Modal"+l).modal("show")},success:function(a){if(void 0!==a.STATUS||void 0!==a.TOKEN){var u=void 0!==a.STATUS?parseInt(a.STATUS):0,i=void 0!==a.TOKEN?a.TOKEN:"";if(1==u&&i.length>0){(m=new jsSHA("SHA-512","TEXT")).update(t);var m,y=m.getHash("HEX");(m=new jsSHA("SHA-512","TEXT")).update(y+i);var p=m.getHash("HEX");jQuery.ajax({type:"POST",url:e,data:{IDSERVICE:1190,IDMODULE:1151,IDTOOLS:800,IDRUN:100,IDDOCMOD:l,IDDOC:d,IDMOD:r,TOKEN:i,CODE:n,LOGIN:s,PASSW:p},beforeSend:function(){jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Czekaj, wysyłam dane do logowania na serwer.</p>'),jQuery("#Modal"+l).modal("show")},success:function(o){if(void 0!==o.STATUS||void 0!==o.IDUSER){var a=void 0!==o.STATUS?parseInt(o.STATUS):0,e=void 0!==o.IDUSER?parseInt(o.IDUSER):0;1==a&&e>0?(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Zalogowano do systemu.</p>'),jQuery("#Modal"+l).modal("show"),window.location.reload(!1)):(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Podane dane do logowania są niepoprawne, konto nie istnieje, jest nieuwieżytelnione lub zablokowane.</p>'),jQuery("#Modal"+l).modal("show"))}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Wystąpił błąd w komunikacji z serwerem.</p>'),jQuery("#Modal"+l).modal("show")},error:function(a,e,d){var r=o.BSAjaxError(a,e,d);jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">'+r+"</p>"),jQuery("#Modal"+l).modal("show")},complete:function(){},dataType:"json"})}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie udało się pobrać unikalny klucz z serwera. Proszę spróbować ponownie.</p>'),jQuery("#Modal"+l).modal("show")}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Wystąpił błąd w komunikacji z serwerem.</p>'),jQuery("#Modal"+l).modal("show")},error:function(a,e,d){var r=o.BSAjaxError(a,e,d);jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">'+r+"</p>"),jQuery("#Modal"+l).modal("show")},complete:function(){},dataType:"json"}):(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Proszę podać nazwę użytkownika oraz hasło przypisane do konta.</p>'),jQuery("#Modal"+l).modal("show"))}},o.Get1190LogOut=function(a){var e=void 0!==a.SERVICE?a.SERVICE:null,l=void 0!==a.IDDOCMOD?a.IDDOCMOD:null,d=void 0!==a.IDDOCUMENT?a.IDDOCUMENT:null,r=void 0!==a.IDMODULE?a.IDMODULE:null,n=void 0!==a.IDUSER?a.IDUSER:null,s=void 0!==a.CODE?a.CODE:null;null==e||null==l||null==n||null==s?(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Błędne wywołanie parametrów - odśwież stronę i spróbuj ponownie.</p>'),jQuery("#Modal"+l).modal("show")):jQuery.ajax({type:"POST",url:e,data:{IDSERVICE:1190,IDMODULE:1151,IDTOOLS:800,IDRUN:200,IDDOCMOD:l,IDDOC:d,IDMOD:r,IDUSER:n,CODE:s},beforeSend:function(){jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Czekaj, wysyłam dane do wylogowania z serwera.</p>'),jQuery("#Modal"+l).modal("show")},success:function(o){void 0!==o.STATUS?1==(void 0!==o.STATUS?parseInt(o.STATUS):0)?(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Wylogowano ...</p>'),jQuery("#Modal"+l).modal("show"),window.location.reload(!1)):(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie udało się wylogować, spróbuj ponownie.</p>'),jQuery("#Modal"+l).modal("show")):(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Wystąpił błąd w komunikacji z serwerem.</p>'),jQuery("#Modal"+l).modal("show"))},error:function(a,e,d){var r=o.BSAjaxError(a,e,d);jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">'+r+"</p>"),jQuery("#Modal"+l).modal("show")},complete:function(){},dataType:"json"})},o.Get1190Registration=function(a){var e=void 0!==a.SERVICE?a.SERVICE:null,l=void 0!==a.IDDOCMOD?a.IDDOCMOD:null,d=void 0!==a.IDDOCUMENT?a.IDDOCUMENT:null,r=void 0!==a.IDMODULE?a.IDMODULE:null,n=void 0!==a.CODE?a.CODE:null;if(null==e||null==l||null==n)jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Błędne wywołanie parametrów - odśwież stronę i spróbuj ponownie.</p>'),jQuery("#Modal"+l).modal("show");else{var s=jQuery("#WEFORMUSERNAME"+l).val(),t=jQuery("#WEFORMIMIE"+l).val(),u=jQuery("#WEFORMNAZWISKO"+l).val(),i=jQuery("#WEFORMZGODA"+l).is(":checked")?1:0;!!new RegExp(/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/).test(s)&&s.length>1&&t.length>1&&u.length>1&&1==i?jQuery.ajax({type:"POST",url:e,data:{IDSERVICE:9050,IDMODULE:1151,IDTOOLS:800,IDDOCMOD:l,IDDOC:d,IDMOD:r,CODE:n},beforeSend:function(){jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Czekaj, pobieram token...</p>'),jQuery("#Modal"+l).modal("show")},success:function(a){if(void 0!==a.STATUS||void 0!==a.TOKEN){var i=void 0!==a.STATUS?parseInt(a.STATUS):0,m=void 0!==a.TOKEN?a.TOKEN:"";1==i&&m.length>0?jQuery.ajax({type:"POST",url:e,data:{IDSERVICE:1190,IDMODULE:1151,IDTOOLS:810,IDRUN:100,IDDOCMOD:l,IDDOC:d,IDMOD:r,TOKEN:m,CODE:n,USERNAME:s,IMIE:t,NAZWISKO:u},beforeSend:function(){jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Czekaj, wysyłam dane do logowania na serwer.</p>'),jQuery("#Modal"+l).modal("show")},success:function(o){if(void 0!==o.ERROR||void 0!==o.IDUSER){var a=void 0!==o.ERROR?parseInt(o.ERROR):0,e=void 0!==o.IDUSER?parseInt(o.IDUSER):0;if(0==a&&e>0){jQuery("#WEFORMUSERNAME"+l).val(""),jQuery("#WEFORMIMIE"+l).val(""),jQuery("#WEFORMNAZWISKO"+l).val(""),jQuery("#WEFORMZGODA"+l).prop("checked",!1),jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Twoje konto zostało utworzone. Sprawdź skrzynkę pocztową podaną na etapie rejestracji (zwyczajowo poczta dochodzi do kilku minut, sprawdź czy wiadomość nie znajduje się w spamie).</p>'),jQuery("#Modal"+l).modal("show")}else 2==a?(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie można utworzyć konta o podanej nazwie użytkownika - konto istnieje w systemie. Użyj procedury odzyskania / przypomnienia hasła by uzyskać dostęp do swojego konta.</p>'),jQuery("#Modal"+l).modal("show")):(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie można utworzyć konta o podanej nazwie użytkownika - błąd komunikacyjny.</p>'),jQuery("#Modal"+l).modal("show"))}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Wystąpił błąd w komunikacji z serwerem.</p>'),jQuery("#Modal"+l).modal("show")},error:function(a,e,d){var r=o.BSAjaxError(a,e,d);jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">'+r+"</p>"),jQuery("#Modal"+l).modal("show")},complete:function(){},dataType:"json"}):(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie udało się pobrać unikalnego klucz z serwera. Proszę spróbować ponownie.</p>'),jQuery("#Modal"+l).modal("show"))}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Wystąpił błąd w komunikacji z serwerem.</p>'),jQuery("#Modal"+l).modal("show")},error:function(a,e,d){var r=o.BSAjaxError(a,e,d);jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">'+r+"</p>"),jQuery("#Modal"+l).modal("show")},complete:function(){},dataType:"json"}):(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Proszę podać <strong>wszystkie wymagane dane</strong> oraz zaznaczyć <strong>zgody obligatoryjne</strong>. Nie można zarejestrować nowego konta w przypadku brakujących danych.</p>'),jQuery("#Modal"+l).modal("show"))}},o.Get1190NewPasswordSendLink=function(a){var e=void 0!==a.SERVICE?a.SERVICE:null,l=void 0!==a.IDDOCMOD?a.IDDOCMOD:null,d=void 0!==a.IDDOCUMENT?a.IDDOCUMENT:null,r=void 0!==a.IDMODULE?a.IDMODULE:null,n=void 0!==a.CODE?a.CODE:null;if(null==e||null==l||null==n)jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Błędne wywołanie parametrów - odśwież stronę i spróbuj ponownie.</p>'),jQuery("#Modal"+l).modal("show");else{var s=jQuery("#WEFORMEMAIL"+l).val();!!new RegExp(/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/).test(s)&&s.length>1?jQuery.ajax({type:"POST",url:e,data:{IDSERVICE:9050,IDMODULE:1151,IDTOOLS:800,IDDOCMOD:l,IDDOC:d,IDMOD:r,CODE:n},beforeSend:function(){jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Czekaj, pobieram token...</p>'),jQuery("#Modal"+l).modal("show")},success:function(a){if(void 0!==a.STATUS||void 0!==a.TOKEN){var t=void 0!==a.STATUS?parseInt(a.STATUS):0,u=void 0!==a.TOKEN?a.TOKEN:"";1==t&&u.length>0?jQuery.ajax({type:"POST",url:e,data:{IDSERVICE:1190,IDMODULE:1151,IDTOOLS:811,IDRUN:100,IDDOCMOD:l,IDDOC:d,IDMOD:r,TOKEN:u,CODE:n,EMAIL:s},beforeSend:function(){jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Czekaj, wysyłam dane na serwer.</p>'),jQuery("#Modal"+l).modal("show")},success:function(o){if(void 0!==o.ERROR||void 0!==o.IDUSER){var a=void 0!==o.ERROR?parseInt(o.ERROR):0,e=void 0!==o.IDUSER?parseInt(o.IDUSER):0;if(0==a&&e>0){jQuery("#WEFORMEMAIL"+l).val(""),jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Wysłano link pozwalający na odzyskanie hasła. Sprawdź skrzynkę pocztową podaną na etapie rejestracji (zwyczajowo poczta dochodzi do kilku minut, sprawdź czy wiadomość nie znajduje się w spamie).</p>'),jQuery("#Modal"+l).modal("show")}else 4==a?(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie można wysłać linka - błędna konfiguracja modułu - brak lub usuniety template</p>'),jQuery("#Modal"+l).modal("show")):3==a?(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie można wysłać linka - błędna konfiguracja modułu - brak szablonu e-mail</p>'),jQuery("#Modal"+l).modal("show")):2==a?(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie można wysłać linka - brak adresu e-mail w koncie</p>'),jQuery("#Modal"+l).modal("show")):(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie można wysłać linka - nie istnieje konto z podanym adresem e-mail.</p>'),jQuery("#Modal"+l).modal("show"))}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Wystąpił błąd w komunikacji z serwerem.</p>'),jQuery("#Modal"+l).modal("show")},error:function(a,e,d){var r=o.BSAjaxError(a,e,d);jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">'+r+"</p>"),jQuery("#Modal"+l).modal("show")},complete:function(){},dataType:"json"}):(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie udało się pobrać unikalnego klucz z serwera. Proszę spróbować ponownie.</p>'),jQuery("#Modal"+l).modal("show"))}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Wystąpił błąd w komunikacji z serwerem.</p>'),jQuery("#Modal"+l).modal("show")},error:function(a,e,d){var r=o.BSAjaxError(a,e,d);jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">'+r+"</p>"),jQuery("#Modal"+l).modal("show")},complete:function(){},dataType:"json"}):(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Proszę podać <strong>adres e-mail</strong> użyty podczas rejestracji konta.</p>'),jQuery("#Modal"+l).modal("show"))}},o.Get1190NewPasswordSendLinkNewPassword=function(a){var e=void 0!==a.SERVICE?a.SERVICE:null,l=void 0!==a.IDDOCMOD?a.IDDOCMOD:null,d=void 0!==a.IDDOCUMENT?a.IDDOCUMENT:null,r=void 0!==a.IDMODULE?a.IDMODULE:null,n=void 0!==a.IDUSER?a.IDUSER:null,s=void 0!==a.CODE?a.CODE:null;if(null==e||null==l||null==n||null==s)jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Błędne wywołanie parametrów - odśwież stronę i spróbuj ponownie.</p>'),jQuery("#Modal"+l).modal("show");else{var t=jQuery("#WEFORMPASSWORD1"+l).val(),u=jQuery("#WEFORMPASSWORD2"+l).val();if(!!new RegExp(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W+).{8,}$/).test(t)&&t==u&&t.length>1){var i=new jsSHA("SHA-512","TEXT");i.update(t);var m=i.getHash("HEX");jQuery.ajax({type:"POST",url:e,data:{IDSERVICE:1190,IDMODULE:1151,IDTOOLS:812,IDRUN:100,IDDOCMOD:l,IDDOC:d,IDMOD:r,CODE:s,IDUSER:n,PASSWORDNEW:m},beforeSend:function(){jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Czekaj, wysyłam dane do logowania na serwer.</p>'),jQuery("#Modal"+l).modal("show")},success:function(o){if(void 0!==o.STATUS)if(1==(void 0!==o.STATUS?parseInt(o.STATUS):0)){jQuery("#WEFORMPASSWORD1"+l).val(""),jQuery("#WEFORMPASSWORD2"+l).val(""),jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Hasło do Twojego konto w Profilu Wnioskodawcy zostało zmienione - przejdź do logowania.</p>'),jQuery("#Modal"+l).modal("show")}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie można zmienić hasła do konta. Procedura mogła zostać wczesniej zakończona. Spróbuj ponownie lub skontaktuj się z Administratorem.</p>'),jQuery("#Modal"+l).modal("show");else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Wystąpił błąd w komunikacji z serwerem.</p>'),jQuery("#Modal"+l).modal("show")},error:function(a,e,d){var r=o.BSAjaxError(a,e,d);jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">'+r+"</p>"),jQuery("#Modal"+l).modal("show")},complete:function(){},dataType:"json"})}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Proszę wpisać hasło do konta. Identyczne hasło musi być wpisane w obu polach formularza.</p>'),jQuery("#Modal"+l).modal("show")}},o.Get1190ChangePassword=function(a){var e=void 0!==a.SERVICE?a.SERVICE:null,l=void 0!==a.IDDOCMOD?a.IDDOCMOD:null,d=void 0!==a.IDDOCUMENT?a.IDDOCUMENT:null,r=void 0!==a.IDMODULE?a.IDMODULE:null,n=void 0!==a.IDUSER?a.IDUSER:null,s=void 0!==a.CODE?a.CODE:null,t=void 0!==a.CODEUSER?a.CODEUSER:null;if(null==e||null==l||null==n||null==s||null==t)jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Błędne wywołanie parametrów - odśwież stronę i spróbuj ponownie.</p>'),jQuery("#Modal"+l).modal("show");else{var u=jQuery("#WEFORMPASSWORD"+l).val(),i=jQuery("#WEFORMPASSWORD1"+l).val(),m=jQuery("#WEFORMPASSWORD2"+l).val();!!new RegExp(/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W+).{8,}/).test(i)&&u.length>1&&i.length>1&&m.length>1&&i==m?jQuery.ajax({type:"POST",url:e,data:{IDSERVICE:9050,IDMODULE:1151,IDTOOLS:800,IDDOCMOD:l,IDDOC:d,IDMOD:r,CODE:s},beforeSend:function(){jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Czekaj, pobieram token...</p>'),jQuery("#Modal"+l).modal("show")},success:function(a){if(void 0!==a.STATUS||void 0!==a.TOKEN){var s=void 0!==a.STATUS?parseInt(a.STATUS):0,m=void 0!==a.TOKEN?a.TOKEN:"";if(1==s&&m.length>0){(y=new jsSHA("SHA-512","TEXT")).update(u);var y,p=y.getHash("HEX");(y=new jsSHA("SHA-512","TEXT")).update(i);var j=y.getHash("HEX");jQuery.ajax({type:"POST",url:e,data:{IDSERVICE:1190,IDMODULE:1151,IDTOOLS:821,IDRUN:100,IDDOCMOD:l,IDDOC:d,IDMOD:r,TOKEN:m,CODE:t,IDUSER:n,PASSWORD:p,PASSWORDNEW:j},beforeSend:function(){jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Czekaj, wysyłam dane do zmiany hasła na serwer.</p>'),jQuery("#Modal"+l).modal("show")},success:function(o){if(void 0!==o.ERROR||void 0!==o.IDUSER){var a=void 0!==o.ERROR?parseInt(o.ERROR):0,e=void 0!==o.IDUSER?parseInt(o.IDUSER):0;if(0==a&&e>0){jQuery("#WEFORMPASSWORD"+l).val(""),jQuery("#WEFORMPASSWORD1"+l).val(""),jQuery("#WEFORMPASSWORD2"+l).val(""),jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Twoje hasło do konto zostało zmienione.</p>'),jQuery("#Modal"+l).modal("show")}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie można zmienić hasła do Twojego konta sprawdź czy podałeś poprawne dane.</p>'),jQuery("#Modal"+l).modal("show")}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Wystąpił błąd w komunikacji z serwerem.</p>'),jQuery("#Modal"+l).modal("show")},error:function(a,e,d){var r=o.BSAjaxError(a,e,d);jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">'+r+"</p>"),jQuery("#Modal"+l).modal("show")},complete:function(){},dataType:"json"})}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie udało się pobrać unikalnego klucz z serwera. Proszę spróbować ponownie.</p>'),jQuery("#Modal"+l).modal("show")}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Wystąpił błąd w komunikacji z serwerem.</p>'),jQuery("#Modal"+l).modal("show")},error:function(a,e,d){var r=o.BSAjaxError(a,e,d);jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">'+r+"</p>"),jQuery("#Modal"+l).modal("show")},complete:function(){},dataType:"json"}):(jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Proszę poprawnie wypełnić formularz. Nie można zmienić hasła do Twojego konta w przypadku gdy podane hasła są puste lub nowe hasło nie jest poprawnie powtórzone.</p>'),jQuery("#Modal"+l).modal("show"))}},o.Get1190RegistrationConfirmed=function(a){var e=void 0!==a.SERVICE?a.SERVICE:null,l=void 0!==a.IDDOCMOD?a.IDDOCMOD:null,d=void 0!==a.IDDOCUMENT?a.IDDOCUMENT:null,r=void 0!==a.IDMODULE?a.IDMODULE:null,n=void 0!==a.IDUSER?a.IDUSER:null,s=void 0!==a.CODE?a.CODE:null;if(null==e||null==l||null==n||null==s)jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Błędne wywołanie parametrów - odśwież stronę i spróbuj ponownie.</p>'),jQuery("#Modal"+l).modal("show");else{var t=jQuery("#WEFORMPASSWORD1"+l).val(),u=jQuery("#WEFORMPASSWORD2"+l).val();if(!!new RegExp(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W+).{8,}$/).test(t)&&t==u&&t.length>1){var i=new jsSHA("SHA-512","TEXT");i.update(t);var m=i.getHash("HEX");jQuery.ajax({type:"POST",url:e,data:{IDSERVICE:1190,IDMODULE:1151,IDTOOLS:820,IDRUN:100,IDDOCMOD:l,IDDOC:d,IDMOD:r,CODE:s,IDUSER:n,PASSWORDNEW:m},beforeSend:function(){jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Czekaj, wysyłam dane do logowania na serwer.</p>'),jQuery("#Modal"+l).modal("show")},success:function(o){if(void 0!==o.STATUS){var a=void 0!==o.STATUS?parseInt(o.STATUS):0;if(1==a){var e="";jQuery("#WEFORMPASSWORD1"+l).val(e),jQuery("#WEFORMPASSWORD2"+l).val(e),jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Konto zostało utworzone - przejdź do logowania.</p>'),jQuery("#Modal"+l).modal("show")}else if(2==a){e="";jQuery("#WEFORMPASSWORD1"+l).val(e),jQuery("#WEFORMPASSWORD2"+l).val(e),jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Konto jest już potwierdzone - przejdź do logowania.</p>'),jQuery("#Modal"+l).modal("show")}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Nie można uwieżytelnić konta lub nadać mu podanego hasła. Konto może już być uwierzytelnione. Spróbuj ponownie lub skontaktuj się z Administratorem.</p>'),jQuery("#Modal"+l).modal("show")}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Wystąpił błąd w komunikacji z serwerem.</p>'),jQuery("#Modal"+l).modal("show")},error:function(a,e,d){var r=o.BSAjaxError(a,e,d);jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">'+r+"</p>"),jQuery("#Modal"+l).modal("show")},complete:function(){},dataType:"json"})}else jQuery("#Modal"+l+" .modal-body").html('<p class="p-0 m-0">Proszę wpisać hasło do konta. Identyczne hasło musi być wpisane w obu polach formularza.</p>'),jQuery("#Modal"+l).modal("show")}},o.Get3100Tools860AnalizeDateTimeGenerateList=function(a){var e=void 0!==a.SERVICE?a.SERVICE:null,l=void 0!==a.IDBAZA?a.IDBAZA:null,d=void 0!==a.IDCONFIG?a.IDCONFIG:null,r=void 0!==a.IDPOLE?a.IDPOLE:null,n=void 0!==a.FIELDDATE?a.FIELDDATE:null,s=void 0!==a.FIELDSELECT?a.FIELDSELECT:null,t=void 0!==a.CODE?a.CODE:null;if(null==e||null==l||null==d||null==r||null==n||null==s||null==t)alert("Brak podstawowych parametrów.");else{var u=jQuery("#"+n).val();jQuery.ajax({type:"POST",url:e,data:{IDSERVICE:3100,IDMODULE:3100,IDTOOLS:860,IDRUN:100,IDBAZA:l,IDPOLE:r,IDCONFIG:d,CHECKDATE:u,CODE:t},beforeSend:function(){},success:function(o){if(void 0!==o.STATUS||void 0!==o.ELEMENTS){var a=void 0!==o.STATUS?parseInt(o.STATUS):0,e=void 0!==o.ELEMENTS?o.ELEMENTS:[];if(1==a){var l=jQuery("#"+s);l.empty(),e.length>0&&jQuery.each(e,function(o,a){var e=jQuery("<option></option>").attr("value",a.value).text(a.label);l.append(e)})}else alert("Brak wykonanego skryptu analizy")}else alert("Wystąpił błąd w komunikacji z serwerem.")},error:function(a,e,l){var d=o.BSAjaxError(a,e,l);alert(d)},complete:function(){},dataType:"json"})}},o.BSAjaxError=function(o,a,e){return"Wystąpił błąd: "+(0===o.status?"Brak połączenia z serwerwm.":404==o.status?"Wywoływana strona nie istniej. [404]":500==o.status?"Wewnątrzny błąd serwera [500].":"parsererror"===a?"Przesłany plik JSON jest wadliwy.":"timeout"===a?"Za długi czas oczekiwania.":"abort"===a?"Przerwano transmisję danych.":"Błąd "+o.responseText)},o}Object.defineProperty(exports,"__esModule",{value:!0}),exports.WEInit=o; },{}],"Focm":[function(require,module,exports) { "use strict";var e=L(require("jquery"));require("@fortawesome/fontawesome-free/css/all.css"),require("@mdi/font/css/materialdesignicons.css"),require("bootstrap/dist/css/bootstrap.min.css");var t=L(require("js-cookie")),a=L(require("jssha")),r=L(require("moment")),i=L(require("chart.js"));require("spectrum-colorpicker/spectrum.css");var o=L(require("dropzone"));require("dropzone/dist/min/dropzone.min.css"),require("ekko-lightbox/dist/ekko-lightbox.css"),require("jquery.fancytree/dist/skin-win8/ui.fancytree.min.css"),require("./bootstrap-datetimepicker/css/bootstrap-datetimepicker.css"),require("./bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"),require("./ubermenu/css/ubermenu.min.css"),require("ol/ol.css");var d=L(require("ol/Map.js")),s=L(require("ol/View.js")),n=require("ol/control.js"),l=L(require("ol/source/Stamen.js")),c=require("ol/proj"),u=L(require("ol/layer/Tile.js")),f=L(require("ol/source/TileWMS.js")),m=L(require("ol/Overlay.js")),p=L(require("ol/source/XYZ.js")),v=L(require("ol/source/OSM.js")),h=L(require("ol/source/Cluster.js")),y=L(require("ol/source/Vector.js")),g=L(require("ol/format/GeoJSON")),w=L(require("ol/control/MousePosition.js")),b=require("ol/coordinate.js"),k=L(require("ol/format/KML.js")),x=require("ol/layer.js");require("ol-contextmenu/dist/ol-contextmenu.css");var q=L(require("ol-contextmenu/dist/ol-contextmenu.js")),j=require("ol/interaction.js"),O=require("ol/extent"),S=L(require("ol-ext/style/Chart")),C=require("ol/style.js"),I=L(require("ol/Feature")),P=L(require("ol/geom/Point"));require("./index_we.css");var M=require("./index_we.js");function L(e){return e&&e.__esModule?e:{default:e}}function z(e){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}window.$=window.jQuery=e.default,require("popper.js"),require("bootstrap"),window.Cookies=t.default,window.jsSHA=a.default,window.moment=r.default,window.Chart=i.default,require("jquery.cookie"),require("jquery-countdown"),require("jquery-knob"),require("spectrum-colorpicker"),require("spectrum-colorpicker/i18n/jquery.spectrum-pl"),window.Dropzone=o.default,require("ekko-lightbox/dist/ekko-lightbox.js");var _=require("jquery.fancytree");window.fancytree=_,require("jquery.fancytree/dist/modules/jquery.fancytree.dnd5"),require("jquery.fancytree/dist/modules/jquery.fancytree.edit"),require("jquery.fancytree/dist/modules/jquery.fancytree.gridnav"),require("jquery.fancytree/dist/modules/jquery.fancytree.table"),require("jquery.fancytree/dist/modules/jquery.fancytree.persist"),require("jquery.fancytree/dist/modules/jquery.fancytree.filter");var A=require("detect-browser"),D=A.detect,F=D();window.DetectBrowser=F;var U=require("tinymce/tinymce");function X(e){var t=!1;if("stamen"==e.provider){t=!0;var a=new u.default({opacity:e.opacity,visible:e.visible,source:new l.default({layer:e.scheme})})}else if("osm"==e.provider){t=!0;a=new u.default({opacity:e.opacity,visible:e.visible,source:new v.default({layer:e.scheme})})}else if("here"==e.provider){t=!0;a=new u.default({opacity:e.opacity,visible:e.visible,preload:1/0,source:new p.default({url:T(e),attributions:e.attributions})})}else if("wms-geoserver"==e.provider){t=!0;a=new u.default({opacity:e.opacity,visible:e.visible,source:new f.default({url:e.url,params:{layers:e.layers},serverType:"geoserver",attributions:e.attributions,transition:0})})}else if("kml"==e.provider){t=!0;a=new x.Vector({visible:e.visible,opacity:e.opacity,source:new y.default({url:e.url,format:new k.default,attributions:e.attributions})})}else if("kml-chart"==e.provider){t=!0;a=new x.Vector({visible:e.visible,opacity:e.opacity,source:new h.default({distance:40,source:new y.default({url:e.url,format:new k.default({extractStyles:!1,extractAttributes:!0})}),attributions:e.attributions}),style:function(e,t){var a,r=e.get("features").length;if(r>1){for(var i=(0,O.createEmpty)(),o=e.get("features"),d=o.length-1;d>=0;--d)(0,O.extend)(i,o[d].getGeometry().getExtent());var s=.35*((0,O.getWidth)(i)+(0,O.getHeight)(i))/t;a=new C.Style({image:new C.Circle({radius:s,fill:new C.Fill({color:"rgba(255, 153, 0, 0.4)"}),stroke:new C.Stroke({color:"rgba(255, 153, 0, 0.6)",width:1})}),text:new C.Text({text:r.toString(),scale:1.5,fill:new C.Fill({color:"#fff"}),stroke:new C.Stroke({color:"rgba(0, 0, 0, 0.6)",width:2})})})}else a=E(e.get("features")[0],!1);return a}})}else if("kml-marker"==e.provider){t=!0;a=new x.Vector({visible:e.visible,opacity:e.opacity,source:new y.default({url:e.url,format:new k.default({extractStyles:!1,extractAttributes:!0}),attributions:e.attributions}),style:function(t){var a=e.iconSrc,r=e.iconAnchorX,i=e.iconAnchorY,o=e.anchorXUnits,d=e.anchorYUnits,s=e.iconOpacity,n=t.get("markerIconSrc"),l=t.get("markerIconAnchorX"),c=t.get("markerIconAnchorY"),u=t.get("markerAnchorXUnits"),f=t.get("markerAnchorYUnits"),m=t.get("markerIconOpacity");void 0!==n&&(a=n),void 0!==l&&(r=l),void 0!==c&&(i=c),void 0!==u&&(o=u),void 0!==f&&(d=f),void 0!==m&&(s=m);var p=new C.Style({image:new C.Icon({anchor:[r,i],anchorXUnits:o,anchorYUnits:d,opacity:s,src:a})});return p}})}else if("kml-marker-cluster"==e.provider){t=!0;a=new x.Vector({visible:e.visible,opacity:e.opacity,source:new h.default({distance:40,source:new y.default({url:e.url,format:new k.default({extractStyles:!1,extractAttributes:!0})}),attributions:e.attributions}),style:function(t,a){var r=t.get("features").length;if(r>1){for(var i=(0,O.createEmpty)(),o=t.get("features"),d=o.length-1;d>=0;--d)(0,O.extend)(i,o[d].getGeometry().getExtent());var s=.45*((0,O.getWidth)(i)+(0,O.getHeight)(i))/a;b=new C.Style({image:new C.Circle({radius:s,fill:new C.Fill({color:"rgba(255, 153, 0, 0.4)"}),stroke:new C.Stroke({color:"rgba(255, 153, 0, 0.6)",width:1})}),text:new C.Text({text:r.toString(),scale:1.5,fill:new C.Fill({color:"#fff"}),stroke:new C.Stroke({color:"rgba(0, 0, 0, 0.6)",width:2})})})}else{var n=e.iconSrc,l=e.iconAnchorX,c=e.iconAnchorY,u=e.anchorXUnits,f=e.anchorYUnits,m=e.iconOpacity,p=t.get("markerIconSrc"),v=t.get("markerIconAnchorX"),h=t.get("markerIconAnchorY"),y=t.get("markerAnchorXUnits"),g=t.get("markerAnchorYUnits"),w=t.get("markerIconOpacity");void 0!==p&&(n=p),void 0!==v&&(l=v),void 0!==h&&(c=h),void 0!==y&&(u=y),void 0!==g&&(f=g),void 0!==w&&(m=w);var b=new C.Style({image:new C.Icon({anchor:[l,c],anchorXUnits:u,anchorYUnits:f,opacity:m,src:n})})}return b}})}else if("kml-heatmap"==e.provider);else if("geojson"==e.provider){t=!0;a=new x.Vector({opacity:e.opacity,visible:e.visible,source:new y.default({url:e.url,format:new g.default,attributions:e.attributions})})}else if("geojson-marker"==e.provider){t=!0;a=new x.Vector({opacity:e.opacity,visible:e.visible,source:new y.default({url:e.url,format:new g.default,attributions:e.attributions}),style:function(t){var a=e.iconSrc,r=e.iconAnchorX,i=e.iconAnchorY,o=e.anchorXUnits,d=e.anchorYUnits,s=e.iconOpacity,n=t.get("markerIconSrc"),l=t.get("markerIconAnchorX"),c=t.get("markerIconAnchorY"),u=t.get("markerAnchorXUnits"),f=t.get("markerAnchorYUnits"),m=t.get("markerIconOpacity");void 0!==n&&(a=n),void 0!==l&&(r=l),void 0!==c&&(i=c),void 0!==u&&(o=u),void 0!==f&&(d=f),void 0!==m&&(s=m);var p=new C.Style({image:new C.Icon({anchor:[r,i],anchorXUnits:o,anchorYUnits:d,opacity:s,src:a})});return p}})}else if("geojson-marker-cluster"==e.provider){t=!0;a=new x.Vector({visible:e.visible,opacity:e.opacity,source:new h.default({distance:40,source:new y.default({url:e.url,format:new g.default}),attributions:e.attributions}),style:function(t,a){var r=t.get("features").length;if(r>1){for(var i=(0,O.createEmpty)(),o=t.get("features"),d=o.length-1;d>=0;--d)(0,O.extend)(i,o[d].getGeometry().getExtent());var s=.5*((0,O.getWidth)(i)+(0,O.getHeight)(i))/a;b=new C.Style({image:new C.Circle({radius:s,fill:new C.Fill({color:"rgba(255, 153, 0, 0.4)"}),stroke:new C.Stroke({color:"rgba(255, 153, 0, 0.6)",width:1})}),text:new C.Text({text:r.toString(),scale:1.5,fill:new C.Fill({color:"#fff"}),stroke:new C.Stroke({color:"rgba(0, 0, 0, 0.6)",width:2})})})}else{var n=e.iconSrc,l=e.iconAnchorX,c=e.iconAnchorY,u=e.anchorXUnits,f=e.anchorYUnits,m=e.iconOpacity,p=t.get("markerIconSrc"),v=t.get("markerIconAnchorX"),h=t.get("markerIconAnchorY"),y=t.get("markerAnchorXUnits"),g=t.get("markerAnchorYUnits"),w=t.get("markerIconOpacity");void 0!==p&&(n=p),void 0!==v&&(l=v),void 0!==h&&(c=h),void 0!==y&&(u=y),void 0!==g&&(f=g),void 0!==w&&(m=w);var b=new C.Style({image:new C.Icon({anchor:[l,c],anchorXUnits:u,anchorYUnits:f,opacity:m,src:n})})}return b}})}else if("marker-array"==e.provider&&e.markers.length>0){for(var r=[],i=0;i<e.markers.length;i++){var o=new I.default({geometry:new P.default((0,c.fromLonLat)([e.markers[i].lon,e.markers[i].lat])),name:e.markers[i].name,description:e.markers[i].description});o.setStyle(new C.Style({image:new C.Icon({anchor:[e.markers[i].iconAnchorX,e.markers[i].iconAnchorY],anchorXUnits:e.markers[i].anchorXUnits,anchorYUnits:e.markers[i].anchorYUnits,opacity:e.markers[i].iconOpacity,src:e.markers[i].iconSrc})})),r.push(o)}t=!0;a=new x.Vector({opacity:e.opacity,visible:e.visible,source:new y.default({features:r,attributions:e.attributions})})}return t?a:null}function Y(t,a,r,i,o,d,s,n,l){fetch("https://nominatim.openstreetmap.org/reverse?format=json&addressdetails=1&limit=1&lon="+n+"&lat="+l).then(function(e){return e.json()}).then(function(n){void 0!==t&&(void 0!==n&&void 0!==n.address&&void 0!==n.address.country&&""!==n.address.country?(0,e.default)("#"+t).val(n.address.country):void 0!==n&&void 0!==n.address&&void 0!==n.address.local_administrative_area&&""!==n.address.local_administrative_area?(0,e.default)("#"+t).val(n.address.local_administrative_area):(0,e.default)("#"+t).val("")),void 0!==a&&(void 0!==n&&void 0!==n.address&&void 0!==n.address.postcode?(0,e.default)("#"+a).val(n.address.postcode):(0,e.default)("#"+a).val("")),void 0!==r&&(void 0!==n&&void 0!==n.address&&void 0!==n.address.city&&""!==n.address.city?(0,e.default)("#"+r).val(n.address.city):void 0!==n&&void 0!==n.address&&void 0!==n.address.town&&""!==n.address.town?(0,e.default)("#"+r).val(n.address.town):void 0!==n&&void 0!==n.address&&void 0!==n.address.municipality&&""!==n.address.municipality?(0,e.default)("#"+r).val(n.address.municipality):(0,e.default)("#"+r).val("")),void 0!==i&&(void 0!==n&&void 0!==n.address&&void 0!==n.address.village&&""!==n.address.village?(0,e.default)("#"+i).val(n.address.village):void 0!==n&&void 0!==n.address&&void 0!==n.address.hamlet&&""!==n.address.hamlet?(0,e.default)("#"+i).val(n.address.hamlet):void 0!==n&&void 0!==n.address&&void 0!==n.address.locality&&""!==n.address.locality?(0,e.default)("#"+i).val(n.address.locality):void 0!==n&&void 0!==n.address&&void 0!==n.address.croft&&""!==n.address.croft?(0,e.default)("#"+i).val(n.address.croft):(0,e.default)("#"+i).val("")),void 0!==o&&(void 0!==n&&void 0!==n.address&&void 0!==n.address.road&&""!==n.address.road?(0,e.default)("#"+o).val(n.address.road):void 0!==n&&void 0!==n.address&&void 0!==n.address.footway&&""!==n.address.footway?(0,e.default)("#"+o).val(n.address.footway):void 0!==n&&void 0!==n.address&&void 0!==n.address.street&&""!==n.address.street?(0,e.default)("#"+o).val(n.address.street):void 0!==n&&void 0!==n.address&&void 0!==n.address.street_name&&""!==n.address.street_name?(0,e.default)("#"+o).val(n.address.street_name):void 0!==n&&void 0!==n.address&&void 0!==n.address.residential&&""!==n.address.residential?(0,e.default)("#"+o).val(n.address.residential):void 0!==n&&void 0!==n.address&&void 0!==n.address.path&&""!==n.address.path?(0,e.default)("#"+o).val(n.address.path):void 0!==n&&void 0!==n.address&&void 0!==n.address.pedestrian&&""!==n.address.pedestrian?(0,e.default)("#"+o).val(n.address.pedestrian):void 0!==n&&void 0!==n.address&&void 0!==n.address.road_reference&&""!==n.address.road_reference?(0,e.default)("#"+o).val(n.address.road_reference):void 0!==n&&void 0!==n.address&&void 0!==n.address.road_reference_intl&&""!==n.address.road_reference_intl?(0,e.default)("#"+o).val(n.address.road_reference_intl):(0,e.default)("#"+o).val("")),void 0!==d&&(void 0!==n&&void 0!==n.address&&void 0!==n.address.house_number&&""!==n.address.house_number?(0,e.default)("#"+d).val(n.address.house_number):(0,e.default)("#"+d).val("")),void 0!==s&&(void 0!==n&&void 0!==n.address&&void 0!==n.display_name?(0,e.default)("#"+s).val(n.display_name):(0,e.default)("#"+s).val(""))})}function T(e){return e.url.replace("{base}",e.base).replace("{type}",e.type).replace("{scheme}",e.scheme).replace("{app_id}",e.app_id).replace("{app_code}",e.app_code)}function E(e,t){if(void 0!==e.get("chartElem")&&void 0!==e.get("chartType")&&void 0!==e.get("chartColors")){for(var a=e.get("chartType"),r=e.get("chartColors"),i=Number(e.get("chartElem")),o=Number(e.get("chartRadius")),d=0,s=[],n=0;n<i;n++)if(void 0!==e.get("value"+n)){var l=Number(e.get("value"+n));d+=l,s.push(l)}var c=o||25;c*=t?1.3:1;var u=[new C.Style({image:new S.default({type:a,radius:c,data:s,rotateWithView:!0,colors:r,stroke:new C.Stroke({color:"#fff",width:2})})})];if(t){var f=0;for(n=0;n<s.length;n++){var m=s[n],p=(2*f+m)/d*Math.PI-Math.PI/2,v=Math.round(m/d*1e3);v>0&&u.push(new C.Style({text:new C.Text({text:v/10+"% "+m.toString(),offsetX:Math.cos(p)*(c+5),offsetY:Math.sin(p)*(c+5),textAlign:p<Math.PI/2?"left":"right",textBaseline:"middle",stroke:new C.Stroke({color:"#fff",width:5}),fill:new C.Fill({color:"#000"})})})),f+=m}}return u}}function V(){(0,e.default)(".container-countdown").each(function(){var t=(0,e.default)(this),a=(0,e.default)(this).data("countdown");t.countdown(a,function(e){var a=e.strftime("%S"),r=e.strftime("%M"),i=e.strftime("%H"),o=e.strftime("%D");t.find(".countdown-ds").val(o).trigger("change"),t.find(".countdown-hr").val(i).trigger("change"),t.find(".countdown-min").val(r).trigger("change"),t.find(".countdown-sec").val(a).trigger("change")}),(0,e.default)(".knob").knob();var r=Math.floor(t.width()/4);t.find(".knob").trigger("configure",{width:r,height:r})})}require("tinymce/themes/silver"),require("./tinymce/langs/pl.js"),window.tinymce=U,window.WE=window.WE=new M.WEInit,(0,e.default)(window).resize(function(){V()}),(0,e.default)(document).ready(function(){void 0!==F.name&&(0,e.default)("body").addClass("we-browser-name-"+F.name.replace(/[^a-z0-9]/gi,"").toLowerCase()),void 0!==F.type&&(0,e.default)("body").addClass("we-browser-type-"+F.type.replace(/[^a-z0-9]/gi,"").toLowerCase()),void 0!==F.os&&(0,e.default)("body").addClass("we-browser-os-"+F.os.replace(/[^a-z0-9]/gi,"").toLowerCase()),void 0!==F.version&&(0,e.default)("body").addClass("we-browser-version-"+F.version.replace(/[^a-z0-9]/gi,"").toLowerCase()),(0,e.default)(".we-form-control").on("change keyup paste click",function(){var t=(0,e.default)(this).attr("data-type"),a=(0,e.default)(this).prop("required");if("checkbox"==t)void 0!==a&&1==a&&((0,e.default)(this).prop("checked")?(0,e.default)(this).removeClass("is-invalid").addClass("is-valid"):(0,e.default)(this).removeClass("is-valid").addClass("is-invalid"));else if("pesel"==t){if(d=(d=(0,e.default)(this).val()).replace(/[^\d]/g,""),(0,e.default)(this).val(d),d.length>0||void 0!==a&&1==a){var r=!0;if((s=new RegExp(/^[0-9]{11}$/g)).test(d)){var i=0;i+=1*parseInt(d.substring(0,1)),i+=3*parseInt(d.substring(1,2)),i+=7*parseInt(d.substring(2,3)),i+=9*parseInt(d.substring(3,4)),i+=1*parseInt(d.substring(4,5)),i+=3*parseInt(d.substring(5,6)),i+=7*parseInt(d.substring(6,7)),i+=9*parseInt(d.substring(7,8)),i+=1*parseInt(d.substring(8,9));var o=10-(i+=3*parseInt(d.substring(9,10)))%10;(o=10==o?0:o)==parseInt(d.substring(10,11))&&(r=!1)}r?(0,e.default)(this).removeClass("is-valid").addClass("is-invalid"):(0,e.default)(this).removeClass("is-invalid").addClass("is-valid")}else(0,e.default)(this).removeClass("is-invalid").removeClass("is-valid")}else{var d=(0,e.default)(this).val(),s=(0,e.default)(this).attr("pattern");if("text-number-decimal"==t){d=d.replace(",",".").replace(/[^\d\.\-]/g,"");var n=/(-?\d*)[^\.]*((?:\.\d{0,2})?)/g.exec(d.replace(/[^\d\.\-]/g,""));d=n[1]+n[2],(0,e.default)(this).val(d)}else if("text-number-decimal-double"==t){d=d.replace(",",".").replace(/[^\d\.\-]/g,"");n=/(-?\d*)[^\.]*((?:\.\d{0,15})?)/g.exec(d.replace(/[^\d\.\-]/g,""));d=n[1]+n[2],(0,e.default)(this).val(d)}else"text-number-tinyint"!=t&&"text-number-int"!=t&&"text-number-bigint"!=t&&"phonenumber"!=t||(d=d.replace(/[^\d\-]/g,""),(0,e.default)(this).val(d));if(d.length>0||void 0!==a&&1==a){var l=!1,c=!1;if(void 0!==a&&1==a&&(l=!0,c=void 0!==d&&d.length>0),void 0!==d&&d.length>0&&void 0!==s&&s.length>0){l=!0;var u=new RegExp("^"+s+"$","gm");c=null!==u&&"object"===z(u)&&!!u.test(d)}l&&(c?(0,e.default)(this).removeClass("is-invalid").addClass("is-valid"):(0,e.default)(this).removeClass("is-valid").addClass("is-invalid"))}else(0,e.default)(this).removeClass("is-invalid").removeClass("is-valid")}}),(0,e.default)(".we-datetimepicker-datetime").each(function(){var t=(0,e.default)(this).attr("date-startdate");void 0===t&&(t=null);var a=(0,e.default)(this).attr("date-enddate");void 0===a&&(a=null),(0,e.default)(this).datetimepicker({format:"yyyy-mm-dd hh:ii:00",todayBtn:!0,language:"pl",autoclose:!0,startDate:t,endDate:a,clearBtn:!0}),void 0!==(0,e.default)(this).attr("date-disabled-weekend")&&(0,e.default)(this).datetimepicker("setDaysOfWeekDisabled",[0,6])}),(0,e.default)(".we-datetimepicker-datetime-noseconds").each(function(){var t=(0,e.default)(this).attr("date-startdate");void 0===t&&(t=null);var a=(0,e.default)(this).attr("date-enddate");void 0===a&&(a=null),(0,e.default)(this).datetimepicker({format:"yyyy-mm-dd hh:ii",todayBtn:!0,language:"pl",autoclose:!0,startDate:t,endDate:a,clearBtn:!0}),void 0!==(0,e.default)(this).attr("date-disabled-weekend")&&(0,e.default)(this).datetimepicker("setDaysOfWeekDisabled",[0,6])}),(0,e.default)(".we-datetimepicker-date").each(function(){var t=(0,e.default)(this).attr("date-startdate");void 0===t&&(t=null);var a=(0,e.default)(this).attr("date-enddate");void 0===a&&(a=null),(0,e.default)(this).datetimepicker({format:"yyyy-mm-dd",language:"pl",todayBtn:!0,autoclose:!0,startDate:t,endDate:a,clearBtn:!0,minView:2}),void 0!==(0,e.default)(this).attr("date-disabled-weekend")&&(0,e.default)(this).datetimepicker("setDaysOfWeekDisabled",[0,6])}),(0,e.default)(".we-datetimepicker-time").each(function(){var t=(0,e.default)(this).attr("date-startdate");void 0===t&&(t=null);var a=(0,e.default)(this).attr("date-enddate");void 0===a&&(a=null),(0,e.default)(this).datetimepicker({format:"hh:ii:00",language:"pl",todayBtn:!0,autoclose:!0,startDate:t,endDate:a,clearBtn:!0}),void 0!==(0,e.default)(this).attr("date-disabled-weekend")&&(0,e.default)(this).datetimepicker("setDaysOfWeekDisabled",[0,6])}),(0,e.default)(".we-datetimepicker-time-noseconds").each(function(){var t=(0,e.default)(this).attr("date-startdate");void 0===t&&(t=null);var a=(0,e.default)(this).attr("date-enddate");void 0===a&&(a=null);(0,e.default)(this).datetimepicker({format:"hh:ii",language:"pl",todayBtn:!0,autoclose:!0,startDate:t,endDate:a,clearBtn:!0}),void 0!==(0,e.default)(this).attr("date-disabled-weekend")&&(0,e.default)(this).datetimepicker("setDaysOfWeekDisabled",[0,6])}),(0,e.default)(".we-we-datetimepicker-datetime.we-datetimepicker-setdate").each(function(){var t=(0,e.default)(this).attr("date-startdate");void 0===t&&(t=null);var a=(0,e.default)(this).attr("date-enddate");void 0===a&&(a=null),(0,e.default)(this).datetimepicker({format:"yyyy-mm-dd hh:ii:00",todayBtn:!0,language:"pl",autoclose:!0,startDate:t,endDate:a,clearBtn:!0}),(0,e.default)(this).datetimepicker("setDate",new Date),void 0!==(0,e.default)(this).attr("date-disabled-weekend")&&(0,e.default)(this).datetimepicker("setDaysOfWeekDisabled",[0,6])}),(0,e.default)(".we-datetimepicker-date.we-datetimepicker-setdate").each(function(){var t=(0,e.default)(this).attr("date-startdate");void 0===t&&(t=null);var a=(0,e.default)(this).attr("date-enddate");void 0===a&&(a=null),(0,e.default)(this).datetimepicker({format:"yyyy-mm-dd",language:"pl",todayBtn:!0,autoclose:!0,startDate:t,endDate:a,clearBtn:!0,minView:2}),(0,e.default)(this).datetimepicker("setDate",new Date),void 0!==(0,e.default)(this).attr("date-disabled-weekend")&&(0,e.default)(this).datetimepicker("setDaysOfWeekDisabled",[0,6])}),(0,e.default)(document).on("click",'[data-toggle="lightbox"]',function(t){t.preventDefault(),(0,e.default)(this).ekkoLightbox()});var t=[["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"],["#f00","#f90","#ff0","#0f0","#0ff","#00f","#90f","#f0f"],["#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#cfe2f3","#d9d2e9","#ead1dc"],["#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#9fc5e8","#b4a7d6","#d5a6bd"],["#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6fa8dc","#8e7cc3","#c27ba0"],["#c00","#e69138","#f1c232","#6aa84f","#45818e","#3d85c6","#674ea7","#a64d79"],["#900","#b45f06","#bf9000","#38761d","#134f5c","#0b5394","#351c75","#741b47"],["#600","#783f04","#7f6000","#274e13","#0c343d","#073763","#20124d","#4c1130"]];(0,e.default)(".we-colorpicker").spectrum({showInput:!0,showInitial:!0,allowEmpty:!0,showAlpha:!0,showPalette:!0,preferredFormat:"rgb",palette:t}),(0,e.default)(".we-colorpicker-hex").spectrum({showInput:!0,showInitial:!0,allowEmpty:!0,showAlpha:!1,showPalette:!0,preferredFormat:"hex",palette:t}),(0,e.default)(".we-form-calculate-elements").on("change keyup paste click",function(){var t=0,a=(0,e.default)(this).attr("data-calculate-elements"),r=(0,e.default)(this).attr("data-calculate-sum");(0,e.default)("."+a).each(function(){var a=(0,e.default)(this).val();a.length>0&&(t+=parseFloat(a))}),(0,e.default)("."+r).val(t.toFixed(2))}),(0,e.default)(".we-button-pagination-submit").click(function(){var t=(0,e.default)(this).attr("data-operation"),a=(0,e.default)(this).attr("data-target");"next"==t?((0,e.default)("#"+a+" option:selected").next().attr("selected","selected"),(0,e.default)("#Formularz").submit()):"prev"==t?((0,e.default)("#"+a+" option:selected").prev().attr("selected","selected"),(0,e.default)("#Formularz").submit()):"last"==t?((0,e.default)("#"+a+" option:last").attr("selected","selected"),(0,e.default)("#Formularz").submit()):((0,e.default)("#"+a+" option:first").attr("selected","selected"),(0,e.default)("#Formularz").submit())}),void 0!==U&&U.init({selector:"textarea.tinymce",language:"pl",plugins:["code","autolink","link","image","lists","advlist","hr","nonbreaking","autoresize","searchreplace","wordcount","visualblocks","visualchars","fullscreen","insertdatetime","paste","table"],autoresize_max_height:500,toolbar:"insertfile undo redo | bold italic underline strikethrough removeformat | link image | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect fontsizeselect",fontsize_formats:"0.5em 0.6em 0.7em 0.8em 0.9em 1.0em 1.1em 1.2em 1.3em 1.4em 1.5em 1.6em 1.7em 1.8em 1.9em 2.0em 2.1em 2.2em 2.3em 2.4em 2.5em 2.6em 2.7em 2.8em 2.9em 3.0em",convert_urls:!1,relative_urls:!1,entity_encoding:"raw"}),(0,e.default)(".we-over-comments").mouseover(function(){var t=(0,e.default)(this).attr("data-we-over-comments");t&&parent.FrameComments&&parent.FrameComments(t)}),(0,e.default)(".we-checkbox-controler-clickallchecked").click(function(){var t=(0,e.default)(this).attr("data-class-controler");(0,e.default)("input."+t+":checkbox").prop("checked",this.checked)}),(0,e.default)(".we-radio-controler-setallvalue").click(function(){var t=(0,e.default)(this).attr("data-class-controler");(0,e.default)("input."+t+":radio").filter('[value="'+(0,e.default)(this).val()+'"]').prop("checked",!0)}),(0,e.default)(".we-form-control").on("change keyup paste",function(){(0,e.default)("button.nav-link.active").addClass("we-change-data")}),(0,e.default)(".we-form-search-field-text").keypress(function(t){10!=t.which&&13!=t.which||(0,e.default)("#Formularz").submit()}),(0,e.default)(".we-button-click-submit-hidden").click(function(){(0,e.default)("#"+(0,e.default)(this).attr("id")+"hidden").val(1),(0,e.default)("#Formularz").submit()}),(0,e.default)(".we-change-form-submit-id").change(function(){var t=(0,e.default)(this).attr("data-we-change-form-submit-id");t&&(0,e.default)("#"+t).submit()}),(0,e.default)(".we-click-form-submit-id").click(function(){var t=(0,e.default)(this).attr("data-we-click-form-submit-id");t&&(0,e.default)("#"+t).submit()}),(0,e.default)(".we-mapcreator").each(function(){var t=[],a=[],r=[],i=[],o=(0,e.default)(this).attr("id"),l=parseInt((0,e.default)(this).attr("data-idmap")),f=parseFloat((0,e.default)(this).attr("data-default-lon")),p=parseFloat((0,e.default)(this).attr("data-default-lat")),h=parseInt((0,e.default)(this).attr("data-default-zoom")),g=parseInt((0,e.default)(this).attr("data-addmarker")),k=(0,e.default)(this).attr("data-addmarker-image"),O=(0,e.default)(this).attr("data-addmarker-icon-anchor-x-units"),S=(0,e.default)(this).attr("data-addmarker-icon-anchor-y-units"),M=parseFloat((0,e.default)(this).attr("data-addmarker-icon-anchor-x")),L=parseFloat((0,e.default)(this).attr("data-addmarker-icon-anchor-y")),z=parseFloat((0,e.default)(this).attr("data-addmarker-icon-opacity")),_=!!(0,e.default)(this).attr("data-get-latlon"),A=(0,e.default)(this).attr("data-form-lon"),D=(0,e.default)(this).attr("data-form-lat"),F=(0,e.default)(this).attr("data-form-zoom"),U=(0,e.default)(this).attr("data-form-info"),T=(0,e.default)(this).attr("data-form-postcode"),V=(0,e.default)(this).attr("data-form-city"),B=(0,e.default)(this).attr("data-form-village"),H=(0,e.default)(this).attr("data-form-country"),W=(0,e.default)(this).attr("data-form-road"),Z=(0,e.default)(this).attr("data-form-house-number"),G="1"==(0,e.default)(this).attr("data-controls-overviewmap")||"true"==(0,e.default)(this).attr("data-controls-overviewmap"),N="0"==(0,e.default)(this).attr("data-controls-overviewmap")||"false"==(0,e.default)(this).attr("data-controls-overviewmap"),R="1"==(0,e.default)(this).attr("data-default-interactions-onfocusonly")||"true"==(0,e.default)(this).attr("data-default-interactions-onfocusonly"),$="0"==(0,e.default)(this).attr("data-default-interactions-onfocusonly")||"false"==(0,e.default)(this).attr("data-default-interactions-onfocusonly"),J="we-map-id-"+o,K=l&&"undefined"!=typeof weMapCreatorConfig&&weMapCreatorConfig&&weMapCreatorConfig.hasOwnProperty(l)?weMapCreatorConfig[l]:{config:{defaulthref:"/we/ext/we/",defaultMap:{Lon:0,Lat:0,Zoom:12},defaultInteractions:{OnFocusOnly:!0},defaultControls:{OverviewMap:!1,ZoomSlider:!1,ScaleLine:!1,MousePosition:!1,ContextMenu:!1}},groups:[{openpanel:!1,id:1,label:"Podkład",type:"radio",addempty:!1,addemptylabel:"",addmenu:0,layers:[{provider:"osm",layerid:10,opacity:1,visible:!0,selectable:!1,addmenu:!1,label:"Open Street Maps",scheme:"osm"}]}]},Q=K.hasOwnProperty("config")?K.config:{defaulthref:"/we/ext/we/",defaultMap:{Lon:0,Lat:0,Zoom:12},defaultInteractions:{OnFocusOnly:!0},defaultControls:{OverviewMap:!1,ZoomSlider:!1,ScaleLine:!1,MousePosition:!1,ContextMenu:!1}},ee=Q.hasOwnProperty("defaulthref")?Q.defaulthref:"/we/ext/we/",te=Q.hasOwnProperty("defaultInteractions")?Q.defaultInteractions:{OnFocusOnly:!0},ae=!te.hasOwnProperty("OnFocusOnly")||te.OnFocusOnly;R&&(ae=!0),$&&(ae=!1);var re=Q.hasOwnProperty("defaultControls")?Q.defaultControls:{OverviewMap:!1,ZoomSlider:!1,ScaleLine:!1,MousePosition:!1,ContextMenu:!1},ie=!!re.hasOwnProperty("OverviewMap")&&re.OverviewMap,oe=!!re.hasOwnProperty("ZoomSlider")&&re.ZoomSlider,de=!!re.hasOwnProperty("ScaleLine")&&re.ScaleLine,se=!!re.hasOwnProperty("MousePosition")&&re.MousePosition,ne=!!re.hasOwnProperty("ContextMenu")&&re.ContextMenu,le=Q.hasOwnProperty("defaultMap")?Q.defaultMap:{Lon:0,Lat:0,Zoom:12};f=f||(le.hasOwnProperty("Lon")?le.Lon:0),p=p||(le.hasOwnProperty("Lat")?le.Lat:0),h=h||(le.hasOwnProperty("Zoom")?le.Zoom:15);var ce=[{text:"Przybliż mapę",icon:ee+"image/maps-marker/context-menu-zoom-in.png",callback:function(e,t){var a=t.getView();a.animate({zoom:a.getZoom()+1,duration:700,center:e.coordinate})}},{text:"Oddal mapę",icon:ee+"image/maps-marker/context-menu-zoom-out.png",callback:function(e,t){var a=t.getView();a.animate({zoom:a.getZoom()-1,duration:700,center:e.coordinate})}},{text:"Wycentruj mapę",icon:ee+"image/maps-marker/context-menu-center.png",callback:function(e){_e.animate({duration:700,center:e.coordinate})}}];if(K.hasOwnProperty("groups"))for(var ue=0;ue<K.groups.length;ue++){if((ve=K.groups[ue]).hasOwnProperty("layers"))for(var fe=0;fe<ve.layers.length;fe++){(me=X(je=ve.layers[fe]))&&(me.set("id",o),me.set("idmap",l),me.set("grouptype",ve.type),me.set("groupid",ve.id),me.set("provider",je.provider),me.set("layerid",je.id),me.set("selectable",je.selectable),t.unshift(me))}}if(K.hasOwnProperty("layers"))for(fe=0;fe<K.layers.length;fe++){var me;(me=X(je=K.layers[fe]))&&(me.set("id",o),me.set("idmap",l),me.set("grouptype","checkbox"),me.set("groupid",1),me.set("provider",je.provider),me.set("layerid",je.id),me.set("selectable",je.selectable),t.unshift(me))}if(t.length>0){(0,e.default)(this).append('<div class="we-map-content"><div id="'+J+'" class="we-map"></div></div>'),(0,e.default)(this).append('<div id="'+J+'-mouse-position" class="we-map-mouse-position"></div>'),(0,e.default)(this).append('<div id="'+J+'-popup" class="ol-popup"><a href="#" id="'+J+'-popup-closer" class="ol-popup-closer"></a><div id="'+J+'-popup-title" class="ol-popup-title"></div><div id="'+J+'-popup-content" class="ol-popup-content"></div></div>');var pe=[];if(K.hasOwnProperty("groups")){for(ue=0;ue<K.groups.length;ue++){var ve,he=(ve=K.groups[ue]).hasOwnProperty("id")?ve.id:"",ye=ve.hasOwnProperty("type")?ve.type:"",ge=!!ve.hasOwnProperty("addempty")&&ve.addempty,we=ve.hasOwnProperty("addemptylabel")?""==ve.addemptylabel?"brak / pusty":ve.addemptylabel:"brak / pusty",be=ve.hasOwnProperty("label")?ve.label:"Lista elementów",ke=!!ve.hasOwnProperty("addmenu")&&ve.addmenu,xe=ve.hasOwnProperty("openpanel")&&ve.openpanel?"show":"";if(ke){var qe=[];if(ye&&ve.hasOwnProperty("layers"))for(fe=0;fe<ve.layers.length;fe++){var je;if((je=ve.layers[fe]).hasOwnProperty("addmenu")&&je.addmenu){var Oe=je.hasOwnProperty("label")?je.label:"brak nazwy";"radio"==ye?qe.push('<div class="form-check"><input class="form-check-input we-map-layer" type="radio" data-group-type="'+ye+'" data-group-id="'+he+'" data-id="'+o+'" data-idmap="'+l+'" data-layer-id="'+je.id+'" name="'+J+"-"+he+'-layer" id="'+J+"-"+he+"-"+je.id+'-layer" value="'+je.id+'"'+(1==je.visible?" checked":"")+'><label class="form-check-label" for="'+J+"-"+he+"-"+je.id+'-layer">'+Oe+"</label></div>"):"checkbox"==ye&&qe.push('<div class="form-check"><input class="form-check-input we-map-layer" type="checkbox" data-group-type="'+ye+'" data-group-id="'+he+'" data-id="'+o+'" data-idmap="'+l+'" data-layer-id="'+je.id+'" name="'+J+"-"+he+"-layer-id-"+je.id+'" id="'+J+"-"+he+"-layer-id-"+je.id+'" value="1"'+(1==je.visible?" checked":"")+'><label class="form-check-label" for="'+J+"-"+he+"-layer-id-"+je.id+'">'+Oe+"</label></div>")}}qe.length>0&&(pe.push('<div class="card rounded-0 border-0"><div class="card-header p-0 m-0" id="'+J+"-heading"+ue+'"><button class="btn btn-link rounded-0" type="button" data-toggle="collapse" data-target="#'+J+"-collapse"+ue+'" aria-expanded="true" aria-controls="'+J+"-collapse"+ue+'">'+be+'</button></div><div id="'+J+"-collapse"+ue+'" class="collapse '+xe+'" aria-labelledby="'+J+"-heading"+ue+'" data-parent="#'+J+'-accordion"><div class="card-body py-2">'),ge&&pe.push('<div class="form-check"><input class="form-check-input we-map-layer" type="radio" data-group-type="'+ye+'" data-group-id="'+he+'" data-id="'+o+'" data-idmap="'+l+'" data-layer-id="0" name="'+J+"-"+he+'-layer" id="'+J+"-"+he+'-0-layer" value="0"><label class="form-check-label" for="'+J+"-"+he+'-0-layer">'+we+"</label></div>"),pe.push(qe.join("")),pe.push("</div></div></div>"))}}pe.length>0&&(0,e.default)(this).append('<div id="'+J+'-menu" class="we-map-menu border"><div id="'+J+'-accordion" class="accordion we-map-accordion">'+pe.join("")+"</div>")}if(g){k=k||ee+"image/maps-marker/map-marker-default.png",M=M||.5,L=L||1,O=O||"fraction",S=S||"fraction",z=z||1;var Se=new x.Vector({source:new y.default({features:[new I.default({geometry:new P.default((0,c.fromLonLat)([f,p]))})],attributions:'© <a href="http://d17.pl/" target="_blank">d17.pl</a>'}),style:new C.Style({image:new C.Icon({anchor:[M,L],anchorXUnits:O,anchorYUnits:S,src:k})}),opacity:z});Se.set("selectable",!0),Se.set("provider","marker"),t.push(Se)}a.push(new n.Attribution({collapsible:!1})),G&&(ie=!0),N&&(ie=!1),ie&&a.push(new n.OverviewMap({layers:[new u.default({source:new v.default})]})),oe&&a.push(new n.ZoomSlider),de&&a.push(new n.ScaleLine),se&&a.push(new w.default({coordinateFormat:(0,b.createStringXY)(8),projection:"EPSG:4326",className:"custom-mouse-position",target:document.getElementById(J+"-mouse-position"),undefinedHTML:""})),ne&&a.push(new q.default({width:210,defaultItems:!1,items:ce}));var Ce=document.getElementById(J+"-popup"),Ie=document.getElementById(J+"-popup-title"),Pe=document.getElementById(J+"-popup-content"),Me=document.getElementById(J+"-popup-closer"),Le=new m.default({element:Ce,autoPan:!0,autoPanAnimation:{duration:250}});Me.onclick=function(){return Ie.innerHTML="",Pe.innerHTML="",Le.setPosition(void 0),Me.blur(),!1},r.push(Le);var ze=new I.default;ze.setStyle(new C.Style({image:new C.Icon({anchor:[.5,1],src:ee+"image/maps-marker/map-marker-getlatlon.png"})})),ze.setGeometry((0,c.fromLonLat)([f,p])?new P.default((0,c.fromLonLat)([f,p])):null);var _e=new s.default({center:(0,c.fromLonLat)([f,p]),zoom:h}),Ae=new d.default({interactions:(0,j.defaults)({onFocusOnly:ae}),controls:(0,n.defaults)({attribution:!1}).extend(a),layers:t,overlays:r,loadTilesWhileInteracting:!0,target:J,view:_e});Ae.getView().on("change:resolution",function(t){_&&F&&(0,e.default)("#"+F).val(Ae.getView().getZoom().toFixed(2))}),Ae.on("click",function(t){if(i.length>0){for(var a=0;a<i.length;a++)i[a].setStyle(null);i=[]}if(Ae.forEachFeatureAtPixel(t.pixel,function(e,t){if(Ie.innerHTML="",Pe.innerHTML="",Le.setPosition(void 0),t&&1==t.get("selectable"))if("kml-chart"==t.get("provider")){var a=e.get("features");if(a.length>1){var r=e.getGeometry().getCoordinates();Ie.innerHTML="Grupa obiektów: "+a.length,Pe.innerHTML="W tym miejscu znajduje się więcej obiektów.<br>Przybliż mapę do tego miejsca aby zobaczyć szczegóły.",Le.setPosition(r)}else if(1==a.length){if(void 0!==a[0].get("name")||void 0!==a[0].get("description")){r=a[0].getGeometry().getCoordinates();void 0!==a[0].get("name")&&(Ie.innerHTML=a[0].get("name")),void 0!==a[0].get("description")&&(Pe.innerHTML=a[0].get("description")),Le.setPosition(r)}e.setStyle(E(a[0],!0)),i.push(e)}}else if("kml-marker-cluster"==t.get("provider")||"geojson-marker-cluster"==t.get("provider")){var o=e.get("features");if(o.length>1){r=e.getGeometry().getCoordinates();Ie.innerHTML="Grupa obiektów: "+o.length,Pe.innerHTML="W tym miejscu znajduje się więcej obiektów.<br>Przybliż mapę do tego miejsca aby zobaczyć szczegóły.",Le.setPosition(r)}else if(1==o.length&&(void 0!==o[0].get("name")||void 0!==o[0].get("description"))){r=o[0].getGeometry().getCoordinates();void 0!==o[0].get("name")&&(Ie.innerHTML=o[0].get("name")),void 0!==o[0].get("description")&&(Pe.innerHTML=o[0].get("description")),Le.setPosition(r)}}else if(void 0!==e.get("name")||void 0!==e.get("description")){r=e.getGeometry().getCoordinates();void 0!==e.get("name")&&(Ie.innerHTML=e.get("name")),void 0!==e.get("description")&&(Pe.innerHTML=e.get("description")),Le.setPosition(r)}}),_){var r=(0,c.toLonLat)(t.coordinate);_e.animate({duration:500,center:(0,c.fromLonLat)(r)}),ze.setGeometry(t.coordinate?new P.default(t.coordinate):null),A&&(0,e.default)("#"+A).val(r[0]).trigger("change"),D&&(0,e.default)("#"+D).val(r[1]).trigger("change"),F&&(0,e.default)("#"+F).val(Ae.getView().getZoom().toFixed(2)).trigger("change"),Y(H,T,V,B,W,Z,U,r[0],r[1])}}),Ae.once("postrender",function(a){(0,e.default)(".we-map-layer").change(function(){var a=(0,e.default)(this).attr("name"),r=(0,e.default)(this).attr("data-id"),i=(0,e.default)(this).attr("data-idmap"),o=(0,e.default)(this).attr("data-group-id"),d=(0,e.default)(this).attr("data-group-type"),s=(0,e.default)(this).attr("data-layer-id");if("radio"==d){for(var n=(0,e.default)("input[type=radio][name="+a+"]:checked").val(),l=0;l<t.length;l++)if(t[l].get("id")==r&&t[l].get("idmap")==i&&t[l].get("groupid")==o){var c=t[l].get("layerid")==n;t[l].setVisible(c)}}else if("checkbox"==d)for(l=0;l<t.length;l++)if(t[l].get("id")==r&&t[l].get("idmap")==i&&t[l].get("groupid")==o&&t[l].get("layerid")==s){c=!!(0,e.default)("input[type=checkbox][name="+a+"]:checked").val();t[l].setVisible(c)}}),_&&new x.Vector({map:Ae,source:new y.default({features:[ze]})})})}}),V()}); },{"jquery":"HlZQ","popper.js":"v5IM","bootstrap":"pe4o","@fortawesome/fontawesome-free/css/all.css":"Eofe","@mdi/font/css/materialdesignicons.css":"FWXb","bootstrap/dist/css/bootstrap.min.css":"H97Y","js-cookie":"lMlK","jssha":"XEp8","moment":"iROh","chart.js":"IvHv","jquery.cookie":"RkNv","jquery-countdown":"f12I","jquery-knob":"uc98","spectrum-colorpicker":"VWng","spectrum-colorpicker/i18n/jquery.spectrum-pl":"n0k7","spectrum-colorpicker/spectrum.css":"H97Y","dropzone":"OEzi","dropzone/dist/min/dropzone.min.css":"H97Y","ekko-lightbox/dist/ekko-lightbox.css":"H97Y","ekko-lightbox/dist/ekko-lightbox.js":"xIWz","jquery.fancytree/dist/skin-win8/ui.fancytree.min.css":"kqo8","jquery.fancytree":"laCd","jquery.fancytree/dist/modules/jquery.fancytree.dnd5":"kCJZ","jquery.fancytree/dist/modules/jquery.fancytree.edit":"kHDm","jquery.fancytree/dist/modules/jquery.fancytree.gridnav":"ICrm","jquery.fancytree/dist/modules/jquery.fancytree.table":"ovbB","jquery.fancytree/dist/modules/jquery.fancytree.persist":"MKUk","jquery.fancytree/dist/modules/jquery.fancytree.filter":"MaIk","detect-browser":"MXTL","tinymce/tinymce":"PBio","tinymce/themes/silver":"wAqg","./tinymce/langs/pl.js":"xPuB","./bootstrap-datetimepicker/css/bootstrap-datetimepicker.css":"H97Y","./bootstrap-datetimepicker/js/bootstrap-datetimepicker.js":"G1XN","./ubermenu/css/ubermenu.min.css":"H97Y","ol/ol.css":"H97Y","ol/Map.js":"kYy5","ol/View.js":"hNqE","ol/control.js":"ucqx","ol/source/Stamen.js":"ehVO","ol/proj":"Diht","ol/layer/Tile.js":"BUEc","ol/source/TileWMS.js":"IcO7","ol/Overlay.js":"qWcX","ol/source/XYZ.js":"knlU","ol/source/OSM.js":"Rmo4","ol/source/Cluster.js":"sV2m","ol/source/Vector.js":"ZS12","ol/format/GeoJSON":"qBlb","ol/control/MousePosition.js":"Cbl8","ol/coordinate.js":"nGsj","ol/format/KML.js":"DiYy","ol/layer.js":"ZVaS","ol-contextmenu/dist/ol-contextmenu.css":"H97Y","ol-contextmenu/dist/ol-contextmenu.js":"sr95","ol/interaction.js":"aMDX","ol/extent":"QDir","ol-ext/style/Chart":"dlS6","ol/style.js":"qeKX","ol/Feature":"mYW9","ol/geom/Point":"gLcY","./index_we.css":"H97Y","./index_we.js":"DiVX"}]},{},["Focm"], null) //# sourceMappingURL=we.783fcd86.js.map