mudlet-map-browser-script 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.min.js +1 -1
- package/index.js +7 -5
- package/package.json +1 -1
package/dist/bundle.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function n(r,s,a){function o(e,t){if(!s[e]){if(!r[e]){var i="function"==typeof require&&require;if(!t&&i)return i(e,!0);if(h)return h(e,!0);throw(t=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",t}i=s[e]={exports:{}},r[e][0].call(i.exports,function(t){return o(r[e][1][t]||t)},i,i.exports,n,r,s,a)}return s[e].exports}for(var h="function"==typeof require&&require,t=0;t<a.length;t++)o(a[t]);return o}({1:[function(t,e,i){"use strict";var n=u(t("@andreasremdt/simple-translator")),r=u(t("bootstrap")),a=t("mudlet-map-renderer"),s=t("./preview"),o=t("./versions"),h=u(t("color-convert")),l=t("./npc");function u(t){return t&&t.__esModule?t:{default:t}}const c=["#CC99C9","#9EC1CF","#9EE09E","#FDFD97","#FEB144","#FF6663"];let d=0;var f=new n.default({defaultLanguage:"pl",detectLanguage:!0,selector:"[data-i18n]",debug:!1,registerGlobally:"__",persist:!0,persistKey:"preferred_language",filesLocation:"i18n"});if(window.translator=f,""!==location.hostname)f.fetch(["pl"],!1).then(t=>{let e={};document.querySelectorAll("[data-i18n]").forEach(t=>{e[t.getAttribute("data-i18n")]=t.innerHTML}),f.add("pl",{...e,...t})}).catch(t=>console.log("Cannot fetch translations. "+t.message)),f.fetch(["en"]).then(()=>{f.translatePageTo()}).catch(t=>console.log("Cannot fetch translations. "+t.message));else if("undefined"!=typeof translations){let e={};document.querySelectorAll("[data-i18n]").forEach(t=>{e[t.getAttribute("data-i18n")]=t.innerHTML}),f.add("pl",{...e,...translations.pl}),f.add("en",translations.en)}t=new URLSearchParams(window.location.search);const p=Object.fromEntries(t.entries()),g=window.location.origin+window.location.pathname;let m={},_=((0,l.downloadNpc)().then(t=>m=t),localStorage.getItem("position"));_=_&&JSON.parse(_);let v=new class{constructor(t){this.map=document.querySelector("#map"),this.map.addEventListener("roomSelected",t=>this.selectRoom(t.detail)),this.map.addEventListener("roomDeselected",()=>this.deselectRoom()),this.map.addEventListener("zoom",t=>this.adjustZoomBar(t.detail)),this.map.addEventListener("zoom",t=>this.zoom=t.detail.zoom),this.map.addEventListener("zoom",t=>this.preview.update()),this.map.addEventListener("drag",t=>this.preview.update()),this.map.addEventListener("goToArea",t=>setTimeout(()=>{t.detail.id&&this.findRoom(t.detail.id)})),this.reader=t,this.select=document.querySelector("#area"),this.infoBox=document.querySelector(".info-box"),this.levels=document.querySelector(".levels"),this.saveImageButton=document.querySelector(".save-image"),this.saveSvgImageButton=document.querySelector(".save-image-svg"),this.copyImageButton=document.querySelector(".copy-image"),this.zoomButtons=document.querySelectorAll(".zoom-controls .btn"),this.toastContainer=document.querySelector(".toast"),this.searchModal=document.querySelector("#search"),this.search=document.querySelector(".search-form"),this.findPathForm=document.querySelector(".findpath-form"),this.findPathModal=document.querySelector("#findpath"),this.helpModal=document.querySelector("#help"),this.zoomBar=document.querySelector(".progress-container"),this.settingsModal=document.querySelector("#settings"),this.settingsForm=document.querySelector("#settings form"),this.resetSettingsButton=document.querySelector("#settings button[type='reset']"),this.versions=document.querySelector("#versions"),this.settings=new a.Settings,this.preview=new s.Preview(this.map,this),this.versionBadge=document.querySelector(".version-number"),this.languageSelector=document.querySelector(".lang-dropdown"),this.currentLanguageFlag=document.querySelector(".current-language-flag"),this.pathBox=document.querySelector(".path-box ul"),this.areaModal=document.getElementById("area-info"),this.zIndex=0,this.settings.optimizeDrag=!0,this.settings.preview=!0;var t=localStorage.getItem("settings");t&&Object.assign(this.settings,JSON.parse(t)),this.versions&&(this.versions.addEventListener("change",t=>{this.replaceVersion(t.target.value),r.default.Modal.getInstance(this.helpModal).hide()}),this.helpModal.addEventListener("shown.bs.modal",()=>{0==this.versions.children.length&&(0,o.downloadTags)(this.versions.getAttribute("data-tags")).then(t=>{t.forEach(t=>{var e=document.createElement("option");e.setAttribute("value",t),e.innerHTML=t,this.versions.append(e)})})})),null!=(t=this.saveImageButton)&&t.addEventListener("click",()=>this.saveImage()),null!=(t=this.saveSvgImageButton)&&t.addEventListener("click",t=>{t.preventDefault(),this.downloadImage()}),null!=(t=this.copyImageButton)&&t.addEventListener("click",()=>this.copyImage()),this.zoomButtons.forEach(t=>t.addEventListener("click",t=>{t=parseFloat(t.currentTarget.getAttribute("data-factor"));this.renderer.controls.deltaZoom(t)})),this.search.addEventListener("submit",t=>{t.preventDefault(),this.submitSearch(t)}),null!=(t=this.findPathForm)&&t.addEventListener("submit",t=>{t.preventDefault(),this.submitPathFind(t)}),null!=(t=this.findPathModal)&&t.addEventListener("shown.bs.modal",()=>{this.findPathModal.querySelector("input").focus()}),this.searchModal.addEventListener("shown.bs.modal",()=>{this.searchModal.querySelector("input").focus()}),this.settingsModal.addEventListener("show.bs.modal",()=>{this.populateSettings(this.settings)}),this.settingsModal.addEventListener("shown.bs.modal",()=>{this.settingsModal.querySelector("input").focus()}),this.settingsForm.addEventListener("submit",t=>{t.preventDefault(),this.handleSaveSettings()}),this.resetSettingsButton.addEventListener("click",t=>{t.preventDefault(),this.resetSettings()}),null!=(t=this.areaModal)&&t.addEventListener("show.bs.modal",()=>{this.populateAreaInfo(this.areaId,this.zIndex)}),window.addEventListener("resize",()=>{this.render()}),this.translatePage(),this.languageSelector.querySelectorAll("a").forEach(e=>{e.addEventListener("click",t=>{t.preventDefault(),this.translatePage(e.getAttribute("data-lang"))})}),this.paths={}}init(){let t=37,e=0;p.loc?(this.findRoom(p.loc),history.replaceState(null,null,g)):(p.area?(t=p.area,history.replaceState(null,null,g)):null!==_&&_.area&&(t=_.area,e=_.zIndex),this.renderArea(t,e))}handleSaveSettings(){var t=this.settingsModal.querySelectorAll("input");let n={};t.forEach(t=>{var e=t.getAttribute("name"),i=t.getAttribute("type");n[e]="checkbox"===i?t.checked:"number"===i?parseInt(t.value):t.value}),Object.assign(this.settings,n),this.showToast(f.translateForKey("settings-saved",f.currentLanguage)),r.default.Modal.getInstance(this.settingsModal).hide(),this.saveSettings(),this.render(!0)}saveSettings(){localStorage.setItem("settings",JSON.stringify(this.settings))}render(t){return this.renderArea(this.select.value,this.zIndex,t)}renderArea(n,r,s){return new Promise((i,t)=>{var e;this.areaId!==n||this.zIndex!==r||s?(this.map.addEventListener("renderComplete",(t,e)=>{this.preview.init(t.detail.controls).then(()=>i())},{once:!0}),this.areaId=n,this.zIndex=r,localStorage.setItem("position",JSON.stringify({area:n,zIndex:r})),document.querySelector("body").style.background=this.settings.mapBackground,e=this.reader.getArea(n,r),this.renderer&&this.renderer.clear(),this.renderer=new a.Renderer(this.map,this.reader,e,this.reader.getColors(),this.settings),this.select.value=n,this.populateLevelButtons(e.getLevels(),r),this.hideRoomInfo(),Object.entries(this.paths).forEach(([t,e])=>{e.remove();var[e,t]=t.split("#");this.findPath(e,t)}),this.renderer.clearHighlight(),this.settings.keepZoomLevel&&this.zoom&&this.renderer.controls.setZoom(this.zoom)):i()})}genericSetup(){document.querySelectorAll(".btn").forEach(t=>t.addEventListener("click",()=>t.blur()))}populateLevelButtons(t,e){if(this.levels.innerHTML="",!(t.size<=1)){t=Array.from(t).sort(function(t,e){return t-e});if(10<t.length){var i,n=document.createElement("div"),r=(n.classList.add("dropdown"),document.createElement("button")),s=(r.classList.add("btn","btn-secondary","dropdown-toggle"),r.setAttribute("type","button"),r.setAttribute("data-bs-toggle","dropdown"),r.append(document.createTextNode(e)),document.createElement("div"));s.classList.add("dropdown-menu"),n.append(r),n.append(s);for(i of t){var a=document.createElement("a");a.classList.add("dropdown-item","btn-level"),a.setAttribute("href","#"),a.setAttribute("data-level",i),a.append(document.createTextNode(i)),s.append(a)}this.levels.append(n)}else for(var o of t){var h=document.createElement("button");h.setAttribute("type","button"),h.setAttribute("data-level",o),h.classList.add("btn","btn-level"),o===e?h.classList.add("btn-primary"):h.classList.add("btn-secondary"),h.append(document.createTextNode(o)),this.levels.append(h)}this.levels.querySelectorAll(".btn-level").forEach(t=>{t.addEventListener("click",t=>{t.preventDefault();t=parseInt(t.target.getAttribute("data-level"));this.renderArea(this.select.value,t)})})}}populateAreaInfo(t,e){t=this.reader.getArea(t,e);this.areaModal.querySelector(".area-name").innerHTML=`${t.areaName} (id: ${t.areaId})`,this.areaModal.querySelector(".area-room-count").innerHTML=Object.keys(t.rooms).length;let a=this.areaModal.querySelector(".area-exits");a.innerHTML="",Object.values(t.rooms).flatMap(t=>this.getAreaExits(t)).forEach(([t,e])=>{var i=this.reader.getAreaByRoomId(e),n=document.createElement("li"),r=document.createElement("a"),t=(r.setAttribute("href","#"),r.setAttribute("data-room",t),r.appendChild(document.createTextNode(t)),r.addEventListener("click",t=>{t.preventDefault(),this.findRoom(parseInt(t.currentTarget.getAttribute("data-room")))}),document.createTextNode(" -> ")),s=document.createElement("a");s.setAttribute("href","#"),s.setAttribute("data-room",e),s.appendChild(document.createTextNode(`${e} (${i.areaName})`)),s.addEventListener("click",t=>{t.preventDefault(),this.findRoom(parseInt(t.currentTarget.getAttribute("data-room")))}),n.append(r,t,s),a.appendChild(n)})}getAreaExits(e){let i=[];return Object.values(e.exits).filter(t=>this.isExitTarget(t)).forEach(t=>i.push([e.id,t])),Object.values(e.specialExits).filter(t=>this.isExitTarget(t)).forEach(t=>i.push([e.id,t])),i}isExitTarget(t){t=this.reader.getRoomById(t);return parseInt(t.areaId)!==this.renderer.area.areaId}populateSelectBox(){this.select.querySelectorAll("option").forEach(t=>t.remove()),this.reader.getAreas().filter(t=>0<t.rooms.length&&void 0!==t.areaName&&""!==t.areaName).sort((t,e)=>{t=t.areaName.toLowerCase(),e=e.areaName.toLowerCase();return t<e?-1:e<t?1:0}).forEach((t,e)=>{t.rooms.length&&this.select.append(new Option(t.areaName,t.areaId))}),this.select.addEventListener("change",t=>{this.renderArea(t.target.value,0)})}submitSearch(){r.default.Modal.getInstance(this.searchModal).hide();var t=this.search.querySelectorAll("input");let e={};if(t.forEach(t=>{e[t.name]=t.value,t.value=""}),void 0!==e.roomId){let t=e.roomId.split(",");isNaN(t[0])&&(t=(0,l.findNpc)(t)),this.findRooms(t)}}submitPathFind(){r.default.Modal.getInstance(this.findPathModal).hide();var t=this.findPathForm.querySelectorAll("input");let e={};t.forEach(t=>{e[t.name]=t.value,t.value=""}),this.findPath(e["start-loc"],e["end-loc"])&&this.findRoom(e["start-loc"])}findRoom(t){var e;t&&(void 0!==(e=this.reader.getAreaByRoomId(t))?this.renderArea(e.areaId,e.zIndex).then(()=>{this.renderer.controls.setZoom(1),this.renderer.controls.centerRoom(t)}):this.showToast(f.translateForKey("location-not-found",f.currentLanguage)))}findRooms(t){var e=this.reader.getAreaByRoomId(t[0]);void 0!==e?this.renderArea(e.areaId,e.zIndex).then(()=>{this.renderer.controls.centerRoom(t[0]),this.renderer.controls.setZoom(1),this.renderer.clearHighlight(),t.forEach(t=>{this.renderer.renderHighlight(t)})}):this.showToast(f.translateForKey("location-not-found",f.currentLanguage))}findPath(e,i){let n=e+"#"+i;var r=null!=(r=null==(r=this.pathBox.querySelector(`[data-path-key='${n}'] input[type='color']`))?void 0:r.value)?r:c[d++%c.length];if(this.paths[n]=this.renderer.controls.renderPath(e,i,h.default.hex.rgb(r).map(t=>t/255)),this.paths[n]){if(!this.pathBox.querySelector(`[data-path-key='${n}']`)){let t=document.createElement("li");t.classList.add("list-group-item","d-inline-flex","align-items-center","position-relative"),t.setAttribute("data-path-key",n);var s=document.createElement("input"),r=(s.setAttribute("type","color"),s.classList.add("small-color","me-2"),s.value=r,s.addEventListener("input",t=>{this.paths[n].strokeColor=t.target.value}),t.appendChild(s),t.appendChild(document.createTextNode(e+" -> "+i)),document.createElement("span"));return r.classList.add("badge","bg-secondary","position-absolute","end-0","me-2"),r.appendChild(document.createTextNode(f.translateForKey("delete",f.currentLanguage))),r.onclick=()=>{this.paths[n].remove(),delete this.paths[n],t.remove(),0===Object.keys(this.paths).length&&this.pathBox.parentNode.classList.add("invisible")},t.appendChild(r),this.pathBox.appendChild(t),this.pathBox.parentNode.classList.remove("invisible"),!0}}else delete this.paths[n],this.showToast(f.translateForKey("no-path",f.currentLanguage)),d--}adjustZoomBar(t){t=(t.zoom-t.minZoom)/(10-t.minZoom);this.zoomBar.querySelector(".progress-bar").style.width=100*t+"%",this.zoomBar.classList.contains("visible")?void 0!==this.progressTimeout&&(clearTimeout(this.progressTimeout),this.progressTimeout=void 0):(this.zoomBar.classList.add("visible"),this.zoomBar.classList.remove("hidden")),this.progressTimeout=setTimeout(()=>{this.zoomBar.classList.add("hidden"),this.zoomBar.classList.remove("visible")},3e3)}selectRoom(t){this.showRoomInfo(t)}deselectRoom(){this.hideRoomInfo()}showRoomInfo(t){var e=null!=(e=this.reader.getColors()[t.env])?e:[114,1,0];this.infoBox.style.border=`2px solid rgba(${e[0]}, ${e[1]}, ${e[2]}, 0.5)`,this.infoBox.style.display="initial",this.infoBox.querySelector(".room-id").innerHTML=t.id,this.infoBox.querySelector(".room-link").setAttribute("href",g+"?loc="+t.id),this.infoBox.querySelector(".room-name").innerHTML=t.name,this.infoBox.querySelector(".room-env").innerHTML=t.env,this.infoBox.querySelector(".coord-x").innerHTML=t.x,this.infoBox.querySelector(".coord-y").innerHTML=t.y,this.infoBox.querySelector(".coord-z").innerHTML=t.z,this.infoBox.querySelector(".room-hash").innerHTML="",this.infoBox.querySelector(".room-hash").innerHTML=null!=(e=t.hash)?e:"",this.infoExitsGroup(this.infoBox.querySelector(".exits"),t.exits),this.infoExitsGroup(this.infoBox.querySelector(".special"),t.specialExits),this.userDataGroup(this.infoBox.querySelector(".userData"),t.userData),this.npcDataGroup(this.infoBox.querySelector(".npc"),m[t.id]||{})}userDataGroup(t,e){var i,n=t.querySelector("ul");n.innerHTML="";let r=!1;for(i in e){r=!0;var s=document.createElement("li");s.classList=["user-data"],s.innerHTML=`<p>${i}:</p><p class="value">${e[i].replaceAll("\\n","\n")}</p>`,n.append(s)}t.style.display=r?"initial":"none"}infoExitsGroup(t,e){var i,n=t.querySelector("ul");n.innerHTML="";let r=!1;for(i in e)r=!0,n.append(this.infoExit(i,e[i]));t.style.display=r?"initial":"none"}npcDataGroup(t,e){var i,n=t.querySelector("ul");n.innerHTML="";let r=!1;for(i in e){r=!0;var s=document.createElement("li");s.append(document.createTextNode(e[i])),n.append(s)}t.style.display=r?"initial":"none"}infoExit(t,e){var i=document.createElement("li"),n=document.createElement("span"),t=(n.setAttribute("data-i18n",t),n.innerHTML=this.translateDir(t),i.append(n),i.append(document.createTextNode(": ")),document.createElement("a")),n=(t.setAttribute("href","#"),t.setAttribute("data-room",e),t.innerHTML=e,t.addEventListener("click",t=>{t.preventDefault(),this.findRoom(parseInt(t.currentTarget.getAttribute("data-room")))}),i.append(t),this.reader.getRoomById(e));return parseInt(n.areaId)!==this.renderer.area.areaId&&(t=this.reader.getAreaProperties(n.areaId),i.append(document.createTextNode(" -> ")),(e=document.createElement("a")).setAttribute("href","#"),e.setAttribute("data-room",n.id),e.innerHTML=t.areaName,e.addEventListener("click",t=>{t.preventDefault(),this.findRoom(parseInt(t.currentTarget.getAttribute("data-room")))}),i.append(e)),i}showToast(t){this.toastContainer.querySelector(".toast-body").innerHTML=t,r.default.Toast.getOrCreateInstance(this.toastContainer).show()}translateDir(t){var e;return null!=(e=f.translateForKey(t))?e:t}translatePage(t){this.currentLanguageFlag.classList.remove("flag-"+f.currentLanguage),t&&f.translatePageTo(t),this.currentLanguageFlag.classList.add("flag-"+f.currentLanguage)}hideRoomInfo(){this.infoBox.style.display="none"}populateSettings(t){for(var e in t){var i=this.settingsModal.querySelector("input[name='"+e+"']");i&&("checkbox"===i.getAttribute("type")?i.checked=t[e]:"color"===i.getAttribute("type")?i.value=t[e].toCSS?t[e].toCSS(!0):t[e]:i.value=t[e])}}resetSettings(){var t=new a.Settings;t.preview=!0,t.optimizeDrag=!0,this.populateSettings(t)}saveImage(){var t=document.createElement("a");t.setAttribute("href",this.map.toDataURL()),t.setAttribute("download",this.renderer.area.areaName+".png"),document.querySelector("body").append(t),t.click(),t.remove()}downloadImage(){var t,e=document.createElement("a");e.setAttribute("href",(t=this.renderer.exportSvg(),"data:image/svg+xml,"+encodeURIComponent(t).replace(/'/g,"%27").replace(/"/g,"%22"))),e.setAttribute("download",this.renderer.area.areaName+".svg"),document.querySelector("body").append(e),e.click(),e.remove()}copyImage(){"undefined"!=typeof ClipboardItem?(this.map.toBlob(t=>navigator.clipboard.write([new ClipboardItem({"image/png":t})])),this.showToast(f.translateForKey("copied",f.currentLanguage))):this.showToast(f.translateForKey("no-clipboard",f.currentLanguage))}move(t,e){this.renderer.controls.move(t,e)}goDirection(t){t=t;var e=void 0!==(e=function(t,e){for(var i in t)if(t.hasOwnProperty(i)&&t[i]===e)return i}(y,t))?e:t;this.renderer.controls.selected&&this.findRoom(this.renderer.controls.selected.exits[e])}registerKeyBoard(){let e={Numpad1:"sw",Numpad2:"s",Numpad3:"se",Numpad4:"w",Numpad6:"e",Numpad7:"nw",Numpad8:"n",Numpad9:"ne",NumpadMultiply:"u",NumpadDivide:"d"};window.addEventListener("keydown",t=>{this.settings.disableKeyBinds||("F1"===t.code&&(t.preventDefault(),this.showHelp()),t.ctrlKey&&"KeyF"===t.code&&(t.preventDefault(),this.showSearch()))}),window.addEventListener("resize",()=>{this.render(!0)}),window.addEventListener("keydown",t=>{document.querySelector("input:focus")||this.settings.disableKeyBinds||(t.ctrlKey&&"KeyS"===t.code&&(this.saveImage(),t.preventDefault()),"Equal"===t.code&&(this.renderer.controls.deltaZoom(1.1),t.preventDefault()),"Minus"===t.code&&(this.renderer.controls.deltaZoom(.9),t.preventDefault()),"ArrowUp"===t.code&&(this.move(0,-1),t.preventDefault()),"ArrowDown"===t.code&&(this.move(0,1),t.preventDefault()),"ArrowLeft"===t.code&&(this.move(-1,0),t.preventDefault()),"ArrowRight"===t.code&&(this.move(1,0),t.preventDefault()),e.hasOwnProperty(t.code)&&(this.goDirection(e[t.code]),t.preventDefault()))})}showHelp(){r.default.Modal.getOrCreateInstance(this.helpModal).show()}showSearch(){r.default.Modal.getOrCreateInstance(this.searchModal).show()}replaceVersion(e){(0,o.downloadVersion)(e,this.versions.getAttribute("data-files")).then(t=>{this.reader=new a.MapReader(t,colors),this.populateSelectBox(),this.renderArea(v.areaId,v.zIndex,!0).then(()=>this.showToast("Przeładowano wersję na "+e)),this.versionBadge.innerHTML="v"+e,this.versionBadge.style.display="initial"})}}(new a.MapReader(mapData,colors)),y=((window.controls=v).genericSetup(),v.populateSelectBox(),v.init(),v.registerKeyBoard(),{north:"n",south:"s",east:"e",west:"w",northeast:"ne",northwest:"nw",southeast:"se",southwest:"sw",up:"u",down:"d"})},{"./npc":62,"./preview":63,"./versions":64,"@andreasremdt/simple-translator":2,bootstrap:7,"color-convert":14,"mudlet-map-renderer":21}],2:[function(f,p,t){!function(c,d){!function(){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var e,i,r,s,l={INVALID_PARAM_LANGUAGE:function(t){return"Invalid parameter for `language` provided. Expected a string, but got ".concat(n(t),".")},INVALID_PARAM_JSON:function(t){return"Invalid parameter for `json` provided. Expected an object, but got ".concat(n(t),".")},EMPTY_PARAM_LANGUAGE:function(){return"The parameter for `language` can't be an empty string."},EMPTY_PARAM_JSON:function(){return"The parameter for `json` must have at least one key/value pair."},INVALID_PARAM_KEY:function(t){return"Invalid parameter for `key` provided. Expected a string, but got ".concat(n(t),".")},NO_LANGUAGE_REGISTERED:function(t){return'No translation for language "'.concat(t,'" has been added, yet. Make sure to register that language using the `.add()` method first.')},TRANSLATION_NOT_FOUND:function(t,e){return'No translation found for key "'.concat(t,'" in language "').concat(e,'". Is there a key/value in your translation file?')},INVALID_PARAMETER_SOURCES:function(t){return"Invalid parameter for `sources` provided. Expected either a string or an array, but got ".concat(n(t),".")},FETCH_ERROR:function(t){return'Could not fetch "'.concat(t.url,'": ').concat(t.status," (").concat(t.statusText,")")},INVALID_ENVIRONMENT:function(){return"You are trying to execute the method `translatePageTo()`, which is only available in the browser. Your environment is most likely Node.js"},MODULE_NOT_FOUND:function(t){return t},MISMATCHING_ATTRIBUTES:function(t,e,i){return'The attributes "data-i18n" and "data-i18n-attr" must contain the same number of keys.\n\nValues in `data-i18n`: ('.concat(t.length,") `").concat(t.join(" "),"`\nValues in `data-i18n-attr`: (").concat(e.length,") `").concat(e.join(" "),"`\n\nThe HTML element is:\n").concat(i.outerHTML)},INVALID_OPTIONS:function(t){return"Invalid config passed to the `Translator` constructor. Expected an object, but got ".concat(n(t),". Using default config instead.")}};function a(o){return function(e){if(o)try{for(var i=l[e],t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new TypeError(i?i.apply(void 0,n):"Unhandled Error")}catch(t){i=t.stack.split(/\n/g)[1].split(/@/),s=(a=2,function(t){if(Array.isArray(t))return t}(s=i)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,s=[],a=!0,o=!1;try{for(i=i.call(t);!(a=(n=i.next()).done)&&(s.push(n.value),!e||s.length!==e);a=!0);}catch(t){o=!0,r=t}finally{try{a||null==i.return||i.return()}finally{if(o)throw r}}return s}}(s,a)||function(t,e){var i;if(t)return"string"==typeof t?h(t,e):"Map"===(i="Object"===(i=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:i)||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?h(t,e):void 0}(s,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=s[0],s=s[1];console.error("".concat(t.message,"\n\nThis error happened in the method `").concat(a,"` from: `").concat(s,"`.\n\nIf you don't want to see these error messages, turn off debugging by passing `{ debug: false }` to the constructor.\n\nError code: ").concat(e,"\n\nCheck out the documentation for more details about the API:\nhttps://github.com/andreasremdt/simple-translator#usage\n "))}var s,a}}function o(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=this,i=o;if(!(e instanceof i))throw new TypeError("Cannot call a class as a function");this.debug=a(!0),"object"==n(t)&&!Array.isArray(t)||(this.debug("INVALID_OPTIONS",t),t={}),this.languages=new Map,this.config=Object.assign(o.defaultConfig,t);e=this.config,i=e.debug,t=e.registerGlobally,e=e.detectLanguage;this.debug=a(i),t&&(this._globalObject[t]=this.translateForKey.bind(this)),e&&"browser"==this._env&&this._detectLanguage()}function u(t){return e.apply(this,arguments)}i=o,r=[{key:"_globalObject",get:function(){return"browser"==this._env?window:d}},{key:"_env",get:function(){return"undefined"==typeof window&&void 0!==p&&p.exports?"node":"browser"}},{key:"_detectLanguage",value:function(){var t=window.localStorage?localStorage.getItem(this.config.persistKey):void 0;t?this.config.defaultLanguage=t:(t=navigator.languages?navigator.languages[0]:navigator.language,this.config.defaultLanguage=t.substr(0,2))}},{key:"_getValueFromJSON",value:function(t,e){e=this.languages.get(e);return t.split(".").reduce(function(t,e){return t?t[e]:null},e)}},{key:"_replace",value:function(n,r){var t,s=this,e=null==(e=n.getAttribute("data-i18n"))?void 0:e.split(/\s/g),a=null==n||null==(t=n.getAttribute("data-i18n-attr"))?void 0:t.split(/\s/g);a&&e.length!=a.length&&this.debug("MISMATCHING_ATTRIBUTES",e,a,n),e.forEach(function(t,e){var i=s._getValueFromJSON(t,r),e=a?a[e]:"innerHTML";i?"innerHTML"==e?n[e]=i:n.setAttribute(e,i):s.debug("TRANSLATION_NOT_FOUND",t,r)})}},{key:"translatePageTo",value:function(){var t,e=this,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.config.defaultLanguage;"node"!=this._env?"string"==typeof i?0!=i.length?this.languages.has(i)?((t="string"==typeof this.config.selector?Array.from(document.querySelectorAll(this.config.selector)):this.config.selector).length&&0<t.length?t.forEach(function(t){return e._replace(t,i)}):null==t.length&&this._replace(t,i),this._currentLanguage=i,document.documentElement.lang=i,this.config.persist&&window.localStorage&&localStorage.setItem(this.config.persistKey,i)):this.debug("NO_LANGUAGE_REGISTERED",i):this.debug("EMPTY_PARAM_LANGUAGE"):this.debug("INVALID_PARAM_LANGUAGE",i):this.debug("INVALID_ENVIRONMENT")}},{key:"translateForKey",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.config.defaultLanguage;return"string"!=typeof t?(this.debug("INVALID_PARAM_KEY",t),null):this.languages.has(e)?this._getValueFromJSON(t,e)||(this.debug("TRANSLATION_NOT_FOUND",t,e),null):(this.debug("NO_LANGUAGE_REGISTERED",e),null)}},{key:"add",value:function(t,e){return"string"!=typeof t?this.debug("INVALID_PARAM_LANGUAGE",t):0==t.length?this.debug("EMPTY_PARAM_LANGUAGE"):Array.isArray(e)||"object"!=n(e)?this.debug("INVALID_PARAM_JSON",e):0==Object.keys(e).length?this.debug("EMPTY_PARAM_JSON"):this.languages.set(t,e),this}},{key:"remove",value:function(t){return"string"!=typeof t?this.debug("INVALID_PARAM_LANGUAGE",t):0==t.length?this.debug("EMPTY_PARAM_LANGUAGE"):this.languages.delete(t),this}},{key:"fetch",value:(e=function(r){var e,s=this,a=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];return Array.isArray(r)||"string"==typeof r?(e=(r=Array.isArray(r)?r:[r]).map(function(t){var t=t.replace(/\.json$/,"").replace(/^\//,""),e=s.config.filesLocation.replace(/\/$/,"");return"".concat(e,"/").concat(t,".json")}),"browser"==this._env?Promise.all(e.map(function(t){return fetch(t)})).then(function(t){return Promise.all(t.map(function(t){if(t.ok)return t.json();s.debug("FETCH_ERROR",t)}))}).then(function(t){return t=t.filter(function(t){return t}),a&&t.forEach(function(t,e){s.add(r[e],t)}),1<t.length?t:t[0]}):"node"==this._env?new Promise(function(t){var n=[];e.forEach(function(t,e){try{var i=JSON.parse(f("fs").readFileSync(c.cwd()+t,"utf-8"));a&&s.add(r[e],i),n.push(i)}catch(t){s.debug("MODULE_NOT_FOUND",t.message)}}),t(1<n.length?n:n[0])}):void 0):(this.debug("INVALID_PARAMETER_SOURCES",r),null)},u.toString=function(){return e.toString()},u)},{key:"setDefaultLanguage",value:function(t){if("string"==typeof t){if(0!=t.length)return this.languages.has(t)?void(this.config.defaultLanguage=t):(this.debug("NO_LANGUAGE_REGISTERED",t),null);this.debug("EMPTY_PARAM_LANGUAGE")}else this.debug("INVALID_PARAM_LANGUAGE",t)}},{key:"currentLanguage",get:function(){return this._currentLanguage||this.config.defaultLanguage}},{key:"defaultLanguage",get:function(){return this.config.defaultLanguage}}],s=[{key:"defaultConfig",get:function(){return{defaultLanguage:"en",detectLanguage:!0,selector:"[data-i18n]",debug:!1,registerGlobally:"__",persist:!1,persistKey:"preferred_language",filesLocation:"/i18n"}}}],t(i.prototype,r),t(i,s),p.exports=o}.call(this)}.call(this,f("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:33,fs:9}],3:[function(t,e,At){!function(Et){!function(){"use strict";function y(t){var e;return null==t?window:"[object Window]"!==t.toString()?(e=t.ownerDocument)&&e.defaultView||window:t}function g(t){return t instanceof y(t).Element||t instanceof Element}function h(t){return t instanceof y(t).HTMLElement||t instanceof HTMLElement}function s(t){return"undefined"!=typeof ShadowRoot&&(t instanceof y(t).ShadowRoot||t instanceof ShadowRoot)}Object.defineProperty(At,"__esModule",{value:!0});var E=Math.max,A=Math.min,b=Math.round;function a(){var t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function k(){return!/^((?!chrome|android).)*safari/i.test(a())}function c(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),r=1,s=1;e&&h(t)&&(r=0<t.offsetWidth&&b(n.width)/t.offsetWidth||1,s=0<t.offsetHeight&&b(n.height)/t.offsetHeight||1);e=(g(t)?y(t):window).visualViewport,t=!k()&&i,i=(n.left+(t&&e?e.offsetLeft:0))/r,t=(n.top+(t&&e?e.offsetTop:0))/s,e=n.width/r,r=n.height/s;return{width:e,height:r,top:t,right:i+e,bottom:t+r,left:i,x:i,y:t}}function d(t){t=y(t);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function l(t){return t?(t.nodeName||"").toLowerCase():null}function w(t){return((g(t)?t.ownerDocument:t.document)||window.document).documentElement}function f(t){return c(w(t)).left+d(t).scrollLeft}function x(t){return y(t).getComputedStyle(t)}function u(t){var t=x(t),e=t.overflow,i=t.overflowX,t=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+t+i)}function q(t,e,i){void 0===i&&(i=!1);var n=h(e),r=h(e)&&(a=(r=e).getBoundingClientRect(),s=b(a.width)/r.offsetWidth||1,a=b(a.height)/r.offsetHeight||1,1!==s||1!==a),s=w(e),a=c(t,r,i),t={scrollLeft:0,scrollTop:0},o={x:0,y:0};return!n&&i||("body"===l(e)&&!u(s)||(t=(n=e)!==y(n)&&h(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:d(n)),h(e)?((o=c(e,!0)).x+=e.clientLeft,o.y+=e.clientTop):s&&(o.x=f(s))),{x:a.left+t.scrollLeft-o.x,y:a.top+t.scrollTop-o.y,width:a.width,height:a.height}}function T(t){var e=c(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function o(t){return"html"===l(t)?t:t.assignedSlot||t.parentNode||(s(t)?t.host:null)||w(t)}function m(t,e){void 0===e&&(e=[]);var i=function t(e){return 0<=["html","body","#document"].indexOf(l(e))?e.ownerDocument.body:h(e)&&u(e)?e:t(o(e))}(t),t=i===(null==(t=t.ownerDocument)?void 0:t.body),n=y(i),n=t?[n].concat(n.visualViewport||[],u(i)?i:[]):i,i=e.concat(n);return t?i:i.concat(m(o(n)))}function r(t){return h(t)&&"fixed"!==x(t).position?t.offsetParent:null}function I(t){for(var e,i=y(t),n=r(t);n&&(e=n,0<=["table","td","th"].indexOf(l(e)))&&"static"===x(n).position;)n=r(n);return(!n||"html"!==l(n)&&("body"!==l(n)||"static"!==x(n).position))&&(n||function(t){var e=/firefox/i.test(a()),i=/Trident/i.test(a());if(!i||!h(t)||"fixed"!==x(t).position){var n=o(t);for(s(n)&&(n=n.host);h(n)&&["html","body"].indexOf(l(n))<0;){var r=x(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}}return null}(t))||i}var L="top",P="bottom",O="right",M="left",N="auto",R=[L,P,O,M],D="start",S="end",U="clippingParents",H="viewport",p="popper",W="reference",G=R.reduce(function(t,e){return t.concat([e+"-"+D,e+"-"+S])},[]),K=[].concat(R,[N]).reduce(function(t,e){return t.concat([e,e+"-"+D,e+"-"+S])},[]),Z=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function $(t){var i=new Map,n=new Set,r=[];return t.forEach(function(t){i.set(t.name,t)}),t.forEach(function(t){n.has(t.name)||!function e(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){n.has(t)||(t=i.get(t))&&e(t)}),r.push(t)}(t)}),r}function _(t){for(var e=arguments.length,i=new Array(1<e?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return[].concat(i).reduce(function(t,e){return t.replace(/%s/,e)},t)}var v='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',Y='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',X=["name","enabled","phase","fn","effect","requires","options"];function B(t){return t.split("-")[0]}function Q(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&s(i)){var n=e;do{if(n&&t.isSameNode(n))return!0}while(n=n.parentNode||n.host)}return!1}function J(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function tt(t,e,i){return e===H?J((r=i,a=y(n=t),o=w(n),a=a.visualViewport,h=o.clientWidth,o=o.clientHeight,u=l=0,a&&(h=a.width,o=a.height,(s=k())||!s&&"fixed"===r)&&(l=a.offsetLeft,u=a.offsetTop),{width:h,height:o,x:l+f(n),y:u})):g(e)?((r=c(s=e,!1,"fixed"===(r=i))).top=r.top+s.clientTop,r.left=r.left+s.clientLeft,r.bottom=r.top+s.clientHeight,r.right=r.left+s.clientWidth,r.width=s.clientWidth,r.height=s.clientHeight,r.x=r.left,r.y=r.top,r):J((a=w(t),h=w(a),o=d(a),l=null==(l=a.ownerDocument)?void 0:l.body,n=E(h.scrollWidth,h.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),u=E(h.scrollHeight,h.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),a=-o.scrollLeft+f(a),o=-o.scrollTop,"rtl"===x(l||h).direction&&(a+=E(h.clientWidth,l?l.clientWidth:0)-n),{width:n,height:u,x:a,y:o}));var n,r,s,a,o,h,l,u}function et(i,t,e,n){var r,s="clippingParents"===t?(a=m(o(s=i)),g(r=0<=["absolute","fixed"].indexOf(x(s).position)&&h(s)?I(s):s)?a.filter(function(t){return g(t)&&Q(t,r)&&"body"!==l(t)}):[]):[].concat(t),a=[].concat(s,[e]),t=a[0],e=a.reduce(function(t,e){e=tt(i,e,n);return t.top=E(e.top,t.top),t.right=A(e.right,t.right),t.bottom=A(e.bottom,t.bottom),t.left=E(e.left,t.left),t},tt(i,t,n));return e.width=e.right-e.left,e.height=e.bottom-e.top,e.x=e.left,e.y=e.top,e}function j(t){return t.split("-")[1]}function it(t){return 0<=["top","bottom"].indexOf(t)?"x":"y"}function nt(t){var e,i=t.reference,n=t.element,t=t.placement,r=t?B(t):null,t=t?j(t):null,s=i.x+i.width/2-n.width/2,a=i.y+i.height/2-n.height/2;switch(r){case L:e={x:s,y:i.y-n.height};break;case P:e={x:s,y:i.y+i.height};break;case O:e={x:i.x+i.width,y:a};break;case M:e={x:i.x-n.width,y:a};break;default:e={x:i.x,y:i.y}}var o=r?it(r):null;if(null!=o){var h="y"===o?"height":"width";switch(t){case D:e[o]=e[o]-(i[h]/2-n[h]/2);break;case S:e[o]=e[o]+(i[h]/2-n[h]/2)}}return e}function rt(){return{top:0,right:0,bottom:0,left:0}}function st(t){return Object.assign({},rt(),t)}function at(i,t){return t.reduce(function(t,e){return t[e]=i,t},{})}function z(t,e){var n,e=e=void 0===e?{}:e,i=e.placement,i=void 0===i?t.placement:i,r=e.strategy,r=void 0===r?t.strategy:r,s=e.boundary,s=void 0===s?U:s,a=e.rootBoundary,a=void 0===a?H:a,o=e.elementContext,o=void 0===o?p:o,h=e.altBoundary,h=void 0!==h&&h,e=e.padding,e=void 0===e?0:e,e=st("number"!=typeof e?e:at(e,R)),l=t.rects.popper,h=t.elements[h?o===p?W:p:o],h=et(g(h)?h:h.contextElement||w(t.elements.popper),s,a,r),s=c(t.elements.reference),a=nt({reference:s,element:l,strategy:"absolute",placement:i}),r=J(Object.assign({},l,a)),l=o===p?r:s,u={top:h.top-l.top+e.top,bottom:l.bottom-h.bottom+e.bottom,left:h.left-l.left+e.left,right:l.right-h.right+e.right},a=t.modifiersData.offset;return o===p&&a&&(n=a[i],Object.keys(u).forEach(function(t){var e=0<=[O,P].indexOf(t)?1:-1,i=0<=[L,P].indexOf(t)?"y":"x";u[t]+=n[i]*e})),u}var ot="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",ht={placement:"bottom",modifiers:[],strategy:"absolute"};function lt(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function t(t){var t=t=void 0===t?{}:t,e=t.defaultModifiers,f=void 0===e?[]:e,e=t.defaultOptions,p=void 0===e?ht:e;return function(a,o,e){void 0===e&&(e=p);var i,n,h={placement:"bottom",orderedModifiers:[],options:Object.assign({},ht,p),modifiersData:{},elements:{reference:a,popper:o},attributes:{},styles:{}},l=[],u=!1,c={state:h,setOptions:function(t){var i,e,n,r,s,t="function"==typeof t?t(h.options):t,t=(d(),h.options=Object.assign({},p,h.options,t),h.scrollParents={reference:g(a)?m(a):a.contextElement?m(a.contextElement):[],popper:m(o)},t=[].concat(f,h.options.modifiers),e=t.reduce(function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t},{}),t=Object.keys(e).map(function(t){return e[t]}),i=$(t),Z.reduce(function(t,e){return t.concat(i.filter(function(t){return t.phase===e}))},[]));return h.orderedModifiers=t.filter(function(t){return t.enabled}),"production"!==Et.env.NODE_ENV&&(t=[].concat(t,h.options.modifiers),r=function(t){return t.name},s=new Set,t=t.filter(function(t){t=r(t);if(!s.has(t))return s.add(t),!0}),(n=t).forEach(function(i){[].concat(Object.keys(i),X).filter(function(t,e,i){return i.indexOf(t)===e}).forEach(function(t){switch(t){case"name":"string"!=typeof i.name&&console.error(_(v,String(i.name),'"name"','"string"','"'+String(i.name)+'"'));break;case"enabled":"boolean"!=typeof i.enabled&&console.error(_(v,i.name,'"enabled"','"boolean"','"'+String(i.enabled)+'"'));break;case"phase":Z.indexOf(i.phase)<0&&console.error(_(v,i.name,'"phase"',"either "+Z.join(", "),'"'+String(i.phase)+'"'));break;case"fn":"function"!=typeof i.fn&&console.error(_(v,i.name,'"fn"','"function"','"'+String(i.fn)+'"'));break;case"effect":null!=i.effect&&"function"!=typeof i.effect&&console.error(_(v,i.name,'"effect"','"function"','"'+String(i.fn)+'"'));break;case"requires":null==i.requires||Array.isArray(i.requires)||console.error(_(v,i.name,'"requires"','"array"','"'+String(i.requires)+'"'));break;case"requiresIfExists":Array.isArray(i.requiresIfExists)||console.error(_(v,i.name,'"requiresIfExists"','"array"','"'+String(i.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+i.name+'" modifier, valid properties are '+X.map(function(t){return'"'+t+'"'}).join(", ")+'; but "'+t+'" was provided.')}i.requires&&i.requires.forEach(function(e){null==n.find(function(t){return t.name===e})&&console.error(_(Y,String(i.name),e,e))})})}),B(h.options.placement)!==N||h.orderedModifiers.find(function(t){return"flip"===t.name})||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" ")),[(t=x(o)).marginTop,t.marginRight,t.marginBottom,t.marginLeft].some(function(t){return parseFloat(t)}))&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" ")),h.orderedModifiers.forEach(function(t){var e=t.name,i=t.options,t=t.effect;"function"==typeof t&&(t=t({state:h,name:e,instance:c,options:void 0===i?{}:i}),l.push(t||function(){}))}),c.update()},forceUpdate:function(){if(!u){var t=h.elements,e=t.reference,t=t.popper;if(lt(e,t)){h.rects={reference:q(e,I(t),"fixed"===h.options.strategy),popper:T(t)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(t){return h.modifiersData[t.name]=Object.assign({},t.data)});for(var i,n,r,s=0,a=0;a<h.orderedModifiers.length;a++){if("production"!==Et.env.NODE_ENV&&100<(s+=1)){console.error("Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.");break}!0===h.reset?(h.reset=!1,a=-1):(i=(r=h.orderedModifiers[a]).fn,n=r.options,r=r.name,"function"==typeof i&&(h=i({state:h,options:void 0===n?{}:n,name:r,instance:c})||h))}}else"production"!==Et.env.NODE_ENV&&console.error(ot)}},update:(i=function(){return new Promise(function(t){c.forceUpdate(),t(h)})},function(){return n=n||new Promise(function(t){Promise.resolve().then(function(){n=void 0,t(i())})})}),destroy:function(){d(),u=!0}};return lt(a,o)?c.setOptions(e).then(function(t){!u&&e.onFirstUpdate&&e.onFirstUpdate(t)}):"production"!==Et.env.NODE_ENV&&console.error(ot),c;function d(){l.forEach(function(t){return t()}),l=[]}}}var C={passive:!0};var e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=(t=t.options).scroll,r=void 0===n||n,s=void 0===(n=t.resize)||n,a=y(e.elements.popper),o=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&o.forEach(function(t){t.addEventListener("scroll",i.update,C)}),s&&a.addEventListener("resize",i.update,C),function(){r&&o.forEach(function(t){t.removeEventListener("scroll",i.update,C)}),s&&a.removeEventListener("resize",i.update,C)}},data:{}};var i={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,t=t.name;e.modifiersData[t]=nt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},ut={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ct(t){var e,i,n,r=t.popper,s=t.popperRect,a=t.placement,o=t.variation,h=t.offsets,l=t.position,u=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,t=t.isFixed,f=h.x,f=void 0===f?0:f,p=h.y,p=void 0===p?0:p,g="function"==typeof d?d({x:f,y:p}):{x:f,y:p},g=(f=g.x,p=g.y,h.hasOwnProperty("x")),h=h.hasOwnProperty("y"),m=M,_=L,v=window,r=(c&&(i="clientHeight",e="clientWidth",(n=I(r))===y(r)&&"static"!==x(n=w(r)).position&&"absolute"===l&&(i="scrollHeight",e="scrollWidth"),a!==L&&(a!==M&&a!==O||o!==S)||(_=P,p=(p-((t&&n===v&&v.visualViewport?v.visualViewport.height:n[i])-s.height))*(u?1:-1)),a!==M&&(a!==L&&a!==P||o!==S)||(m=O,f=(f-((t&&n===v&&v.visualViewport?v.visualViewport.width:n[e])-s.width))*(u?1:-1))),Object.assign({position:l},c&&ut)),t=!0===d?(a=(i={x:f,y:p}).x,i=i.y,o=window.devicePixelRatio||1,{x:b(a*o)/o||0,y:b(i*o)/o||0}):{x:f,y:p};return f=t.x,p=t.y,u?Object.assign({},r,((n={})[_]=h?"0":"",n[m]=g?"0":"",n.transform=(v.devicePixelRatio||1)<=1?"translate("+f+"px, "+p+"px)":"translate3d("+f+"px, "+p+"px, 0)",n)):Object.assign({},r,((e={})[_]=h?p+"px":"",e[m]=g?f+"px":"",e.transform="",e))}var n={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e,i=t.state,t=t.options,n=void 0===(n=t.gpuAcceleration)||n,r=void 0===(r=t.adaptive)||r,t=void 0===(t=t.roundOffsets)||t,n=("production"!==Et.env.NODE_ENV&&(e=x(i.elements.popper).transitionProperty||"",r)&&["transform","top","right","bottom","left"].some(function(t){return 0<=e.indexOf(t)})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',"\n\n",'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.","\n\n","We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" ")),{placement:B(i.placement),variation:j(i.placement),popper:i.elements.popper,popperRect:i.rects.popper,gpuAcceleration:n,isFixed:"fixed"===i.options.strategy});null!=i.modifiersData.popperOffsets&&(i.styles.popper=Object.assign({},i.styles.popper,ct(Object.assign({},n,{offsets:i.modifiersData.popperOffsets,position:i.options.strategy,adaptive:r,roundOffsets:t})))),null!=i.modifiersData.arrow&&(i.styles.arrow=Object.assign({},i.styles.arrow,ct(Object.assign({},n,{offsets:i.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:t})))),i.attributes.popper=Object.assign({},i.attributes.popper,{"data-popper-placement":i.placement})},data:{}};var dt={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var r=t.state;Object.keys(r.elements).forEach(function(t){var e=r.styles[t]||{},i=r.attributes[t]||{},n=r.elements[t];h(n)&&l(n)&&(Object.assign(n.style,e),Object.keys(i).forEach(function(t){var e=i[t];!1===e?n.removeAttribute(t):n.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow),function(){Object.keys(n.elements).forEach(function(t){var e=n.elements[t],i=n.attributes[t]||{},t=Object.keys((n.styles.hasOwnProperty(t)?n.styles:r)[t]).reduce(function(t,e){return t[e]="",t},{});h(e)&&l(e)&&(Object.assign(e.style,t),Object.keys(i).forEach(function(t){e.removeAttribute(t)}))})}},requires:["computeStyles"]};var ft={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var a=t.state,e=t.options,t=t.name,o=void 0===(e=e.offset)?[0,0]:e,e=K.reduce(function(t,e){var i,n,r,s;return t[e]=(e=e,i=a.rects,n=o,r=B(e),s=0<=[M,L].indexOf(r)?-1:1,e=(i="function"==typeof n?n(Object.assign({},i,{placement:e})):n)[0]||0,n=(i[1]||0)*s,0<=[M,O].indexOf(r)?{x:n,y:e}:{x:e,y:n}),t},{}),i=(n=e[a.placement]).x,n=n.y;null!=a.modifiersData.popperOffsets&&(a.modifiersData.popperOffsets.x+=i,a.modifiersData.popperOffsets.y+=n),a.modifiersData[t]=e}},pt={left:"right",right:"left",bottom:"top",top:"bottom"};function F(t){return t.replace(/left|right|bottom|top/g,function(t){return pt[t]})}var gt={start:"end",end:"start"};function mt(t){return t.replace(/start|end/g,function(t){return gt[t]})}var _t={name:"flip",enabled:!0,phase:"main",fn:function(t){var c=t.state,e=t.options,t=t.name;if(!c.modifiersData[t]._skip){for(var i=e.mainAxis,n=void 0===i||i,i=e.altAxis,r=void 0===i||i,i=e.fallbackPlacements,d=e.padding,f=e.boundary,p=e.rootBoundary,s=e.altBoundary,a=e.flipVariations,g=void 0===a||a,m=e.allowedAutoPlacements,a=c.options.placement,e=B(a),i=i||(e===a||!g?[F(a)]:B(i=a)===N?[]:(e=F(i),[mt(i),e,mt(e)])),o=[a].concat(i).reduce(function(t,e){return t.concat(B(e)===N?(i=c,n=(t=t=void 0===(t={placement:e,boundary:f,rootBoundary:p,padding:d,flipVariations:g,allowedAutoPlacements:m})?{}:t).placement,r=t.boundary,s=t.rootBoundary,a=t.padding,o=t.flipVariations,h=void 0===(t=t.allowedAutoPlacements)?K:t,l=j(n),t=l?o?G:G.filter(function(t){return j(t)===l}):R,0===(n=t.filter(function(t){return 0<=h.indexOf(t)})).length&&(n=t,"production"!==Et.env.NODE_ENV)&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")),u=n.reduce(function(t,e){return t[e]=z(i,{placement:e,boundary:r,rootBoundary:s,padding:a})[B(e)],t},{}),Object.keys(u).sort(function(t,e){return u[t]-u[e]})):e);var i,n,r,s,a,o,h,l,u},[]),h=c.rects.reference,l=c.rects.popper,u=new Map,_=!0,v=o[0],y=0;y<o.length;y++){var b=o[y],w=B(b),x=j(b)===D,S=0<=[L,P].indexOf(w),C=S?"width":"height",k=z(c,{placement:b,boundary:f,rootBoundary:p,altBoundary:s,padding:d}),S=S?x?O:M:x?P:L,x=(h[C]>l[C]&&(S=F(S)),F(S)),C=[];if(n&&C.push(k[w]<=0),r&&C.push(k[S]<=0,k[x]<=0),C.every(function(t){return t})){v=b,_=!1;break}u.set(b,C)}if(_)for(var E=g?3:1;0<E;E--)if("break"===function(e){var t=o.find(function(t){t=u.get(t);if(t)return t.slice(0,e).every(function(t){return t})});if(t)return v=t,"break"}(E))break;c.placement!==v&&(c.modifiersData[t]._skip=!0,c.placement=v,c.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function V(t,e,i){return E(t,A(e,i))}var vt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e,i,n,r,s,a,o,h,l,u=t.state,c=t.options,t=t.name,d=void 0===(d=c.mainAxis)||d,f=void 0!==(f=c.altAxis)&&f,p=c.boundary,g=c.rootBoundary,m=c.altBoundary,_=c.padding,v=void 0===(v=c.tether)||v,c=void 0===(c=c.tetherOffset)?0:c,p=z(u,{boundary:p,rootBoundary:g,padding:_,altBoundary:m}),g=B(u.placement),m=!(_=j(u.placement)),y=it(g),b="x"===y?"y":"x",w=u.modifiersData.popperOffsets,x=u.rects.reference,S=u.rects.popper,c="number"==typeof(c="function"==typeof c?c(Object.assign({},u.rects,{placement:u.placement})):c)?{mainAxis:c,altAxis:c}:Object.assign({mainAxis:0,altAxis:0},c),C=u.modifiersData.offset?u.modifiersData.offset[u.placement]:null,k={x:0,y:0};w&&(d&&(d="y"===y?"height":"width",a=(o=w[y])+p[i="y"===y?L:M],h=o-p[l="y"===y?P:O],e=v?-S[d]/2:0,r=(_===D?x:S)[d],_=_===D?-S[d]:-x[d],s=u.elements.arrow,s=v&&s?T(s):{width:0,height:0},i=(n=u.modifiersData["arrow#persistent"]?u.modifiersData["arrow#persistent"].padding:rt())[i],n=n[l],l=V(0,x[d],s[d]),s=m?x[d]/2-e-l-i-c.mainAxis:r-l-i-c.mainAxis,r=m?-x[d]/2+e+l+n+c.mainAxis:_+l+n+c.mainAxis,m=(i=u.elements.arrow&&I(u.elements.arrow))?"y"===y?i.clientTop||0:i.clientLeft||0:0,_=o+r-(e=null!=(d=null==C?void 0:C[y])?d:0),l=V(v?A(a,o+s-e-m):a,o,v?E(h,_):h),w[y]=l,k[y]=l-o),f&&(n="y"==b?"height":"width",r=(i=w[b])+p["x"===y?L:M],d=i-p["x"===y?P:O],s=-1!==[L,M].indexOf(g),m=null!=(e=null==C?void 0:C[b])?e:0,a=s?r:i-x[n]-S[n]-m+c.altAxis,_=s?i+x[n]+S[n]-m-c.altAxis:d,o=v&&s?(h=V(h=a,i,l=_),l<h?l:h):V(v?a:r,i,v?_:d),w[b]=o,k[b]=o-i),u.modifiersData[t]=k)},requiresIfExists:["offset"]};var yt={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i,n,r,s=t.state,a=t.name,t=t.options,o=s.elements.arrow,h=s.modifiersData.popperOffsets,l=it(u=B(s.placement)),u=0<=[M,O].indexOf(u)?"height":"width";o&&h&&(t=t.padding,i=s,i=st("number"!=typeof(t="function"==typeof t?t(Object.assign({},i.rects,{placement:i.placement})):t)?t:at(t,R)),t=T(o),r="y"===l?L:M,n="y"===l?P:O,e=s.rects.reference[u]+s.rects.reference[l]-h[l]-s.rects.popper[u],h=h[l]-s.rects.reference[l],o=(o=I(o))?"y"===l?o.clientHeight||0:o.clientWidth||0:0,r=i[r],i=o-t[u]-i[n],r=V(r,n=o/2-t[u]/2+(e/2-h/2),i),s.modifiersData[a]=((o={})[l]=r,o.centerOffset=r-n,o))},effect:function(t){var e=t.state;null==(t=void 0===(t=t.options.element)?"[data-popper-arrow]":t)||"string"==typeof t&&!(t=e.elements.popper.querySelector(t))||("production"===Et.env.NODE_ENV||h(t)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" ")),Q(e.elements.popper,t)?e.elements.arrow=t:"production"!==Et.env.NODE_ENV&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" ")))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bt(t,e,i){return{top:t.top-e.height-(i=void 0===i?{x:0,y:0}:i).y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function wt(e){return[L,O,P,M].some(function(t){return 0<=e[t]})}var xt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,t=t.name,i=e.rects.reference,n=e.rects.popper,r=e.modifiersData.preventOverflow,s=z(e,{elementContext:"reference"}),a=z(e,{altBoundary:!0}),s=bt(s,i),i=bt(a,n,r),a=wt(s),n=wt(i);e.modifiersData[t]={referenceClippingOffsets:s,popperEscapeOffsets:i,isReferenceHidden:a,hasPopperEscaped:n},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":a,"data-popper-escaped":n})}},St=t({defaultModifiers:[e,i,n,dt]}),Ct=[e,i,n,dt,ft,_t,vt,yt,xt],kt=t({defaultModifiers:Ct});At.applyStyles=dt,At.arrow=yt,At.computeStyles=n,At.createPopper=kt,At.createPopperLite=St,At.defaultModifiers=Ct,At.detectOverflow=z,At.eventListeners=e,At.flip=_t,At.hide=xt,At.offset=ft,At.popperGenerator=t,At.popperOffsets=i,At.preventOverflow=vt}.call(this)}.call(this,t("_process"))},{_process:33}],4:[function(t,e,i){var n=this,r=function(){"use strict";function e(e,t){var i,n=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)),n}function g(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?e(Object(r),!0).forEach(function(t){var e,i;e=n,i=r[t=t],t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(r,t))})}return n}function h(t){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}()||u(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){var i;if(t)return"string"==typeof t?n(t,e):"Map"===(i="Object"===(i=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:i)||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function l(t){return"string"==typeof t?document.querySelector(t):t()}function c(i,t,e){var n=(e=e||{}).mode,r=e.diacritics,s=e.highlight,a=_(t,r);if(t=String(t),i=_(i,r),"loose"===n){var o=(i=i.replace(/ /g,"")).length,h=0,e=Array.from(t).map(function(t,e){return h<o&&a[e]===i[h]&&(t=s?v(t,s):t,h++),t}).join("");if(h===o)return e}else{r=a.indexOf(i);if(~r)return i=t.substring(r,r+i.length),s?t.replace(i,v(i,s)):t}}function d(t){k(t.cursor+1,t)}function f(t){k(t.cursor-1,t)}function p(t,e,i){(i=0<=i?i:t.cursor)<0||(t.feedback.event=e,x(t,i),y("selection",t),C(t))}var m=function(t,e){var i,n="string"==typeof t?document.createElement(t):t;for(i in e){var r,s=e[i];"inside"===i?s.append(n):"dest"===i?l(s[0]).insertAdjacentElement(s[1],n):"around"===i?((r=s).parentNode.insertBefore(n,r),n.append(r),null!=r.getAttribute("autofocus")&&r.focus()):i in n?n[i]=s:n.setAttribute(i,s)}return n},_=function(t,e){return t=String(t).toLowerCase(),e?t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").normalize("NFC"):t},v=function(t,e){return m("mark",g({innerHTML:t},"string"==typeof e&&{class:e})).outerHTML},y=function(t,e){e.input.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e.feedback,cancelable:!0}))},b=function(r,s){return new Promise(function(e,i){var n;return(n=r.data).cache&&n.store?e():new Promise(function(t,e){return"function"==typeof n.src?n.src(s).then(t,e):t(n.src)}).then(function(t){try{return r.feedback=n.store=t,y("response",r),e()}catch(t){return i(t)}},i)})},w=function(s,a){var o=a.data,h=a.searchEngine,l=[],t=(o.store.forEach(function(i,t){function e(t){var e=t?i[t]:i;(e="function"==typeof h?h(s,e):c(s,e,{mode:h,diacritics:a.diacritics,highlight:a.resultItem.highlight}))&&(e={match:e,value:i},t&&(e.key=t),l.push(e))}if(o.keys){var n,r=function(t){var e,i,n,r,s,a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(a)return n=!(i=!0),{s:function(){a=a.call(t)},n:function(){var t=a.next();return i=t.done,t},e:function(t){n=!0,e=t},f:function(){try{i||null==a.return||a.return()}finally{if(n)throw e}}};if(Array.isArray(t)||(a=u(t)))return a&&(t=a),r=0,{s:s=function(){},n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(o.keys);try{for(r.s();!(n=r.n()).done;)e(n.value)}catch(t){r.e(t)}finally{r.f()}}else e()}),(l=o.filter?o.filter(l):l).slice(0,a.resultsList.maxResults));a.feedback={query:s,matches:l,results:t},y("results",a)},i="aria-expanded",a="aria-activedescendant",o="aria-selected",x=function(t,e){t.feedback.selection=g({index:e},t.feedback.results[e])},S=function(t){t.isOpen||((t.wrapper||t.input).setAttribute(i,!0),t.list.removeAttribute("hidden"),t.isOpen=!0,y("open",t))},C=function(t){t.isOpen&&((t.wrapper||t.input).setAttribute(i,!1),t.input.setAttribute(a,""),t.list.setAttribute("hidden",""),t.isOpen=!1,y("close",t))},k=function(t,e){var i,n=e.resultItem,r=e.list.getElementsByTagName(n.tag),n=!!n.selected&&n.selected.split(" ");e.isOpen&&r.length&&(i=e.cursor,(t=t>=r.length?0:t)<0&&(t=r.length-1),e.cursor=t,-1<i&&(r[i].removeAttribute(o),n)&&(i=r[i].classList).remove.apply(i,s(n)),r[t].setAttribute(o,!0),n&&(i=r[t].classList).add.apply(i,s(n)),e.input.setAttribute(a,r[e.cursor].id),e.list.scrollTop=r[t].offsetTop-e.list.clientHeight+r[t].clientHeight+5,e.feedback.cursor=e.cursor,x(e,t),y("navigate",e))};function E(f,n){var p=this;return new Promise(function(l,u){var t,e,i,c=n||((t=f.input)instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t.value:t.innerHTML);return t=c=f.query?f.query(c):c,e=f.trigger,i=f.threshold,(e?e(t):t.length>=i)?b(f,c).then(function(t){try{return f.feedback instanceof Error?l():(w(c,f),f.resultsList&&(n=(e=f).resultsList,r=e.list,s=e.resultItem,a=e.feedback,o=a.matches,h=a.results,e.cursor=-1,r.innerHTML="",(o.length||n.noResults?(i=new DocumentFragment,h.forEach(function(t,e){e=m(s.tag,g({id:"".concat(s.id,"_").concat(e),role:"option",innerHTML:t.match,inside:i},s.class&&{class:s.class}));s.element&&s.element(e,t)}),r.append(i),n.element&&n.element(r,a),S):C)(e)),d.call(p))}catch(t){return u(t)}var e,i,n,r,s,a,o,h},u):(C(f),d.call(p));function d(){return l()}})}function A(t,e){for(var i in t)for(var n in t[i])e(i,n)}var T=function(s){var t,e,i,n=s.events,r=(t=function(){return E(s)},e=s.debounce,s.events=g({input:g({},n&&n.input)},s.resultsList&&{list:n?g({},n.list):{}})),a={input:{input:function(){clearTimeout(i),i=setTimeout(t,e)},keydown:function(t){var e=t,i=s;switch(e.keyCode){case 40:case 38:e.preventDefault(),(40===e.keyCode?d:f)(i);break;case 13:i.submit||e.preventDefault(),0<=i.cursor&&p(i,e);break;case 9:i.resultsList.tabSelect&&0<=i.cursor&&p(i,e);break;case 27:i.input.value="",C(i)}},blur:function(){C(s)}},list:{mousedown:function(t){t.preventDefault()},click:function(t){var e,i,n,r;t=t,i=(e=s).resultItem.tag.toUpperCase(),n=Array.from(e.list.querySelectorAll(i)),(r=t.target.closest(i))&&r.nodeName===i&&p(e,t,n.indexOf(r))}}};A(a,function(t,e){!s.resultsList&&"input"!==e||r[t][e]||(r[t][e]=a[t][e])}),A(r,function(t,e){s[t].addEventListener(e,r[t][e])})};function I(a){var o=this;new Promise(function(t,e){var i,n,r;return i=a.placeHolder,r={role:"combobox","aria-owns":(n=a.resultsList).id,"aria-haspopup":!0,"aria-expanded":!1},m(a.input,g(g({"aria-controls":n.id,"aria-autocomplete":"both"},i&&{placeholder:i}),!a.wrapper&&g({},r))),a.wrapper&&(a.wrapper=m("div",g({around:a.input,class:a.name+"_wrapper"},r))),n&&(a.list=m(n.tag,g({dest:[n.destination,n.position],id:n.id,role:"listbox",hidden:"hidden"},n.class&&{class:n.class}))),T(a),a.data.cache?b(a).then(function(t){try{return s.call(o)}catch(t){return e(t)}},e):s.call(o);function s(){return y("init",a),t()}})}return function t(e){this.options=e,this.id=t.instances=(t.instances||0)+1,this.name="autoComplete",this.wrapper=1,this.threshold=1,this.debounce=0,this.resultsList={position:"afterend",tag:"ul",maxResults:5},this.resultItem={tag:"li"};var i,n=this,e=n.name,r=n.options,s=n.resultsList,a=n.resultItem;for(i in r)if("object"===h(r[i]))for(var o in n[i]||(n[i]={}),r[i])n[i][o]=r[i][o];else n[i]=r[i];n.selector=n.selector||"#"+e,s.destination=s.destination||n.selector,s.id=s.id||e+"_list_"+n.id,a.id=a.id||e+"_result",n.input=l(n.selector),function(t){(t=t.prototype).init=function(){I(this)},t.start=function(t){E(this,t)},t.unInit=function(){var t,i;this.wrapper&&((t=this.wrapper.parentNode).insertBefore(this.input,this.wrapper),t.removeChild(this.wrapper)),A((i=this).events,function(t,e){i[t].removeEventListener(e,i.events[t][e])})},t.open=function(){S(this)},t.close=function(){C(this)},t.goTo=function(t){k(t,this)},t.next=function(){d(this)},t.previous=function(){f(this)},t.select=function(t){p(this,null,t)},t.search=c}.call(this,t),I(this)}};"object"==typeof i&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).autoComplete=r()},{}],5:[function(t,e,i){var n,r;n=this,r=function(t){"use strict";var a={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},e="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",D={5:e,"5module":e+" export import",6:e+" const class extends export import super"},B=/^in(stanceof)?$/,e="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",j=new RegExp("["+e+"]"),z=new RegExp("["+e+"·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_]"),F=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],V=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function i(t,e){for(var i=65536,n=0;n<e.length;n+=2){if(t<(i+=e[n]))return!1;if(t<=(i+=e[n+1]))return!0}}function o(t,e){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?170<=t&&j.test(String.fromCharCode(t)):!1!==e&&i(t,F)))}function h(t,e){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?170<=t&&z.test(String.fromCharCode(t)):!1!==e&&(i(t,F)||i(t,V)))))}function n(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null}function r(t,e){return new n(t,{beforeExpr:!0,binop:e})}var e={beforeExpr:!0},s={startsExpr:!0},l={};function u(t,e){return(e=void 0===e?{}:e).keyword=t,l[t]=new n(t,e)}var m={num:new n("num",s),regexp:new n("regexp",s),string:new n("string",s),name:new n("name",s),eof:new n("eof"),bracketL:new n("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new n("]"),braceL:new n("{",{beforeExpr:!0,startsExpr:!0}),braceR:new n("}"),parenL:new n("(",{beforeExpr:!0,startsExpr:!0}),parenR:new n(")"),comma:new n(",",e),semi:new n(";",e),colon:new n(":",e),dot:new n("."),question:new n("?",e),questionDot:new n("?."),arrow:new n("=>",e),template:new n("template"),invalidTemplate:new n("invalidTemplate"),ellipsis:new n("...",e),backQuote:new n("`",s),dollarBraceL:new n("${",{beforeExpr:!0,startsExpr:!0}),eq:new n("=",{beforeExpr:!0,isAssign:!0}),assign:new n("_=",{beforeExpr:!0,isAssign:!0}),incDec:new n("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new n("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:r("||",1),logicalAND:r("&&",2),bitwiseOR:r("|",3),bitwiseXOR:r("^",4),bitwiseAND:r("&",5),equality:r("==/!=/===/!==",6),relational:r("</>/<=/>=",7),bitShift:r("<</>>/>>>",8),plusMin:new n("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:r("%",10),star:r("*",10),slash:r("/",10),starstar:new n("**",{beforeExpr:!0}),coalesce:r("??",1),_break:u("break"),_case:u("case",e),_catch:u("catch"),_continue:u("continue"),_debugger:u("debugger"),_default:u("default",e),_do:u("do",{isLoop:!0,beforeExpr:!0}),_else:u("else",e),_finally:u("finally"),_for:u("for",{isLoop:!0}),_function:u("function",s),_if:u("if"),_return:u("return",e),_switch:u("switch"),_throw:u("throw",e),_try:u("try"),_var:u("var"),_const:u("const"),_while:u("while",{isLoop:!0}),_with:u("with"),_new:u("new",{beforeExpr:!0,startsExpr:!0}),_this:u("this",s),_super:u("super",s),_class:u("class",s),_extends:u("extends",e),_export:u("export"),_import:u("import",s),_null:u("null",s),_true:u("true",s),_false:u("false",s),_in:u("in",{beforeExpr:!0,binop:7}),_instanceof:u("instanceof",{beforeExpr:!0,binop:7}),_typeof:u("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:u("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:u("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},c=/\r\n?|\n|\u2028|\u2029/,d=new RegExp(c.source,"g");function f(t,e){return 10===t||13===t||!e&&(8232===t||8233===t)}var p=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,g=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,e=Object.prototype,q=e.hasOwnProperty,U=e.toString;function _(t,e){return q.call(t,e)}var H=Array.isArray||function(t){return"[object Array]"===U.call(t)};function v(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}function y(t,e){this.line=t,this.column=e}function b(t,e,i){this.start=e,this.end=i,null!==t.sourceFile&&(this.source=t.sourceFile)}function w(t,e){for(var i=1,n=0;;){d.lastIndex=n;var r=d.exec(t);if(!(r&&r.index<e))return new y(i,e-n);++i,n=r.index+r[0].length}}var x={ecmaVersion:10,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!(y.prototype.offset=function(t){return new y(this.line,this.column+t)}),allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function W(t){var e,i,a,o,n={};for(e in x)n[e]=(t&&_(t,e)?t:x)[e];return 2015<=n.ecmaVersion&&(n.ecmaVersion-=2009),null==n.allowReserved&&(n.allowReserved=n.ecmaVersion<5),H(n.onToken)&&(i=n.onToken,n.onToken=function(t){return i.push(t)}),H(n.onComment)&&(n.onComment=(o=(a=n).onComment,function(t,e,i,n,r,s){t={type:t?"Block":"Line",value:e,start:i,end:n};a.locations&&(t.loc=new b(this,r,s)),a.ranges&&(t.range=[i,n]),o.push(t)})),n}function S(t,e){return 2|(t?4:0)|(e?8:0)}function C(t,e,i){this.options=t=W(t),this.sourceFile=t.sourceFile,this.keywords=v(D[6<=t.ecmaVersion?6:"module"===t.sourceType?"5module":5]);var n="";if(!0!==t.allowReserved){for(var r=t.ecmaVersion;!(n=a[r]);r--);"module"===t.sourceType&&(n+=" await")}this.reservedWords=v(n);var s=(n?n+" ":"")+a.strict;this.reservedWordsStrict=v(s),this.reservedWordsStrictBind=v(s+" "+a.strictBind),this.input=String(e),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(c).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=m.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===t.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null}var s={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}},e=(C.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)},s.inFunction.get=function(){return 0<(2&this.currentVarScope().flags)},s.inGenerator.get=function(){return 0<(8&this.currentVarScope().flags)},s.inAsync.get=function(){return 0<(4&this.currentVarScope().flags)},s.allowSuper.get=function(){return 0<(64&this.currentThisScope().flags)},s.allowDirectSuper.get=function(){return 0<(128&this.currentThisScope().flags)},s.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},C.prototype.inNonArrowFunction=function(){return 0<(2&this.currentThisScope().flags)},C.extend=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var i=this,n=0;n<t.length;n++)i=t[n](i);return i},C.parse=function(t,e){return new this(e,t).parse()},C.parseExpressionAt=function(t,e,i){i=new this(i,t,e);return i.nextToken(),i.parseExpression()},C.tokenizer=function(t,e){return new this(e,t)},Object.defineProperties(C.prototype,s),C.prototype),G=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;function k(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}e.strictDirective=function(t){for(;;){g.lastIndex=t,t+=g.exec(this.input)[0].length;var e,i,n,r=G.exec(this.input.slice(t));if(!r)return!1;if("use strict"===(r[1]||r[2]))return g.lastIndex=t+r[0].length,i=(e=g.exec(this.input)).index+e[0].length,";"===(n=this.input.charAt(i))||"}"===n||c.test(e[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(n)||"!"===n&&"="===this.input.charAt(i+1));t+=r[0].length,g.lastIndex=t,t+=g.exec(this.input)[0].length,";"===this.input[t]&&t++}},e.eat=function(t){return this.type===t&&(this.next(),!0)},e.isContextual=function(t){return this.type===m.name&&this.value===t&&!this.containsEsc},e.eatContextual=function(t){return!!this.isContextual(t)&&(this.next(),!0)},e.expectContextual=function(t){this.eatContextual(t)||this.unexpected()},e.canInsertSemicolon=function(){return this.type===m.eof||this.type===m.braceR||c.test(this.input.slice(this.lastTokEnd,this.start))},e.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},e.semicolon=function(){this.eat(m.semi)||this.insertSemicolon()||this.unexpected()},e.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0},e.expect=function(t){this.eat(t)||this.unexpected()},e.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")},e.checkPatternErrors=function(t,e){t&&(-1<t.trailingComma&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element"),-1<(e=e?t.parenthesizedAssign:t.parenthesizedBind))&&this.raiseRecoverable(e,"Parenthesized pattern")},e.checkExpressionErrors=function(t,e){var i;return!!t&&(i=t.shorthandAssign,t=t.doubleProto,e?(0<=i&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),void(0<=t&&this.raiseRecoverable(t,"Redefinition of __proto__ property"))):0<=i||0<=t)},e.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},e.isSimpleAssignTarget=function(t){return"ParenthesizedExpression"===t.type?this.isSimpleAssignTarget(t.expression):"Identifier"===t.type||"MemberExpression"===t.type};function K(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]}function E(t,e,i){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new b(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])}var s=C.prototype,A=(s.parseTopLevel=function(t){var e={};for(t.body||(t.body=[]);this.type!==m.eof;){var i=this.parseStatement(null,!0,e);t.body.push(i)}if(this.inModule)for(var n=0,r=Object.keys(this.undefinedExports);n<r.length;n+=1){var s=r[n];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType,this.finishNode(t,"Program")},{kind:"loop"}),Z={kind:"switch"},$=(s.isLet=function(t){if(!(this.options.ecmaVersion<6)&&this.isContextual("let")){g.lastIndex=this.pos;var e=g.exec(this.input),e=this.pos+e[0].length,i=this.input.charCodeAt(e);if(91===i)return!0;if(!t){if(123===i)return!0;if(o(i,!0)){for(var n=e+1;h(this.input.charCodeAt(n),!0);)++n;t=this.input.slice(e,n);if(!B.test(t))return!0}}}return!1},s.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;g.lastIndex=this.pos;var t=g.exec(this.input),t=this.pos+t[0].length;return!(c.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!==this.input.length&&h(this.input.charAt(t+8)))},s.parseStatement=function(t,e,i){var n,r,s=this.type,a=this.startNode();switch(this.isLet(t)&&(s=m._var,n="let"),s){case m._break:case m._continue:return this.parseBreakContinueStatement(a,s.keyword);case m._debugger:return this.parseDebuggerStatement(a);case m._do:return this.parseDoStatement(a);case m._for:return this.parseForStatement(a);case m._function:return t&&(this.strict||"if"!==t&&"label"!==t)&&6<=this.options.ecmaVersion&&this.unexpected(),this.parseFunctionStatement(a,!1,!t);case m._class:return t&&this.unexpected(),this.parseClass(a,!0);case m._if:return this.parseIfStatement(a);case m._return:return this.parseReturnStatement(a);case m._switch:return this.parseSwitchStatement(a);case m._throw:return this.parseThrowStatement(a);case m._try:return this.parseTryStatement(a);case m._const:case m._var:return n=n||this.value,t&&"var"!==n&&this.unexpected(),this.parseVarStatement(a,n);case m._while:return this.parseWhileStatement(a);case m._with:return this.parseWithStatement(a);case m.braceL:return this.parseBlock(!0,a);case m.semi:return this.parseEmptyStatement(a);case m._export:case m._import:if(10<this.options.ecmaVersion&&s===m._import){g.lastIndex=this.pos;var o=g.exec(this.input),o=this.pos+o[0].length,o=this.input.charCodeAt(o);if(40===o||46===o)return this.parseExpressionStatement(a,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule)||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'"),s===m._import?this.parseImport(a):this.parseExport(a,i);default:return this.isAsyncFunction()?(t&&this.unexpected(),this.next(),this.parseFunctionStatement(a,!0,!t)):(o=this.value,r=this.parseExpression(),s===m.name&&"Identifier"===r.type&&this.eat(m.colon)?this.parseLabeledStatement(a,o,r,t):this.parseExpressionStatement(a,r))}},s.parseBreakContinueStatement=function(t,e){for(var i="break"===e,n=(this.next(),this.eat(m.semi)||this.insertSemicolon()?t.label=null:this.type!==m.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon()),0);n<this.labels.length;++n){var r=this.labels[n];if(null==t.label||r.name===t.label.name){if(null!=r.kind&&(i||"loop"===r.kind))break;if(t.label&&i)break}}return n===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,i?"BreakStatement":"ContinueStatement")},s.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")},s.parseDoStatement=function(t){return this.next(),this.labels.push(A),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(m._while),t.test=this.parseParenExpression(),6<=this.options.ecmaVersion?this.eat(m.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},s.parseForStatement=function(t){this.next();var e,i,n=9<=this.options.ecmaVersion&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;return this.labels.push(A),this.enterScope(0),this.expect(m.parenL),this.type===m.semi?(-1<n&&this.unexpected(n),this.parseFor(t,null)):(e=this.isLet(),this.type===m._var||this.type===m._const||e?(i=this.startNode(),e=e?"let":this.value,this.next(),this.parseVar(i,!0,e),this.finishNode(i,"VariableDeclaration"),(this.type===m._in||6<=this.options.ecmaVersion&&this.isContextual("of"))&&1===i.declarations.length?(9<=this.options.ecmaVersion&&(this.type===m._in?-1<n&&this.unexpected(n):t.await=-1<n),this.parseForIn(t,i)):(-1<n&&this.unexpected(n),this.parseFor(t,i))):(e=new k,i=this.parseExpression(!0,e),this.type===m._in||6<=this.options.ecmaVersion&&this.isContextual("of")?(9<=this.options.ecmaVersion&&(this.type===m._in?-1<n&&this.unexpected(n):t.await=-1<n),this.toAssignable(i,!1,e),this.checkLVal(i),this.parseForIn(t,i)):(this.checkExpressionErrors(e,!0),-1<n&&this.unexpected(n),this.parseFor(t,i))))},s.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,T|(i?0:I),!1,e)},s.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(m._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")},s.parseReturnStatement=function(t){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(m.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},s.parseSwitchStatement=function(t){var e;this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(m.braceL),this.labels.push(Z),this.enterScope(0);for(var i,n=!1;this.type!==m.braceR;)this.type===m._case||this.type===m._default?(i=this.type===m._case,e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),i?e.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,e.test=null),this.expect(m.colon)):(e||this.unexpected(),e.consequent.push(this.parseStatement(null)));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},s.parseThrowStatement=function(t){return this.next(),c.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")},[]),T=(s.parseTryStatement=function(t){var e,i;return this.next(),t.block=this.parseBlock(),t.handler=null,this.type===m._catch&&(e=this.startNode(),this.next(),this.eat(m.parenL)?(e.param=this.parseBindingAtom(),i="Identifier"===e.param.type,this.enterScope(i?32:0),this.checkLVal(e.param,i?4:2),this.expect(m.parenR)):(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0)),e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")),t.finalizer=this.eat(m._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},s.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")},s.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(A),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")},s.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")},s.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},s.parseLabeledStatement=function(t,e,i,n){for(var r=0,s=this.labels;r<s.length;r+=1)s[r].name===e&&this.raise(i.start,"Label '"+e+"' is already declared");for(var a=this.type.isLoop?"loop":this.type===m._switch?"switch":null,o=this.labels.length-1;0<=o;o--){var h=this.labels[o];if(h.statementStart!==t.start)break;h.statementStart=this.start,h.kind=a}return this.labels.push({name:e,kind:a,statementStart:this.start}),t.body=this.parseStatement(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")},s.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},s.parseBlock=function(t,e,i){for(void 0===t&&(t=!0),(e=void 0===e?this.startNode():e).body=[],this.expect(m.braceL),t&&this.enterScope(0);this.type!==m.braceR;){var n=this.parseStatement(null);e.body.push(n)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")},s.parseFor=function(t,e){return t.init=e,this.expect(m.semi),t.test=this.type===m.semi?null:this.parseExpression(),this.expect(m.semi),t.update=this.type===m.parenR?null:this.parseExpression(),this.expect(m.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")},s.parseForIn=function(t,e){var i=this.type===m._in;return this.next(),"VariableDeclaration"===e.type&&null!=e.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==e.kind||"Identifier"!==e.declarations[0].id.type)?this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===e.type&&this.raise(e.start,"Invalid left-hand side in for-loop"),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(m.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")},s.parseVar=function(t,e,i){for(t.declarations=[],t.kind=i;;){var n=this.startNode();if(this.parseVarId(n,i),this.eat(m.eq)?n.init=this.parseMaybeAssign(e):"const"!==i||this.type===m._in||6<=this.options.ecmaVersion&&this.isContextual("of")?"Identifier"===n.id.type||e&&(this.type===m._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),t.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(m.comma))break}return t},s.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLVal(t.id,"var"===e?1:2,!1)},1),I=2,e=(s.parseFunction=function(t,e,i,n){this.initFunction(t),(9<=this.options.ecmaVersion||6<=this.options.ecmaVersion&&!n)&&(this.type===m.star&&e&I&&this.unexpected(),t.generator=this.eat(m.star)),8<=this.options.ecmaVersion&&(t.async=!!n),e&T&&(t.id=4&e&&this.type!==m.name?null:this.parseIdent(),!t.id||e&I||this.checkLVal(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?1:2:3));var n=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(S(t.async,t.generator)),e&T||(t.id=this.type===m.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=s,this.finishNode(t,e&T?"FunctionDeclaration":"FunctionExpression")},s.parseFunctionParams=function(t){this.expect(m.parenL),t.params=this.parseBindingList(m.parenR,!1,8<=this.options.ecmaVersion),this.checkYieldAwaitInDefaultParams()},s.parseClass=function(t,e){this.next();var i=this.strict,n=(this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t),this.startNode()),r=!1;for(n.body=[],this.expect(m.braceL);this.type!==m.braceR;){var s=this.parseClassElement(null!==t.superClass);s&&(n.body.push(s),"MethodDefinition"===s.type)&&"constructor"===s.kind&&(r&&this.raise(s.start,"Duplicate constructor in the same class"),r=!0)}return this.strict=i,this.next(),t.body=this.finishNode(n,"ClassBody"),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},s.parseClassElement=function(t){var r,e,i,n,s,a=this;return this.eat(m.semi)?null:(n=function(t,e){void 0===e&&(e=!1);var i=a.start,n=a.startLoc;if(a.eatContextual(t)){if(!(a.type===m.parenL||e&&a.canInsertSemicolon()))return!0;r.key&&a.unexpected(),r.computed=!1,r.key=a.startNodeAt(i,n),r.key.name=t,a.finishNode(r.key,"Identifier")}return!1},(r=this.startNode()).kind="method",r.static=n("static"),i=!1,(e=this.eat(m.star))||(8<=this.options.ecmaVersion&&n("async",!0)?(i=!0,e=9<=this.options.ecmaVersion&&this.eat(m.star)):n("get")?r.kind="get":n("set")&&(r.kind="set")),r.key||this.parsePropertyName(r),n=r.key,s=!1,r.computed||r.static||!("Identifier"===n.type&&"constructor"===n.name||"Literal"===n.type&&"constructor"===n.value)?r.static&&"Identifier"===n.type&&"prototype"===n.name&&this.raise(n.start,"Classes may not have a static property named prototype"):("method"!==r.kind&&this.raise(n.start,"Constructor can't have get/set modifier"),e&&this.raise(n.start,"Constructor can't be a generator"),i&&this.raise(n.start,"Constructor can't be an async method"),r.kind="constructor",s=t),this.parseClassMethod(r,e,i,s),"get"===r.kind&&0!==r.value.params.length&&this.raiseRecoverable(r.value.start,"getter should have no params"),"set"===r.kind&&1!==r.value.params.length&&this.raiseRecoverable(r.value.start,"setter should have exactly one param"),"set"===r.kind&&"RestElement"===r.value.params[0].type&&this.raiseRecoverable(r.value.params[0].start,"Setter cannot use rest params"),r)},s.parseClassMethod=function(t,e,i,n){return t.value=this.parseMethod(e,i,n),this.finishNode(t,"MethodDefinition")},s.parseClassId=function(t,e){this.type===m.name?(t.id=this.parseIdent(),e&&this.checkLVal(t.id,2,!1)):(!0===e&&this.unexpected(),t.id=null)},s.parseClassSuper=function(t){t.superClass=this.eat(m._extends)?this.parseExprSubscripts():null},s.parseExport=function(t,e){if(this.next(),this.eat(m.star))return 11<=this.options.ecmaVersion&&(this.eatContextual("as")?(t.exported=this.parseIdent(!0),this.checkExport(e,t.exported.name,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==m.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");var i,n;if(this.eat(m._default))return this.checkExport(e,"default",this.lastTokStart),this.type===m._function||(i=this.isAsyncFunction())?(n=this.startNode(),this.next(),i&&this.next(),t.declaration=this.parseFunction(n,4|T,!1,i)):this.type===m._class?(n=this.startNode(),t.declaration=this.parseClass(n,"nullableID")):(t.declaration=this.parseMaybeAssign(),this.semicolon()),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseStatement(null),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==m.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var r=0,s=t.specifiers;r<s.length;r+=1){var a=s[r];this.checkUnreserved(a.local),this.checkLocalExport(a.local)}t.source=null}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")},s.checkExport=function(t,e,i){t&&(_(t,e)&&this.raiseRecoverable(i,"Duplicate export '"+e+"'"),t[e]=!0)},s.checkPatternExport=function(t,e){var i=e.type;if("Identifier"===i)this.checkExport(t,e.name,e.start);else if("ObjectPattern"===i)for(var n=0,r=e.properties;n<r.length;n+=1){var s=r[n];this.checkPatternExport(t,s)}else if("ArrayPattern"===i)for(var a=0,o=e.elements;a<o.length;a+=1){var h=o[a];h&&this.checkPatternExport(t,h)}else"Property"===i?this.checkPatternExport(t,e.value):"AssignmentPattern"===i?this.checkPatternExport(t,e.left):"RestElement"===i?this.checkPatternExport(t,e.argument):"ParenthesizedExpression"===i&&this.checkPatternExport(t,e.expression)},s.checkVariableExport=function(t,e){if(t)for(var i=0,n=e;i<n.length;i+=1){var r=n[i];this.checkPatternExport(t,r.id)}},s.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},s.parseExportSpecifiers=function(t){var e=[],i=!0;for(this.expect(m.braceL);!this.eat(m.braceR);){if(i)i=!1;else if(this.expect(m.comma),this.afterTrailingComma(m.braceR))break;var n=this.startNode();n.local=this.parseIdent(!0),n.exported=this.eatContextual("as")?this.parseIdent(!0):n.local,this.checkExport(t,n.exported.name,n.exported.start),e.push(this.finishNode(n,"ExportSpecifier"))}return e},s.parseImport=function(t){return this.next(),this.type===m.string?(t.specifiers=$,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===m.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(t,"ImportDeclaration")},s.parseImportSpecifiers=function(){var t=[],e=!0;if(this.type===m.name){var i=this.startNode();if(i.local=this.parseIdent(),this.checkLVal(i.local,2),t.push(this.finishNode(i,"ImportDefaultSpecifier")),!this.eat(m.comma))return t}if(this.type===m.star)i=this.startNode(),this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLVal(i.local,2),t.push(this.finishNode(i,"ImportNamespaceSpecifier"));else for(this.expect(m.braceL);!this.eat(m.braceR);){if(e)e=!1;else if(this.expect(m.comma),this.afterTrailingComma(m.braceR))break;var n=this.startNode();n.imported=this.parseIdent(!0),this.eatContextual("as")?n.local=this.parseIdent():(this.checkUnreserved(n.imported),n.local=n.imported),this.checkLVal(n.local,2),t.push(this.finishNode(n,"ImportSpecifier"))}return t},s.adaptDirectivePrologue=function(t){for(var e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)},s.isDirectiveCandidate=function(t){return"ExpressionStatement"===t.type&&"Literal"===t.expression.type&&"string"==typeof t.expression.value&&('"'===this.input[t.start]||"'"===this.input[t.start])},C.prototype),s=(e.toAssignable=function(t,e,i){if(6<=this.options.ecmaVersion&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var n=0,r=t.properties;n<r.length;n+=1){var s=r[n];this.toAssignable(s,e),"RestElement"!==s.type||"ArrayPattern"!==s.argument.type&&"ObjectPattern"!==s.argument.type||this.raise(s.argument.start,"Unexpected token")}break;case"Property":"init"!==t.kind&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),"AssignmentPattern"===t.argument.type&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==t.operator&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,i);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return t},e.toAssignableList=function(t,e){for(var i,n=t.length,r=0;r<n;r++){var s=t[r];s&&this.toAssignable(s,e)}return n&&(i=t[n-1],6===this.options.ecmaVersion)&&e&&i&&"RestElement"===i.type&&"Identifier"!==i.argument.type&&this.unexpected(i.argument.start),t},e.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")},e.parseRestBinding=function(){var t=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==m.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")},e.parseBindingAtom=function(){if(6<=this.options.ecmaVersion)switch(this.type){case m.bracketL:var t=this.startNode();return this.next(),t.elements=this.parseBindingList(m.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case m.braceL:return this.parseObj(!0)}return this.parseIdent()},e.parseBindingList=function(t,e,i){for(var n=[],r=!0;!this.eat(t);)if(r?r=!1:this.expect(m.comma),e&&this.type===m.comma)n.push(null);else{if(i&&this.afterTrailingComma(t))break;if(this.type===m.ellipsis){var s=this.parseRestBinding();this.parseBindingListItem(s),n.push(s),this.type===m.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(t);break}s=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(s),n.push(s)}return n},e.parseBindingListItem=function(t){return t},e.parseMaybeDefault=function(t,e,i){return i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(m.eq)?i:((t=this.startNodeAt(t,e)).left=i,t.right=this.parseMaybeAssign(),this.finishNode(t,"AssignmentPattern"))},e.checkLVal=function(t,e,i){switch(void 0===e&&(e=0),t.type){case"Identifier":2===e&&"let"===t.name&&this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name"),this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(e?"Binding ":"Assigning to ")+t.name+" in strict mode"),i&&(_(i,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),i[t.name]=!0),0!==e&&5!==e&&this.declareName(t.name,e,t.start);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":e&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ObjectPattern":for(var n=0,r=t.properties;n<r.length;n+=1){var s=r[n];this.checkLVal(s,e,i)}break;case"Property":this.checkLVal(t.value,e,i);break;case"ArrayPattern":for(var a=0,o=t.elements;a<o.length;a+=1){var h=o[a];h&&this.checkLVal(h,e,i)}break;case"AssignmentPattern":this.checkLVal(t.left,e,i);break;case"RestElement":this.checkLVal(t.argument,e,i);break;case"ParenthesizedExpression":this.checkLVal(t.expression,e,i);break;default:this.raise(t.start,(e?"Binding":"Assigning to")+" rvalue")}},C.prototype),Y=(s.checkPropClash=function(t,e,i){if(!(9<=this.options.ecmaVersion&&"SpreadElement"===t.type||6<=this.options.ecmaVersion&&(t.computed||t.method||t.shorthand))){var n=t.key;switch(n.type){case"Identifier":r=n.name;break;case"Literal":r=String(n.value);break;default:return}var r,t=t.kind;6<=this.options.ecmaVersion?"__proto__"===r&&"init"===t&&(e.proto&&(i?i.doubleProto<0&&(i.doubleProto=n.start):this.raiseRecoverable(n.start,"Redefinition of __proto__ property")),e.proto=!0):((i=e[r="$"+r])?("init"===t?this.strict&&i.init||i.get||i.set:i.init||i[t])&&this.raiseRecoverable(n.start,"Redefinition of property"):i=e[r]={init:!1,get:!1,set:!1},i[t]=!0)}},s.parseExpression=function(t,e){var i=this.start,n=this.startLoc,r=this.parseMaybeAssign(t,e);if(this.type!==m.comma)return r;var s=this.startNodeAt(i,n);for(s.expressions=[r];this.eat(m.comma);)s.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(s,"SequenceExpression")},s.parseMaybeAssign=function(t,e,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}var n=!1,r=-1,s=-1,a=(e?(r=e.parenthesizedAssign,s=e.trailingComma,e.parenthesizedAssign=e.trailingComma=-1):(e=new k,n=!0),this.start),o=this.startLoc,h=(this.type!==m.parenL&&this.type!==m.name||(this.potentialArrowAt=this.start),this.parseMaybeConditional(t,e));return i&&(h=i.call(this,h,a,o)),this.type.isAssign?((i=this.startNodeAt(a,o)).operator=this.value,i.left=this.type===m.eq?this.toAssignable(h,!1,e):h,n||(e.parenthesizedAssign=e.trailingComma=e.doubleProto=-1),e.shorthandAssign>=i.left.start&&(e.shorthandAssign=-1),this.checkLVal(h),this.next(),i.right=this.parseMaybeAssign(t),this.finishNode(i,"AssignmentExpression")):(n&&this.checkExpressionErrors(e,!0),-1<r&&(e.parenthesizedAssign=r),-1<s&&(e.trailingComma=s),h)},s.parseMaybeConditional=function(t,e){var i=this.start,n=this.startLoc,r=this.parseExprOps(t,e);return!this.checkExpressionErrors(e)&&this.eat(m.question)?((e=this.startNodeAt(i,n)).test=r,e.consequent=this.parseMaybeAssign(),this.expect(m.colon),e.alternate=this.parseMaybeAssign(t),this.finishNode(e,"ConditionalExpression")):r},s.parseExprOps=function(t,e){var i=this.start,n=this.startLoc,r=this.parseMaybeUnary(e,!1);return this.checkExpressionErrors(e)||r.start===i&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,i,n,-1,t)},s.parseExprOp=function(t,e,i,n,r){var s,a,o,h,l,u=this.type.binop;if(null!=u&&(!r||this.type!==m._in)&&n<u)return s=this.type===m.logicalOR||this.type===m.logicalAND,(a=this.type===m.coalesce)&&(u=m.logicalAND.binop),o=this.value,this.next(),h=this.start,l=this.startLoc,h=this.parseExprOp(this.parseMaybeUnary(null,!1),h,l,u,r),l=this.buildBinary(e,i,t,h,o,s||a),(s&&this.type===m.coalesce||a&&(this.type===m.logicalOR||this.type===m.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(l,e,i,n,r);return t},s.buildBinary=function(t,e,i,n,r,s){t=this.startNodeAt(t,e);return t.left=i,t.operator=r,t.right=n,this.finishNode(t,s?"LogicalExpression":"BinaryExpression")},s.parseMaybeUnary=function(t,e){var i,n=this.start,r=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))i=this.parseAwait(),e=!0;else if(this.type.prefix){var s=this.startNode(),a=this.type===m.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),a?this.checkLVal(s.argument):this.strict&&"delete"===s.operator&&"Identifier"===s.argument.type?this.raiseRecoverable(s.start,"Deleting local variable in strict mode"):e=!0,i=this.finishNode(s,a?"UpdateExpression":"UnaryExpression")}else{if(i=this.parseExprSubscripts(t),this.checkExpressionErrors(t))return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(n,r);o.operator=this.value,o.prefix=!1,o.argument=i,this.checkLVal(i),this.next(),i=this.finishNode(o,"UpdateExpression")}}return!e&&this.eat(m.starstar)?this.buildBinary(n,r,i,this.parseMaybeUnary(null,!1),"**",!1):i},s.parseExprSubscripts=function(t){var e=this.start,i=this.startLoc,n=this.parseExprAtom(t);return"ArrowFunctionExpression"===n.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd)||(n=this.parseSubscripts(n,e,i),t&&"MemberExpression"===n.type&&(t.parenthesizedAssign>=n.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=n.start)&&(t.parenthesizedBind=-1)),n},s.parseSubscripts=function(t,e,i,n){for(var r=8<=this.options.ecmaVersion&&"Identifier"===t.type&&"async"===t.name&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start==5&&this.potentialArrowAt===t.start,s=!1;;){var a,o=this.parseSubscript(t,e,i,n,r,s);if(o.optional&&(s=!0),o===t||"ArrowFunctionExpression"===o.type)return s&&((a=this.startNodeAt(e,i)).expression=o,o=this.finishNode(a,"ChainExpression")),o;t=o}},s.parseSubscript=function(t,e,i,n,r,s){var a=11<=this.options.ecmaVersion,o=a&&this.eat(m.questionDot),h=(n&&o&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions"),this.eat(m.bracketL));if(h||o&&this.type!==m.parenL&&this.type!==m.backQuote||this.eat(m.dot)){var l=this.startNodeAt(e,i);l.object=t,l.property=h?this.parseExpression():this.parseIdent("never"!==this.options.allowReserved),l.computed=!!h,h&&this.expect(m.bracketR),a&&(l.optional=o),t=this.finishNode(l,"MemberExpression")}else if(!n&&this.eat(m.parenL)){var h=new k,l=this.yieldPos,n=this.awaitPos,u=this.awaitIdentPos,c=(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.parseExprList(m.parenR,8<=this.options.ecmaVersion,!1,h));if(r&&!o&&!this.canInsertSemicolon()&&this.eat(m.arrow))return this.checkPatternErrors(h,!1),this.checkYieldAwaitInDefaultParams(),0<this.awaitIdentPos&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=l,this.awaitPos=n,this.awaitIdentPos=u,this.parseArrowExpression(this.startNodeAt(e,i),c,!0);this.checkExpressionErrors(h,!0),this.yieldPos=l||this.yieldPos,this.awaitPos=n||this.awaitPos,this.awaitIdentPos=u||this.awaitIdentPos;r=this.startNodeAt(e,i);r.callee=t,r.arguments=c,a&&(r.optional=o),t=this.finishNode(r,"CallExpression")}else this.type===m.backQuote&&((o||s)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions"),(h=this.startNodeAt(e,i)).tag=t,h.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(h,"TaggedTemplateExpression"));return t},s.parseExprAtom=function(t){this.type===m.slash&&this.readRegexp();var e=this.potentialArrowAt===this.start;switch(this.type){case m._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),a=this.startNode(),this.next(),this.type!==m.parenL||this.allowDirectSuper||this.raise(a.start,"super() call outside constructor of a subclass"),this.type!==m.dot&&this.type!==m.bracketL&&this.type!==m.parenL&&this.unexpected(),this.finishNode(a,"Super");case m._this:return a=this.startNode(),this.next(),this.finishNode(a,"ThisExpression");case m.name:var i=this.start,n=this.startLoc,r=this.containsEsc,s=this.parseIdent(!1);if(8<=this.options.ecmaVersion&&!r&&"async"===s.name&&!this.canInsertSemicolon()&&this.eat(m._function))return this.parseFunction(this.startNodeAt(i,n),0,!1,!0);if(e&&!this.canInsertSemicolon()){if(this.eat(m.arrow))return this.parseArrowExpression(this.startNodeAt(i,n),[s],!1);if(8<=this.options.ecmaVersion&&"async"===s.name&&this.type===m.name&&!r)return s=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(m.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,n),[s],!0)}return s;case m.regexp:var a,r=this.value;return(a=this.parseLiteral(r.value)).regex={pattern:r.pattern,flags:r.flags},a;case m.num:case m.string:return this.parseLiteral(this.value);case m._null:case m._true:case m._false:return(a=this.startNode()).value=this.type===m._null?null:this.type===m._true,a.raw=this.type.keyword,this.next(),this.finishNode(a,"Literal");case m.parenL:i=this.start,n=this.parseParenAndDistinguishExpression(e);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(n)&&(t.parenthesizedAssign=i),t.parenthesizedBind<0)&&(t.parenthesizedBind=i),n;case m.bracketL:return a=this.startNode(),this.next(),a.elements=this.parseExprList(m.bracketR,!0,!0,t),this.finishNode(a,"ArrayExpression");case m.braceL:return this.parseObj(!1,t);case m._function:return a=this.startNode(),this.next(),this.parseFunction(a,0);case m._class:return this.parseClass(this.startNode(),!1);case m._new:return this.parseNew();case m.backQuote:return this.parseTemplate();case m._import:return 11<=this.options.ecmaVersion?this.parseExprImport():this.unexpected();default:this.unexpected()}},s.parseExprImport=function(){var t=this.startNode(),e=(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.parseIdent(!0));switch(this.type){case m.parenL:return this.parseDynamicImport(t);case m.dot:return t.meta=e,this.parseImportMeta(t);default:this.unexpected()}},s.parseDynamicImport=function(t){var e;return this.next(),t.source=this.parseMaybeAssign(),this.eat(m.parenR)||(e=this.start,this.eat(m.comma)&&this.eat(m.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)),this.finishNode(t,"ImportExpression")},s.parseImportMeta=function(t){this.next();var e=this.containsEsc;return t.property=this.parseIdent(!0),"meta"!==t.property.name&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")},s.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),110===e.raw.charCodeAt(e.raw.length-1)&&(e.bigint=e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")},s.parseParenExpression=function(){this.expect(m.parenL);var t=this.parseExpression();return this.expect(m.parenR),t},s.parseParenAndDistinguishExpression=function(t){var e,i=this.start,n=this.startLoc,r=8<=this.options.ecmaVersion;if(6<=this.options.ecmaVersion){this.next();var s,a=this.start,o=this.startLoc,h=[],l=!0,u=!1,c=new k,d=this.yieldPos,f=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==m.parenR;){if(l?l=!1:this.expect(m.comma),r&&this.afterTrailingComma(m.parenR,!0)){u=!0;break}if(this.type===m.ellipsis){s=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===m.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}h.push(this.parseMaybeAssign(!1,c,this.parseParenItem))}var p=this.start,g=this.startLoc;if(this.expect(m.parenR),t&&!this.canInsertSemicolon()&&this.eat(m.arrow))return this.checkPatternErrors(c,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=f,this.parseParenArrowList(i,n,h);h.length&&!u||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(c,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=f||this.awaitPos,1<h.length?((e=this.startNodeAt(a,o)).expressions=h,this.finishNodeAt(e,"SequenceExpression",p,g)):e=h[0]}else e=this.parseParenExpression();return this.options.preserveParens?((t=this.startNodeAt(i,n)).expression=e,this.finishNode(t,"ParenthesizedExpression")):e},s.parseParenItem=function(t){return t},s.parseParenArrowList=function(t,e,i){return this.parseArrowExpression(this.startNodeAt(t,e),i)},[]),e=(s.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t,e,i=this.startNode(),n=this.parseIdent(!0);return 6<=this.options.ecmaVersion&&this.eat(m.dot)?(i.meta=n,n=this.containsEsc,i.property=this.parseIdent(!0),"target"!==i.property.name&&this.raiseRecoverable(i.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(i.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(i.start,"'new.target' can only be used in functions"),this.finishNode(i,"MetaProperty")):(n=this.start,t=this.startLoc,e=this.type===m._import,i.callee=this.parseSubscripts(this.parseExprAtom(),n,t,!0),e&&"ImportExpression"===i.callee.type&&this.raise(n,"Cannot use new with import()"),this.eat(m.parenL)?i.arguments=this.parseExprList(m.parenR,8<=this.options.ecmaVersion,!1):i.arguments=Y,this.finishNode(i,"NewExpression"))},s.parseTemplateElement=function(t){var t=t.isTagged,e=this.startNode();return this.type===m.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),e.value={raw:this.value,cooked:null}):e.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),e.tail=this.type===m.backQuote,this.finishNode(e,"TemplateElement")},s.parseTemplate=function(t){var e=(t=void 0===t?{}:t).isTagged,i=(void 0===e&&(e=!1),this.startNode()),n=(this.next(),i.expressions=[],this.parseTemplateElement({isTagged:e}));for(i.quasis=[n];!n.tail;)this.type===m.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(m.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(m.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(i,"TemplateLiteral")},s.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.key.name&&(this.type===m.name||this.type===m.num||this.type===m.string||this.type===m.bracketL||this.type.keyword||9<=this.options.ecmaVersion&&this.type===m.star)&&!c.test(this.input.slice(this.lastTokEnd,this.start))},s.parseObj=function(t,e){var i=this.startNode(),n=!0,r={};for(i.properties=[],this.next();!this.eat(m.braceR);){if(n)n=!1;else if(this.expect(m.comma),5<=this.options.ecmaVersion&&this.afterTrailingComma(m.braceR))break;var s=this.parseProperty(t,e);t||this.checkPropClash(s,r,e),i.properties.push(s)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")},s.parseProperty=function(t,e){var i,n,r,s,a=this.startNode();if(9<=this.options.ecmaVersion&&this.eat(m.ellipsis))return t?(a.argument=this.parseIdent(!1),this.type===m.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===m.parenL&&e&&(e.parenthesizedAssign<0&&(e.parenthesizedAssign=this.start),e.parenthesizedBind<0)&&(e.parenthesizedBind=this.start),a.argument=this.parseMaybeAssign(!1,e),this.type===m.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(a,"SpreadElement"));6<=this.options.ecmaVersion&&(a.method=!1,a.shorthand=!1,(t||e)&&(r=this.start,s=this.startLoc),t||(i=this.eat(m.star)));var o=this.containsEsc;return this.parsePropertyName(a),!t&&!o&&8<=this.options.ecmaVersion&&!i&&this.isAsyncProp(a)?(n=!0,i=9<=this.options.ecmaVersion&&this.eat(m.star),this.parsePropertyName(a,e)):n=!1,this.parsePropertyValue(a,t,i,n,r,s,e,o),this.finishNode(a,"Property")},s.parsePropertyValue=function(t,e,i,n,r,s,a,o){(i||n)&&this.type===m.colon&&this.unexpected(),this.eat(m.colon)?(t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),t.kind="init"):6<=this.options.ecmaVersion&&this.type===m.parenL?(e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(i,n)):e||o||!(5<=this.options.ecmaVersion)||t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||this.type===m.comma||this.type===m.braceR||this.type===m.eq?6<=this.options.ecmaVersion&&!t.computed&&"Identifier"===t.key.type?((i||n)&&this.unexpected(),this.checkUnreserved(t.key),"await"!==t.key.name||this.awaitIdentPos||(this.awaitIdentPos=r),t.kind="init",e?t.value=this.parseMaybeDefault(r,s,t.key):this.type===m.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),t.value=this.parseMaybeDefault(r,s,t.key)):t.value=t.key,t.shorthand=!0):this.unexpected():((i||n)&&this.unexpected(),t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1),o="get"===t.kind?0:1,t.value.params.length!==o?(e=t.value.start,"get"===t.kind?this.raiseRecoverable(e,"getter should have no params"):this.raiseRecoverable(e,"setter should have exactly one param")):"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params"))},s.parsePropertyName=function(t){if(6<=this.options.ecmaVersion){if(this.eat(m.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(m.bracketR),t.key;t.computed=!1}return t.key=this.type===m.num||this.type===m.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},s.initFunction=function(t){t.id=null,6<=this.options.ecmaVersion&&(t.generator=t.expression=!1),8<=this.options.ecmaVersion&&(t.async=!1)},s.parseMethod=function(t,e,i){var n=this.startNode(),r=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(n),6<=this.options.ecmaVersion&&(n.generator=t),8<=this.options.ecmaVersion&&(n.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|S(e,n.generator)|(i?128:0)),this.expect(m.parenL),n.params=this.parseBindingList(m.parenR,!1,8<=this.options.ecmaVersion),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(n,"FunctionExpression")},s.parseArrowExpression=function(t,e,i){var n=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|S(i,!1)),this.initFunction(t),8<=this.options.ecmaVersion&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=s,this.finishNode(t,"ArrowFunctionExpression")},s.parseFunctionBody=function(t,e,i){var n=e&&this.type!==m.braceL,r=this.strict,s=!1;n?(t.body=this.parseMaybeAssign(),t.expression=!0,this.checkParams(t,!1)):(n=7<=this.options.ecmaVersion&&!this.isSimpleParamList(t.params),r&&!n||(s=this.strictDirective(this.end))&&n&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"),n=this.labels,this.labels=[],s&&(this.strict=!0),this.checkParams(t,!r&&!s&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLVal(t.id,5),t.body=this.parseBlock(!1,void 0,s&&!r),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=n),this.exitScope()},s.isSimpleParamList=function(t){for(var e=0,i=t;e<i.length;e+=1)if("Identifier"!==i[e].type)return!1;return!0},s.checkParams=function(t,e){for(var i={},n=0,r=t.params;n<r.length;n+=1){var s=r[n];this.checkLVal(s,1,e?null:i)}},s.parseExprList=function(t,e,i,n){for(var r=[],s=!0;!this.eat(t);){if(s)s=!1;else if(this.expect(m.comma),e&&this.afterTrailingComma(t))break;var a=void 0;i&&this.type===m.comma?a=null:this.type===m.ellipsis?(a=this.parseSpread(n),n&&this.type===m.comma&&n.trailingComma<0&&(n.trailingComma=this.start)):a=this.parseMaybeAssign(!1,n),r.push(a)}return r},s.checkUnreserved=function(t){var e=t.start,i=t.end,t=t.name;this.inGenerator&&"yield"===t&&this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===t&&this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(t)&&this.raise(e,"Unexpected keyword '"+t+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(e,i).indexOf("\\")||(this.strict?this.reservedWordsStrict:this.reservedWords).test(t)&&(this.inAsync||"await"!==t||this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(e,"The keyword '"+t+"' is reserved"))},s.parseIdent=function(t,e){var i=this.startNode();return this.type===m.name?i.name=this.value:this.type.keyword?(i.name=this.type.keyword,"class"!==i.name&&"function"!==i.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(!!t),this.finishNode(i,"Identifier"),t||(this.checkUnreserved(i),"await"!==i.name)||this.awaitIdentPos||(this.awaitIdentPos=i.start),i},s.parseYield=function(t){this.yieldPos||(this.yieldPos=this.start);var e=this.startNode();return this.next(),this.type===m.semi||this.canInsertSemicolon()||this.type!==m.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(m.star),e.argument=this.parseMaybeAssign(t)),this.finishNode(e,"YieldExpression")},s.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!1),this.finishNode(t,"AwaitExpression")},C.prototype),s=(e.raise=function(t,e){var i=w(this.input,t),e=(e+=" ("+i.line+":"+i.column+")",new SyntaxError(e));throw e.pos=t,e.loc=i,e.raisedAt=this.pos,e},e.raiseRecoverable=e.raise,e.curPosition=function(){if(this.options.locations)return new y(this.curLine,this.pos-this.lineStart)},C.prototype),e=(s.enterScope=function(t){this.scopeStack.push(new K(t))},s.exitScope=function(){this.scopeStack.pop()},s.treatFunctionsAsVarInScope=function(t){return 2&t.flags||!this.inModule&&1&t.flags},s.declareName=function(t,e,i){var n=!1;if(2===e){var r=this.currentScope(),n=-1<r.lexical.indexOf(t)||-1<r.functions.indexOf(t)||-1<r.var.indexOf(t);r.lexical.push(t),this.inModule&&1&r.flags&&delete this.undefinedExports[t]}else if(4===e)this.currentScope().lexical.push(t);else if(3===e){r=this.currentScope();n=this.treatFunctionsAsVar?-1<r.lexical.indexOf(t):-1<r.lexical.indexOf(t)||-1<r.var.indexOf(t),r.functions.push(t)}else for(var s=this.scopeStack.length-1;0<=s;--s){var a=this.scopeStack[s];if(-1<a.lexical.indexOf(t)&&!(32&a.flags&&a.lexical[0]===t)||!this.treatFunctionsAsVarInScope(a)&&-1<a.functions.indexOf(t)){n=!0;break}if(a.var.push(t),this.inModule&&1&a.flags&&delete this.undefinedExports[t],3&a.flags)break}n&&this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")},s.checkLocalExport=function(t){-1===this.scopeStack[0].lexical.indexOf(t.name)&&-1===this.scopeStack[0].var.indexOf(t.name)&&(this.undefinedExports[t.name]=t)},s.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},s.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(3&e.flags)return e}},s.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(3&e.flags&&!(16&e.flags))return e}},C.prototype);function X(t,e,i,n){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=n),this.options.ranges&&(t.range[1]=i),t}e.startNode=function(){return new E(this,this.start,this.startLoc)},e.startNodeAt=function(t,e){return new E(this,t,e)},e.finishNode=function(t,e){return X.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};function L(t,e,i,n,r){this.token=t,this.isExpr=!!e,this.preserveSpace=!!i,this.override=n,this.generator=!!r}var P={b_stat:new L("{",!(e.finishNodeAt=function(t,e,i,n){return X.call(this,t,e,i,n)})),b_expr:new L("{",!0),b_tmpl:new L("${",!1),p_stat:new L("(",!1),p_expr:new L("(",!0),q_tmpl:new L("`",!0,!0,function(t){return t.tryReadTemplateToken()}),f_stat:new L("function",!1),f_expr:new L("function",!0),f_expr_gen:new L("function",!0,!1,null,!0),f_gen:new L("function",!1,!1,null,!0)},s=C.prototype,e=(s.initialContext=function(){return[P.b_stat]},s.braceIsBlock=function(t){var e=this.curContext();return e===P.f_expr||e===P.f_stat||(t!==m.colon||e!==P.b_stat&&e!==P.b_expr?t===m._return||t===m.name&&this.exprAllowed?c.test(this.input.slice(this.lastTokEnd,this.start)):t===m._else||t===m.semi||t===m.eof||t===m.parenR||t===m.arrow||(t===m.braceL?e===P.b_stat:t!==m._var&&t!==m._const&&t!==m.name&&!this.exprAllowed):!e.isExpr)},s.inGeneratorContext=function(){for(var t=this.context.length-1;1<=t;t--){var e=this.context[t];if("function"===e.token)return e.generator}return!1},s.updateContext=function(t){var e,i=this.type;i.keyword&&t===m.dot?this.exprAllowed=!1:(e=i.updateContext)?e.call(this,t):this.exprAllowed=i.beforeExpr},m.parenR.updateContext=m.braceR.updateContext=function(){var t;1===this.context.length?this.exprAllowed=!0:((t=this.context.pop())===P.b_stat&&"function"===this.curContext().token&&(t=this.context.pop()),this.exprAllowed=!t.isExpr)},m.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?P.b_stat:P.b_expr),this.exprAllowed=!0},m.dollarBraceL.updateContext=function(){this.context.push(P.b_tmpl),this.exprAllowed=!0},m.parenL.updateContext=function(t){t=t===m._if||t===m._for||t===m._with||t===m._while;this.context.push(t?P.p_stat:P.p_expr),this.exprAllowed=!0},m.incDec.updateContext=function(){},m._function.updateContext=m._class.updateContext=function(t){!t.beforeExpr||t===m.semi||t===m._else||t===m._return&&c.test(this.input.slice(this.lastTokEnd,this.start))||(t===m.colon||t===m.braceL)&&this.curContext()===P.b_stat?this.context.push(P.f_stat):this.context.push(P.f_expr),this.exprAllowed=!1},m.backQuote.updateContext=function(){this.curContext()===P.q_tmpl?this.context.pop():this.context.push(P.q_tmpl),this.exprAllowed=!1},m.star.updateContext=function(t){t===m._function&&(t=this.context.length-1,this.context[t]===P.f_expr?this.context[t]=P.f_expr_gen:this.context[t]=P.f_gen),this.exprAllowed=!0},m.name.updateContext=function(t){var e=!1;6<=this.options.ecmaVersion&&t!==m.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e},"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"),s=e+" Extended_Pictographic",Q={9:e,10:s,11:"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS Extended_Pictographic"},J="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",e="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",s=e+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",tt={9:e,10:s,11:"Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},et={};function it(t){t=et[t]={binary:v(Q[t]+" "+J),nonBinary:{General_Category:v(J),Script:v(tt[t])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}it(9),it(10),it(11);function O(t){this.parser=t,this.validFlags="gim"+(6<=t.options.ecmaVersion?"uy":"")+(9<=t.options.ecmaVersion?"s":""),this.unicodeProperties=et[11<=t.options.ecmaVersion?11:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]}e=C.prototype;function M(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function nt(t){return 36===t||40<=t&&t<=43||46===t||63===t||91<=t&&t<=94||123<=t&&t<=125}function rt(t){return 65<=t&&t<=90||97<=t&&t<=122}function st(t){return rt(t)||95===t}function N(t){return 48<=t&&t<=57}function at(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function ot(t){return 65<=t&&t<=70?t-65+10:97<=t&&t<=102?t-97+10:t-48}function ht(t){return 48<=t&&t<=55}O.prototype.reset=function(t,e,i){var n=-1!==i.indexOf("u");this.start=0|t,this.source=e+"",this.flags=i,this.switchU=n&&6<=this.parser.options.ecmaVersion,this.switchN=n&&9<=this.parser.options.ecmaVersion},O.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},O.prototype.at=function(t,e){void 0===e&&(e=!1);var i,n=this.source,r=n.length;return r<=t?-1:(i=n.charCodeAt(t),!(!e&&!this.switchU||i<=55295||57344<=i||r<=t+1)&&56320<=(e=n.charCodeAt(t+1))&&e<=57343?(i<<10)+e-56613888:i)},O.prototype.nextIndex=function(t,e){void 0===e&&(e=!1);var i,n=this.source,r=n.length;return r<=t?r:(i=n.charCodeAt(t),!e&&!this.switchU||i<=55295||57344<=i||r<=t+1||(e=n.charCodeAt(t+1))<56320||57343<e?t+1:t+2)},O.prototype.current=function(t){return this.at(this.pos,t=void 0===t?!1:t)},O.prototype.lookahead=function(t){return this.at(this.nextIndex(this.pos,t=void 0===t?!1:t),t)},O.prototype.advance=function(t){this.pos=this.nextIndex(this.pos,t=void 0===t?!1:t)},O.prototype.eat=function(t,e){return this.current(e=void 0===e?!1:e)===t&&(this.advance(e),!0)},e.validateRegExpFlags=function(t){for(var e=t.validFlags,i=t.flags,n=0;n<i.length;n++){var r=i.charAt(n);-1===e.indexOf(r)&&this.raise(t.start,"Invalid regular expression flag"),-1<i.indexOf(r,n+1)&&this.raise(t.start,"Duplicate regular expression flag")}},e.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&9<=this.options.ecmaVersion&&0<t.groupNames.length&&(t.switchN=!0,this.regexp_pattern(t))},e.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames.length=0,t.backReferenceNames.length=0,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets"),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,i=t.backReferenceNames;e<i.length;e+=1){var n=i[e];-1===t.groupNames.indexOf(n)&&t.raise("Invalid named capture referenced")}},e.regexp_disjunction=function(t){for(this.regexp_alternative(t);t.eat(124);)this.regexp_alternative(t);this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")},e.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););},e.regexp_eatTerm=function(t){return this.regexp_eatAssertion(t)?(t.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(t)&&t.switchU&&t.raise("Invalid quantifier"),!0):!(t.switchU?!this.regexp_eatAtom(t):!this.regexp_eatExtendedAtom(t))&&(this.regexp_eatQuantifier(t),!0)},e.regexp_eatAssertion=function(t){var e=t.pos;if(t.lastAssertionIsQuantifiable=!1,t.eat(94)||t.eat(36))return!0;if(t.eat(92)){if(t.eat(66)||t.eat(98))return!0;t.pos=e}if(t.eat(40)&&t.eat(63)){var i=!1;if(9<=this.options.ecmaVersion&&(i=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!i,!0}return t.pos=e,!1},e.regexp_eatQuantifier=function(t,e){return!!this.regexp_eatQuantifierPrefix(t,e=void 0===e?!1:e)&&(t.eat(63),!0)},e.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)},e.regexp_eatBracedQuantifier=function(t,e){var i=t.pos;if(t.eat(123)){var n,r=-1;if(this.regexp_eatDecimalDigits(t)&&(n=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(r=t.lastIntValue),t.eat(125)))return-1!==r&&r<n&&!e&&t.raise("numbers out of order in {} quantifier"),!0;t.switchU&&!e&&t.raise("Incomplete quantifier"),t.pos=i}return!1},e.regexp_eatAtom=function(t){return this.regexp_eatPatternCharacters(t)||t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)},e.regexp_eatReverseSolidusAtomEscape=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1},e.regexp_eatUncapturingGroup=function(t){var e=t.pos;if(t.eat(40)){if(t.eat(63)&&t.eat(58)){if(this.regexp_disjunction(t),t.eat(41))return!0;t.raise("Unterminated group")}t.pos=e}return!1},e.regexp_eatCapturingGroup=function(t){if(t.eat(40)){if(9<=this.options.ecmaVersion?this.regexp_groupSpecifier(t):63===t.current()&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1},e.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)},e.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1},e.regexp_eatSyntaxCharacter=function(t){var e=t.current();return!!nt(e)&&(t.lastIntValue=e,t.advance(),!0)},e.regexp_eatPatternCharacters=function(t){for(var e,i=t.pos;-1!==(e=t.current())&&!nt(e);)t.advance();return t.pos!==i},e.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return!(-1===e||36===e||40<=e&&e<=43||46===e||63===e||91===e||94===e||124===e||(t.advance(),0))},e.regexp_groupSpecifier=function(t){t.eat(63)&&(this.regexp_eatGroupName(t)?(-1!==t.groupNames.indexOf(t.lastStringValue)&&t.raise("Duplicate capture group name"),t.groupNames.push(t.lastStringValue)):t.raise("Invalid group"))},e.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1},e.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=M(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=M(t.lastIntValue);return!0}return!1},e.regexp_eatRegExpIdentifierStart=function(t){var e=t.pos,i=11<=this.options.ecmaVersion,n=t.current(i);return t.advance(i),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(n=t.lastIntValue),o(i=n,!0)||36===i||95===i?(t.lastIntValue=n,!0):(t.pos=e,!1)},e.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,i=11<=this.options.ecmaVersion,n=t.current(i);return t.advance(i),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(n=t.lastIntValue),h(i=n,!0)||36===i||95===i||8204===i||8205===i?(t.lastIntValue=n,!0):(t.pos=e,!1)},e.regexp_eatAtomEscape=function(t){return!!(this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t))||(t.switchU&&(99===t.current()&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)},e.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1},e.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1},e.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)},e.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1},e.regexp_eatZero=function(t){return 48===t.current()&&!N(t.lookahead())&&(t.lastIntValue=0,t.advance(),!0)},e.regexp_eatControlEscape=function(t){var e=t.current();return 116===e?(t.lastIntValue=9,t.advance(),!0):110===e?(t.lastIntValue=10,t.advance(),!0):118===e?(t.lastIntValue=11,t.advance(),!0):102===e?(t.lastIntValue=12,t.advance(),!0):114===e&&(t.lastIntValue=13,t.advance(),!0)},e.regexp_eatControlLetter=function(t){var e=t.current();return!!rt(e)&&(t.lastIntValue=e%32,t.advance(),!0)},e.regexp_eatRegExpUnicodeEscapeSequence=function(t,e){var i=t.pos,e=(e=void 0===e?!1:e)||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var n=t.lastIntValue;if(e&&55296<=n&&n<=56319){var r=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var s=t.lastIntValue;if(56320<=s&&s<=57343)return t.lastIntValue=1024*(n-55296)+(s-56320)+65536,!0}t.pos=r,t.lastIntValue=n}return!0}if(e&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&0<=(s=t.lastIntValue)&&s<=1114111)return!0;e&&t.raise("Invalid unicode escape"),t.pos=i}return!1},e.regexp_eatIdentityEscape=function(t){var e;return t.switchU?!!this.regexp_eatSyntaxCharacter(t)||!!t.eat(47)&&(t.lastIntValue=47,!0):!(99===(e=t.current())||t.switchN&&107===e||(t.lastIntValue=e,t.advance(),0))},e.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(49<=e&&e<=57){for(;t.lastIntValue=10*t.lastIntValue+(e-48),t.advance(),48<=(e=t.current())&&e<=57;);return!0}return!1},e.regexp_eatCharacterClassEscape=function(t){var e,i=t.current();if(100===(e=i)||68===e||115===e||83===e||119===e||87===e)return t.lastIntValue=-1,t.advance(),!0;if(t.switchU&&9<=this.options.ecmaVersion&&(80===i||112===i)){if(t.lastIntValue=-1,t.advance(),t.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(t)&&t.eat(125))return!0;t.raise("Invalid property name")}return!1},e.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var i,n=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t))return i=t.lastStringValue,this.regexp_validateUnicodePropertyNameAndValue(t,n,i),!0}return t.pos=e,!!this.regexp_eatLoneUnicodePropertyNameOrValue(t)&&(n=t.lastStringValue,this.regexp_validateUnicodePropertyNameOrValue(t,n),!0)},e.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){_(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")},e.regexp_validateUnicodePropertyNameOrValue=function(t,e){t.unicodeProperties.binary.test(e)||t.raise("Invalid property name")},e.regexp_eatUnicodePropertyName=function(t){var e;for(t.lastStringValue="";st(e=t.current());)t.lastStringValue+=M(e),t.advance();return""!==t.lastStringValue},e.regexp_eatUnicodePropertyValue=function(t){var e,i;for(t.lastStringValue="";st(i=e=t.current())||N(i);)t.lastStringValue+=M(e),t.advance();return""!==t.lastStringValue},e.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)},e.regexp_eatCharacterClass=function(t){if(t.eat(91)){if(t.eat(94),this.regexp_classRanges(t),t.eat(93))return!0;t.raise("Unterminated character class")}return!1},e.regexp_classRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e,i=t.lastIntValue;t.eat(45)&&this.regexp_eatClassAtom(t)&&(e=t.lastIntValue,!t.switchU||-1!==i&&-1!==e||t.raise("Invalid character class"),-1!==i)&&-1!==e&&e<i&&t.raise("Range out of order in character class")}},e.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;t.switchU&&(99!==(i=t.current())&&!ht(i)||t.raise("Invalid class escape"),t.raise("Invalid escape")),t.pos=e}var i=t.current();return 93!==i&&(t.lastIntValue=i,t.advance(),!0)},e.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)},e.regexp_eatClassControlLetter=function(t){var e=t.current();return!(!N(e)&&95!==e||(t.lastIntValue=e%32,t.advance(),0))},e.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1},e.regexp_eatDecimalDigits=function(t){var e,i=t.pos;for(t.lastIntValue=0;N(e=t.current());)t.lastIntValue=10*t.lastIntValue+(e-48),t.advance();return t.pos!==i},e.regexp_eatHexDigits=function(t){var e,i=t.pos;for(t.lastIntValue=0;at(e=t.current());)t.lastIntValue=16*t.lastIntValue+ot(e),t.advance();return t.pos!==i},e.regexp_eatLegacyOctalEscapeSequence=function(t){var e,i;return!!this.regexp_eatOctalDigit(t)&&(e=t.lastIntValue,this.regexp_eatOctalDigit(t)?(i=t.lastIntValue,e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=64*e+8*i+t.lastIntValue:t.lastIntValue=8*e+i):t.lastIntValue=e,!0)},e.regexp_eatOctalDigit=function(t){var e=t.current();return ht(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)},e.regexp_eatFixedHexDigits=function(t,e){for(var i=t.pos,n=t.lastIntValue=0;n<e;++n){var r=t.current();if(!at(r))return t.pos=i,!1;t.lastIntValue=16*t.lastIntValue+ot(r),t.advance()}return!0};function R(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new b(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])}s=C.prototype;function lt(t){return"function"!=typeof BigInt?null:BigInt(t.replace(/_/g,""))}function ut(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}s.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new R(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},s.getToken=function(){return this.next(),new R(this)},"undefined"!=typeof Symbol&&(s[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===m.eof,value:t}}}}),s.curContext=function(){return this.context[this.context.length-1]},s.nextToken=function(){var t=this.curContext();return t&&t.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(m.eof):t.override?t.override(this):void this.readToken(this.fullCharCodeAtPos())},s.readToken=function(t){return o(t,6<=this.options.ecmaVersion)||92===t?this.readWord():this.getTokenFromCode(t)},s.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);return t<=55295||57344<=t?t:(t<<10)+this.input.charCodeAt(this.pos+1)-56613888},s.skipBlockComment=function(){var t,e=this.options.onComment&&this.curPosition(),i=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(d.lastIndex=i;(t=d.exec(this.input))&&t.index<this.pos;)++this.curLine,this.lineStart=t.index+t[0].length;this.options.onComment&&this.options.onComment(!0,this.input.slice(i+2,n),i,this.pos,e,this.curPosition())},s.skipLineComment=function(t){for(var e=this.pos,i=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&!f(n);)n=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,i,this.curPosition())},s.skipSpace=function(){t:for(;this.pos<this.input.length;){var t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(!(8<t&&t<14||5760<=t&&p.test(String.fromCharCode(t))))break t;++this.pos}}},s.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=t,this.value=e,this.updateContext(i)},s.readToken_dot=function(){var t,e=this.input.charCodeAt(this.pos+1);return 48<=e&&e<=57?this.readNumber(!0):(t=this.input.charCodeAt(this.pos+2),6<=this.options.ecmaVersion&&46===e&&46===t?(this.pos+=3,this.finishToken(m.ellipsis)):(++this.pos,this.finishToken(m.dot)))},s.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===t?this.finishOp(m.assign,2):this.finishOp(m.slash,1)},s.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,n=42===t?m.star:m.modulo;return 7<=this.options.ecmaVersion&&42===t&&42===e&&(++i,n=m.starstar,e=this.input.charCodeAt(this.pos+2)),61===e?this.finishOp(m.assign,i+1):this.finishOp(n,i)},s.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);if(e!==t)return 61===e?this.finishOp(m.assign,2):this.finishOp(124===t?m.bitwiseOR:m.bitwiseAND,1);if(12<=this.options.ecmaVersion&&61===this.input.charCodeAt(this.pos+2))return this.finishOp(m.assign,3);return this.finishOp(124===t?m.logicalOR:m.logicalAND,2)},s.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(m.assign,2):this.finishOp(m.bitwiseXOR,1)},s.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?45!==e||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!c.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(m.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===e?this.finishOp(m.assign,2):this.finishOp(m.plusMin,1)},s.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=62===t&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(m.assign,i+1):this.finishOp(m.bitShift,i)):33!==e||60!==t||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?this.finishOp(m.relational,i=61===e?2:i):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},s.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(m.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===t&&62===e&&6<=this.options.ecmaVersion?(this.pos+=2,this.finishToken(m.arrow)):this.finishOp(61===t?m.eq:m.prefix,1)},s.readToken_question=function(){var t=this.options.ecmaVersion;if(11<=t){var e=this.input.charCodeAt(this.pos+1);if(46===e){var i=this.input.charCodeAt(this.pos+2);if(i<48||57<i)return this.finishOp(m.questionDot,2)}if(63===e){if(12<=t)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(m.assign,3);return this.finishOp(m.coalesce,2)}}return this.finishOp(m.question,1)},s.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(m.parenL);case 41:return++this.pos,this.finishToken(m.parenR);case 59:return++this.pos,this.finishToken(m.semi);case 44:return++this.pos,this.finishToken(m.comma);case 91:return++this.pos,this.finishToken(m.bracketL);case 93:return++this.pos,this.finishToken(m.bracketR);case 123:return++this.pos,this.finishToken(m.braceL);case 125:return++this.pos,this.finishToken(m.braceR);case 58:return++this.pos,this.finishToken(m.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(m.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(120===e||88===e)return this.readRadixNumber(16);if(6<=this.options.ecmaVersion){if(111===e||79===e)return this.readRadixNumber(8);if(98===e||66===e)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(m.prefix,1)}this.raise(this.pos,"Unexpected character '"+ut(t)+"'")},s.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)},s.readRegexp=function(){for(var t,e,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(c.test(n)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if("["===n)e=!0;else if("]"===n&&e)e=!1;else if("/"===n&&!e)break;t="\\"===n}++this.pos}var r=this.input.slice(i,this.pos),s=(++this.pos,this.pos),a=this.readWord1(),s=(this.containsEsc&&this.unexpected(s),this.regexpState||(this.regexpState=new O(this))),s=(s.reset(i,r,a),this.validateRegExpFlags(s),this.validateRegExpPattern(s),null);try{s=new RegExp(r,a)}catch(t){}return this.finishToken(m.regexp,{pattern:r,flags:a,value:s})},s.readInt=function(t,e,i){for(var n=12<=this.options.ecmaVersion&&void 0===e,r=i&&48===this.input.charCodeAt(this.pos),i=this.pos,s=0,a=0,o=0,h=null==e?1/0:e;o<h;++o,++this.pos){var l=this.input.charCodeAt(this.pos),u=void 0;if(n&&95===l)r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===a&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===o&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),a=l;else{if(t<=(u=97<=l?l-97+10:65<=l?l-65+10:48<=l&&l<=57?l-48:1/0))break;a=l,s=s*t+u}}return n&&95===a&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===i||null!=e&&this.pos-i!==e?null:s},s.readRadixNumber=function(t){var e=this.pos,i=(this.pos+=2,this.readInt(t));return null==i&&this.raise(this.start+2,"Expected number in radix "+t),11<=this.options.ecmaVersion&&110===this.input.charCodeAt(this.pos)?(i=lt(this.input.slice(e,this.pos)),++this.pos):o(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(m.num,i)},s.readNumber=function(t){var e=this.pos,i=(t||null!==this.readInt(10,void 0,!0)||this.raise(e,"Invalid number"),2<=this.pos-e&&48===this.input.charCodeAt(e)),n=(i&&this.strict&&this.raise(e,"Invalid number"),this.input.charCodeAt(this.pos));if(!i&&!t&&11<=this.options.ecmaVersion&&110===n)return t=lt(this.input.slice(e,this.pos)),++this.pos,o(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(m.num,t);i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),46!==n||i||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||i||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(e,"Invalid number")),o(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");t=this.input.slice(e,this.pos);n=i?parseInt(t,8):parseFloat(t.replace(/_/g,""));return this.finishToken(m.num,n)},s.readCodePoint=function(){var t,e;return 123===this.input.charCodeAt(this.pos)?(this.options.ecmaVersion<6&&this.unexpected(),t=++this.pos,e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,1114111<e&&this.invalidStringToken(t,"Code point out of bounds")):e=this.readHexChar(4),e},s.readString=function(t){for(var e="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===t)break;92===n?(e=(e+=this.input.slice(i,this.pos))+this.readEscapedChar(!1),i=this.pos):(f(n,10<=this.options.ecmaVersion)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(m.string,e)};var ct={};s.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t!==ct)throw t;this.readInvalidTemplateToken()}this.inTemplateElement=!1},s.invalidStringToken=function(t,e){if(this.inTemplateElement&&9<=this.options.ecmaVersion)throw ct;this.raise(t,e)},s.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==m.template&&this.type!==m.invalidTemplate?(t+=this.input.slice(e,this.pos),this.finishToken(m.template,t)):36===i?(this.pos+=2,this.finishToken(m.dollarBraceL)):(++this.pos,this.finishToken(m.backQuote));if(92===i)t=(t+=this.input.slice(e,this.pos))+this.readEscapedChar(!0),e=this.pos;else if(f(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}},s.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(m.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")},s.readEscapedChar=function(t){var e,i,n=this.input.charCodeAt(++this.pos);switch(++this.pos,n){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ut(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(t)return e=this.pos-1,this.invalidStringToken(e,"Invalid escape sequence in template string"),null;default:return 48<=n&&n<=55?(e=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],255<(i=parseInt(e,8))&&(e=e.slice(0,-1),i=parseInt(e,8)),this.pos+=e.length-1,n=this.input.charCodeAt(this.pos),"0"===e&&56!==n&&57!==n||!this.strict&&!t||this.invalidStringToken(this.pos-1-e.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)):f(n)?"":String.fromCharCode(n)}},s.readHexChar=function(t){var e=this.pos,t=this.readInt(16,t);return null===t&&this.invalidStringToken(e,"Bad character escape sequence"),t},s.readWord1=function(){for(var t="",e=!(this.containsEsc=!1),i=this.pos,n=6<=this.options.ecmaVersion;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(h(r,n))this.pos+=r<=65535?1:2;else{if(92!==r)break;this.containsEsc=!0,t+=this.input.slice(i,this.pos);var r=this.pos,s=(117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos,this.readCodePoint());(e?o:h)(s,n)||this.invalidStringToken(r,"Invalid Unicode escape"),t+=ut(s),i=this.pos}e=!1}return t+this.input.slice(i,this.pos)},s.readWord=function(){var t=this.readWord1(),e=m.name;return this.keywords.test(t)&&(e=l[t]),this.finishToken(e,t)};C.acorn={Parser:C,version:"7.4.1",defaultOptions:x,Position:y,SourceLocation:b,getLineInfo:w,Node:E,TokenType:n,tokTypes:m,keywordTypes:l,TokContext:L,tokContexts:P,isIdentifierChar:h,isIdentifierStart:o,Token:R,isNewLine:f,lineBreak:c,lineBreakG:d,nonASCIIwhitespace:p},t.Node=E,t.Parser=C,t.Position=y,t.SourceLocation=b,t.TokContext=L,t.Token=R,t.TokenType=n,t.defaultOptions=x,t.getLineInfo=w,t.isIdentifierChar=h,t.isIdentifierStart=o,t.isNewLine=f,t.keywordTypes=l,t.lineBreak=c,t.lineBreakG=d,t.nonASCIIwhitespace=p,t.parse=function(t,e){return C.parse(t,e)},t.parseExpressionAt=function(t,e,i){return C.parseExpressionAt(t,e,i)},t.tokContexts=P,t.tokTypes=m,t.tokenizer=function(t,e){return C.tokenizer(t,e)},t.version="7.4.1",Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof i&&void 0!==e?r(i):"function"==typeof define&&define.amd?define(["exports"],r):r((n=n||self).acorn={})},{}],6:[function(t,e,i){"use strict";i.byteLength=function(t){var t=u(t),e=t[0],t=t[1];return 3*(e+t)/4-t},i.toByteArray=function(t){var e,i,n=u(t),r=n[0],n=n[1],s=new l(function(t,e){return 3*(t+e)/4-e}(r,n)),a=0,o=0<n?r-4:r;for(i=0;i<o;i+=4)e=h[t.charCodeAt(i)]<<18|h[t.charCodeAt(i+1)]<<12|h[t.charCodeAt(i+2)]<<6|h[t.charCodeAt(i+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;2===n&&(e=h[t.charCodeAt(i)]<<2|h[t.charCodeAt(i+1)]>>4,s[a++]=255&e);1===n&&(e=h[t.charCodeAt(i)]<<10|h[t.charCodeAt(i+1)]<<4|h[t.charCodeAt(i+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e);return s},i.fromByteArray=function(t){for(var e,i=t.length,n=i%3,r=[],s=0,a=i-n;s<a;s+=16383)r.push(function(t,e,i){for(var n,r=[],s=e;s<i;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),r.push(function(t){return o[t>>18&63]+o[t>>12&63]+o[t>>6&63]+o[63&t]}(n));return r.join("")}(t,s,a<s+16383?a:s+16383));1==n?(e=t[i-1],r.push(o[e>>2]+o[e<<4&63]+"==")):2==n&&(e=(t[i-2]<<8)+t[i-1],r.push(o[e>>10]+o[e>>4&63]+o[e<<2&63]+"="));return r.join("")};for(var o=[],h=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,s=n.length;r<s;++r)o[r]=n[r],h[n.charCodeAt(r)]=r;function u(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("="),e=(t=-1===t?e:t)===e?0:4-t%4;return[t,e]}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},{}],7:[function(t,e,i){var n,r;n=this,r=function(t){"use strict";function D(t){if(t&&t.__esModule)return t;var e,i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const n in t)"default"!==n&&(e=Object.getOwnPropertyDescriptor(t,n),Object.defineProperty(i,n,e.get?e:{enumerable:!0,get:()=>t[n]}));return i.default=t,Object.freeze(i)}const i=D(t),B=1e3,j="transitionend",z=e=>{let i=e.getAttribute("data-bs-target");if(!i||"#"===i){let t=e.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t="#"+t.split("#")[1]),i=t&&"#"!==t?t.trim():null}return i},F=t=>{t=z(t);return t&&document.querySelector(t)?t:null},r=t=>{t=z(t);return t?document.querySelector(t):null},V=t=>{t.dispatchEvent(new Event(j))},s=t=>!(!t||"object"!=typeof t)&&void 0!==(t=void 0!==t.jquery?t[0]:t).nodeType,n=t=>s(t)?t.jquery?t[0]:t:"string"==typeof t&&0<t.length?document.querySelector(t):null,a=t=>{if(!s(t)||0===t.getClientRects().length)return!1;var e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(i&&i!==t){t=t.closest("summary");if(t&&t.parentNode!==i)return!1;if(null===t)return!1}return e},o=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),q=t=>{var e;return document.documentElement.attachShadow?"function"==typeof t.getRootNode?(e=t.getRootNode())instanceof ShadowRoot?e:null:t instanceof ShadowRoot?t:t.parentNode?q(t.parentNode):null:null},U=()=>{},l=t=>{t.offsetHeight},H=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,W=[],h=()=>"rtl"===document.documentElement.dir;t=n=>{var t;t=()=>{const t=H();if(t){const e=n.NAME,i=t.fn[e];t.fn[e]=n.jQueryInterface,t.fn[e].Constructor=n,t.fn[e].noConflict=()=>(t.fn[e]=i,n.jQueryInterface)}},"loading"===document.readyState?(W.length||document.addEventListener("DOMContentLoaded",()=>{for(const t of W)t()}),W.push(t)):t()};const u=t=>{"function"==typeof t&&t()},G=(i,n,t=!0)=>{if(t){t=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);var t=Number.parseFloat(e),n=Number.parseFloat(i);return t||n?(e=e.split(",")[0],i=i.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(i))*B):0})(n)+5;let e=!1;const r=({target:t})=>{t===n&&(e=!0,n.removeEventListener(j,r),u(i))};n.addEventListener(j,r),setTimeout(()=>{e||V(n)},t)}else u(i)},K=(t,e,i,n)=>{var r=t.length;let s=t.indexOf(e);return-1===s?!i&&n?t[r-1]:t[0]:(s+=i?1:-1,n&&(s=(s+r)%r),t[Math.max(0,Math.min(s,r-1))])},Z=/[^.]*(?=\..*)\.|.*/,$=/\..*/,Y=/::\d+$/,X={};let Q=1;const J={mouseenter:"mouseover",mouseleave:"mouseout"},tt=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function et(t,e){return e&&e+"::"+Q++||t.uidEvent||Q++}function it(t){var e=et(t);return t.uidEvent=e,X[e]=X[e]||{},X[e]}function nt(t,e,i=null){return Object.values(t).find(t=>t.callable===e&&t.delegationSelector===i)}function rt(t,e,i){var n="string"==typeof e,e=!n&&e||i;let r=ot(t);return[n,e,r=tt.has(r)?r:t]}function st(n,r,s,a,o){if("string"==typeof r&&n){let[t,e,i]=rt(r,s,a);r in J&&(e=(h=e,function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return h.call(this,t)}));var h,l,u,c,d,f,a=it(n),a=a[i]||(a[i]={}),p=nt(a,e,t?s:null);p?p.oneOff=p.oneOff&&o:(p=et(e,r.replace(Z,"")),(r=t?(c=n,d=s,f=e,function e(i){var n=c.querySelectorAll(d);for(let t=i["target"];t&&t!==this;t=t.parentNode)for(const r of n)if(r===t)return ht(i,{delegateTarget:t}),e.oneOff&&g.off(c,i.type,d,f),f.apply(t,[i])}):(l=n,u=e,function t(e){return ht(e,{delegateTarget:l}),t.oneOff&&g.off(l,e.type,u),u.apply(l,[e])})).delegationSelector=t?s:null,r.callable=e,r.oneOff=o,a[r.uidEvent=p]=r,n.addEventListener(i,r,t))}}function at(t,e,i,n,r){n=nt(e[i],n,r);n&&(t.removeEventListener(i,n,Boolean(r)),delete e[i][n.uidEvent])}function ot(t){return t=t.replace($,""),J[t]||t}const g={on(t,e,i,n){st(t,e,i,n,!1)},one(t,e,i,n){st(t,e,i,n,!0)},off(t,e,i,n){if("string"==typeof e&&t){var[n,r,s]=rt(e,i,n),a=s!==e,o=it(t),h=o[s]||{},l=e.startsWith(".");if(void 0!==r)return Object.keys(h).length?void at(t,o,s,r,n?i:null):void 0;if(l)for(const _ of Object.keys(o)){u=g=p=f=d=c=void 0;var u,c=t,d=o,f=_,p=e.slice(1),g=d[f]||{};for(const v of Object.keys(g))v.includes(p)&&at(c,d,f,(u=g[v]).callable,u.delegationSelector)}for(const y of Object.keys(h)){var m=y.replace(Y,"");a&&!e.includes(m)||at(t,o,s,(m=h[y]).callable,m.delegationSelector)}}},trigger(t,e,i){if("string"!=typeof e||!t)return null;var n=H();let r=null,s=!0,a=!0,o=!1;e!==ot(e)&&n&&(r=n.Event(e,i),n(t).trigger(r),s=!r.isPropagationStopped(),a=!r.isImmediatePropagationStopped(),o=r.isDefaultPrevented());n=ht(n=new Event(e,{bubbles:s,cancelable:!0}),i);return o&&n.preventDefault(),a&&t.dispatchEvent(n),n.defaultPrevented&&r&&r.preventDefault(),n}};function ht(e,t){for(const[i,n]of Object.entries(t||{}))try{e[i]=n}catch(t){Object.defineProperty(e,i,{configurable:!0,get(){return n}})}return e}const c=new Map,lt={set(t,e,i){c.has(t)||c.set(t,new Map);t=c.get(t);t.has(e)||0===t.size?t.set(e,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(t.keys())[0]}.`)},get(t,e){return c.has(t)&&c.get(t).get(e)||null},remove(t,e){var i;c.has(t)&&((i=c.get(t)).delete(e),0===i.size)&&c.delete(t)}};function ut(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function ct(t){return t.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}const d={setDataAttribute(t,e,i){t.setAttribute("data-bs-"+ct(e),i)},removeDataAttribute(t,e){t.removeAttribute("data-bs-"+ct(e))},getDataAttributes(e){if(!e)return{};var i={};for(const n of Object.keys(e.dataset).filter(t=>t.startsWith("bs")&&!t.startsWith("bsConfig"))){let t=n.replace(/^bs/,"");i[t=t.charAt(0).toLowerCase()+t.slice(1,t.length)]=ut(e.dataset[n])}return i},getDataAttribute(t,e){return ut(t.getAttribute("data-bs-"+ct(e)))}};class e{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){var i=s(e)?d.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...s(e)?d.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const r of Object.keys(e)){var i=e[r],n=t[r],n=s(n)?"element":null==(n=n)?""+n:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(i).test(n))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${r}" provided type "${n}" but expected type "${i}".`)}}}class f extends e{constructor(t,e){super(),(t=n(t))&&(this._element=t,this._config=this._getConfig(e),lt.set(this._element,this.constructor.DATA_KEY,this))}dispose(){lt.remove(this._element,this.constructor.DATA_KEY),g.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){G(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return lt.get(n(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.2.3"}static get DATA_KEY(){return"bs."+this.NAME}static get EVENT_KEY(){return"."+this.DATA_KEY}static eventName(t){return""+t+this.EVENT_KEY}}var dt=(e,i="hide")=>{var t="click.dismiss"+e.EVENT_KEY;const n=e.NAME;g.on(document,t,`[data-bs-dismiss="${n}"]`,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),o(this)||(t=r(this)||this.closest("."+n),e.getOrCreateInstance(t)[i]())})};class ft extends f{static get NAME(){return"alert"}close(){var t;g.trigger(this._element,"close.bs.alert").defaultPrevented||(this._element.classList.remove("show"),t=this._element.classList.contains("fade"),this._queueCallback(()=>this._destroyElement(),this._element,t))}_destroyElement(){this._element.remove(),g.trigger(this._element,"closed.bs.alert"),this.dispose()}static jQueryInterface(e){return this.each(function(){var t=ft.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}dt(ft,"close"),t(ft);const pt='[data-bs-toggle="button"]';class gt extends f{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){var t=gt.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}g.on(document,"click.bs.button.data-api",pt,t=>{t.preventDefault();t=t.target.closest(pt);gt.getOrCreateInstance(t).toggle()}),t(gt);const p={find(t,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,t))},findOne(t,e=document.documentElement){return Element.prototype.querySelector.call(e,t)},children(t,e){return[].concat(...t.children).filter(t=>t.matches(e))},parents(t,e){var i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){var e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>t+':not([tabindex^="-"])').join(",");return this.find(e,t).filter(t=>!o(t)&&a(t))}},m=".bs.swipe",mt=(m,m,m,m,m,{endCallback:null,leftCallback:null,rightCallback:null}),_t={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class vt extends e{constructor(t,e){super(),(this._element=t)&&vt.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return mt}static get DefaultType(){return _t}static get NAME(){return"swipe"}dispose(){g.off(this._element,m)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),u(this._config.endCallback)}_move(t){this._deltaX=t.touches&&1<t.touches.length?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){var t=Math.abs(this._deltaX);t<=40||(t=t/this._deltaX,this._deltaX=0,t&&u(0<t?this._config.rightCallback:this._config.leftCallback))}_initEvents(){this._supportPointerEvents?(g.on(this._element,"pointerdown.bs.swipe",t=>this._start(t)),g.on(this._element,"pointerup.bs.swipe",t=>this._end(t)),this._element.classList.add("pointer-event")):(g.on(this._element,"touchstart.bs.swipe",t=>this._start(t)),g.on(this._element,"touchmove.bs.swipe",t=>this._move(t)),g.on(this._element,"touchend.bs.swipe",t=>this._end(t)))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||0<navigator.maxTouchPoints}}var _=".bs.carousel";const v="next",y="prev",b="left",yt="right",bt="slid"+_;const wt="carousel",xt="active",St=".active",Ct=".carousel-item";St,Ct;const kt={ArrowLeft:yt,ArrowRight:b},Et={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},At={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class w extends f{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=p.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===wt&&this.cycle()}static get Default(){return Et}static get DefaultType(){return At}static get NAME(){return"carousel"}next(){this._slide(v)}nextWhenVisible(){!document.hidden&&a(this._element)&&this.next()}prev(){this._slide(y)}pause(){this._isSliding&&V(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?g.one(this._element,bt,()=>this.cycle()):this.cycle())}to(t){var e,i=this._getItems();t>i.length-1||t<0||(this._isSliding?g.one(this._element,bt,()=>this.to(t)):(e=this._getItemIndex(this._getActive()))!==t&&(e=e<t?v:y,this._slide(e,i[t])))}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&g.on(this._element,"keydown.bs.carousel",t=>this._keydown(t)),"hover"===this._config.pause&&(g.on(this._element,"mouseenter.bs.carousel",()=>this.pause()),g.on(this._element,"mouseleave.bs.carousel",()=>this._maybeEnableCycle())),this._config.touch&&vt.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of p.find(".carousel-item img",this._element))g.on(e,"dragstart.bs.carousel",t=>t.preventDefault());var t={leftCallback:()=>this._slide(this._directionToOrder(b)),rightCallback:()=>this._slide(this._directionToOrder(yt)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new vt(this._element,t)}_keydown(t){var e;/input|textarea/i.test(t.target.tagName)||(e=kt[t.key])&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){var e;this._indicatorsElement&&((e=p.findOne(St,this._indicatorsElement)).classList.remove(xt),e.removeAttribute("aria-current"),e=p.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement))&&(e.classList.add(xt),e.setAttribute("aria-current","true"))}_updateInterval(){var t=this._activeElement||this._getActive();t&&(t=Number.parseInt(t.getAttribute("data-bs-interval"),10),this._config.interval=t||this._config.defaultInterval)}_slide(e,t=null){if(!this._isSliding){const n=this._getActive();var i=e===v;const r=t||K(this._getItems(),n,i,this._config.wrap);if(r!==n){const s=this._getItemIndex(r),a=t=>g.trigger(this._element,t,{relatedTarget:r,direction:this._orderToDirection(e),from:this._getItemIndex(n),to:s});t=a("slide.bs.carousel");if(!t.defaultPrevented&&n&&r){t=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=r;const o=i?"carousel-item-start":"carousel-item-end",h=i?"carousel-item-next":"carousel-item-prev";r.classList.add(h),l(r),n.classList.add(o),r.classList.add(o);this._queueCallback(()=>{r.classList.remove(o,h),r.classList.add(xt),n.classList.remove(xt,h,o),this._isSliding=!1,a(bt)},n,this._isAnimated()),t&&this.cycle()}}}}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return p.findOne(".active.carousel-item",this._element)}_getItems(){return p.find(Ct,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return h()?t===b?y:v:t===b?v:y}_orderToDirection(t){return h()?t===y?b:yt:t===y?yt:b}static jQueryInterface(e){return this.each(function(){var t=w.getOrCreateInstance(this,e);if("number"==typeof e)t.to(e);else if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}g.on(document,"click.bs.carousel.data-api","[data-bs-slide], [data-bs-slide-to]",function(t){var e=r(this);e&&e.classList.contains(wt)&&(t.preventDefault(),t=w.getOrCreateInstance(e),(e=this.getAttribute("data-bs-slide-to"))?t.to(e):"next"===d.getDataAttribute(this,"slide")?t.next():t.prev(),t._maybeEnableCycle())}),g.on(window,"load.bs.carousel.data-api",()=>{for(const t of p.find('[data-bs-ride="carousel"]'))w.getOrCreateInstance(t)}),t(w);const Tt="show",x="collapse",It="collapsing",Lt=(x,x,'[data-bs-toggle="collapse"]'),Pt={parent:null,toggle:!0},Ot={parent:"(null|element)",toggle:"boolean"};class S extends f{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];for(const r of p.find(Lt)){var i=F(r),n=p.find(i).filter(t=>t===this._element);null!==i&&n.length&&this._triggerArray.push(r)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Pt}static get DefaultType(){return Ot}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(!this._isTransitioning&&!this._isShown()){let t=[];if(!(t=this._config.parent?this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(t=>t!==this._element).map(t=>S.getOrCreateInstance(t,{toggle:!1})):t).length||!t[0]._isTransitioning){var e=g.trigger(this._element,"show.bs.collapse");if(!e.defaultPrevented){for(const n of t)n.hide();const i=this._getDimension();this._element.classList.remove(x),this._element.classList.add(It),this._element.style[i]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;e="scroll"+(i[0].toUpperCase()+i.slice(1));this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(It),this._element.classList.add(x,Tt),this._element.style[i]="",g.trigger(this._element,"shown.bs.collapse")},this._element,!0),this._element.style[i]=this._element[e]+"px"}}}}hide(){if(!this._isTransitioning&&this._isShown()){var t=g.trigger(this._element,"hide.bs.collapse");if(!t.defaultPrevented){t=this._getDimension();this._element.style[t]=this._element.getBoundingClientRect()[t]+"px",l(this._element),this._element.classList.add(It),this._element.classList.remove(x,Tt);for(const i of this._triggerArray){var e=r(i);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([i],!1)}this._isTransitioning=!0;this._element.style[t]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(It),this._element.classList.add(x),g.trigger(this._element,"hidden.bs.collapse")},this._element,!0)}}}_isShown(t=this._element){return t.classList.contains(Tt)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=n(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(this._config.parent)for(const e of this._getFirstLevelChildren(Lt)){var t=r(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=p.find(":scope .collapse .collapse",this._config.parent);return p.find(t,this._config.parent).filter(t=>!e.includes(t))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle("collapsed",!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(e){const i={};return"string"==typeof e&&/show|hide/.test(e)&&(i.toggle=!1),this.each(function(){var t=S.getOrCreateInstance(this,i);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}g.on(document,"click.bs.collapse.data-api",Lt,function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();t=F(this);for(const e of p.find(t))S.getOrCreateInstance(e,{toggle:!1}).toggle()}),t(S);const Mt="dropdown";var _=".bs.dropdown",C=".data-api";const Nt="ArrowDown";var Rt="click"+_+C,_="keydown"+_+C;const k="show",E='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',Dt=(E,".dropdown-menu"),Bt=h()?"top-end":"top-start",jt=h()?"top-start":"top-end",zt=h()?"bottom-end":"bottom-start",Ft=h()?"bottom-start":"bottom-end",Vt=h()?"left-start":"right-start",qt=h()?"right-start":"left-start",Ut={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Ht={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class A extends f{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=p.next(this._element,Dt)[0]||p.prev(this._element,Dt)[0]||p.findOne(Dt,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Ut}static get DefaultType(){return Ht}static get NAME(){return Mt}toggle(){return this._isShown()?this.hide():this.show()}show(){if(!o(this._element)&&!this._isShown()){var t={relatedTarget:this._element},e=g.trigger(this._element,"show.bs.dropdown",t);if(!e.defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const i of[].concat(...document.body.children))g.on(i,"mouseover",U);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(k),this._element.classList.add(k),g.trigger(this._element,"shown.bs.dropdown",t)}}}hide(){var t;!o(this._element)&&this._isShown()&&(t={relatedTarget:this._element},this._completeHide(t))}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){var e=g.trigger(this._element,"hide.bs.dropdown",t);if(!e.defaultPrevented){if("ontouchstart"in document.documentElement)for(const i of[].concat(...document.body.children))g.off(i,"mouseover",U);this._popper&&this._popper.destroy(),this._menu.classList.remove(k),this._element.classList.remove(k),this._element.setAttribute("aria-expanded","false"),d.removeDataAttribute(this._menu,"popper"),g.trigger(this._element,"hidden.bs.dropdown",t)}}_getConfig(t){if("object"!=typeof(t=super._getConfig(t)).reference||s(t.reference)||"function"==typeof t.reference.getBoundingClientRect)return t;throw new TypeError(Mt.toUpperCase()+': Option "reference" provided type "object" without a required "getBoundingClientRect" method.')}_createPopper(){if(void 0===i)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let t=this._element;"parent"===this._config.reference?t=this._parent:s(this._config.reference)?t=n(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);var e=this._getPopperConfig();this._popper=i.createPopper(t,this._menu,e)}_isShown(){return this._menu.classList.contains(k)}_getPlacement(){var t,e=this._parent;return e.classList.contains("dropend")?Vt:e.classList.contains("dropstart")?qt:e.classList.contains("dropup-center")?"top":e.classList.contains("dropdown-center")?"bottom":(t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim(),e.classList.contains("dropup")?t?jt:Bt:t?Ft:zt)}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const e=this._config["offset"];return"string"==typeof e?e.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){var t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return!this._inNavbar&&"static"!==this._config.display||(d.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,..."function"==typeof this._config.popperConfig?this._config.popperConfig(t):this._config.popperConfig}}_selectMenuItem({key:t,target:e}){var i=p.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(t=>a(t));i.length&&K(i,e,t===Nt,!i.includes(e)).focus()}static jQueryInterface(e){return this.each(function(){var t=A.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(t){if(2!==t.button&&("keyup"!==t.type||"Tab"===t.key))for(const r of p.find('[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled).show')){var e,i,n=A.getInstance(r);n&&!1!==n._config.autoClose&&(e=(i=t.composedPath()).includes(n._menu),i.includes(n._element)||"inside"===n._config.autoClose&&!e||"outside"===n._config.autoClose&&e||n._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName))||(i={relatedTarget:n._element},"click"===t.type&&(i.clickEvent=t),n._completeHide(i)))}}static dataApiKeydownHandler(t){var e=/input|textarea/i.test(t.target.tagName),i="Escape"===t.key,n=["ArrowUp",Nt].includes(t.key);!n&&!i||e&&!i||(t.preventDefault(),e=this.matches(E)?this:p.prev(this,E)[0]||p.next(this,E)[0]||p.findOne(E,t.delegateTarget.parentNode),i=A.getOrCreateInstance(e),n?(t.stopPropagation(),i.show(),i._selectMenuItem(t)):i._isShown()&&(t.stopPropagation(),i.hide(),e.focus()))}}g.on(document,_,E,A.dataApiKeydownHandler),g.on(document,_,Dt,A.dataApiKeydownHandler),g.on(document,Rt,A.clearMenus),g.on(document,"keyup.bs.dropdown.data-api",A.clearMenus),g.on(document,Rt,E,function(t){t.preventDefault(),A.getOrCreateInstance(this).toggle()}),t(A);const Wt=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Gt=".sticky-top",Kt="padding-right",Zt="margin-right";class $t{constructor(){this._element=document.body}getWidth(){var t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Kt,t=>t+e),this._setElementAttributes(Wt,Kt,t=>t+e),this._setElementAttributes(Gt,Zt,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Kt),this._resetElementAttributes(Wt,Kt),this._resetElementAttributes(Gt,Zt)}isOverflowing(){return 0<this.getWidth()}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,i,n){const r=this.getWidth();this._applyManipulationCallback(t,t=>{var e;t!==this._element&&window.innerWidth>t.clientWidth+r||(this._saveInitialAttribute(t,i),e=window.getComputedStyle(t).getPropertyValue(i),t.style.setProperty(i,n(Number.parseFloat(e))+"px"))})}_saveInitialAttribute(t,e){var i=t.style.getPropertyValue(e);i&&d.setDataAttribute(t,e,i)}_resetElementAttributes(t,i){this._applyManipulationCallback(t,t=>{var e=d.getDataAttribute(t,i);null===e?t.style.removeProperty(i):(d.removeDataAttribute(t,i),t.style.setProperty(i,e))})}_applyManipulationCallback(t,e){if(s(t))e(t);else for(const i of p.find(t,this._element))e(i)}}const Yt="backdrop",Xt="mousedown.bs."+Yt,Qt={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Jt={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class te extends e{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return Qt}static get DefaultType(){return Jt}static get NAME(){return Yt}show(t){var e;this._config.isVisible?(this._append(),e=this._getElement(),this._config.isAnimated&&l(e),e.classList.add("show"),this._emulateAnimation(()=>{u(t)})):u(t)}hide(t){this._config.isVisible?(this._getElement().classList.remove("show"),this._emulateAnimation(()=>{this.dispose(),u(t)})):u(t)}dispose(){this._isAppended&&(g.off(this._element,Xt),this._element.remove(),this._isAppended=!1)}_getElement(){var t;return this._element||((t=document.createElement("div")).className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t),this._element}_configAfterMerge(t){return t.rootElement=n(t.rootElement),t}_append(){var t;this._isAppended||(t=this._getElement(),this._config.rootElement.append(t),g.on(t,Xt,()=>{u(this._config.clickCallback)}),this._isAppended=!0)}_emulateAnimation(t){G(t,this._getElement(),this._config.isAnimated)}}const ee=".bs.focustrap",ie=(ee,ee,"backward"),ne={autofocus:!0,trapElement:null},re={autofocus:"boolean",trapElement:"element"};class se extends e{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return ne}static get DefaultType(){return re}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),g.off(document,ee),g.on(document,"focusin.bs.focustrap",t=>this._handleFocusin(t)),g.on(document,"keydown.tab.bs.focustrap",t=>this._handleKeydown(t)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,g.off(document,ee))}_handleFocusin(t){var e=this._config["trapElement"];t.target===document||t.target===e||e.contains(t.target)||(0===(t=p.focusableChildren(e)).length?e:this._lastTabNavDirection===ie?t[t.length-1]:t[0]).focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?ie:"forward")}}const T=".bs.modal";T,T;const ae="hidden"+T,oe="show"+T;T,T,T,T,T;T;const he="modal-open",le="modal-static";const ue={backdrop:!0,focus:!0,keyboard:!0},ce={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class I extends f{constructor(t,e){super(t,e),this._dialog=p.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new $t,this._addEventListeners()}static get Default(){return ue}static get DefaultType(){return ce}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||g.trigger(this._element,oe,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(he),this._adjustDialog(),this._backdrop.show(()=>this._showElement(t)))}hide(){!this._isShown||this._isTransitioning||g.trigger(this._element,"hide.bs.modal").defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove("show"),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){for(const t of[window,this._dialog])g.off(t,T);this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new te({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new se({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;var e=p.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),l(this._element),this._element.classList.add("show");this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,g.trigger(this._element,"shown.bs.modal",{relatedTarget:t})},this._dialog,this._isAnimated())}_addEventListeners(){g.on(this._element,"keydown.dismiss.bs.modal",t=>{"Escape"===t.key&&(this._config.keyboard?(t.preventDefault(),this.hide()):this._triggerBackdropTransition())}),g.on(window,"resize.bs.modal",()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),g.on(this._element,"mousedown.dismiss.bs.modal",e=>{g.one(this._element,"click.dismiss.bs.modal",t=>{this._element===e.target&&this._element===t.target&&("static"===this._config.backdrop?this._triggerBackdropTransition():this._config.backdrop&&this.hide())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(he),this._resetAdjustments(),this._scrollBar.reset(),g.trigger(this._element,ae)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){var t=g.trigger(this._element,"hidePrevented.bs.modal");if(!t.defaultPrevented){t=this._element.scrollHeight>document.documentElement.clientHeight;const e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(le)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(le),this._queueCallback(()=>{this._element.classList.remove(le),this._queueCallback(()=>{this._element.style.overflowY=e},this._dialog)},this._dialog),this._element.focus())}}_adjustDialog(){var t,e=this._element.scrollHeight>document.documentElement.clientHeight,i=this._scrollBar.getWidth(),n=0<i;n&&!e&&(t=h()?"paddingLeft":"paddingRight",this._element.style[t]=i+"px"),!n&&e&&(t=h()?"paddingRight":"paddingLeft",this._element.style[t]=i+"px")}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,i){return this.each(function(){var t=I.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](i)}})}}g.on(document,"click.bs.modal.data-api",'[data-bs-toggle="modal"]',function(t){const e=r(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),g.one(e,oe,t=>{t.defaultPrevented||g.one(e,ae,()=>{a(this)&&this.focus()})});t=p.findOne(".modal.show");t&&I.getInstance(t).hide(),I.getOrCreateInstance(e).toggle(this)}),dt(I),t(I);C=".bs.offcanvas";const de="showing",fe=".offcanvas.show",pe="hidePrevented"+C,ge="hidden"+C;const me={backdrop:!0,keyboard:!0,scroll:!1},_e={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class L extends f{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return me}static get DefaultType(){return _e}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||g.trigger(this._element,"show.bs.offcanvas",{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new $t).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(de),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add("show"),this._element.classList.remove(de),g.trigger(this._element,"shown.bs.offcanvas",{relatedTarget:t})},this._element,!0))}hide(){this._isShown&&!g.trigger(this._element,"hide.bs.offcanvas").defaultPrevented&&(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add("hiding"),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove("show","hiding"),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new $t).reset(),g.trigger(this._element,ge)},this._element,!0))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){var t=Boolean(this._config.backdrop);return new te({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"===this._config.backdrop?g.trigger(this._element,pe):this.hide()}:null})}_initializeFocusTrap(){return new se({trapElement:this._element})}_addEventListeners(){g.on(this._element,"keydown.dismiss.bs.offcanvas",t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():g.trigger(this._element,pe))})}static jQueryInterface(e){return this.each(function(){var t=L.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}g.on(document,"click.bs.offcanvas.data-api",'[data-bs-toggle="offcanvas"]',function(t){var e=r(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),o(this)||(g.one(e,ge,()=>{a(this)&&this.focus()}),(t=p.findOne(fe))&&t!==e&&L.getInstance(t).hide(),L.getOrCreateInstance(e).toggle(this))}),g.on(window,"load.bs.offcanvas.data-api",()=>{for(const t of p.find(fe))L.getOrCreateInstance(t).show()}),g.on(window,"resize.bs.offcanvas",()=>{for(const t of p.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&L.getOrCreateInstance(t).hide()}),dt(L),t(L);const ve=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]);const ye=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i,be=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;_={"*":["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:[]};function we(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);i=(new window.DOMParser).parseFromString(t,"text/html");for(const a of[].concat(...i.body.querySelectorAll("*"))){var n=a.nodeName.toLowerCase();if(Object.keys(e).includes(n)){var r=[].concat(...a.attributes),s=[].concat(e["*"]||[],e[n]||[]);for(const o of r)((t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!ve.has(i)||Boolean(ye.test(t.nodeValue)||be.test(t.nodeValue)):e.filter(t=>t instanceof RegExp).some(t=>t.test(i))})(o,s)||a.removeAttribute(o.nodeName)}else a.remove()}return i.body.innerHTML}const xe={allowList:_,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},Se={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Ce={entry:"(string|element|function|null)",selector:"(string|element)"};class ke extends e{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return xe}static get DefaultType(){return Se}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(t=>this._resolvePossibleFunction(t)).filter(Boolean)}hasContent(){return 0<this.getContent().length}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){var t,e,i=document.createElement("div");i.innerHTML=this._maybeSanitize(this._config.template);for([t,e]of Object.entries(this._config.content))this._setContent(i,e,t);var n=i.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&n.classList.add(...r.split(" ")),n}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(var[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},Ce)}_setContent(t,e,i){i=p.findOne(i,t);i&&((e=this._resolvePossibleFunction(e))?s(e)?this._putElementInTemplate(n(e),i):this._config.html?i.innerHTML=this._maybeSanitize(e):i.textContent=e:i.remove())}_maybeSanitize(t){return this._config.sanitize?we(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return"function"==typeof t?t(this):t}_putElementInTemplate(t,e){this._config.html?(e.innerHTML="",e.append(t)):e.textContent=t.textContent}}const Ee=new Set(["sanitize","allowList","sanitizeFn"]),Ae="fade";const Te="show",Ie="hide.bs.modal",P="hover",Le="focus",Pe={AUTO:"auto",TOP:"top",RIGHT:h()?"left":"right",BOTTOM:"bottom",LEFT:h()?"right":"left"},Oe={allowList:_,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,0],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},Me={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class O extends f{constructor(t,e){if(void 0===i)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Oe}static get DefaultType(){return Me}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),g.off(this._element.closest(".modal"),Ie,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(this._isWithContent()&&this._isEnabled){var t=g.trigger(this._element,this.constructor.eventName("show")),e=(q(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(!t.defaultPrevented&&e){this._disposePopper();t=this._getTipElement(),e=(this._element.setAttribute("aria-describedby",t.getAttribute("id")),this._config)["container"];if(this._element.ownerDocument.documentElement.contains(this.tip)||(e.append(t),g.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(t),t.classList.add(Te),"ontouchstart"in document.documentElement)for(const i of[].concat(...document.body.children))g.on(i,"mouseover",U);this._queueCallback(()=>{g.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}}}hide(){if(this._isShown()){var t=g.trigger(this._element,this.constructor.eventName("hide"));if(!t.defaultPrevented){if(this._getTipElement().classList.remove(Te),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))g.off(e,"mouseover",U);this._activeTrigger.click=!1,this._activeTrigger[Le]=!1,this._activeTrigger[P]=!1,this._isHovered=null;this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),g.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){t=this._getTemplateFactory(t).toHtml();if(!t)return null;t.classList.remove(Ae,Te),t.classList.add(`bs-${this.constructor.NAME}-auto`);var e=(t=>{for(;t+=Math.floor(1e6*Math.random()),document.getElementById(t););return t})(this.constructor.NAME).toString();return t.setAttribute("id",e),this._isAnimated()&&t.classList.add(Ae),t}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new ke({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Ae)}_isShown(){return this.tip&&this.tip.classList.contains(Te)}_createPopper(t){var e="function"==typeof this._config.placement?this._config.placement.call(this,t,this._element):this._config.placement,e=Pe[e.toUpperCase()];return i.createPopper(this._element,t,this._getPopperConfig(e))}_getOffset(){const e=this._config["offset"];return"string"==typeof e?e.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(t){return"function"==typeof t?t.call(this._element):t}_getPopperConfig(t){t={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...t,..."function"==typeof this._config.popperConfig?this._config.popperConfig(t):this._config.popperConfig}}_setListeners(){var t,e;for(const i of this._config.trigger.split(" "))"click"===i?g.on(this._element,this.constructor.eventName("click"),this._config.selector,t=>{this._initializeOnDelegatedTarget(t).toggle()}):"manual"!==i&&(t=i===P?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),e=i===P?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout"),g.on(this._element,t,this._config.selector,t=>{var e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?Le:P]=!0,e._enter()}),g.on(this._element,e,this._config.selector,t=>{var e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?Le:P]=e._element.contains(t.relatedTarget),e._leave()}));this._hideModalHandler=()=>{this._element&&this.hide()},g.on(this._element.closest(".modal"),Ie,this._hideModalHandler)}_fixTitle(){var t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){var e=d.getDataAttributes(this._element);for(const i of Object.keys(e))Ee.has(i)&&delete e[i];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:n(t.container),"number"==typeof 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()),t}_getDelegateConfig(){var t={};for(const e in this._config)this.constructor.Default[e]!==this._config[e]&&(t[e]=this._config[e]);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){var t=O.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}t(O);const Ne={...O.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},Re={...O.DefaultType,content:"(null|string|element|function)"};class De extends O{static get Default(){return Ne}static get DefaultType(){return Re}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){var t=De.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}t(De);Rt=".bs.scrollspy";const Be="click"+Rt;const M="active",je="[href]";const ze={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Fe={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Ve extends f{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return ze}static get DefaultType(){return Fe}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=n(t.target)||document.body,t.rootMargin=t.offset?t.offset+"px 0px -30%":t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map(t=>Number.parseFloat(t))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(g.off(this._config.target,Be),g.on(this._config.target,Be,je,t=>{var e=this._observableSections.get(t.target.hash);e&&(t.preventDefault(),t=this._rootElement||window,e=e.offsetTop-this._element.offsetTop,t.scrollTo?t.scrollTo({top:e,behavior:"smooth"}):t.scrollTop=e)}))}_getNewObserver(){var t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),t)}_observerCallback(t){const e=t=>this._targetLinks.get("#"+t.target.id);var i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,r=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const a of t)if(a.isIntersecting){var s=a.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&s){if(i(a),n)continue;return}r||s||i(a)}else this._activeTarget=null,this._clearActiveClass(e(a))}_initializeTargetsAndObservables(){var t;this._targetLinks=new Map,this._observableSections=new Map;for(const e of p.find(je,this._config.target))e.hash&&!o(e)&&(t=p.findOne(e.hash,this._element),a(t))&&(this._targetLinks.set(e.hash,e),this._observableSections.set(e.hash,t))}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),(this._activeTarget=t).classList.add(M),this._activateParents(t),g.trigger(this._element,"activate.bs.scrollspy",{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))p.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(M);else for(const e of p.parents(t,".nav, .list-group"))for(const i of p.prev(e,".nav-link, .nav-item > .nav-link, .list-group-item"))i.classList.add(M)}_clearActiveClass(t){t.classList.remove(M);for(const e of p.find(je+"."+M,t))e.classList.remove(M)}static jQueryInterface(e){return this.each(function(){var t=Ve.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}g.on(window,"load.bs.scrollspy.data-api",()=>{for(const t of p.find('[data-bs-spy="scroll"]'))Ve.getOrCreateInstance(t)}),t(Ve);const qe="ArrowRight",Ue="ArrowDown",N="active",He="show";C='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';const We='.nav-link:not(.dropdown-toggle), .list-group-item:not(.dropdown-toggle), [role="tab"]:not(.dropdown-toggle), '+C;N,N,N;class R extends f{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),g.on(this._element,"keydown.bs.tab",t=>this._keydown(t)))}static get NAME(){return"tab"}show(){var t,e,i=this._element;this._elemIsActive(i)||(e=(t=this._getActiveElem())?g.trigger(t,"hide.bs.tab",{relatedTarget:i}):null,g.trigger(i,"show.bs.tab",{relatedTarget:t}).defaultPrevented)||e&&e.defaultPrevented||(this._deactivate(t,i),this._activate(i,t))}_activate(t,e){t&&(t.classList.add(N),this._activate(r(t)),this._queueCallback(()=>{"tab"!==t.getAttribute("role")?t.classList.add(He):(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),g.trigger(t,"shown.bs.tab",{relatedTarget:e}))},t,t.classList.contains("fade")))}_deactivate(t,e){t&&(t.classList.remove(N),t.blur(),this._deactivate(r(t)),this._queueCallback(()=>{"tab"!==t.getAttribute("role")?t.classList.remove(He):(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),g.trigger(t,"hidden.bs.tab",{relatedTarget:e}))},t,t.classList.contains("fade")))}_keydown(t){var e;["ArrowLeft",qe,"ArrowUp",Ue].includes(t.key)&&(t.stopPropagation(),t.preventDefault(),e=[qe,Ue].includes(t.key),t=K(this._getChildren().filter(t=>!o(t)),t.target,e,!0))&&(t.focus({preventScroll:!0}),R.getOrCreateInstance(t).show())}_getChildren(){return p.find(We,this._parent)}_getActiveElem(){return this._getChildren().find(t=>this._elemIsActive(t))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const i of e)this._setInitialAttributesOnChild(i)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);var e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){var e=r(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id)&&this._setAttributeIfNotExists(e,"aria-labelledby","#"+t.id)}_toggleDropDown(t,i){const n=this._getOuterElement(t);n.classList.contains("dropdown")&&((t=(t,e)=>{t=p.findOne(t,n);t&&t.classList.toggle(e,i)})(".dropdown-toggle",N),t(".dropdown-menu",He),n.setAttribute("aria-expanded",i))}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(N)}_getInnerElement(t){return t.matches(We)?t:p.findOne(We,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(e){return this.each(function(){var t=R.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}g.on(document,"click.bs.tab",C,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),o(this)||R.getOrCreateInstance(this).show()}),g.on(window,"load.bs.tab",()=>{for(const t of p.find('.active[data-bs-toggle="tab"], .active[data-bs-toggle="pill"], .active[data-bs-toggle="list"]'))R.getOrCreateInstance(t)}),t(R);const Ge="show",Ke="showing",Ze={animation:"boolean",autohide:"boolean",delay:"number"},$e={animation:!0,autohide:!0,delay:5e3};class Ye extends f{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return $e}static get DefaultType(){return Ze}static get NAME(){return"toast"}show(){g.trigger(this._element,"show.bs.toast").defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove("hide"),l(this._element),this._element.classList.add(Ge,Ke),this._queueCallback(()=>{this._element.classList.remove(Ke),g.trigger(this._element,"shown.bs.toast"),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&!g.trigger(this._element,"hide.bs.toast").defaultPrevented&&(this._element.classList.add(Ke),this._queueCallback(()=>{this._element.classList.add("hide"),this._element.classList.remove(Ke,Ge),g.trigger(this._element,"hidden.bs.toast")},this._element,this._config.animation))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Ge),super.dispose()}isShown(){return this._element.classList.contains(Ge)}_maybeScheduleHide(){!this._config.autohide||this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}e?this._clearTimeout():(t=t.relatedTarget,this._element===t||this._element.contains(t)||this._maybeScheduleHide())}_setListeners(){g.on(this._element,"mouseover.bs.toast",t=>this._onInteraction(t,!0)),g.on(this._element,"mouseout.bs.toast",t=>this._onInteraction(t,!1)),g.on(this._element,"focusin.bs.toast",t=>this._onInteraction(t,!0)),g.on(this._element,"focusout.bs.toast",t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){var t=Ye.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}})}}return dt(Ye),t(Ye),{Alert:ft,Button:gt,Carousel:w,Collapse:S,Dropdown:A,Modal:I,Offcanvas:L,Popover:De,ScrollSpy:Ve,Tab:R,Toast:Ye,Tooltip:O}},"object"==typeof i&&void 0!==e?e.exports=r(t("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],r):(n="undefined"!=typeof globalThis?globalThis:n||self).bootstrap=r(n.Popper)},{"@popperjs/core":3}],8:[function(t,e,i){},{}],9:[function(t,e,i){arguments[4][8][0].apply(i,arguments)},{dup:8}],10:[function(t,T,I){!function(A){!function(){var t=this,e="object"==typeof I&&I&&!I.nodeType&&I,i="object"==typeof T&&T&&!T.nodeType&&T,n="object"==typeof A&&A;n.global!==n&&n.window!==n&&n.self!==n||(t=n);var r,s,m=2147483647,_=36,v=26,a=38,o=700,h=/^xn--/,l=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=_-1,y=Math.floor,b=String.fromCharCode;function w(t){throw new RangeError(c[t])}function f(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function p(t,e){var i=t.split("@"),n="",i=(1<i.length&&(n=i[0]+"@",t=i[1]),(t=t.replace(u,".")).split("."));return n+f(i,e).join(".")}function x(t){for(var e,i,n=[],r=0,s=t.length;r<s;)55296<=(e=t.charCodeAt(r++))&&e<=56319&&r<s?56320==(64512&(i=t.charCodeAt(r++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),r--):n.push(e);return n}function g(t){return f(t,function(t){var e="";return 65535<t&&(e+=b((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=b(t)}).join("")}function S(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function C(t,e,i){var n=0;for(t=i?y(t/o):t>>1,t+=y(t/e);d*v>>1<t;n+=_)t=y(t/d);return y(n+(d+1)*t/(t+a))}function k(t){var e,i,n,r,s,a,o,h=[],l=t.length,u=0,c=128,d=72,f=t.lastIndexOf("-");for(f<0&&(f=0),i=0;i<f;++i)128<=t.charCodeAt(i)&&w("not-basic"),h.push(t.charCodeAt(i));for(n=0<f?f+1:0;n<l;){for(r=u,s=1,a=_;l<=n&&w("invalid-input"),o=t.charCodeAt(n++),(_<=(o=o-48<10?o-22:o-65<26?o-65:o-97<26?o-97:_)||o>y((m-u)/s))&&w("overflow"),u+=o*s,!(o<(o=a<=d?1:d+v<=a?v:a-d));a+=_)s>y(m/(o=_-o))&&w("overflow"),s*=o;d=C(u-r,e=h.length+1,0==r),y(u/e)>m-c&&w("overflow"),c+=y(u/e),u%=e,h.splice(u++,0,c)}return g(h)}function E(t){for(var e,i,n,r,s,a,o,h,l,u,c=[],d=(t=x(t)).length,f=128,p=72,g=e=0;g<d;++g)(o=t[g])<128&&c.push(b(o));for(i=n=c.length,n&&c.push("-");i<d;){for(r=m,g=0;g<d;++g)f<=(o=t[g])&&o<r&&(r=o);for(r-f>y((m-e)/(h=i+1))&&w("overflow"),e+=(r-f)*h,f=r,g=0;g<d;++g)if((o=t[g])<f&&++e>m&&w("overflow"),o==f){for(s=e,a=_;!(s<(l=a<=p?1:p+v<=a?v:a-p));a+=_)c.push(b(S(l+(u=s-l)%(l=_-l),0))),s=y(u/l);c.push(b(S(s,0))),p=C(e,h,i==n),e=0,++i}++e,++f}return c.join("")}if(r={version:"1.4.1",ucs2:{decode:x,encode:g},decode:k,encode:E,toASCII:function(t){return p(t,function(t){return l.test(t)?"xn--"+E(t):t})},toUnicode:function(t){return p(t,function(t){return h.test(t)?k(t.slice(4).toLowerCase()):t})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return r});else if(e&&i)if(T.exports==e)i.exports=r;else for(s in r)r.hasOwnProperty(s)&&(e[s]=r[s]);else t.punycode=r}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(P,t,O){!function(t){!function(){"use strict";var C=P("base64-js"),s=P("ieee754"),e=(O.Buffer=c,O.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},O.INSPECT_MAX_BYTES=50,2147483647);function h(t){if(e<t)throw new RangeError('The value "'+t+'" is invalid for option "size"');t=new Uint8Array(t);return t.__proto__=c.prototype,t}function c(t,e,i){if("number"!=typeof t)return n(t,e,i);if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}function n(t,e,i){if("string"==typeof t){var n=t,r=e;if(c.isEncoding(r="string"==typeof r&&""!==r?r:"utf8"))return s=0|d(n,r),a=h(s),a=(n=a.write(n,r))!==s?a.slice(0,n):a;throw new TypeError("Unknown encoding: "+r)}if(ArrayBuffer.isView(t))return l(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(I(t,ArrayBuffer)||t&&I(t.buffer,ArrayBuffer)){var s=t,n=e,a=i;if(n<0||s.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<n+(a||0))throw new RangeError('"length" is outside of buffer bounds');return(s=void 0===n&&void 0===a?new Uint8Array(s):void 0===a?new Uint8Array(s,n):new Uint8Array(s,n,a)).__proto__=c.prototype,s}if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return c.from(r,e,i);var o=function(t){{var e,i;if(c.isBuffer(t))return e=0|u(t.length),0!==(i=h(e)).length&&t.copy(i,0,0,e),i}if(void 0!==t.length)return"number"!=typeof t.length||L(t.length)?h(0):l(t);if("Buffer"===t.type&&Array.isArray(t.data))return l(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function r(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return r(t),h(t<0?0:0|u(t))}function l(t){for(var e=t.length<0?0:0|u(t.length),i=h(e),n=0;n<e;n+=1)i[n]=255&t[n];return i}function u(t){if(e<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e.toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||I(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var i=t.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===i)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return E(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return A(t).length;default:if(r)return n?-1:E(t).length;e=(""+e).toLowerCase(),r=!0}}function i(t,e,i){var n,r=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((i=void 0===i||i>this.length?this.length:i)<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":var s=this,a=e,o=i,h=s.length;(!o||o<0||h<o)&&(o=h);for(var l="",u=a=!a||a<0?0:a;u<o;++u)l+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(s[u]);return l;case"utf8":case"utf-8":return k(this,e,i);case"ascii":var c=this,h=e,d=i,f="";d=Math.min(c.length,d);for(var p=h;p<d;++p)f+=String.fromCharCode(127&c[p]);return f;case"latin1":case"binary":var g=this,a=e,m=i,_="";m=Math.min(g.length,m);for(var v=a;v<m;++v)_+=String.fromCharCode(g[v]);return _;case"base64":return y=this,n=i,0===(b=e)&&n===y.length?C.fromByteArray(y):C.fromByteArray(y.slice(b,n));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var y=e,b=i,w=this.slice(y,b),x="",S=0;S<w.length;S+=2)x+=String.fromCharCode(w[S]+256*w[S+1]);return x;default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function o(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function f(t,e,i,n,r){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):2147483647<i?i=2147483647:i<-2147483648&&(i=-2147483648),(i=(i=L(i=+i)?r?0:t.length-1:i)<0?t.length+i:i)>=t.length){if(r)return-1;i=t.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:p(t,e,i,n,r);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?(r?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,i):p(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}function p(t,e,i,n,r){var s=1,a=t.length,o=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a/=s=2,o/=2,i/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(r)for(var l=-1,u=i;u<a;u++)if(h(t,u)===h(e,-1===l?0:u-l)){if(u-(l=-1===l?u:l)+1===o)return l*s}else-1!==l&&(u-=u-l),l=-1;else for(u=i=a<i+o?a-o:i;0<=u;u--){for(var c=!0,d=0;d<o;d++)if(h(t,u+d)!==h(e,d)){c=!1;break}if(c)return u}return-1}function m(t,e,i,n){return T(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,n)}function _(t,e,i,n){return T(function(t,e){for(var i,n,r=[],s=0;s<t.length&&!((e-=2)<0);++s)i=t.charCodeAt(s),n=i>>8,r.push(i%256),r.push(n);return r}(e,t.length-i),t,i,n)}function k(t,e,i){i=Math.min(t.length,i);for(var n=[],r=e;r<i;){var s,a,o,h,l=t[r],u=null,c=239<l?4:223<l?3:191<l?2:1;if(r+c<=i)switch(c){case 1:l<128&&(u=l);break;case 2:128==(192&(s=t[r+1]))&&127<(h=(31&l)<<6|63&s)&&(u=h);break;case 3:s=t[r+1],a=t[r+2],128==(192&s)&&128==(192&a)&&2047<(h=(15&l)<<12|(63&s)<<6|63&a)&&(h<55296||57343<h)&&(u=h);break;case 4:s=t[r+1],a=t[r+2],o=t[r+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&65535<(h=(15&l)<<18|(63&s)<<12|(63&a)<<6|63&o)&&h<1114112&&(u=h)}null===u?(u=65533,c=1):65535<u&&(n.push((u-=65536)>>>10&1023|55296),u=56320|1023&u),n.push(u),r+=c}var d=n,f=d.length;if(f<=v)return String.fromCharCode.apply(String,d);for(var p="",g=0;g<f;)p+=String.fromCharCode.apply(String,d.slice(g,g+=v));return p}O.kMaxLength=e,(c.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),c.poolSize=8192,c.from=n,c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,c.alloc=function(t,e,i){return e=e,i=i,r(t=t),!(t<=0)&&void 0!==e?"string"==typeof i?h(t).fill(e,i):h(t).fill(e):h(t)},c.allocUnsafe=a,c.allocUnsafeSlow=a,c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(I(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),I(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var i=t.length,n=e.length,r=0,s=Math.min(i,n);r<s;++r)if(t[r]!==e[r]){i=t[r],n=e[r];break}return i<n?-1:n<i?1:0},c.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}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;for(var i=c.allocUnsafe(e),n=0,r=0;r<t.length;++r){var s=t[r];if(I(s,Uint8Array)&&(s=c.from(s)),!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n),n+=s.length}return i},c.byteLength=d,c.prototype._isBuffer=!0,c.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 e=0;e<t;e+=2)o(this,e,e+1);return this},c.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 e=0;e<t;e+=4)o(this,e,e+3),o(this,e+1,e+2);return this},c.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 e=0;e<t;e+=8)o(this,e,e+7),o(this,e+1,e+6),o(this,e+2,e+5),o(this,e+3,e+4);return this},c.prototype.toLocaleString=c.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?k(this,0,t):i.apply(this,arguments)},c.prototype.equals=function(t){if(c.isBuffer(t))return this===t||0===c.compare(this,t);throw new TypeError("Argument must be a Buffer")},c.prototype.inspect=function(){var t="",e=O.INSPECT_MAX_BYTES,t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim();return this.length>e&&(t+=" ... "),"<Buffer "+t+">"},c.prototype.compare=function(t,e,i,n,r){if(I(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),(e=void 0===e?0:e)<0||i>t.length||n<0||r>this.length)throw new RangeError("out of range index");if(r<=n&&i<=e)return 0;if(r<=n)return-1;if(i<=e)return 1;if(this===t)return 0;for(var s=(r>>>=0)-(n>>>=0),a=(i>>>=0)-(e>>>=0),o=Math.min(s,a),h=this.slice(n,r),l=t.slice(e,i),u=0;u<o;++u)if(h[u]!==l[u]){s=h[u],a=l[u];break}return s<a?-1:a<s?1:0},c.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},c.prototype.indexOf=function(t,e,i){return f(this,t,e,i,!0)},c.prototype.lastIndexOf=function(t,e,i){return f(this,t,e,i,!1)},c.prototype.write=function(t,e,i,n){if(void 0===e)n="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)n=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-e;if((void 0===i||r<i)&&(i=r),0<t.length&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var s,a,o,h=!1;;)switch(n){case"hex":var l=this,u=t,c=e,d=i,f=(c=Number(c)||0,l.length-c);(!d||f<(d=Number(d)))&&(d=f),(f=u.length)/2<d&&(d=f/2);for(var p=0;p<d;++p){var g=parseInt(u.substr(2*p,2),16);if(L(g))return p;l[c+p]=g}return p;case"utf8":case"utf-8":return f=e,o=i,T(E(t,(a=this).length-f),a,f,o);case"ascii":return m(this,t,e,i);case"latin1":case"binary":return m(this,t,e,i);case"base64":return a=this,o=e,s=i,T(A(t),a,o,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,i);default:if(h)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var v=4096;function g(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(i<t+e)throw new RangeError("Trying to access beyond buffer length")}function y(t,e,i,n,r,s){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r<e||e<s)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}function b(t,e,i,n){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function w(t,e,i,n,r){return e=+e,i>>>=0,r||b(t,0,i,4),s.write(t,e,i,n,23,4),i+4}function x(t,e,i,n,r){return e=+e,i>>>=0,r||b(t,0,i,8),s.write(t,e,i,n,52,8),i+8}c.prototype.slice=function(t,e){var i=this.length,i=((t=~~t)<0?(t+=i)<0&&(t=0):i<t&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):i<e&&(e=i),e<t&&(e=t),this.subarray(t,e));return i.__proto__=c.prototype,i},c.prototype.readUIntLE=function(t,e,i){t>>>=0,e>>>=0,i||g(t,e,this.length);for(var n=this[t],r=1,s=0;++s<e&&(r*=256);)n+=this[t+s]*r;return n},c.prototype.readUIntBE=function(t,e,i){t>>>=0,e>>>=0,i||g(t,e,this.length);for(var n=this[t+--e],r=1;0<e&&(r*=256);)n+=this[t+--e]*r;return n},c.prototype.readUInt8=function(t,e){return t>>>=0,e||g(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||g(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||g(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||g(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||g(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,i){t>>>=0,e>>>=0,i||g(t,e,this.length);for(var n=this[t],r=1,s=0;++s<e&&(r*=256);)n+=this[t+s]*r;return(r*=128)<=n&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,i){t>>>=0,e>>>=0,i||g(t,e,this.length);for(var n=e,r=1,s=this[t+--n];0<n&&(r*=256);)s+=this[t+--n]*r;return(r*=128)<=s&&(s-=Math.pow(2,8*e)),s},c.prototype.readInt8=function(t,e){return t>>>=0,e||g(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||g(t,2,this.length);e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},c.prototype.readInt16BE=function(t,e){t>>>=0,e||g(t,2,this.length);e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||g(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||g(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return t>>>=0,e||g(t,4,this.length),s.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||g(t,4,this.length),s.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||g(t,8,this.length),s.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||g(t,8,this.length),s.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,i,n){t=+t,e>>>=0,i>>>=0,n||y(this,t,e,i,Math.pow(2,8*i)-1,0);var r=1,s=0;for(this[e]=255&t;++s<i&&(r*=256);)this[e+s]=t/r&255;return e+i},c.prototype.writeUIntBE=function(t,e,i,n){t=+t,e>>>=0,i>>>=0,n||y(this,t,e,i,Math.pow(2,8*i)-1,0);var r=i-1,s=1;for(this[e+r]=255&t;0<=--r&&(s*=256);)this[e+r]=t/s&255;return e+i},c.prototype.writeUInt8=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUInt16BE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUInt32LE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUInt32BE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeIntLE=function(t,e,i,n){t=+t,e>>>=0,n||y(this,t,e,i,(n=Math.pow(2,8*i-1))-1,-n);var r=0,s=1,a=0;for(this[e]=255&t;++r<i&&(s*=256);)t<0&&0===a&&0!==this[e+r-1]&&(a=1),this[e+r]=(t/s>>0)-a&255;return e+i},c.prototype.writeIntBE=function(t,e,i,n){t=+t,e>>>=0,n||y(this,t,e,i,(n=Math.pow(2,8*i-1))-1,-n);var r=i-1,s=1,a=0;for(this[e+r]=255&t;0<=--r&&(s*=256);)t<0&&0===a&&0!==this[e+r+1]&&(a=1),this[e+r]=(t/s>>0)-a&255;return e+i},c.prototype.writeInt8=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,1,127,-128),this[e]=255&(t=t<0?255+t+1:t),e+1},c.prototype.writeInt16LE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,4,2147483647,-2147483648),this[e]=(t=t<0?4294967295+t+1:t)>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeFloatLE=function(t,e,i){return w(this,t,e,!0,i)},c.prototype.writeFloatBE=function(t,e,i){return w(this,t,e,!1,i)},c.prototype.writeDoubleLE=function(t,e,i){return x(this,t,e,!0,i)},c.prototype.writeDoubleBE=function(t,e,i){return x(this,t,e,!1,i)},c.prototype.copy=function(t,e,i,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i=i||0,n||0===n||(n=this.length),e>=t.length&&(e=t.length),(n=0<n&&n<i?i:n)===i)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var r=(n=t.length-e<n-i?t.length-e+i:n)-i;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,i,n);else if(this===t&&i<e&&e<n)for(var s=r-1;0<=s;--s)t[s+e]=this[s+i];else Uint8Array.prototype.set.call(t,this.subarray(i,n),e);return r},c.prototype.fill=function(t,e,i,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var r;1===t.length&&(r=t.charCodeAt(0),"utf8"===n&&r<128||"latin1"===n)&&(t=r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");var s;if(!(i<=e))if(e>>>=0,i=void 0===i?this.length:i>>>0,"number"==typeof(t=t||0))for(s=e;s<i;++s)this[s]=t;else{var a=c.isBuffer(t)?t:c.from(t,n),o=a.length;if(0===o)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<i-e;++s)this[s+e]=a[s%o]}return this};var S=/[^+/0-9A-Za-z-_]/g;function E(t,e){e=e||1/0;for(var i,n=t.length,r=null,s=[],a=0;a<n;++a){if(55295<(i=t.charCodeAt(a))&&i<57344){if(!r){if(56319<i){-1<(e-=3)&&s.push(239,191,189);continue}if(a+1===n){-1<(e-=3)&&s.push(239,191,189);continue}r=i;continue}if(i<56320){-1<(e-=3)&&s.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&-1<(e-=3)&&s.push(239,191,189);if(r=null,i<128){if(--e<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function A(t){return C.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(S,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function T(t,e,i,n){for(var r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}function I(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function L(t){return t!=t}}.call(this)}.call(this,P("buffer").Buffer)},{"base64-js":6,buffer:11,ieee754:19}],12:[function(t,e,i){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],13:[function(t,e,i){const a=t("color-name"),o={};for(const s of Object.keys(a))o[a[s]]=s;const h={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"]}};e.exports=h;for(const l of Object.keys(h)){if(!("channels"in h[l]))throw new Error("missing channels property: "+l);if(!("labels"in h[l]))throw new Error("missing channel labels property: "+l);if(h[l].labels.length!==h[l].channels)throw new Error("channel and label counts mismatch: "+l);var{channels:n,labels:r}=h[l];delete h[l].channels,delete h[l].labels,Object.defineProperty(h[l],"channels",{value:n}),Object.defineProperty(h[l],"labels",{value:r})}h.rgb.hsl=function(t){var e=t[0]/255,i=t[1]/255,t=t[2]/255,n=Math.min(e,i,t),r=Math.max(e,i,t),s=r-n;let a,o;r===n?a=0:e===r?a=(i-t)/s:i===r?a=2+(t-e)/s:t===r&&(a=4+(e-i)/s),(a=Math.min(60*a,360))<0&&(a+=360);t=(n+r)/2;return o=r===n?0:t<=.5?s/(r+n):s/(2-r-n),[a,100*o,100*t]},h.rgb.hsv=function(t){var e,i,n;let r,s;var a=t[0]/255,o=t[1]/255,t=t[2]/255;const h=Math.max(a,o,t),l=h-Math.min(a,o,t);function u(t){return(h-t)/6/l+.5}return 0==l?(r=0,s=0):(s=l/h,e=u(a),i=u(o),n=u(t),a===h?r=n-i:o===h?r=1/3+e-n:t===h&&(r=2/3+i-e),r<0?r+=1:1<r&&--r),[360*r,100*s,100*h]},h.rgb.hwb=function(t){var e=t[0],i=t[1],n=t[2];return[h.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(i,n))),100*(1-1/255*Math.max(e,Math.max(i,n)))]},h.rgb.cmyk=function(t){var e=t[0]/255,i=t[1]/255,t=t[2]/255,n=Math.min(1-e,1-i,1-t);return[100*((1-e-n)/(1-n)||0),100*((1-i-n)/(1-n)||0),100*((1-t-n)/(1-n)||0),100*n]},h.rgb.keyword=function(t){var e=o[t];if(e)return e;let i=1/0,n;for(const s of Object.keys(a)){var r=a[s],r=(t[0]-r[0])**2+(t[1]-r[1])**2+(t[2]-r[2])**2;r<i&&(i=r,n=s)}return n},h.keyword.rgb=function(t){return a[t]},h.rgb.xyz=function(t){var e=t[0]/255,i=t[1]/255,t=t[2]/255;return[100*(.4124*(e=.04045<e?((.055+e)/1.055)**2.4:e/12.92)+.3576*(i=.04045<i?((.055+i)/1.055)**2.4:i/12.92)+.1805*(t=.04045<t?((.055+t)/1.055)**2.4:t/12.92)),100*(.2126*e+.7152*i+.0722*t),100*(.0193*e+.1192*i+.9505*t)]},h.rgb.lab=function(t){var t=h.rgb.xyz(t),e=t[0],i=t[1],t=t[2];return[116*(i=.008856<(i/=100)?i**(1/3):7.787*i+16/116)-16,500*((.008856<(e/=95.047)?e**(1/3):7.787*e+16/116)-i),200*(i-(.008856<(t/=108.883)?t**(1/3):7.787*t+16/116))]},h.hsl.rgb=function(t){var e=t[0]/360,i=t[1]/100,t=t[2]/100;let n,r,s;if(0==i)return[s=255*t,s,s];var a=2*t-(n=t<.5?t*(1+i):t+i-t*i),o=[0,0,0];for(let t=0;t<3;t++)(r=e+1/3*-(t-1))<0&&r++,1<r&&r--,s=6*r<1?a+6*(n-a)*r:2*r<1?n:3*r<2?a+(n-a)*(2/3-r)*6:a,o[t]=255*s;return o},h.hsl.hsv=function(t){var e=t[0],i=t[1]/100,t=t[2]/100,n=i,r=Math.max(t,.01),s=(n*=r<=1?r:2-r,((t*=2)+(i*=t<=1?t:2-t))/2);return[e,100*(0==t?2*n/(r+n):2*i/(t+i)),100*s]},h.hsv.rgb=function(t){var e=t[0]/60,i=t[1]/100,n=t[2]/100,t=Math.floor(e)%6,e=e-Math.floor(e),r=255*n*(1-i),s=255*n*(1-i*e),a=255*n*(1-i*(1-e));switch(n*=255,t){case 0:return[n,a,r];case 1:return[s,n,r];case 2:return[r,n,a];case 3:return[r,s,n];case 4:return[a,r,n];case 5:return[n,r,s]}},h.hsv.hsl=function(t){var e=t[0],i=t[1]/100,t=t[2]/100,n=Math.max(t,.01),t=(2-i)*t,r=(2-i)*n,i=i*n;return[e,100*((i/=r<=1?r:2-r)||0),100*(t/=2)]},h.hwb.rgb=function(t){var e=t[0]/360;let i=t[1]/100,n=t[2]/100;t=i+n;let r;1<t&&(i/=t,n/=t);var t=Math.floor(6*e),s=1-n,a=(r=6*e-t,0!=(1&t)&&(r=1-r),i+r*(s-i));let o,h,l;switch(t){default:case 6:case 0:o=s,h=a,l=i;break;case 1:o=a,h=s,l=i;break;case 2:o=i,h=s,l=a;break;case 3:o=i,h=a,l=s;break;case 4:o=a,h=i,l=s;break;case 5:o=s,h=i,l=a}return[255*o,255*h,255*l]},h.cmyk.rgb=function(t){var e=t[0]/100,i=t[1]/100,n=t[2]/100,t=t[3]/100;return[255*(1-Math.min(1,e*(1-t)+t)),255*(1-Math.min(1,i*(1-t)+t)),255*(1-Math.min(1,n*(1-t)+t))]},h.xyz.rgb=function(t){var e=t[0]/100,i=t[1]/100,t=t[2]/100,n=3.2406*e+-1.5372*i+-.4986*t,r=-.9689*e+1.8758*i+.0415*t,e=.0557*e+-.204*i+1.057*t;return r=.0031308<r?1.055*r**(1/2.4)-.055:12.92*r,e=.0031308<e?1.055*e**(1/2.4)-.055:12.92*e,[255*Math.min(Math.max(0,.0031308<n?1.055*n**(1/2.4)-.055:12.92*n),1),255*Math.min(Math.max(0,r),1),255*Math.min(Math.max(0,e),1)]},h.xyz.lab=function(t){var e=t[0],i=t[1],t=t[2];return[116*(i=.008856<(i/=100)?i**(1/3):7.787*i+16/116)-16,500*((.008856<(e/=95.047)?e**(1/3):7.787*e+16/116)-i),200*(i-(.008856<(t/=108.883)?t**(1/3):7.787*t+16/116))]},h.lab.xyz=function(t){var e=(t[0]+16)/116,i=t[1]/500+e,t=e-t[2]/200,n=e**3,r=i**3,s=t**3;return e=.008856<n?n:(e-16/116)/7.787,i=.008856<r?r:(i-16/116)/7.787,t=.008856<s?s:(t-16/116)/7.787,[i*=95.047,e*=100,t*=108.883]},h.lab.lch=function(t){var e=t[0],i=t[1],t=t[2];let n;var r=Math.atan2(t,i),r=((n=360*r/2/Math.PI)<0&&(n+=360),Math.sqrt(i*i+t*t));return[e,r,n]},h.lch.lab=function(t){var e=t[0],i=t[1],t=t[2]/360*2*Math.PI;return[e,i*Math.cos(t),i*Math.sin(t)]},h.rgb.ansi16=function(t,e=null){var[i,n,r]=t,t=null===e?h.rgb.hsv(t)[2]:e;if(0===(t=Math.round(t/50)))return 30;let s=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(i/255));return 2===t&&(s+=60),s},h.hsv.ansi16=function(t){return h.rgb.ansi16(h.hsv.rgb(t),t[2])},h.rgb.ansi256=function(t){var e=t[0],i=t[1],t=t[2];return e===i&&i===t?e<8?16:248<e?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(i/255*5)+Math.round(t/255*5)},h.ansi16.rgb=function(t){let e=t%10;return 0===e||7===e?(50<t&&(e+=3.5),[e=e/10.5*255,e,e]):(t=.5*(1+~~(50<t)),[(1&e)*t*255,(e>>1&1)*t*255,(e>>2&1)*t*255])},h.ansi256.rgb=function(t){var e;return 232<=t?[e=10*(t-232)+8,e,e]:(t-=16,[Math.floor(t/36)/5*255,Math.floor((e=t%36)/6)/5*255,e%6/5*255])},h.rgb.hex=function(t){t=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},h.hex.rgb=function(t){t=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let e=t[0];3===t[0].length&&(e=e.split("").map(t=>t+t).join(""));t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t]},h.rgb.hcg=function(t){var e=t[0]/255,i=t[1]/255,t=t[2]/255,n=Math.max(Math.max(e,i),t),r=Math.min(Math.min(e,i),t),s=n-r;let a,o;return a=s<1?r/(1-s):0,[360*(o=(o=s<=0?0:n===e?(i-t)/s%6:n===i?2+(t-e)/s:4+(e-i)/s)/6%1),100*s,100*a]},h.hsl.hcg=function(t){var e=t[1]/100,i=t[2]/100,e=i<.5?2*e*i:2*e*(1-i);let n=e<1?(i-.5*e)/(1-e):0;return[t[0],100*e,100*n]},h.hsv.hcg=function(t){var e=t[1]/100,i=t[2]/100,e=e*i;let n=e<1?(i-e)/(1-e):0;return[t[0],100*e,100*n]},h.hcg.rgb=function(t){var e=t[0]/360,i=t[1]/100,t=t[2]/100;if(0==i)return[255*t,255*t,255*t];var n=[0,0,0],e=e%1*6,r=e%1,s=1-r;switch(Math.floor(e)){case 0:n[0]=1,n[1]=r,n[2]=0;break;case 1:n[0]=s,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=r;break;case 3:n[0]=0,n[1]=s,n[2]=1;break;case 4:n[0]=r,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=s}return[255*(i*n[0]+(e=(1-i)*t)),255*(i*n[1]+e),255*(i*n[2]+e)]},h.hcg.hsv=function(t){var e=t[1]/100,i=e+t[2]/100*(1-e);let n=0<i?e/i:0;return[t[0],100*n,100*i]},h.hcg.hsl=function(t){var e=t[1]/100,i=t[2]/100*(1-e)+.5*e;let n=0;return 0<i&&i<.5?n=e/(2*i):.5<=i&&i<1&&(n=e/(2*(1-i))),[t[0],100*n,100*i]},h.hcg.hwb=function(t){var e=t[1]/100,i=e+t[2]/100*(1-e);return[t[0],100*(i-e),100*(1-i)]},h.hwb.hcg=function(t){var e=t[1]/100,i=1-t[2]/100,e=i-e;let n=e<1?(i-e)/(1-e):0;return[t[0],100*e,100*n]},h.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},h.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},h.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},h.gray.hsl=function(t){return[0,0,t[0]]},h.gray.hsv=h.gray.hsl,h.gray.hwb=function(t){return[0,100,t[0]]},h.gray.cmyk=function(t){return[0,0,0,t[0]]},h.gray.lab=function(t){return[t[0],0,0]},h.gray.hex=function(t){t=255&Math.round(t[0]/100*255),t=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(t.length)+t},h.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},{"color-name":16}],14:[function(t,e,i){const r=t("./conversions"),s=t("./route"),a={};function o(i){function t(...t){var e=t[0];return null==e?e:(1<e.length&&(t=e),i(t))}return"conversion"in i&&(t.conversion=i.conversion),t}function h(n){function t(...t){var e=t[0];if(null==e)return e;1<e.length&&(t=e);var i=n(t);if("object"==typeof i)for(let t=i.length,e=0;e<t;e++)i[e]=Math.round(i[e]);return i}return"conversion"in n&&(t.conversion=n.conversion),t}Object.keys(r).forEach(i=>{a[i]={},Object.defineProperty(a[i],"channels",{value:r[i].channels}),Object.defineProperty(a[i],"labels",{value:r[i].labels});const n=s(i);Object.keys(n).forEach(t=>{var e=n[t];a[i][t]=h(e),a[i][t].raw=o(e)})}),e.exports=a},{"./conversions":13,"./route":15}],15:[function(t,e,i){const h=t("./conversions");function a(t){var i=function(){var i={},n=Object.keys(h);for(let t=n.length,e=0;e<t;e++)i[n[e]]={distance:-1,parent:null};return i}(),n=[t];for(i[t].distance=0;n.length;){var r=n.pop(),s=Object.keys(h[r]);for(let t=s.length,e=0;e<t;e++){var a=s[e],o=i[a];-1===o.distance&&(o.distance=i[r].distance+1,o.parent=r,n.unshift(a))}}return i}function o(t,e){var i=[e[t].parent,t];let n=h[e[t].parent][t],r=e[t].parent;for(;e[r].parent;)i.unshift(e[r].parent),n=function(e,i){return function(t){return i(e(t))}}(h[e[r].parent][r],n),r=e[r].parent;return n.conversion=i,n}e.exports=function(t){var i=a(t),n={},r=Object.keys(i);for(let t=r.length,e=0;e<t;e++){var s=r[e];null!==i[s].parent&&(n[s]=o(s,i))}return n}},{"./conversions":13}],16:[function(t,e,i){"use strict";e.exports={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]}},{}],17:[function(t,e,i){"use strict";var n="object"==typeof Reflect?Reflect:null,h=n&&"function"==typeof n.apply?n.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};var r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)},s=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(o,h){return new Promise(function(t,e){function i(t){o.removeListener(h,n),e(t)}function n(){"function"==typeof o.removeListener&&o.removeListener("error",i),t([].slice.call(arguments))}var r,s,a;m(o,h,n,{once:!0}),"error"!==h&&(s=i,a={once:!0},"function"==typeof(r=o).on)&&m(r,"error",s,a)})},(a.EventEmitter=a).prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function c(t,e,i,n){var r,s;return l(i),void 0===(r=t._events)?(r=t._events=Object.create(null),t._eventsCount=0):(void 0!==r.newListener&&(t.emit("newListener",e,i.listener||i),r=t._events),s=r[e]),void 0===s?(s=r[e]=i,++t._eventsCount):("function"==typeof s?s=r[e]=n?[i,s]:[s,i]:n?s.unshift(i):s.push(i),0<(r=u(t))&&s.length>r&&!s.warned&&(s.warned=!0,(n=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",n.emitter=t,n.type=e,n.count=s.length,i=n,console)&&console.warn&&console.warn(i)),t}function d(t,e,i){t={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},e=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(t);return e.listener=i,t.wrapFn=e}function f(t,e,i){t=t._events;if(void 0===t)return[];t=t[e];if(void 0===t)return[];if("function"==typeof t)return i?[t.listener||t]:[t];if(i){for(var n=t,r=new Array(n.length),s=0;s<r.length;++s)r[s]=n[s].listener||n[s];return r}return g(t,t.length)}function p(t){var e=this._events;if(void 0!==e){e=e[t];if("function"==typeof e)return 1;if(void 0!==e)return e.length}return 0}function g(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}function m(i,n,r,s){if("function"==typeof i.on)s.once?i.once(n,r):i.on(n,r);else{if("function"!=typeof i.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof i);i.addEventListener(n,function t(e){s.once&&i.removeEventListener(n,t),r(e)})}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");o=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return u(this)},a.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var n="error"===t,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){if((s=0<e.length?e[0]:s)instanceof Error)throw s;n=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw n.context=s,n}var s=r[t];if(void 0===s)return!1;if("function"==typeof s)h(s,this,e);else for(var a=s.length,o=g(s,a),i=0;i<a;++i)h(o[i],this,e);return!0},a.prototype.on=a.prototype.addListener=function(t,e){return c(this,t,e,!1)},a.prototype.prependListener=function(t,e){return c(this,t,e,!0)},a.prototype.once=function(t,e){return l(e),this.on(t,d(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return l(e),this.prependListener(t,d(this,t,e)),this},a.prototype.off=a.prototype.removeListener=function(t,e){var i,n,r,s,a;if(l(e),void 0!==(n=this._events)&&void 0!==(i=n[t]))if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(r=-1,s=i.length-1;0<=s;s--)if(i[s]===e||i[s].listener===e){a=i[s].listener,r=s;break}if(r<0)return this;if(0===r)i.shift();else{for(var o=i,h=r;h+1<o.length;h++)o[h]=o[h+1];o.pop()}1===i.length&&(n[t]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",t,a||e)}return this},a.prototype.removeAllListeners=function(t){var e,i=this._events;if(void 0!==i)if(void 0===i.removeListener)0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]);else if(0===arguments.length){for(var n,r=Object.keys(i),s=0;s<r.length;++s)"removeListener"!==(n=r[s])&&this.removeAllListeners(n);this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0}else if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(s=e.length-1;0<=s;s--)this.removeListener(t,e[s]);return this},a.prototype.listeners=function(t){return f(this,t,!0)},a.prototype.rawListeners=function(t){return f(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return 0<this._eventsCount?r(this._events):[]}},{}],18:[function(t,e,i){var n,r=t("http"),s=t("url"),a=e.exports;for(n in r)r.hasOwnProperty(n)&&(a[n]=r[n]);function o(t){if((t="string"==typeof t?s.parse(t):t).protocol||(t.protocol="https:"),"https:"!==t.protocol)throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}a.request=function(t,e){return t=o(t),r.request.call(this,t,e)},a.get=function(t,e){return t=o(t),r.get.call(this,t,e)}},{http:38,url:58}],19:[function(t,e,i){i.read=function(t,e,i,n,r){var s,a,o=8*r-n-1,h=(1<<o)-1,l=h>>1,u=-7,c=i?r-1:0,d=i?-1:1,r=t[e+c];for(c+=d,s=r&(1<<-u)-1,r>>=-u,u+=o;0<u;s=256*s+t[e+c],c+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=n;0<u;a=256*a+t[e+c],c+=d,u-=8);if(0===s)s=1-l;else{if(s===h)return a?NaN:1/0*(r?-1:1);a+=Math.pow(2,n),s-=l}return(r?-1:1)*a*Math.pow(2,s-n)},i.write=function(t,e,i,n,r,s){var a,o,h=8*s-r-1,l=(1<<h)-1,u=l>>1,c=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,f=n?1:-1,s=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(n=Math.pow(2,-a))<1&&(a--,n*=2),2<=(e+=1<=a+u?c/n:c*Math.pow(2,1-u))*n&&(a++,n/=2),l<=a+u?(o=0,a=l):1<=a+u?(o=(e*n-1)*Math.pow(2,r),a+=u):(o=e*Math.pow(2,u-1)*Math.pow(2,r),a=0));8<=r;t[i+d]=255&o,d+=f,o/=256,r-=8);for(a=a<<r|o,h+=r;0<h;t[i+d]=255&a,d+=f,a/=256,h-=8);t[i+d-f]|=128*s}},{}],20:[function(t,e,i){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){var i;e&&(t.super_=e,(i=function(){}).prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t)}},{}],21:[function(t,e,i){e.exports={Renderer:t("./map-fragment/draw/renderer").Renderer,Settings:t("./map-fragment/draw/renderer").Settings,MapReader:t("./map-fragment/reader/MapReader").MapReader}},{"./map-fragment/draw/renderer":23,"./map-fragment/reader/MapReader":25}],22:[function(t,e,i){const n=t("paper"),r=t("../reader/PathFinder")["PathFinder"];function s(t){var e={strokeColor:new n.Color(180/255,93/255,60/255,.9)};return t.closed&&(e.fillColor=new n.Color(new n.Gradient([[t.fillColor,.38],new n.Color(1,1,1)],!1),t.bounds.topCenter,t.bounds.bottomCenter)),e}n.Item.prototype.select=function(t){if(this.mapSelected=!this.mapSelected,this.mapSelected&&void 0!==t){t=t(this);this.orgStyle={};for(const e in t)this.orgStyle[e]=this[e];this.style=t}else this.style=this.orgStyle};e.exports={Controls:class{constructor(t,e,i,n){this.renderer=t,this.reader=e,this.element=i,this.scope=n,this.view=n.view,this.element.onwheel=t=>this.zoom(t),this.activateDrag(),this.renderer.emitter.addEventListener("roomClick",t=>this.selectRoom(t.detail)),this.renderer.emitter.addEventListener("backgroundClick",()=>this.deselectRoom()),this.renderer.emitter.addEventListener("areaArrowClick",t=>this.goToRoomArea(t.detail));t=this.renderer.getBounds();this.view.center=t.center,this.view.zoom=Math.min(this.view.size.width/t.width,this.view.size.height/t.height),this.view.minZoom=this.view.zoom,this.pathFinder=new r(e)}zoom(t){t.preventDefault();var e=this.view.zoom,t=(this.deltaZoom(0<t.deltaY?.9:1.1),this.view.viewToProject(new n.Point(t.offsetX,t.offsetY))),e=e/this.view.zoom,i=t.subtract(this.view.center),t=t.subtract(i.multiply(e)).subtract(this.view.center);this.view.center=this.view.center.add(t)}setZoom(t){this.view.zoom=t,this.view.zoom=Math.min(Math.max(this.view.zoom,this.view.minZoom),50),this.element.dispatchEvent(new CustomEvent("zoom",{detail:this.view}))}deltaZoom(t){this.setZoom(this.view.zoom*t)}activateDrag(){var t=new n.Tool;t.activate(),t.onMouseDrag=t=>{this.toggleOptimizedDrag(!0),this.element.style.cursor="all-scroll";t=t.downPoint.subtract(t.point);this.view.translate(t.negate()),this.isDrag=!0,this.element.dispatchEvent(new CustomEvent("drag",{detail:this.view}))},t.onMouseDown=()=>{this.isDrag=!1,this.element.dispatchEvent(new CustomEvent("drag",{detail:this.view}))},t.onMouseUp=()=>{this.isDrag=!1,this.element.style.cursor="default",this.toggleOptimizedDrag(!1)}}toggleOptimizedDrag(t){this.renderer.settings.optimizeDrag&&(t?this.isDrag||(this.renderer.linkLayer.visible=!1,this.renderer.roomLayer.visible=!1,this.renderer.rasterLayer.visible=!0):(this.renderer.linkLayer.visible=!0,this.renderer.roomLayer.visible=!0,this.renderer.rasterLayer.visible=!1))}selectRoom(t){if(this.isDrag)return!1;this.deselectRoom(),this.renderer.renderPosition(t.id),t.render.select(s),t.exitsRenders.forEach(t=>t.select(s)),this.selected=t,this.element.dispatchEvent(new CustomEvent("roomSelected",{detail:t}))}deselectRoom(){if(this.isDrag)return!1;this.renderer.clearPosition(),this.renderer.clearHighlight(),void 0!==this.selected&&(this.selected.render.select(),this.selected.exitsRenders.forEach(t=>t.select()),delete this.selected,this.element.dispatchEvent(new CustomEvent("roomDeselected")))}centerRoom(t){t=this.renderer.area.getRoomById(t);void 0!==t&&(this.centerOnItem(t.render),this.selectRoom(t))}centerOnItem(t){this.view.center=t.localToGlobal(t.position)}goToRoomArea(t){t=this.reader.getRoomById(t);this.element.dispatchEvent(new CustomEvent("goToArea",{detail:t}))}move(t,e){this.view.scrollBy(new n.Point(50*t,50*e))}renderPath(t,e,i){t=this.pathFinder.path(t,e)?.map(t=>parseInt(t));if(t)return this.renderer.renderPath(t,i)}}}},{"../reader/PathFinder":26,paper:32}],23:[function(t,e,i){const u=t("paper");t("../reader/MapReader").MapReader;const n=t("./controls").Controls,s={OPEN_DOOR:new u.Color(10/255,155/255,10/255),CLOSED_DOOR:new u.Color(226/255,205/255,59/255),LOCKED_DOOR:new u.Color(155/255,10/255,10/255),DEFAULT_BACKGROUND:new u.Color(0,0,0),DEFAULT:new u.Color(1,1,1)};class a{constructor(){this.isRound=!1,this.scale=55,this.roomSize=10,this.exitsSize=2,this.borders=!1,this.frameMode=!1,this.areaName=!0,this.showLabels=!0,this.uniformLevelSize=!1,this.fontFamily="sans-serif",this.mapBackground=s.DEFAULT_BACKGROUND,this.linesColor=s.DEFAULT,this.transparentLabels=!1,this.emboss=!1}}u.Item.prototype.registerClick=function(t){"undefined"!=typeof document&&(this.onClick=t)},u.Item.prototype.pointerReactor=function(t){"undefined"!=typeof document&&(this.onMouseEnter=()=>t.style.cursor="pointer",this.onMouseLeave=()=>t.style.cursor="default")};function c(t,e){for(var i in t)if(t.hasOwnProperty(i)&&t[i]===e)return i}e.exports={Renderer:class{constructor(t,e,i,n,r){this.settings=new a,Object.assign(this.settings,r),this.reader=e,this.area=i,this.colors=n,this.scale=this.settings.scale,this.grideSize=this.settings.gridSize,this.roomSize=this.settings.roomSize,this.roomFactor=this.roomSize/20,this.exitFactor=.01*this.settings.exitsSize,this.roomDiagonal=this.roomFactor*Math.sqrt(2),this.innerExits=["up","down","u","d","in","out","i","u"],this.paper=new u.PaperScope,this.bounds=this.area.getAreaBounds(this.settings.uniformLevelSize),null==t?(t=new u.Size((this.bounds.width+14)*this.scale,(this.bounds.height+14)*this.scale),this.isVisual=!1):(this.isVisual=!0,this.emitter=new EventTarget),this.paper.setup(t),this.element=t,this.backgroundLayer=new u.Layer,this.bgLabels=new u.Layer,this.linkLayer=new u.Layer,this.roomLayer=new u.Layer,this.rasterLayer=new u.Layer,this.labelsLayer=new u.Layer,this.specialLinkLayer=new u.Layer,this.charsLayer=new u.Layer,this.overlayLayer=new u.Layer,this.exitsRendered={},this.defualtColor=new u.Color(this.colors.default[0]/255,this.colors.default[1]/255,this.colors.default[2]/255),this.highlights=new u.Group,this.highlights.locked=!0,this.path=[],this.render()}render(t=!1){this.pngRender=t,this.renderBackground(this.bounds.minX-7,this.bounds.minY-7,this.bounds.maxX+7,this.bounds.maxY+7),this.renderHeader(this.bounds.minX-3.5,this.bounds.maxY+3.5),this.area.rooms.filter(t=>t.z==this.area.zIndex).forEach(t=>{this.renderRoom(t)}),void 0!==this.area.labels&&this.settings.showLabels&&(this.bgLabels.activate(),this.area.labels.filter(t=>t.Z==this.area.zIndex).forEach(t=>this.renderLabel(t),this)),this.matrix=new u.Matrix(1,0,0,-1,7-this.bounds.minX,this.bounds.maxY+7).scale(this.scale,new u.Point(this.bounds.minX,this.bounds.maxY)),this.settings.optimizeDrag&&(this.rasterLayer.activate(),this.linkRaster=this.linkLayer.rasterize({resolution:2e3}),this.roomRaster=this.roomLayer.rasterize({resolution:2e3}),this.rasterLayer.visible=!1),this.transform(),this.isVisual&&(this.controls=new n(this,this.reader,this.element,this.paper),this.element.dispatchEvent(new CustomEvent("renderComplete",{detail:this})))}transform(){let e=+this.scale;this.paper.project.layers.forEach(t=>{t.applyMatrix=!1,t.matrix=new u.Matrix(1,0,0,-1,-this.bounds.minX+e,this.bounds.maxY+e).scale(this.scale,new u.Point(this.bounds.minX,this.bounds.maxY))})}renderBackground(t,e,i,n){this.backgroundLayer.activate();t=new u.Path.Rectangle(new u.Point(t,e),new u.Point(i,n));t.fillColor=new u.Color(this.settings.mapBackground),t.registerClick(()=>{this.emitter.dispatchEvent(new CustomEvent("backgroundClick"))})}renderHeader(t,e){this.settings.areaName&&(this.backgroundLayer.activate(),(t=new u.PointText(t,e)).fillColor=new u.Color(1,1,1,1),t.fontSize=2.5,t.fontFamily=this.settings.fontFamily,t.content=this.area.areaName,t.scale(1,-1))}renderRoom(e){this.roomLayer.activate();let t,i=(t=this.settings.isRound?new u.Path.Circle(new u.Point(e.x+this.roomFactor/2,e.y+this.roomFactor/2),this.roomFactor/2):new u.Path.Rectangle(new u.Point(e.x,e.y),new u.Size(this.roomFactor,this.roomFactor)),this.colors[e.env]);void 0===i&&(i=[114,1,0]);var n,r,s,a,o=new u.Color(i[0]/255,i[1]/255,i[2]/255,1);for(n in t.fillColor=this.settings.frameMode?new u.Color(this.settings.mapBackground):o,t.strokeWidth=this.exitFactor,t.strokeColor=!this.settings.borders||this.settings.frameMode?o:this.settings.linesColor,e.render=t,e.exitsRenders=null!=e.exitsRenders?e.exitsRenders:[],e.exits)this.innerExits.indexOf(n)<=-1?e.exits.hasOwnProperty(n)&&!e.customLines.hasOwnProperty(d(n))&&this.renderLink(e,e.exits[n],n):this.renderInnerExit(e,n);for(r in e.specialExits)e.specialExits.hasOwnProperty(r)&&!e.customLines.hasOwnProperty(r)&&this.renderSpecialLink(e,e.specialExits[r],r);for(s in e.customLines)this.renderCustomLine(e,s,e.exits[l(s)]??e.specialExits[l(s)]);for(a in e.stubs)this.renderStub(e,h[e.stubs[a]]);if(this.settings.emboss){this.overlayLayer.activate();let t;.41<new u.Color(this.settings.linesColor).lightness?(t=new u.Path([e.render.bounds.topLeft,e.render.bounds.topRight,e.render.bounds.bottomRight])).strokeColor="#000000":(t=t=new u.Path([e.render.bounds.topLeft,e.render.bounds.bottomLeft,e.render.bounds.bottomRight])).strokeColor="#ffffff",t.strokeWidth=this.exitFactor}this.renderChar(e),t.pointerReactor(this.element),t.registerClick(()=>{this.emitter.dispatchEvent(new CustomEvent("roomClick",{detail:e}))})}renderLink(n,r,t){var s=new Array(n.id,r).sort().join("#");if(!this.exitsRendered[s]||void 0!==n.doors[d(t)]){this.linkLayer.activate();var a=this.area.getRoomById(r),o=new u.Point(this.getExitX(n.x,t),this.getExitY(n.y,t));let e=new u.Path,i;if(a){var h=c(a.exits,n.id),l=null==h;i=new u.Point(this.getExitX(a.x,h),this.getExitY(a.y,h)),l?this.renderArrow(o,i,this.settings.linesColor,[],this.exitFactor,this.settings.linesColor,!0):(e.moveTo(o),e.lineTo(i),e.strokeWidth=this.exitFactor,e.strokeColor=this.settings.linesColor)}else{i=new u.Point(n.x+this.roomFactor/2,n.y+this.roomFactor/2);let t=this.colors[this.reader.getRoomById(r).env];void 0===t&&(t=[114,1,0]),(e=this.renderArrow(o,i,new u.Color(t[0]/255,t[1]/255,t[2]/255),[],this.exitFactor)).rotate(180,o),e.scale(2),e.pointerReactor(this.element),e.registerClick(()=>this.emitter.dispatchEvent(new CustomEvent("areaArrowClick",{detail:r})))}return void 0!==n.doors[d(t)]&&this.renderDoors(o,i,n.doors[d(t)]),this.exitsRendered[s]=!0,n.exitsRenders.push(e),a&&(a.exitsRenders=null!=a.exitsRenders?a.exitsRenders:[],a.exitsRenders.push(e)),e}}renderSpecialLink(e,t,i){this.linkLayer.activate();let n;var r,s=new u.Point(e.x+this.roomFactor/2,e.y+this.roomFactor/2);let a=this.area.getRoomById(t),o;return a&&0==Object.entries(a.specialExits).filter(t=>t[1]==e.id).filter(t=>Object.keys(a.specialExits).indexOf(-1!=t[0])).length?((n=new u.Path).moveTo(s),r=c(a.exits,e.id),o=new u.Point(this.getExitX(a.x,r),this.getExitY(a.y,r)),n.lineTo(o),n.strokeColor=this.settings.linesColor,n.strokeWidth=this.exitFactor):(o=new u.Point(e.x+this.roomFactor/2,e.y+this.roomFactor/2),(n=this.renderArrow(s,o,this.defualtColor,[],this.exitFactor)).strokeColor=this.settings.linesColor,n.scale(1,s),n.rotate(180,s),n.registerClick(()=>this.emitter.dispatchEvent(new CustomEvent("areaArrowClick",{detail:t})))),e.exitsRenders.push(n),a&&(a.exitsRenders=a.exitsRenders??[],a.exitsRenders.push(n)),n}renderCustomLine(t,i,e){if(void 0===t.customLines[i].points||0!==t.customLines[i].points.length){this.linkLayer.activate();var n=new u.Group,r=new u.Path,s=t.customLines[i].attributes.style,a=("dot line"===s?(r.dashArray=[.05,.05],r.dashOffset=.1):"dash line"===s?r.dashArray=[.4,.2]:"solid line"!==s&&console.log("Brak opisu stylu: "+s),void 0!==t.customLines[i].attributes.color?(s=t.customLines[i].attributes.color,r.strokeColor=new u.Color(s.r/255,s.g/255,s.b/255)):r.strokeColor=this.defualtColor,new u.Point(t.x+this.roomFactor/2,t.y+this.roomFactor/2));if(r.moveTo(a),void 0!==t.customLines[i].points){let e=[];for(var o in t.customLines[i].points.forEach(t=>e.push(t)),e){o=e[o],o=new u.Point(o.x+this.roomFactor/2,o.y+this.roomFactor/2),a=new u.Point(o);r.lineTo(a)}}return n.addChild(r),t.customLines[i].attributes.arrow&&1<r.segments.length&&(s=this.renderArrow(r.segments[r.segments.length-2].point,r.segments[r.segments.length-1].point,r.strokeColor,r.dashArray,this.exitFactor),n.addChild(s)),r.strokeWidth=this.exitFactor,r.orgStrokeColor=r.strokeColor,this.area.getRoomById(e)||(n.registerClick(()=>this.emitter.dispatchEvent(new CustomEvent("areaArrowClick",{detail:e}))),n.pointerReactor(this.element)),t.exitsRenders.push(n),n}}renderArrow(t,e,i,n,r,s,a){var o=e,o=new u.Path.RegularPolygon(o,3,this.roomDiagonal/6),h=(o.position=o.position.add(o.bounds.topCenter.subtract(o.bounds.center)),o.rotate(e.subtract(t).getAngle()+90,e),new u.Path.Line(t,o.bounds.center)),l=new u.Group([h,o]);return l.closed=!0,o.fillColor=i,o.strokeColor=i,o.strokeWidth=this.exitFactor,h.fillColor=s||i,h.strokeColor=s||i,h.dashArray=n,h.strokeWidth=this.exitFactor,a?(o.position=new u.Point(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2),h.dashArray=[.1,.1],l.fillColor=new u.Color(1,0,0),o.scale(1.5)):h.strokeWidth=r,l}renderStub(t,e){this.linkLayer.activate();let i;var n;return-1<this.innerExits.indexOf(e)?i=this.renderInnerExit(t,e,!0):(n=new u.Point(t.x+.5*this.roomFactor,t.y+.5*this.roomFactor),t=new u.Point(this.getExitX(t.x,e),this.getExitY(t.y,e)),(i=new u.Path).moveTo(n),i.lineTo(t),i.pivot=n,i.scale(2),i.position=t,i.strokeWidth=this.exitFactor,i.strokeColor=this.settings.linesColor),i}renderInnerExit(t,e,i=!1){this.labelsLayer.activate();var n,r,s=new u.Group;return"down"!==e&&"d"!=e||s.addChild(this.renderInnerTriangle(t,e,i)),"up"!==e&&"u"!==e||(s.addChild(this.renderInnerTriangle(t,e,i)),s.rotate(180,t.render.bounds.center)),"in"!==e&&"i"!==e||((n=this.renderInnerTriangle(t,e,i)).rotate(90,t.render.bounds.center),n.scale(.4,t.render.bounds.center),n.position.x-=.01,(r=this.renderInnerTriangle(t,e,i)).scale(.4,t.render.bounds.center),r.rotate(270,t.render.bounds.center),r.position.x+=.01,s.addChild(n),s.addChild(r)),"out"!==e&&"o"!==e||((n=this.renderInnerTriangle(t,e,i)).rotate(270,t.render.bounds.center),n.scale(.5,t.render.bounds.rightCenter),n.rotate(180),n.position.x-=.01,(r=this.renderInnerTriangle(t,e,i)).rotate(90,t.render.bounds.center),r.scale(.5,t.render.bounds.leftCenter),r.rotate(180),r.position.x+=.01,s.addChild(n),s.addChild(r)),this.settings.isRound&&s.scale(.8,.8,new u.Point(t.render.bounds.center)),s.locked=!0,s}renderInnerTriangle(t,e,i){var n=new u.Path.RegularPolygon(new u.Point(t.render.bounds.bottomCenter).subtract(new u.Point(0,.2*this.roomFactor)),3,.3*this.roomFactor),r=(n.scale(1.2,.75),this.lightnessDependantColor(t)),i=(n.strokeWidth=this.exitFactor,i||(n.fillColor=new u.Color(r,r,r,.75)),n.strokeColor=new u.Color(r,r,r),t.doors[l(e)]);if(void 0!==i)switch(i){case 1:n.strokeColor=s.OPEN_DOOR;break;case 2:n.strokeColor=s.CLOSED_DOOR;break;default:n.strokeColor=s.LOCKED_DOOR}return n.bringToFront(),n}renderChar(t){var e,i;this.charsLayer.activate(),t.roomChar&&(e=.85*this.roomFactor/t.roomChar.length,i=this.pngRender?t.render.position.x-.1:t.render.position.x,i=new u.PointText(i,t.render.position.y+e/4),t.userData&&void 0!==t.userData["system.fallback_symbol_color"]?i.fillColor=t.userData["system.fallback_symbol_color"]:i.fillColor=this.lightnessDependantColor(t),i.fontSize=e,i.content=t.roomChar,i.justification="center",i.locked=!0,i.scale(1,-1))}renderDoors(t,e,i){this.specialLinkLayer.activate();var n=(t.x+e.x)/2,t=(t.y+e.y)/2,r=new u.Path.Rectangle(n-.5,t-.5,1,1);switch(r.scale(.5*this.roomFactor,r.center),i){case 1:r.strokeColor=s.OPEN_DOOR;break;case 2:r.strokeColor=s.CLOSED_DOOR;break;default:r.strokeColor=s.LOCKED_DOOR}r.strokeWidth=this.exitFactor}renderLabel(t){var e=new u.Path.Rectangle(new u.Point(t.X,t.Y-t.Height),new u.Size(t.Width,t.Height)),e=(this.settings.transparentLabels||(e.fillColor=new u.Color(t.BgColor.r/255,t.BgColor.g/255,t.BgColor.b/255)),new u.PointText(e.bounds.center.add(0,1.2))),i=(e.fillColor=new u.Color(t.FgColor.r/255,t.FgColor.g/255,t.FgColor.b/255),Math.min(.75,t.Width/(t.Text.length/2)));e.fontSize=4,e.content=t.Text,e.fontFamily=this.settings.fontFamily,e.justification="center",e.locked=!0,e.scale(i/4,-i/4)}lightnessDependantColor(t){return.41<t.render.fillColor.lightness?.1:.9}getXMid(t){return t+this.roomFactor/2}getYMid(t){return t+this.roomFactor/2}getExitX(t,e){if(this.settings.isRound)return t+.5*this.roomFactor;switch(e){case"west":case"w":case"northwest":case"nw":case"southwest":case"sw":return t;case"east":case"e":case"northeast":case"ne":case"southeast":case"se":return t+this.roomFactor;default:return t+.5*this.roomFactor}}getExitY(t,e){if(this.settings.isRound)return t+.5*this.roomFactor;switch(e){case"north":case"n":case"northwest":case"nw":case"northeast":case"ne":return t+this.roomFactor;case"south":case"s":case"southwest":case"sw":case"southeast":case"se":return t;default:return t+.5*this.roomFactor}}getRealPoint(t,e){return this.matrix.transform(new u.Point(t,e))}getBounds(){return this.backgroundLayer.getBounds()}renderPosition(t,e){this.clearPosition(),this.overlayLayer.activate();t=this.area.getRoomById(t),t=new u.Shape.Circle(new u.Point(t.x+.5*this.roomFactor,t.y+.5*this.roomFactor),.6*this.roomDiagonal);t.fillColor=new u.Color(.5,.1,.1,.2),t.strokeWidth=5*this.exitFactor,t.shadowColor=new u.Color(1,1,1),t.shadowBlur=12,void 0===e&&(e=[0,.9,.7]),t.strokeColor=new u.Color(e[0],e[1],e[2]),t.dashArray=[.05,.05],this.position=t}clearPosition(){void 0!==this.position&&this.position.remove()}renderSelection(t,e){this.clearSelection(),this.overlayLayer.activate();t=this.area.getRoomById(t),t=new u.Path.Rectangle(new u.Point(t.x-.05,t.y-.05),new u.Size(this.roomFactor+.1,this.roomFactor+.1));t.fillColor=new u.Color(1,1,1,0),t.strokeWidth=this.exitFactor,void 0===e&&(e=[0,.9,.7]),t.strokeColor=new u.Color(e[0],e[1],e[2]),this.selection=t}clearSelection(){void 0!==this.selection&&this.selection.remove()}renderHighlight(t,e){this.overlayLayer.activate();var t=this.area.getRoomById(t),i=new u.Shape.Circle(new u.Point(t.x+.5*this.roomFactor,t.y+.5*this.roomFactor),.6*this.roomDiagonal);i.fillColor=new u.Color(.5,.1,.1,.2),i.strokeWidth=4*this.exitFactor,i.shadowColor=t.render.fillColor,i.shadowBlur=12,void 0===e&&(e=[.4,.9,.3]),i.strokeColor=new u.Color(e[0],e[1],e[2]),i.dashArray=[.1,.1],i.locked=!0,this.highlights.addChild(i)}clearHighlight(){this.highlights.removeChildren()}renderPath(i,n){this.overlayLayer.activate();let r=new u.Group;return i.forEach(t=>{t=this.area.getRoomById(t);if(t&&t.z===this.area.zIndex){let e=new u.Point(t.x+.5*this.roomFactor,t.y+.5*this.roomFactor);Object.values(t.exits).concat(Object.values(t.specialExits)).forEach(t=>{-1<i.indexOf(t)&&(t=this.area.getRoomById(t))&&t.z===this.area.zIndex&&(t=new u.Point(t.x+.5*this.roomFactor,t.y+.5*this.roomFactor),(t=new u.Path.Line(e,t)).strokeWidth=4*this.exitFactor,void 0===n&&(n=[.4,.9,.3]),this.path.push(t),r.addChild(t))})}}),r.strokeColor=new u.Color(n[0],n[1],n[2]),r.locked=!0,r}clearPath(){this.path.forEach(t=>t.remove()),this.path=[]}clear(){this.paper.clear()}exportSvg(t,e){let i="content";if(void 0!==t){var n=this.reader.roomIndex[t];if(void 0===n)throw new Error(`Room ${t} not found.`);i=new u.Rectangle(this.getRealPoint(new u.Point(n.x,n.y)).subtract(e*this.scale),2*e*this.scale,2*e*this.scale)}return this.paper.project.exportSVG({asString:!0,bounds:i})}},Settings:a};let r={north:"n",south:"s",east:"e",west:"w",northeast:"ne",northwest:"nw",southeast:"se",southwest:"sw",up:"u",down:"d",in:"i",out:"o"},h={1:"n",2:"ne",3:"nw",4:"e",5:"w",6:"s",7:"se",8:"sw",9:"u",10:"d",11:"i",12:"o"};function l(t){var e=c(r,t);return void 0!==e?e:t}function d(t){return void 0!==r[t]?r[t]:t}},{"../reader/MapReader":25,"./controls":22,paper:32}],24:[function(t,e,i){e.exports={Area:class r{constructor(t,e,i,n,r,s){this.areaId=parseInt(t),this.areaName=e,this.rooms=[],this.labels=n,i.forEach(t=>this.rooms[t.id]=t),this.levels=s,this.zIndex=r}getAreaBounds(s=!1){if(void 0===this.bounds){let e=9999999999,i=9999999999,n=-9999999999,r=-9999999999;this.rooms.forEach(t=>{!s&&t.z!==this.zIndex||(e=Math.min(e,t.x),i=Math.min(i,t.y),n=Math.max(n,t.x),r=Math.max(r,t.y))}),this.labels.forEach(t=>{!s&&t.Z!==this.zIndex||(e=Math.min(e,t.X),i=Math.min(i,t.Y),n=Math.max(n,t.X+t.Width),r=Math.max(r,t.Y+t.Height))}),this.bounds={minX:e,minY:i,maxX:n,maxY:r}}return this.bounds}getRoomById(t){return this.rooms[t]}getLevels(){return this.levels}getZIndex(){return this.zIndex}limit(t,e){let i={xMin:(t=this.rooms[t]).x-e,xMax:t.x+e,yMin:t.y-e,yMax:t.y+e},n=this.rooms.filter(t=>i.xMin<t.x&&i.xMax>t.x&&i.yMin<t.y&&i.yMax>t.y).map(t=>t.id);return new r(this.areaId,this.areaName,this.rooms.filter(t=>n.includes(t.id)||0<Object.values(t.exits).filter(t=>n.includes(t)).length),this.labels.filter(t=>i.xMin<t.X&&i.xMax>t.X&&i.yMin<t.Y&&i.yMax>t.Y),this.zIndex,this.levels)}}}},{}],25:[function(t,e,i){let a=t("./Area").Area;e.exports={MapReader:class{constructor(t,e){this.mapDataIndex={},this.roomIndex={},this.data=t,this.data.sort(function(t,e){return t.areaName<e.areaName?-1:t.areaName>e.areaName?1:0}),t.forEach((e,t)=>{this.mapDataIndex[e.areaId]=t,e.rooms.forEach(t=>{t.areaId=e.areaId,this.roomIndex[t.id]=t})}),this.colors={},e.forEach(t=>{this.colors[parseInt(t.envId)]=t.colors}),this.colors.default=[255,255,255]}getAreas(){return this.data}getArea(t,e,i){var n=this.data[this.mapDataIndex[t]];let r=new Set,s=new a(t,n.areaName,n.rooms.filter(t=>{r.add(parseInt(t.z));let e=!0;return e=i?i.xMin<t.x&&i.xMax>t.x&&i.yMin<t.y&&i.yMax>t.y:e}),n.labels.filter(t=>{let e=!0;return e=i?i.xMin<t.X&&i.xMax>t.X&&i.yMin<t.Y&&i.yMax>t.Y:e}),e,r);return s=0<n.rooms.length&&!r.has(e)?this.getArea(t,r.values().next().value):s}getAreaProperties(t){return this.data[this.mapDataIndex[t]]}getAreaByRoomId(t,e){t=this.getRoomById(t);if(void 0!==t)return this.getArea(t.areaId,t.z,e)}getColors(){return this.colors}getRoomById(t){return this.roomIndex[t]}}}},{"./Area":24}],26:[function(t,e,i){var{}=t("./MapReader");const n=t("node-dijkstra");e.exports={PathFinder:class{constructor(t){this.route=new n,t.getAreas().forEach(t=>t.rooms.forEach(t=>{var e=Object.values(t.exits).concat(Object.values(t.specialExits)).map(t=>[t,1]);this.route.addNode(t.id.toString(),Object.fromEntries(e))}))}path(t,e){return this.route.path(t.toString(),e.toString())}}}},{"./MapReader":25,"node-dijkstra":27}],27:[function(t,e,i){const u=t("./PriorityQueue"),n=t("./removeDeepFromMap"),r=t("./toDeepMap"),s=t("./validateDeep");e.exports=class{constructor(t){t instanceof Map?(s(t),this.graph=t):this.graph=t?r(t):new Map}addNode(t,e){let i;return i=e instanceof Map?(s(e),e):r(e),this.graph.set(t,i),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=n(this.graph,t),this}path(t,e,i={}){if(!this.graph.size)return i.cost?{path:null,cost:0}:null;const r=new Set,s=new u,a=new Map;let n=[],o=0,h=[];if((h=i.avoid?[].concat(i.avoid):h).includes(t))throw new Error(`Starting node (${t}) cannot be avoided`);if(h.includes(e))throw new Error(`Ending node (${e}) cannot be avoided`);for(s.set(t,0);!s.isEmpty();){const l=s.next();if(l.key===e){o=l.priority;let t=l.key;for(;a.has(t);)n.push(t),t=a.get(t);break}r.add(l.key),(this.graph.get(l.key)||new Map).forEach((t,e)=>{var i,n;return r.has(e)||h.includes(e)?null:s.has(e)?(i=s.get(e).priority,(n=l.priority+t)<i?(a.set(e,l.key),s.set(e,n)):null):(a.set(e,l.key),s.set(e,l.priority+t))})}return n.length?(i.trim?n.shift():n=n.concat([t]),i.reverse||(n=n.reverse()),i.cost?{path:n,cost:o}:n):i.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}}},{"./PriorityQueue":28,"./removeDeepFromMap":29,"./toDeepMap":30,"./validateDeep":31}],28:[function(t,e,i){e.exports=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(e,t){const i=Number(t);if(isNaN(i))throw new TypeError('"priority" must be a number');return this.keys.has(e)?this.queue.map(t=>(t.key===e&&Object.assign(t,{priority:i}),t)):(this.keys.add(e),this.queue.push({key:e,priority:i})),this.sort(),this.queue.length}next(){var t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return Boolean(0===this.queue.length)}has(t){return this.keys.has(t)}get(e){return this.queue.find(t=>t.key===e)}}},{}],29:[function(t,e,i){e.exports=function t(e,i){var n,r,s=new Map;for([n,r]of e)n!==i&&r instanceof Map?s.set(n,t(r,i)):n!==i&&s.set(n,r);return s}},{}],30:[function(t,e,i){e.exports=function n(r){const s=new Map;return Object.keys(r).forEach(t=>{var e,i=r[t];if(null!==i&&"object"==typeof i&&!Array.isArray(i))return s.set(t,n(i));if(e=i,e=Number(e),isNaN(e)||e<=0)throw new Error(`Could not add node at key "${t}", make sure it's a valid node`,i);return s.set(t,Number(i))}),s}},{}],31:[function(t,e,i){e.exports=function i(t){if(!(t instanceof Map))throw new Error("Invalid graph: Expected Map instead found "+typeof t);t.forEach((t,e)=>{if("object"==typeof t&&t instanceof Map)i(t);else if("number"!=typeof t||t<=0)throw new Error(`Values must be numbers greater than 0. Found value ${t} at `+e)})}},{}],32:[function(Bt,jt,t){(function(b,j){var p,s,a,C,k,E,i,T=(b=b||Bt("./node/self.js")).window,I=b.document,z=new function(){function r(t,e){for(var i in this)this.hasOwnProperty(i)&&t.call(e,this[i],i,this)}function i(t,e,i){var n;return t&&((n=d(t,"length"))&&"number"==typeof n.value?o:r).call(t,e,i=i||t),i}var s=/^(statics|enumerable|beans|preserve)$/,t=[],n=t.slice,a=Object.create,d=Object.getOwnPropertyDescriptor,f=Object.defineProperty,o=t.forEach||function(t,e){for(var i=0,n=this.length;i<n;i++)t.call(e,this[i],i,this)},h=Object.assign||function(t){for(var e=1,i=arguments.length;e<i;e++){var n,r=arguments[e];for(n in r)r.hasOwnProperty(n)&&(t[n]=r[n])}return t};function l(a,o,h,l,u){var c={};function t(t,e){var i,n="function"==typeof(e="string"==typeof(e=e||(e=d(o,t))&&(e.get?e:e.value))&&"#"===e[0]?a[e.substring(1)]||e:e),r=e,s=u||n&&!e.base?e&&e.get?t in a:a[t]:null;u&&s||(n&&s&&(e.base=s),n&&!1!==l&&(i=t.match(/^([gs]et|is)(([A-Z])(.*))$/))&&(c[i[3].toLowerCase()+i[4]]=i[2]),r&&!n&&r.get&&"function"==typeof r.get&&p.isPlainObject(r)||(r={value:r,writable:!0}),(d(a,t)||{configurable:!0}).configurable&&(r.configurable=!0,r.enumerable=null!=h?h:!i),f(a,t,r))}if(o){for(var e in o)o.hasOwnProperty(e)&&!s.test(e)&&t(e);for(var e in c){var i=c[e],n=a["set"+i],i=a["get"+i]||n&&a["is"+i];!i||!0!==l&&0!==i.length||t(e,{get:i,set:n})}}return a}function p(){for(var t=0,e=arguments.length;t<e;t++){var i=arguments[t];i&&h(this,i)}return this}return l(p,{inject:function(t){var e,i,n;t&&(e=!0===t.statics?t:t.statics,i=t.beans,n=t.preserve,e!==t&&l(this.prototype,t,t.enumerable,i,n),l(this,e,null,i,n));for(var r=1,s=arguments.length;r<s;r++)this.inject(arguments[r]);return this},extend:function(){for(var t,e,i,n=this,r=0,s=arguments.length;r<s&&(!t||!e);r++)i=arguments[r],t=t||i.initialize,e=e||i.prototype;return e=(t=t||function(){n.apply(this,arguments)}).prototype=e||a(this.prototype),f(e,"constructor",{value:t,writable:!0,configurable:!0}),l(t,this),arguments.length&&this.inject.apply(t,arguments),t.base=n,t}}).inject({enumerable:!1,initialize:p,set:p,inject:function(){for(var t=0,e=arguments.length;t<e;t++){var i=arguments[t];i&&l(this,i,i.enumerable,i.beans,i.preserve)}return this},extend:function(){var t=a(this);return t.inject.apply(t,arguments)},each:function(t,e){return i(this,t,e)},clone:function(){return new this.constructor(this)},statics:{set:h,each:i,create:a,define:f,describe:d,clone:function(t){return h(new t.constructor,t)},isPlainObject:function(t){t=null!=t&&t.constructor;return t&&(t===Object||t===p||"Object"===t.name)},pick:function(t,e){return t!==j?t:e},slice:function(t,e,i){return n.call(t,e,i)}}})},t=(void 0!==jt&&(jt.exports=z),z.inject({enumerable:!1,toString:function(){return null!=this._id?(this._class||"Object")+(this._name?" '"+this._name+"'":" @"+this._id):"{ "+z.each(this,function(t,e){/^_/.test(e)||this.push(e+": "+("number"==(e=typeof t)?w.instance.number(t):"string"==e?"'"+t+"'":t))},[]).join(", ")+" }"},getClassName:function(){return this._class||""},importJSON:function(t){return z.importJSON(t,this)},exportJSON:function(t){return z.exportJSON(this,t)},toJSON:function(){return z.serialize(this)},set:function(t,e){return t&&z.filter(this,t,e,this._prioritize),this}},{beans:!1,statics:{exports:{},extend:function t(){var e=t.base.apply(this,arguments),i=e.prototype._class;return i&&!z.exports[i]&&(z.exports[i]=e),e},equals:function(t,e){if(t===e)return!0;if(t&&t.equals)return t.equals(e);if(e&&e.equals)return e.equals(t);if(t&&e&&"object"==typeof t&&"object"==typeof e){if(Array.isArray(t)&&Array.isArray(e)){if((i=t.length)!==e.length)return!1;for(;i--;)if(!z.equals(t[i],e[i]))return!1}else{var i,n=Object.keys(t);if((i=n.length)!==Object.keys(e).length)return!1;for(;i--;){var r=n[i];if(!e.hasOwnProperty(r)||!z.equals(t[r],e[r]))return!1}}return!0}return!1},read:function(t,e,i,n){var r,s,a,o;return this===z?(r=this.peek(t,e),t.__index++,r):(s=(r=this.prototype)._readIndex,e=e||s&&t.__index||0,a=t.length,n=n||a-e,(o=t[e])instanceof this||i&&i.readNull&&null==o&&n<=1?(s&&(t.__index=e+1),o&&i&&i.clone?o.clone():o):(o=z.create(r),s&&(o.__read=!0),o=o.initialize.apply(o,0<e||e+n<a?z.slice(t,e,e+n):t)||o,s&&(t.__index=e+o.__read,(i=o.__filtered)&&(t.__filtered=i,o.__filtered=j),o.__read=j),o))},peek:function(t,e){return t[t.__index=e||t.__index||0]},remain:function(t){return t.length-(t.__index||0)},readList:function(t,e,i,n){for(var r,s=[],e=e||0,a=n?e+n:t.length,o=e;o<a;o++)s.push(Array.isArray(r=t[o])?this.read(r,0,i):this.read(t,o,i,1));return s},readNamed:function(t,e,i,n,r){var s,a,o=this.getNamed(t,e),h=o!==j;return h&&((a=t.__filtered)||(s=this.getSource(t),(a=t.__filtered=z.create(s)).__unfiltered=s),a[e]=j),this.read(h?[o]:t,i,n,r)},readSupported:function(i,n){var t=this.getSource(i),r=this,s=!1;return t&&Object.keys(t).forEach(function(t){var e;t in n&&((e=r.readNamed(i,t))!==j&&(n[t]=e),s=!0)}),s},getSource:function(t){var e,i=t.__source;return i===j&&(e=1===t.length&&t[0],i=t.__source=e&&z.isPlainObject(e)?e:null),i},getNamed:function(t,e){var i=this.getSource(t);if(i)return e?i[e]:t.__filtered||i},hasNamed:function(t,e){return!!this.getNamed(t,e)},filter:function(i,n,r,t){var s;function e(t){var e;r&&t in r||s&&t in s||(e=n[t])!==j&&(i[t]=e)}if(t){for(var a,o={},h=0,l=t.length;h<l;h++)(a=t[h])in n&&(e(a),o[a]=!0);s=o}return Object.keys(n.__unfiltered||n).forEach(e),i},isPlainValue:function(t,e){return z.isPlainObject(t)||Array.isArray(t)||e&&"string"==typeof t},serialize:function(t,e,i,n){e=e||{};var r=!n;if(r&&(e.formatter=new w(e.precision),n={length:0,definitions:{},references:{},add:function(t,e){var i="#"+t._id,n=this.references[i];return n||(this.length++,e=e.call(t),(t=t._class)&&e[0]!==t&&e.unshift(t),this.definitions[i]=e,n=this.references[i]=[i]),n}}),t&&t._serialize){var s=t._serialize(e,n),a=t._class;!a||t._compactSerialize||!r&&i||s[0]===a||s.unshift(a)}else if(Array.isArray(t)){s=[];for(var o=0,h=t.length;o<h;o++)s[o]=z.serialize(t[o],e,i,n)}else if(z.isPlainObject(t)){s={};for(var l=Object.keys(t),o=0,h=l.length;o<h;o++){var u=l[o];s[u]=z.serialize(t[u],e,i,n)}}else s="number"==typeof t?e.formatter.number(t,e.precision):t;return r&&0<n.length?[["dictionary",n.definitions],s]:s},deserialize:function(t,e,i,n,r){var s=t,a=!i,o=a&&t&&t.length&&"dictionary"===t[0][0];if(i=i||{},Array.isArray(t)){var h=t[0],l="dictionary"===h;if(1==t.length&&/^#/.test(h))return i.dictionary[h];s=[];for(var u,c=(h=z.exports[h])?1:0,d=t.length;c<d;c++)s.push(z.deserialize(t[c],e,i,l,o));h&&(u=s,s=e?e(h,u,a||r):new h(u))}else if(z.isPlainObject(t))for(var f in s={},n&&(i.dictionary=s),t)s[f]=z.deserialize(t[f],e,i);return o?s[1]:s},exportJSON:function(t,e){t=z.serialize(t,e);return e&&0==e.asString?t:JSON.stringify(t)},importJSON:function(t,s){return z.deserialize("string"==typeof t?JSON.parse(t):t,function(t,e,i){var n,i=i&&s&&s.constructor===t,r=i?s:z.create(t.prototype);return!(1===e.length&&r instanceof V)||!i&&r instanceof Z||(n=e[0],z.isPlainObject(n)&&(n.insert=!1,i)&&(e=e.concat([V.INSERT]))),(i?r.set:t).apply(r,e),i&&(s=null),r})},push:function(t,e){var i=e.length;if(i<4096)t.push.apply(t,e);else{var n=t.length;t.length+=i;for(var r=0;r<i;r++)t[n+r]=e[r]}return t},splice:function(t,e,i,n){var r=e&&e.length,s=i===j;(i=s?t.length:i)>t.length&&(i=t.length);for(var a=0;a<r;a++)e[a]._index=i+a;if(s)return z.push(t,e),[];for(var s=[i,n],o=(e&&z.push(s,e),t.splice.apply(t,s)),a=0,h=o.length;a<h;a++)o[a]._index=j;for(a=i+r,h=t.length;a<h;a++)t[a]._index=a;return o},capitalize:function(t){return t.replace(/\b[a-z]/g,function(t){return t.toUpperCase()})},camelize:function(t){return t.replace(/-(.)/g,function(t,e){return e.toUpperCase()})},hyphenate:function(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}}}),{on:function(t,e){var i,n;return"string"!=typeof t?z.each(t,function(t,e){this.on(e,t)},this):(i=(i=this._eventTypes)&&i[t],-1===(n=(n=this._callbacks=this._callbacks||{})[t]=n[t]||[]).indexOf(e)&&(n.push(e),i)&&i.install&&1===n.length&&i.install.call(this,t)),this},off:function(t,e){var i,n;if("string"==typeof t)return i=(i=this._eventTypes)&&i[t],(n=this._callbacks&&this._callbacks[t])&&(!e||-1!==(e=n.indexOf(e))&&1===n.length?(i&&i.uninstall&&i.uninstall.call(this,t),delete this._callbacks[t]):-1!==e&&n.splice(e,1)),this;z.each(t,function(t,e){this.off(e,t)},this)},once:function(e,i){return this.on(e,function t(){i.apply(this,arguments),this.off(e,t)})},emit:function(t,e){if(!(r=this._callbacks&&this._callbacks[t]))return!1;var i=z.slice(arguments,1),n=e&&e.target&&!e.currentTarget,r=r.slice();n&&(e.currentTarget=this);for(var s=0,a=r.length;s<a;s++)if(0==r[s].apply(this,i)){e&&e.stop&&e.stop();break}return n&&delete e.currentTarget,!0},responds:function(t){return!(!this._callbacks||!this._callbacks[t])},attach:"#on",detach:"#off",fire:"#emit",_installEvents:function(t){var e,i=this._eventTypes,n=this._callbacks,r=t?"install":"uninstall";if(i)for(var s in n)0<n[s].length&&(e=(e=i[s])&&e[r])&&e.call(this,s)},statics:{inject:function t(s){var a,e=s._events;return e&&(a={},z.each(e,function(t,e){var i="string"==typeof t,n=i?t:e,e=z.capitalize(n),r=n.substring(2).toLowerCase();a[r]=i?{}:t,n="_"+n,s["get"+e]=function(){return this[n]},s["set"+e]=function(t){var e=this[n];e&&this.off(r,e),t&&this.on(r,t),this[n]=t}}),s._eventTypes=a),t.base.apply(this,arguments)}}}),u=z.extend({_class:"PaperScope",initialize:function t(){(B=this).settings=new z({applyMatrix:!0,insertItems:!0,handleSize:4,hitTolerance:0}),this.project=null,this.projects=[],this.tools=[],this._id=t._id++,t._scopes[this._id]=this;var e,i,s,n=t.prototype;this.support||(e=A.getContext(1,1)||{},n.support={nativeDash:"setLineDash"in e||"mozDash"in e,nativeBlendModes:gt.nativeModes},A.release(e)),this.agent||(e=b.navigator.userAgent.toLowerCase(),i=(/(darwin|win|mac|linux|freebsd|sunos)/.exec(e)||[])[0],s=n.agent=n.browser={platform:n="darwin"===i?"mac":i},n&&(s[n]=!0),e.replace(/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node|jsdom)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g,function(t,e,i,n,r){s.chrome||(n="opera"===e?n:/^(node|trident)$/.test(e)?r:i,s.version=n,s.versionNumber=parseFloat(n),s.name=e={trident:"msie",jsdom:"node"}[e]||e,s[e]=!0)}),s.chrome&&delete s.webkit,s.atom&&delete s.chrome)},version:"0.12.17",getView:function(){var t=this.project;return t&&t._view},getPaper:function(){return this},execute:function(t,e){t=B.PaperScript.execute(t,this,e);return D.updateFocus(),t},install:function(e){var t,i=this;for(t in z.each(["project","view","tool"],function(t){z.define(e,t,{configurable:!0,get:function(){return i[t]}})}),this)!/^_/.test(t)&&this[t]&&(e[t]=this[t])},setup:function(t){return(B=this).project=new h(t),this},createCanvas:function(t,e){return A.getCanvas(t,e)},activate:function(){B=this},clear:function(){for(var t=this.projects,e=this.tools,i=t.length-1;0<=i;i--)t[i].remove();for(i=e.length-1;0<=i;i--)e[i].remove()},remove:function(){this.clear(),delete u._scopes[this._id]},statics:new function(){function t(i){return i+="Attribute",function(t,e){return t[i](e)||t[i]("data-paper-"+e)}}return{_scopes:{},_id:0,get:function(t){return this._scopes[t]||null},getAttribute:t("get"),hasAttribute:t("has")}}}),e=z.extend(t,{initialize:function(t){this._scope=B,this._index=this._scope[this._list].push(this)-1,!t&&this._scope[this._reference]||this.activate()},activate:function(){var t;return!!this._scope&&((t=this._scope[this._reference])&&t!==this&&t.emit("deactivate"),(this._scope[this._reference]=this).emit("activate",t),!0)},isActive:function(){return this._scope[this._reference]===this},remove:function(){return null!=this._index&&(z.splice(this._scope[this._list],null,this._index,1),this._scope[this._reference]==this&&(this._scope[this._reference]=null),!(this._scope=null))},getView:function(){return this._scope.getView()}}),K={findItemBoundsCollisions:function(t,e,i){function n(t){for(var e=new Array(t.length),i=0;i<t.length;i++){var n=t[i].getBounds();e[i]=[n.left,n.top,n.right,n.bottom]}return e}var r=n(t),t=e&&e!==t?n(e):r;return this.findBoundsCollisions(r,t,i||0)},findCurveBoundsCollisions:function(t,e,i,n){function r(t){for(var e=Math.min,i=Math.max,n=new Array(t.length),r=0;r<t.length;r++){var s=t[r];n[r]=[e(s[0],s[2],s[4],s[6]),e(s[1],s[3],s[5],s[7]),i(s[0],s[2],s[4],s[6]),i(s[1],s[3],s[5],s[7])]}return n}var s=r(t),t=e&&e!==t?r(e):s;if(n){for(var a=this.findBoundsCollisions(s,t,i||0,!1,!0),o=this.findBoundsCollisions(s,t,i||0,!0,!0),h=[],l=0,u=a.length;l<u;l++)h[l]={hor:a[l],ver:o[l]};return h}return this.findBoundsCollisions(s,t,i||0)},findBoundsCollisions:function(t,e,i,n,r){var s=!e||t===e,a=s?t:t.concat(e),o=t.length,h=a.length;function l(t,e,i){for(var n=0,r=t.length;n<r;){var s=r+n>>>1;a[t[s]][e]<i?n=1+s:r=s}return n-1}for(var u=n?1:0,c=2+u,d=n?0:1,f=2+d,p=new Array(h),g=0;g<h;g++)p[g]=g;p.sort(function(t,e){return a[t][u]-a[e][u]});for(var m=[],_=new Array(o),g=0;g<h;g++){var v=p[g],y=a[v],b=s?v:v-o,w=v<o,x=s||!w,S=w?[]:null;if(m.length){var C=l(m,c,y[u]-i)+1;if(m.splice(0,C),s&&r)for(var S=S.concat(m),k=0;k<m.length;k++)_[T=m[k]].push(b);else for(var E=y[f],A=y[d],k=0;k<m.length;k++){var T=m[k],I=a[T],L=T<o,P=s||o<=T;(r||(w&&P||x&&L)&&E>=I[d]-i&&A<=I[f]+i)&&(w&&P&&S.push(s?T:T-o),x)&&L&&_[T].push(b)}}w&&(t===e&&S.push(v),_[v]=S),m.length?(C=l(m,c,y[c]),m.splice(C+1,0,v)):m.push(v)}for(g=0;g<_.length;g++){var O=_[g];O&&O.sort(function(t,e){return t-e})}return _}},w=z.extend({initialize:function(t){this.precision=z.pick(t,5),this.multiplier=Math.pow(10,this.precision)},number:function(t){return this.precision<16?Math.round(t*this.multiplier)/this.multiplier:t},pair:function(t,e,i){return this.number(t)+(i||",")+this.number(e)},point:function(t,e){return this.number(t.x)+(e||",")+this.number(t.y)},size:function(t,e){return this.number(t.width)+(e||",")+this.number(t.height)},rectangle:function(t,e){return this.point(t,e)+(e||",")+this.size(t,e)}}),F=(w.instance=new w,new function(){var d=[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],f=[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]],_=Math.abs,v=Math.sqrt,y=Math.pow,e=Math.log2||function(t){return Math.log(t)*Math.LOG2E},b=1e-12,w=112e-18;function x(t,e,i){return t<e?e:i<t?i:t}function u(t,e,i){function n(t){var e=134217729*t,e=t-e+e;return[e,t-e]}var r,s,a=e*e-t*i,o=e*e+t*i;return 3*_(a)<o&&(o=n(t),r=n(e),s=n(i),a=(e=e*e)-(t=t*i)+(r[0]*r[0]-e+2*r[0]*r[1]+r[1]*r[1]-(o[0]*s[0]-t+o[0]*s[1]+o[1]*s[0]+o[1]*s[1]))),a}function S(){var t=Math.max.apply(Math,arguments);return t&&(t<1e-8||1e8<t)?y(2,-Math.round(e(t))):0}return{EPSILON:b,MACHINE_EPSILON:w,CURVETIME_EPSILON:1e-8,GEOMETRIC_EPSILON:1e-7,TRIGONOMETRIC_EPSILON:1e-8,ANGULAR_EPSILON:1e-5,KAPPA:4*(v(2)-1)/3,isZero:function(t){return-b<=t&&t<=b},isMachineZero:function(t){return-w<=t&&t<=w},clamp:x,integrate:function(t,e,i,n){for(var r=d[n-2],s=f[n-2],a=.5*(i-e),o=a+e,h=0,l=n+1>>1,u=1&n?s[h++]*t(o):0;h<l;){var c=a*r[h];u+=s[h++]*(t(o+c)+t(o-c))}return a*u},findRoot:function(t,e,i,n,r,s,a){for(var o=0;o<s;o++){var h=t(i),l=h/e(i),u=i-l;if(_(l)<a){i=u;break}i=0<h?(r=i,u<=n?.5*(n+r):u):(n=i,r<=u?.5*(n+r):u)}return x(i,n,r)},solveQuadratic:function(t,e,i,n,r,s){var a,o=1/0;if(_(t)<b){if(_(e)<b)return _(i)<b?-1:0;a=-i/e}else{var h=u(t,e*=-.5,i);h&&_(h)<w&&(l=S(_(t),_(e),_(i)))&&(h=u(t*=l,e*=l,i*=l)),-w<=h&&(l=h<0?0:v(h),o=0===(h=e+(e<0?-l:l))?-(a=i/t):(a=h/t,i/h))}var e=0,l=null==r,t=r-b,i=s+b;return isFinite(a)&&(l||t<a&&a<i)&&(n[e++]=l?a:x(a,r,s)),o!==a&&isFinite(o)&&(l||t<o&&o<i)&&(n[e++]=l?o:x(o,r,s)),e},solveCubic:function(e,i,n,r,t,s,a){var o,h,l,u,c,d=S(_(e),_(i),_(n),_(r));function f(t){t=e*(o=t);u=(t+(h=t+i))*o+(l=h*o+n),c=l*o+r}if(d&&(e*=d,i*=d,n*=d,r*=d),_(e)<b)e=i,h=n,l=r,o=1/0;else if(_(r)<b)h=i,l=n,o=0;else{f(-i/e/3);var d=c/e,p=y(_(d),1/3),g=d<0?-1:1,d=-u/e,d=0<d?1.324717957244746*Math.max(p,v(d)):p,m=o-g*d;if(m!==o){for(;f(m),g*o<g*(m=0===u?o:o-c/u/(1+w)););_(e)*o*o>_(r/o)&&(h=((l=-r/o)-n)/o)}}p=F.solveQuadratic(e,h,l,t,s,a),d=null==s;return isFinite(o)&&(0===p||0<p&&o!==t[0]&&o!==t[1])&&(d||s-b<o&&o<a+b)&&(t[p++]=d?o:x(o,s,a)),p}}}),o={_id:1,_pools:{},get:function(t){return t?(this._pools[t]||(this._pools[t]={_id:1}))._id++:this._id++}},P=z.extend({_class:"Point",_readIndex:!0,initialize:function(t,e){var i,n=typeof t,r=this.__read,s=0;return"number"==n?(this._set(t,(i="number"==typeof e)?e:t),r&&(s=i?2:1)):"undefined"==n||null===t?(this._set(0,0),r&&(s=null===t?1:0)):(e="string"==n?t.split(/[\s,]+/)||[]:t,s=1,Array.isArray(e)?this._set(+e[0],+(1<e.length?e[1]:e[0])):"x"in e?this._set(e.x||0,e.y||0):"width"in e?this._set(e.width||0,e.height||0):"angle"in e?(this._set(e.length||0,0),this.setAngle(e.angle||0)):(this._set(0,0),s=0)),r&&(this.__read=s),this},set:"#initialize",_set:function(t,e){return this.x=t,this.y=e,this},equals:function(t){return this===t||t&&(this.x===t.x&&this.y===t.y||Array.isArray(t)&&this.x===t[0]&&this.y===t[1])||!1},clone:function(){return new P(this.x,this.y)},toString:function(){var t=w.instance;return"{ x: "+t.number(this.x)+", y: "+t.number(this.y)+" }"},_serialize:function(t){t=t.formatter;return[t.number(this.x),t.number(this.y)]},getLength:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},setLength:function(t){var e;this.isZero()?(e=this._angle||0,this._set(Math.cos(e)*t,Math.sin(e)*t)):(e=t/this.getLength(),F.isZero(e)&&this.getAngle(),this._set(this.x*e,this.y*e))},getAngle:function(){return 180*this.getAngleInRadians.apply(this,arguments)/Math.PI},setAngle:function(t){this.setAngleInRadians.call(this,t*Math.PI/180)},getAngleInDegrees:"#getAngle",setAngleInDegrees:"#setAngle",getAngleInRadians:function(){var t,e;return arguments.length?(e=P.read(arguments),t=this.getLength()*e.getLength(),F.isZero(t)?NaN:(e=this.dot(e)/t,Math.acos(e<-1?-1:1<e?1:e))):this.isZero()?this._angle||0:this._angle=Math.atan2(this.y,this.x)},setAngleInRadians:function(t){var e;this._angle=t,this.isZero()||(e=this.getLength(),this._set(Math.cos(t)*e,Math.sin(t)*e))},getQuadrant:function(){return 0<=this.x?0<=this.y?1:4:0<=this.y?2:3}},{beans:!1,getDirectedAngle:function(){var t=P.read(arguments);return 180*Math.atan2(this.cross(t),this.dot(t))/Math.PI},getDistance:function(){var t=arguments,e=P.read(t),i=e.x-this.x,e=e.y-this.y,i=i*i+e*e;return z.read(t)?i:Math.sqrt(i)},normalize:function(t){t===j&&(t=1);var e=this.getLength(),t=0!==e?t/e:0,e=new P(this.x*t,this.y*t);return 0<=t&&(e._angle=this._angle),e},rotate:function(t,e){if(0===t)return this.clone();t=t*Math.PI/180;var i=e?this.subtract(e):this,n=Math.sin(t),t=Math.cos(t),i=new P(i.x*t-i.y*n,i.x*n+i.y*t);return e?i.add(e):i},transform:function(t){return t?t._transformPoint(this):this},add:function(){var t=P.read(arguments);return new P(this.x+t.x,this.y+t.y)},subtract:function(){var t=P.read(arguments);return new P(this.x-t.x,this.y-t.y)},multiply:function(){var t=P.read(arguments);return new P(this.x*t.x,this.y*t.y)},divide:function(){var t=P.read(arguments);return new P(this.x/t.x,this.y/t.y)},modulo:function(){var t=P.read(arguments);return new P(this.x%t.x,this.y%t.y)},negate:function(){return new P(-this.x,-this.y)},isInside:function(){return x.read(arguments).contains(this)},isClose:function(){var t=arguments,e=P.read(t),t=z.read(t);return this.getDistance(e)<=t},isCollinear:function(){var t=P.read(arguments);return P.isCollinear(this.x,this.y,t.x,t.y)},isColinear:"#isCollinear",isOrthogonal:function(){var t=P.read(arguments);return P.isOrthogonal(this.x,this.y,t.x,t.y)},isZero:function(){var t=F.isZero;return t(this.x)&&t(this.y)},isNaN:function(){return isNaN(this.x)||isNaN(this.y)},isInQuadrant:function(t){return 0<=this.x*(1<t&&t<4?-1:1)&&0<=this.y*(2<t?-1:1)},dot:function(){var t=P.read(arguments);return this.x*t.x+this.y*t.y},cross:function(){var t=P.read(arguments);return this.x*t.y-this.y*t.x},project:function(){var t=P.read(arguments),e=t.isZero()?0:this.dot(t)/t.dot(t);return new P(t.x*e,t.y*e)},statics:{min:function(){var t=arguments,e=P.read(t),t=P.read(t);return new P(Math.min(e.x,t.x),Math.min(e.y,t.y))},max:function(){var t=arguments,e=P.read(t),t=P.read(t);return new P(Math.max(e.x,t.x),Math.max(e.y,t.y))},random:function(){return new P(Math.random(),Math.random())},isCollinear:function(t,e,i,n){return Math.abs(t*n-e*i)<=1e-8*Math.sqrt((t*t+e*e)*(i*i+n*n))},isOrthogonal:function(t,e,i,n){return Math.abs(t*i+e*n)<=1e-8*Math.sqrt((t*t+e*e)*(i*i+n*n))}}},z.each(["round","ceil","floor","abs"],function(t){var e=Math[t];this[t]=function(){return new P(e(this.x),e(this.y))}},{})),l=P.extend({initialize:function(t,e,i,n){this._x=t,this._y=e,this._owner=i,this._setter=n},_set:function(t,e,i){return this._x=t,this._y=e,i||this._owner[this._setter](this),this},getX:function(){return this._x},setX:function(t){this._x=t,this._owner[this._setter](this)},getY:function(){return this._y},setY:function(t){this._y=t,this._owner[this._setter](this)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(t){this._owner._changeSelection(this._getSelection(),t)},_getSelection:function(){return"setPosition"===this._setter?4:0}}),O=z.extend({_class:"Size",_readIndex:!0,initialize:function(t,e){var i,n=typeof t,r=this.__read,s=0;return"number"==n?(this._set(t,(i="number"==typeof e)?e:t),r&&(s=i?2:1)):"undefined"==n||null===t?(this._set(0,0),r&&(s=null===t?1:0)):(e="string"==n?t.split(/[\s,]+/)||[]:t,s=1,Array.isArray(e)?this._set(+e[0],+(1<e.length?e[1]:e[0])):"width"in e?this._set(e.width||0,e.height||0):"x"in e?this._set(e.x||0,e.y||0):(this._set(0,0),s=0)),r&&(this.__read=s),this},set:"#initialize",_set:function(t,e){return this.width=t,this.height=e,this},equals:function(t){return t===this||t&&(this.width===t.width&&this.height===t.height||Array.isArray(t)&&this.width===t[0]&&this.height===t[1])||!1},clone:function(){return new O(this.width,this.height)},toString:function(){var t=w.instance;return"{ width: "+t.number(this.width)+", height: "+t.number(this.height)+" }"},_serialize:function(t){t=t.formatter;return[t.number(this.width),t.number(this.height)]},add:function(){var t=O.read(arguments);return new O(this.width+t.width,this.height+t.height)},subtract:function(){var t=O.read(arguments);return new O(this.width-t.width,this.height-t.height)},multiply:function(){var t=O.read(arguments);return new O(this.width*t.width,this.height*t.height)},divide:function(){var t=O.read(arguments);return new O(this.width/t.width,this.height/t.height)},modulo:function(){var t=O.read(arguments);return new O(this.width%t.width,this.height%t.height)},negate:function(){return new O(-this.width,-this.height)},isZero:function(){var t=F.isZero;return t(this.width)&&t(this.height)},isNaN:function(){return isNaN(this.width)||isNaN(this.height)},statics:{min:function(t,e){return new O(Math.min(t.width,e.width),Math.min(t.height,e.height))},max:function(t,e){return new O(Math.max(t.width,e.width),Math.max(t.height,e.height))},random:function(){return new O(Math.random(),Math.random())}}},z.each(["round","ceil","floor","abs"],function(t){var e=Math[t];this[t]=function(){return new O(e(this.width),e(this.height))}},{})),n=O.extend({initialize:function(t,e,i,n){this._width=t,this._height=e,this._owner=i,this._setter=n},_set:function(t,e,i){return this._width=t,this._height=e,i||this._owner[this._setter](this),this},getWidth:function(){return this._width},setWidth:function(t){this._width=t,this._owner[this._setter](this)},getHeight:function(){return this._height},setHeight:function(t){this._height=t,this._owner[this._setter](this)}}),x=z.extend({_class:"Rectangle",_readIndex:!0,beans:!0,initialize:function(t,e,i,n){var r,s,a,o,h=arguments,l=typeof t,u=("number"==l?(this._set(t,e,i,n),r=4):"undefined"==l||null===t?(this._set(0,0,0,0),r=null===t?1:0):1===h.length&&(Array.isArray(t)?(this._set.apply(this,t),r=1):t.x!==j||t.width!==j?(this._set(t.x||0,t.y||0,t.width||0,t.height||0),r=1):t.from===j&&t.to===j&&(this._set(0,0,0,0),z.readSupported(h,this))&&(r=1)),r===j&&(l=P.readNamed(h,"from"),u=z.peek(h),s=l.x,l=l.y,u&&u.x!==j||z.hasNamed(h,"to")?(a=(u=P.readNamed(h,"to")).x-s,o=u.y-l,a<0&&(s=u.x,a=-a),o<0&&(l=u.y,o=-o)):(a=(u=O.read(h)).width,o=u.height),this._set(s,l,a,o),r=h.__index),h.__filtered);return u&&(this.__filtered=u),this.__read&&(this.__read=r),this},set:"#initialize",_set:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},clone:function(){return new x(this.x,this.y,this.width,this.height)},equals:function(t){var e=z.isPlainValue(t)?x.read(arguments):t;return e===this||e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height||!1},toString:function(){var t=w.instance;return"{ x: "+t.number(this.x)+", y: "+t.number(this.y)+", width: "+t.number(this.width)+", height: "+t.number(this.height)+" }"},_serialize:function(t){t=t.formatter;return[t.number(this.x),t.number(this.y),t.number(this.width),t.number(this.height)]},getPoint:function(t){return new(t?P:l)(this.x,this.y,this,"setPoint")},setPoint:function(){var t=P.read(arguments);this.x=t.x,this.y=t.y},getSize:function(t){return new(t?O:n)(this.width,this.height,this,"setSize")},_fw:1,_fh:1,setSize:function(){var t=O.read(arguments),e=this._sx,i=this._sy,n=t.width,t=t.height;e&&(this.x+=(this.width-n)*e),i&&(this.y+=(this.height-t)*i),this.width=n,this.height=t,this._fw=this._fh=1},getLeft:function(){return this.x},setLeft:function(t){var e;this._fw||(e=t-this.x,this.width-=.5===this._sx?2*e:e),this.x=t,this._sx=this._fw=0},getTop:function(){return this.y},setTop:function(t){var e;this._fh||(e=t-this.y,this.height-=.5===this._sy?2*e:e),this.y=t,this._sy=this._fh=0},getRight:function(){return this.x+this.width},setRight:function(t){var e;this._fw||(e=t-this.x,this.width=.5===this._sx?2*e:e),this.x=t-this.width,this._sx=1,this._fw=0},getBottom:function(){return this.y+this.height},setBottom:function(t){var e;this._fh||(e=t-this.y,this.height=.5===this._sy?2*e:e),this.y=t-this.height,this._sy=1,this._fh=0},getCenterX:function(){return this.x+this.width/2},setCenterX:function(t){this._fw||.5===this._sx?this.x=t-this.width/2:(this._sx&&(this.x+=2*(t-this.x)*this._sx),this.width=2*(t-this.x)),this._sx=.5,this._fw=0},getCenterY:function(){return this.y+this.height/2},setCenterY:function(t){this._fh||.5===this._sy?this.y=t-this.height/2:(this._sy&&(this.y+=2*(t-this.y)*this._sy),this.height=2*(t-this.y)),this._sy=.5,this._fh=0},getCenter:function(t){return new(t?P:l)(this.getCenterX(),this.getCenterY(),this,"setCenter")},setCenter:function(){var t=P.read(arguments);return this.setCenterX(t.x),this.setCenterY(t.y),this},getArea:function(){return this.width*this.height},isEmpty:function(){return 0===this.width||0===this.height},contains:function(t){return t&&t.width!==j||4===(Array.isArray(t)?t:arguments).length?this._containsRectangle(x.read(arguments)):this._containsPoint(P.read(arguments))},_containsPoint:function(t){var e=t.x,t=t.y;return e>=this.x&&t>=this.y&&e<=this.x+this.width&&t<=this.y+this.height},_containsRectangle:function(t){var e=t.x,i=t.y;return e>=this.x&&i>=this.y&&e+t.width<=this.x+this.width&&i+t.height<=this.y+this.height},intersects:function(){var t=x.read(arguments),e=z.read(arguments)||0;return t.x+t.width>this.x-e&&t.y+t.height>this.y-e&&t.x<this.x+this.width+e&&t.y<this.y+this.height+e},intersect:function(){var t=x.read(arguments),e=Math.max(this.x,t.x),i=Math.max(this.y,t.y),n=Math.min(this.x+this.width,t.x+t.width),t=Math.min(this.y+this.height,t.y+t.height);return new x(e,i,n-e,t-i)},unite:function(){var t=x.read(arguments),e=Math.min(this.x,t.x),i=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width),t=Math.max(this.y+this.height,t.y+t.height);return new x(e,i,n-e,t-i)},include:function(){var t=P.read(arguments),e=Math.min(this.x,t.x),i=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x),t=Math.max(this.y+this.height,t.y);return new x(e,i,n-e,t-i)},expand:function(){var t=O.read(arguments),e=t.width,t=t.height;return new x(this.x-e/2,this.y-t/2,this.width+e,this.height+t)},scale:function(t,e){return this.expand(this.width*t-this.width,this.height*(e===j?t:e)-this.height)}},z.each([["Top","Left"],["Top","Right"],["Bottom","Left"],["Bottom","Right"],["Left","Center"],["Top","Center"],["Right","Center"],["Bottom","Center"]],function(t,e){var i=t.join(""),n=/^[RL]/.test(i),e=(4<=e&&(t[1]+=n?"Y":"X"),t[n?0:1]),t=t[n?1:0],r="get"+e,s="get"+t,a="set"+e,o="set"+t,h="set"+i;this["get"+i]=function(t){return new(t?P:l)(this[r](),this[s](),this,h)},this[h]=function(){var t=P.read(arguments);this[a](t.x),this[o](t.y)}},{beans:!0})),r=x.extend({initialize:function(t,e,i,n,r,s){this._set(t,e,i,n,!0),this._owner=r,this._setter=s},_set:function(t,e,i,n,r){return this._x=t,this._y=e,this._width=i,this._height=n,r||this._owner[this._setter](this),this}},new function(){var i=x.prototype;return z.each(["x","y","width","height"],function(t){var e=z.capitalize(t),i="_"+t;this["get"+e]=function(){return this[i]},this["set"+e]=function(t){this[i]=t,this._dontNotify||this._owner[this._setter](this)}},z.each(["Point","Size","Center","Left","Top","Right","Bottom","CenterX","CenterY","TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],function(t){var e="set"+t;this[e]=function(){this._dontNotify=!0,i[e].apply(this,arguments),this._dontNotify=!1,this._owner[this._setter](this)}},{isSelected:function(){return!!(2&this._owner._selection)},setSelected:function(t){var e=this._owner;e._changeSelection&&e._changeSelection(2,t)}}))}),M=z.extend({_class:"Matrix",initialize:function t(e,i){var n=arguments,r=n.length,s=!0;if(6<=r?this._set.apply(this,n):1===r||2===r?e instanceof t?this._set(e._a,e._b,e._c,e._d,e._tx,e._ty,i):Array.isArray(e)?this._set.apply(this,i?e.concat([i]):e):s=!1:r?s=!1:this.reset(),s)return this;throw new Error("Unsupported matrix parameters")},set:"#initialize",_set:function(t,e,i,n,r,s,a){return this._a=t,this._b=e,this._c=i,this._d=n,this._tx=r,this._ty=s,a||this._changed(),this},_serialize:function(t,e){return z.serialize(this.getValues(),t,!0,e)},_changed:function(){var t=this._owner;t&&(t._applyMatrix?t.transform(null,!0):t._changed(25))},clone:function(){return new M(this._a,this._b,this._c,this._d,this._tx,this._ty)},equals:function(t){return t===this||t&&this._a===t._a&&this._b===t._b&&this._c===t._c&&this._d===t._d&&this._tx===t._tx&&this._ty===t._ty},toString:function(){var t=w.instance;return"[["+[t.number(this._a),t.number(this._c),t.number(this._tx)].join(", ")+"], ["+[t.number(this._b),t.number(this._d),t.number(this._ty)].join(", ")+"]]"},reset:function(t){return this._a=this._d=1,this._b=this._c=this._tx=this._ty=0,t||this._changed(),this},apply:function(t,e){var i=this._owner;return!!i&&(i.transform(null,z.pick(t,!0),e),this.isIdentity())},translate:function(){var t=P.read(arguments),e=t.x,t=t.y;return this._tx+=e*this._a+t*this._c,this._ty+=e*this._b+t*this._d,this._changed(),this},scale:function(){var t=arguments,e=P.read(t),t=P.read(t,0,{readNull:!0});return t&&this.translate(t),this._a*=e.x,this._b*=e.x,this._c*=e.y,this._d*=e.y,t&&this.translate(t.negate()),this._changed(),this},rotate:function(t){t*=Math.PI/180;var e=P.read(arguments,1),i=e.x,e=e.y,n=Math.cos(t),r=Math.sin(t),s=i-i*n+e*r,i=e-i*r-e*n,e=this._a,a=this._b,o=this._c,h=this._d;return this._a=n*e+r*o,this._b=n*a+r*h,this._c=-r*e+n*o,this._d=-r*a+n*h,this._tx+=s*e+i*o,this._ty+=s*a+i*h,this._changed(),this},shear:function(){var t=arguments,e=P.read(t),t=P.read(t,0,{readNull:!0}),i=(t&&this.translate(t),this._a),n=this._b;return this._a+=e.y*this._c,this._b+=e.y*this._d,this._c+=e.x*i,this._d+=e.x*n,t&&this.translate(t.negate()),this._changed(),this},skew:function(){var t=arguments,e=P.read(t),t=P.read(t,0,{readNull:!0}),i=Math.PI/180,e=new P(Math.tan(e.x*i),Math.tan(e.y*i));return this.shear(e,t)},append:function(t,e){var i,n,r,s,a,o,h,l,u;return t&&(i=this._a,n=this._b,r=this._c,s=this._d,a=t._a,o=t._c,h=t._b,l=t._d,u=t._tx,t=t._ty,this._a=a*i+h*r,this._c=o*i+l*r,this._b=a*n+h*s,this._d=o*n+l*s,this._tx+=u*i+t*r,this._ty+=u*n+t*s,e||this._changed()),this},prepend:function(t,e){var i,n,r,s,a,o,h,l,u,c,d;return t&&(i=this._a,n=this._b,r=this._c,s=this._d,a=this._tx,o=this._ty,h=t._a,l=t._c,u=t._b,c=t._d,d=t._tx,t=t._ty,this._a=h*i+l*n,this._c=h*r+l*s,this._b=u*i+c*n,this._d=u*r+c*s,this._tx=h*a+l*o+d,this._ty=u*a+c*o+t,e||this._changed()),this},appended:function(t){return this.clone().append(t)},prepended:function(t){return this.clone().prepend(t)},invert:function(){var t=this._a,e=this._b,i=this._c,n=this._d,r=this._tx,s=this._ty,a=t*n-e*i,o=null;return a&&!isNaN(a)&&isFinite(r)&&isFinite(s)&&(this._a=n/a,this._b=-e/a,this._c=-i/a,this._d=t/a,this._tx=(i*s-n*r)/a,this._ty=(e*r-t*s)/a,o=this),o},inverted:function(){return this.clone().invert()},concatenate:"#append",preConcatenate:"#prepend",chain:"#appended",_shiftless:function(){return new M(this._a,this._b,this._c,this._d,0,0)},_orNullIfIdentity:function(){return this.isIdentity()?null:this},isIdentity:function(){return 1===this._a&&0===this._b&&0===this._c&&1===this._d&&0===this._tx&&0===this._ty},isInvertible:function(){var t=this._a*this._d-this._c*this._b;return t&&!isNaN(t)&&isFinite(this._tx)&&isFinite(this._ty)},isSingular:function(){return!this.isInvertible()},transform:function(t,e,i){return arguments.length<3?this._transformPoint(P.read(arguments)):this._transformCoordinates(t,e,i)},_transformPoint:function(t,e,i){var n=t.x,t=t.y;return(e=e||new P)._set(n*this._a+t*this._c+this._tx,n*this._b+t*this._d+this._ty,i)},_transformCoordinates:function(t,e,i){for(var n=0,r=2*i;n<r;n+=2){var s=t[n],a=t[n+1];e[n]=s*this._a+a*this._c+this._tx,e[n+1]=s*this._b+a*this._d+this._ty}return e},_transformCorners:function(t){var e=t.x,i=t.y,n=e+t.width,t=i+t.height,i=[e,i,n,i,n,t,e,t];return this._transformCoordinates(i,i,4)},_transformBounds:function(t,e,i){for(var n=this._transformCorners(t),r=n.slice(0,2),s=r.slice(),a=2;a<8;a++){var o=n[a],h=1&a;o<r[h]?r[h]=o:o>s[h]&&(s[h]=o)}return(e=e||new x)._set(r[0],r[1],s[0]-r[0],s[1]-r[1],i)},inverseTransform:function(){return this._inverseTransform(P.read(arguments))},_inverseTransform:function(t,e,i){var n=this._a,r=this._b,s=this._c,a=this._d,o=this._tx,h=this._ty,l=n*a-r*s,u=null;return l&&!isNaN(l)&&isFinite(o)&&isFinite(h)&&(o=t.x-this._tx,h=t.y-this._ty,u=(e=e||new P)._set((o*a-h*s)/l,(h*n-o*r)/l,i)),u},decompose:function(){var t,e,i,n=this._a,r=this._b,s=this._c,a=this._d,o=n*a-r*s,h=Math.sqrt,l=Math.atan2,u=180/Math.PI;return h=0!==n||0!==r?(i=h(n*n+r*r),t=Math.acos(n/i)*(0<r?1:-1),e=[i,o/i],[l(n*s+r*a,i*i),0]):0!==s||0!==a?(i=h(s*s+a*a),t=Math.asin(s/i)*(0<a?1:-1),e=[o/i,i],[0,l(n*s+r*a,i*i)]):e=[t=0,0],{translation:this.getTranslation(),rotation:t*u,scaling:new P(e),skewing:new P(h[0]*u,h[1]*u)}},getValues:function(){return[this._a,this._b,this._c,this._d,this._tx,this._ty]},getTranslation:function(){return new P(this._tx,this._ty)},getScaling:function(){return this.decompose().scaling},getRotation:function(){return this.decompose().rotation},applyToContext:function(t){this.isIdentity()||t.transform(this._a,this._b,this._c,this._d,this._tx,this._ty)}},z.each(["a","b","c","d","tx","ty"],function(t){var e=z.capitalize(t),i="_"+t;this["get"+e]=function(){return this[i]},this["set"+e]=function(t){this[i]=t,this._changed()}},{})),N=z.extend({_class:"Line",initialize:function(t,e,i,n,r){(4<=arguments.length?(this._px=t,this._py=e,this._vx=i,this._vy=n,r):(this._px=t.x,this._py=t.y,this._vx=e.x,this._vy=e.y,i))||(this._vx-=this._px,this._vy-=this._py)},getPoint:function(){return new P(this._px,this._py)},getVector:function(){return new P(this._vx,this._vy)},getLength:function(){return this.getVector().getLength()},intersect:function(t,e){return N.intersect(this._px,this._py,this._vx,this._vy,t._px,t._py,t._vx,t._vy,!0,e)},getSide:function(t,e){return N.getSide(this._px,this._py,this._vx,this._vy,t.x,t.y,!0,e)},getDistance:function(t){return Math.abs(this.getSignedDistance(t))},getSignedDistance:function(t){return N.getSignedDistance(this._px,this._py,this._vx,this._vy,t.x,t.y,!0)},isCollinear:function(t){return P.isCollinear(this._vx,this._vy,t._vx,t._vy)},isOrthogonal:function(t){return P.isOrthogonal(this._vx,this._vy,t._vx,t._vy)},statics:{intersect:function(t,e,i,n,r,s,a,o,h,l){h||(i-=t,n-=e,a-=r,o-=s);h=i*o-n*a;if(!F.isMachineZero(h)){r=t-r,s=e-s,a=(a*s-o*r)/h,o=(i*s-n*r)/h;if(l||-1e-12<a&&a<1+1e-12&&-1e-12<o&&o<1+1e-12)return new P(t+(a=l?a:a<=0?0:1<=a?1:a)*i,e+a*n)}},getSide:function(t,e,i,n,r,s,a,o){a||(i-=t,n-=e);a=r-t,r=a*n-(s-e)*i;return(r=!o&&F.isMachineZero(r)&&0<=(r=(a*i+a*i)/(i*i+n*n))&&r<=1?0:r)<0?-1:0<r?1:0},getSignedDistance:function(t,e,i,n,r,s,a){return a||(i-=t,n-=e),0===i?0<n?r-t:t-r:0===n?i<0?s-e:e-s:((r-t)*n-(s-e)*i)/(i<n?n*Math.sqrt(1+i*i/(n*n)):i*Math.sqrt(1+n*n/(i*i)))},getDistance:function(t,e,i,n,r,s,a){return Math.abs(N.getSignedDistance(t,e,i,n,r,s,a))}}}),h=e.extend({_class:"Project",_list:"projects",_reference:"project",_compactSerialize:!0,initialize:function(t){e.call(this,!0),this._children=[],this._namedChildren={},this._activeLayer=null,this._currentStyle=new st(null,null,this),this._view=D.create(this,t||A.getCanvas(1,1)),this._selectionItems={},this._selectionCount=0,this._updateVersion=0},_serialize:function(t,e){return z.serialize(this._children,t,!0,e)},_changed:function(t,e){1&t&&(s=this._view)&&(s._needsUpdate=!0,!s._requested)&&s._autoUpdate&&s.requestUpdate();var i,n,r,s=this._changes;s&&e&&((r=(i=this._changesById)[n=e._id])?r.flags|=t:s.push(i[n]={item:e,flags:t}))},clear:function(){for(var t=this._children,e=t.length-1;0<=e;e--)t[e].remove()},isEmpty:function(){return!this._children.length},remove:function t(){return!!t.base.call(this)&&(this._view&&this._view.remove(),!0)},getView:function(){return this._view},getCurrentStyle:function(){return this._currentStyle},setCurrentStyle:function(t){this._currentStyle.set(t)},getIndex:function(){return this._index},getOptions:function(){return this._scope.settings},getLayers:function(){return this._children},getActiveLayer:function(){return this._activeLayer||new Z({project:this,insert:!0})},getSymbolDefinitions:function(){var i=[],n={};return this.getItems({class:Y,match:function(t){var t=t._definition,e=t._id;return n[e]||(n[e]=!0,i.push(t)),!1}}),i},getSymbols:"getSymbolDefinitions",getSelectedItems:function(){var t,e=this._selectionItems,i=[];for(t in e){var n=e[t],r=n._selection;1&r&&n.isInserted()?i.push(n):r||this._updateSelection(n)}return i},_updateSelection:function(t){var e=t._id,i=this._selectionItems;t._selection?i[e]!==t&&(this._selectionCount++,i[e]=t):i[e]===t&&(this._selectionCount--,delete i[e])},selectAll:function(){for(var t=this._children,e=0,i=t.length;e<i;e++)t[e].setFullySelected(!0)},deselectAll:function(){var t,e=this._selectionItems;for(t in e)e[t].setFullySelected(!1)},addLayer:function(t){return this.insertLayer(j,t)},insertLayer:function(t,e){return e instanceof Z?(e._remove(!1,!0),z.splice(this._children,[e],t,0),e._setProject(this,!0),(t=e._name)&&e.setName(t),this._changes&&e._changed(5),this._activeLayer||(this._activeLayer=e)):e=null,e},_insertItem:function(t,e,i){return e=this.insertLayer(t,e)||(this._activeLayer||this._insertItem(j,new Z(V.NO_INSERT),!0)).insertChild(t,e),i&&e.activate&&e.activate(),e},getItems:function(t){return V._getItems(this,t)},getItem:function(t){return V._getItems(this,t,null,null,!0)[0]||null},importJSON:function(t){this.activate();var e=this._activeLayer;return z.importJSON(t,e&&e.isEmpty()&&e)},removeOn:function(t){var e=this._removeSets;if(e){"mouseup"===t&&(e.mousedrag=null);var i=e[t];if(i){for(var n in i){var r,s=i[n];for(r in e){var a=e[r];a&&a!=i&&delete a[s._id]}s.remove()}e[t]=null}}},draw:function(t,e,i){this._updateVersion++,t.save(),e.applyToContext(t);for(var n=this._children,r=new z({offset:new P(0,0),pixelRatio:i,viewMatrix:e.isIdentity()?null:e,matrices:[new M],updateMatrix:!0}),s=0,a=n.length;s<a;s++)n[s].draw(t,r);if(t.restore(),0<this._selectionCount){t.save(),t.strokeWidth=1;var o,h=this._selectionItems,l=this._scope.settings.handleSize,u=this._updateVersion;for(o in h)h[o]._drawSelection(t,e,l,h,u);t.restore()}}}),V=z.extend(t,{statics:{extend:function t(e){return e._serializeFields&&(e._serializeFields=z.set({},this.prototype._serializeFields,e._serializeFields)),t.base.apply(this,arguments)},INSERT:{insert:!0},NO_INSERT:{insert:!1}},_class:"Item",_name:null,_applyMatrix:!0,_canApplyMatrix:!0,_canScaleStroke:!1,_pivot:null,_visible:!0,_blendMode:"normal",_opacity:1,_locked:!1,_guide:!1,_clipMask:!1,_selection:0,_selectBounds:!0,_selectChildren:!1,_serializeFields:{name:null,applyMatrix:null,matrix:new M,pivot:null,visible:!0,blendMode:"normal",opacity:1,locked:!1,guide:!1,clipMask:!1,selected:!1,data:{}},_prioritize:["applyMatrix"]},new function(){var t=["onMouseDown","onMouseUp","onMouseDrag","onClick","onDoubleClick","onMouseMove","onMouseEnter","onMouseLeave"];return z.each(t,function(t){this._events[t]={install:function(t){this.getView()._countItemEvent(t,1)},uninstall:function(t){this.getView()._countItemEvent(t,-1)}}},{_events:{onFrame:{install:function(){this.getView()._animateItem(this,!0)},uninstall:function(){this.getView()._animateItem(this,!1)}},onLoad:{},onError:{}},statics:{_itemHandlers:t}})},{initialize:function(){},_initialize:function(t,e){var i=t&&z.isPlainObject(t),n=i&&!0===t.internal,r=this._matrix=new M,s=i&&t.project||B.project,a=B.settings;return this._id=n?null:o.get(),this._parent=this._index=null,this._applyMatrix=this._canApplyMatrix&&a.applyMatrix,e&&r.translate(e),(r._owner=this)._style=new st(s._currentStyle,this,s),n||i&&0==t.insert||!a.insertItems&&(!i||1!=t.insert)?this._setProject(s):(i&&t.parent||s)._insertItem(j,this,!0),i&&t!==V.NO_INSERT&&t!==V.INSERT&&this.set(t,{internal:!0,insert:!0,project:!0,parent:!0}),i},_serialize:function(n,r){var s={},a=this;function t(t){for(var e in t){var i=a[e];z.equals(i,"leading"===e?1.2*t.fontSize:t[e])||(s[e]=z.serialize(i,n,"data"!==e,r))}}return t(this._serializeFields),this instanceof g||t(this._style._defaults),[this._class,s]},_changed:function(t){var e=this._symbol,i=this._parent||e,n=this._project;8&t&&(this._bounds=this._position=this._decomposed=j),16&t&&(this._globalMatrix=j),i&&72&t&&V._clearBoundsCache(i),2&t&&V._clearBoundsCache(this),n&&n._changed(t,this),e&&e._changed(t)},getId:function(){return this._id},getName:function(){return this._name},setName:function(t){if(this._name&&this._removeNamed(),t===+t+"")throw new Error("Names consisting only of numbers are not supported.");var e,i=this._getOwner();t&&i&&(e=i._children,((i=i._namedChildren)[t]=i[t]||[]).push(this),t in e||(e[t]=this)),this._name=t||j,this._changed(256)},getStyle:function(){return this._style},setStyle:function(t){this.getStyle().set(t)}},z.each(["locked","visible","blendMode","opacity","guide"],function(e){var t=z.capitalize(e),i="_"+e,n={locked:256,visible:265};this["get"+t]=function(){return this[i]},this["set"+t]=function(t){t!=this[i]&&(this[i]=t,this._changed(n[e]||257))}},{}),{beans:!0,getSelection:function(){return this._selection},setSelection:function(t){t!==this._selection&&(this._selection=t,t=this._project)&&(t._updateSelection(this),this._changed(257))},_changeSelection:function(t,e){var i=this._selection;this.setSelection(e?i|t:i&~t)},isSelected:function(){if(this._selectChildren)for(var t=this._children,e=0,i=t.length;e<i;e++)if(t[e].isSelected())return!0;return!!(1&this._selection)},setSelected:function(t){if(this._selectChildren)for(var e=this._children,i=0,n=e.length;i<n;i++)e[i].setSelected(t);this._changeSelection(1,t)},isFullySelected:function(){var t=this._children,e=!!(1&this._selection);if(t&&e){for(var i=0,n=t.length;i<n;i++)if(!t[i].isFullySelected())return!1;return!0}return e},setFullySelected:function(t){var e=this._children;if(e)for(var i=0,n=e.length;i<n;i++)e[i].setFullySelected(t);this._changeSelection(1,t)},isClipMask:function(){return this._clipMask},setClipMask:function(t){this._clipMask!=(t=!!t)&&((this._clipMask=t)&&(this.setFillColor(null),this.setStrokeColor(null)),this._changed(257),this._parent)&&this._parent._changed(2048)},getData:function(){return this._data||(this._data={}),this._data},setData:function(t){this._data=t},getPosition:function(t){var t=t?P:l,e=this._position||(this._position=this._getPositionFromBounds());return new t(e.x,e.y,this,"setPosition")},setPosition:function(){this.translate(P.read(arguments).subtract(this.getPosition(!0)))},_getPositionFromBounds:function(t){return this._pivot?this._matrix._transformPoint(this._pivot):(t||this.getBounds()).getCenter(!0)},getPivot:function(){var t=this._pivot;return t?new l(t.x,t.y,this,"setPivot"):null},setPivot:function(){this._pivot=P.read(arguments,0,{clone:!0,readNull:!0}),this._position=j}},z.each({getStrokeBounds:{stroke:!0},getHandleBounds:{handle:!0},getInternalBounds:{internal:!0}},function(e,t){this[t]=function(t){return this.getBounds(t,e)}},{beans:!0,getBounds:function(t,e){var i=e||t instanceof M,n=z.set({},i?e:t,this._boundsOptions),i=(n.stroke&&!this.getStrokeScaling()||(n.cacheItem=this),this._getCachedBounds(i&&t,n).rect);return arguments.length?i:new r(i.x,i.y,i.width,i.height,this,"setBounds")},setBounds:function(){var t=x.read(arguments),e=this.getBounds(),i=this._matrix,n=new M,r=t.getCenter();n.translate(r),t.width==e.width&&t.height==e.height||(i.isInvertible()||(i.set(i._backup||(new M).translate(i.getTranslation())),e=this.getBounds()),n.scale(0!==e.width?t.width/e.width:0,0!==e.height?t.height/e.height:0)),r=e.getCenter(),n.translate(-r.x,-r.y),this.transform(n)},_getBounds:function(t,e){var i=this._children;return i&&i.length?(V._updateBoundsCache(this,e.cacheItem),V._getBounds(i,t,e)):new x},_getBoundsCacheKey:function(t,e){return[t.stroke?1:0,t.handle?1:0,e?1:0].join("")},_getCachedBounds:function(t,e,i){t=t&&t._orNullIfIdentity();var n,i=e.internal&&!i,r=e.cacheItem,s=i?null:this._matrix._orNullIfIdentity(),a=r&&(!t||t.equals(s))&&this._getBoundsCacheKey(e,i),o=this._bounds;return V._updateBoundsCache(this._parent||this._symbol,r),a&&o&&a in o?{rect:(n=o[a]).rect.clone(),nonscaling:n.nonscaling}:(t=(r=this._getBounds(t||s,e)).rect||r,s=this._style,e=r.nonscaling||s.hasStroke()&&!s.getStrokeScaling(),a&&(o||(this._bounds=o={}),n=o[a]={rect:t.clone(),nonscaling:e,internal:i}),{rect:t,nonscaling:e})},_getStrokeMatrix:function(t,e){e=this.getStrokeScaling()?null:e&&e.internal?this:this._parent||this._symbol&&this._symbol._item,e=e?e.getViewMatrix().invert():t;return e&&e._shiftless()},statics:{_updateBoundsCache:function(t,e){var i;t&&e&&(i=e._id,(t=t._boundsCache=t._boundsCache||{ids:{},list:[]}).ids[i]||(t.list.push(e),t.ids[i]=e))},_clearBoundsCache:function(t){var e=t._boundsCache;if(e){t._bounds=t._position=t._boundsCache=j;for(var i=0,n=e.list,r=n.length;i<r;i++){var s=n[i];s!==t&&(s._bounds=s._position=j,s._boundsCache)&&V._clearBoundsCache(s)}}},_getBounds:function(t,e,i){var n=l=1/0,r=u=-l,s=!1;i=i||{};for(var a=0,o=t.length;a<o;a++){var h,l,u,c=t[a];c._visible&&!c.isEmpty(!0)&&(h=(c=c._getCachedBounds(e&&e.appended(c._matrix),i,!0)).rect,l=Math.min(h.x,l),n=Math.min(h.y,n),u=Math.max(h.x+h.width,u),r=Math.max(h.y+h.height,r),c.nonscaling)&&(s=!0)}return{rect:isFinite(l)?new x(l,n,u-l,r-n):new x,nonscaling:s}}}}),{beans:!0,_decompose:function(){return this._applyMatrix?null:this._decomposed||(this._decomposed=this._matrix.decompose())},getRotation:function(){var t=this._decompose();return t?t.rotation:0},setRotation:function(t){var e,i=this.getRotation();null!=i&&null!=t&&(e=this._decomposed,this.rotate(t-i),e)&&(e.rotation=t,this._decomposed=e)},getScaling:function(){var t=this._decompose(),t=t&&t.scaling;return new l(t?t.x:1,t?t.y:1,this,"setScaling")},setScaling:function(){var t,e,i,n,r=this.getScaling(),s=P.read(arguments,0,{clone:!0,readNull:!0});r&&s&&!r.equals(s)&&(t=this.getRotation(),e=this._decomposed,i=new M,(n=F.isZero)(r.x)||n(r.y)?(i.translate(e.translation),t&&i.rotate(t),i.scale(s.x,s.y),this._matrix.set(i)):(n=this.getPosition(!0),i.translate(n),t&&i.rotate(t),i.scale(s.x/r.x,s.y/r.y),t&&i.rotate(-t),i.translate(n.negate()),this.transform(i)),e)&&(e.scaling=s,this._decomposed=e)},getMatrix:function(){return this._matrix},setMatrix:function(){var t=this._matrix;t.set.apply(t,arguments)},getGlobalMatrix:function(t){if(n=this._globalMatrix)for(var e=this._parent,i=[];e;){if(!e._globalMatrix){for(var n=null,r=0,s=i.length;r<s;r++)i[r]._globalMatrix=null;break}i.push(e),e=e._parent}return!n&&(n=this._globalMatrix=this._matrix.clone(),e=this._parent)&&n.prepend(e.getGlobalMatrix(!0)),t?n:n.clone()},getViewMatrix:function(){return this.getGlobalMatrix().prepend(this.getView()._matrix)},getApplyMatrix:function(){return this._applyMatrix},setApplyMatrix:function(t){(this._applyMatrix=this._canApplyMatrix&&!!t)&&this.transform(null,!0)},getTransformContent:"#getApplyMatrix",setTransformContent:"#setApplyMatrix"},{getProject:function(){return this._project},_setProject:function(t,e){if(this._project!==t){this._project&&this._installEvents(!1),this._project=t;for(var i=this._children,n=0,r=i&&i.length;n<r;n++)i[n]._setProject(t);e=!0}e&&this._installEvents(!0)},getView:function(){return this._project._view},_installEvents:function t(e){t.base.call(this,e);for(var i=this._children,n=0,r=i&&i.length;n<r;n++)i[n]._installEvents(e)},getLayer:function(){for(var t=this;t=t._parent;)if(t instanceof Z)return t;return null},getParent:function(){return this._parent},setParent:function(t){return t.addChild(this)},_getOwner:"#getParent",getChildren:function(){return this._children},setChildren:function(t){this.removeChildren(),this.addChildren(t)},getFirstChild:function(){return this._children&&this._children[0]||null},getLastChild:function(){return this._children&&this._children[this._children.length-1]||null},getNextSibling:function(){var t=this._getOwner();return t&&t._children[this._index+1]||null},getPreviousSibling:function(){var t=this._getOwner();return t&&t._children[this._index-1]||null},getIndex:function(){return this._index},equals:function(t){return t===this||t&&this._class===t._class&&this._style.equals(t._style)&&this._matrix.equals(t._matrix)&&this._locked===t._locked&&this._visible===t._visible&&this._blendMode===t._blendMode&&this._opacity===t._opacity&&this._clipMask===t._clipMask&&this._guide===t._guide&&this._equals(t)||!1},_equals:function(t){return z.equals(this._children,t._children)},clone:function(t){var e=new this.constructor(V.NO_INSERT),i=this._children,n=z.pick(t?t.insert:j,t===j||!0===t),t=z.pick(t?t.deep:j,!0),r=(i&&e.copyAttributes(this),i&&!t||e.copyContent(this),i||e.copyAttributes(this),n&&e.insertAbove(this),this._name),t=this._parent;if(r&&t){for(var i=t._children,s=r,a=1;i[r];)r=s+" "+a++;r!==s&&e.setName(r)}return e},copyContent:function(t){for(var e=t._children,i=0,n=e&&e.length;i<n;i++)this.addChild(e[i].clone(!1),!0)},copyAttributes:function(t,e){this.setStyle(t._style);for(var i=["_locked","_visible","_blendMode","_opacity","_clipMask","_guide"],n=0,r=i.length;n<r;n++){var s=i[n];t.hasOwnProperty(s)&&(this[s]=t[s])}e||this._matrix.set(t._matrix,!0),this.setApplyMatrix(t._applyMatrix),this.setPivot(t._pivot),this.setSelection(t._selection);var e=t._data,a=t._name;this._data=e?z.clone(e):null,a&&this.setName(a)},rasterize:function(t,e){z.isPlainObject(t)?(s=t.resolution,i=t.insert,n=t.raster):(s=t,i=e),n=n||new $(V.NO_INSERT);var i,n,r,t=this.getStrokeBounds(),e=(s||this.getView().getResolution())/72,s=t.getTopLeft().floor(),t=t.getBottomRight().ceil(),t=new O(t.subtract(s)),a=t.multiply(e);return n.setSize(a,!0),a.isZero()||(a=n.getContext(!0),r=(new M).scale(e).translate(s.negate()),a.save(),r.applyToContext(a),this.draw(a,new z({matrices:[r]})),a.restore()),n._matrix.set((new M).translate(s.add(t.divide(2))).scale(1/e)),i!==j&&!i||n.insertAbove(this),n},contains:function(){var t=this._matrix;return t.isInvertible()&&!!this._contains(t._inverseTransform(P.read(arguments)))},_contains:function(t){var e=this._children;if(e){for(var i=e.length-1;0<=i;i--)if(e[i].contains(t))return!0;return!1}return t.isInside(this.getInternalBounds())},isInside:function(){return x.read(arguments).contains(this.getBounds())},_asPathItem:function(){return new W.Rectangle({rectangle:this.getInternalBounds(),matrix:this._matrix,insert:!1})},intersects:function(t,e){return t instanceof V&&0<this._asPathItem().getIntersections(t._asPathItem(),null,e,!0).length}},new function(){function t(){var t=arguments;return this._hitTest(P.read(t),L.getOptions(t))}function e(){var t=arguments,e=P.read(t),t=L.getOptions(t),i=[];return this._hitTest(e,new z({all:i},t)),i}function i(t,e,i,n){var r=this._children;if(r)for(var s=r.length-1;0<=s;s--){var a=r[s],a=a!==n&&a._hitTest(t,e,i);if(a&&!e.all)return a}return null}return h.inject({hitTest:t,hitTestAll:e,_hitTest:i}),{hitTest:t,hitTestAll:e,_hitTestChildren:i}},{_hitTest:function(n,e,t){if(this._locked||!this._visible||this._guide&&!e.guides||this.isEmpty())return null;var i=this._matrix,t=t?t.appended(i):this.getGlobalMatrix().prepend(this.getView()._matrix),r=Math.max(e.tolerance,1e-12),s=e._tolerancePadding=new O(W._getStrokePadding(r,i._shiftless().invert()));if(!(n=i._inverseTransform(n))||!this._children&&!this.getBounds({internal:!0,stroke:!0,handle:!0}).expand(s.multiply(2))._containsPoint(n))return null;var a,o,r=!(e.guides&&!this._guide||e.selected&&!this.isSelected()||e.type&&e.type!==z.hyphenate(this._class)||e.class&&!(this instanceof e.class)),h=e.match,l=this;function u(t){return(t=t&&h&&!h(t)?null:t)&&e.all&&e.all.push(t),t}function c(t,e){var i=e?a["get"+e]():l.getPosition();if(n.subtract(i).divide(s).length<=1)return new L(t,l,{name:e?z.hyphenate(e):t,point:i})}var d=e.position,f=e.center,p=e.bounds;if(r&&this._parent&&(d||f||p)){if((f||p)&&(a=this.getInternalBounds()),!(o=d&&c("position")||f&&c("center","Center"))&&p)for(var g=["TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],m=0;m<8&&!o;m++)o=c("bounds",g[m]);o=u(o)}return(o=o||this._hitTestChildren(n,e,t)||r&&u(this._hitTestSelf(n,e,t,this.getStrokeScaling()?null:t._shiftless().invert()))||null)&&o.point&&(o.point=i.transform(o.point)),o},_hitTestSelf:function(t,e){if(e.fill&&this.hasFill()&&this._contains(t))return new L("fill",this)},matches:function(t,e){var i=typeof t;if("object"==i){for(var n in t)if(t.hasOwnProperty(n)&&!this.matches(n,t[n]))return!1;return!0}if("function"==i)return t(this);if("match"===t)return e(this);i=/^(empty|editable)$/.test(t)?this["is"+z.capitalize(t)]():"type"===t?z.hyphenate(this._class):this[t];if("class"===t){if("function"==typeof e)return this instanceof e;i=this._class}if("function"==typeof e)return!!e(i);if(e){if(e.test)return e.test(i);if(z.isPlainObject(e))return function t(e,i){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n],n=i[n];if(z.isPlainObject(r)&&z.isPlainObject(n)){if(!t(r,n))return!1}else if(!z.equals(r,n))return!1}return!0}(e,i)}return z.equals(i,e)},getItems:function(t){return V._getItems(this,t,this._matrix)},getItem:function(t){return V._getItems(this,t,this._matrix,null,!0)[0]||null},statics:{_getItems:function t(e,i,n,r,s){r||(o=(a="object"==typeof i&&i)&&a.overlapping,h=a&&a.inside,c=(_=o||h)&&x.read([_]),r={items:[],recursive:a&&!1!==a.recursive,inside:!!h,overlapping:!!o,rect:c,path:o&&new W.Rectangle({rectangle:c,insert:!1})},a&&(i=z.filter({},i,{recursive:!0,inside:!0,overlapping:!0})));var a,o,h,l=e._children,u=r.items,c=r.rect;n=c&&(n||new M);for(var d=0,f=l&&l.length;d<f;d++){var p=l[d],g=n&&n.appended(p._matrix),m=!0;if(c){var _=p.getBounds(g);if(!c.intersects(_))continue;c.contains(_)||r.overlapping&&(_.contains(c)||r.path.intersects(p,g))||(m=!1)}if(m&&p.matches(i)&&(u.push(p),s))break;if(!1!==r.recursive&&t(p,i,g,r,s),s&&0<u.length)break}return u}}},{importJSON:function(t){t=z.importJSON(t,this);return t!==this?this.addChild(t):t},addChild:function(t){return this.insertChild(j,t)},insertChild:function(t,e){t=e?this.insertChildren(t,[e]):null;return t&&t[0]},addChildren:function(t){return this.insertChildren(this._children.length,t)},insertChildren:function(t,e){var i=this._children;if(i&&e&&0<e.length){for(var n={},r=(e=z.slice(e)).length-1;0<=r;r--){var s=(l=e[r])&&l._id;!l||n[s]?e.splice(r,1):(l._remove(!1,!0),n[s]=!0)}z.splice(i,e,t,0);for(var a=this._project,o=a._changes,r=0,h=e.length;r<h;r++){var l,u=(l=e[r])._name;l._parent=this,l._setProject(a,!0),u&&l.setName(u),o&&l._changed(5)}this._changed(11)}else e=null;return e},_insertItem:"#insertChild",_insertAt:function(t,e){var i=t&&t._getOwner(),n=t!==this&&i?this:null;return n&&(n._remove(!1,!0),i._insertItem(t._index+e,n)),n},insertAbove:function(t){return this._insertAt(t,1)},insertBelow:function(t){return this._insertAt(t,0)},sendToBack:function(){var t=this._getOwner();return t?t._insertItem(0,this):null},bringToFront:function(){var t=this._getOwner();return t?t._insertItem(j,this):null},appendTop:"#addChild",appendBottom:function(t){return this.insertChild(0,t)},moveAbove:"#insertAbove",moveBelow:"#insertBelow",addTo:function(t){return t._insertItem(j,this)},copyTo:function(t){return this.clone(!1).addTo(t)},reduce:function(t){var e=this._children;return e&&1===e.length?(e=e[0].reduce(t),(this._parent?(e.insertAbove(this),this):e).remove(),e):this},_removeNamed:function(){var t,e,i,n,r=this._getOwner();r&&(t=r._children,-1!==(n=(i=(r=r._namedChildren)[e=this._name])?i.indexOf(this):-1))&&(t[e]==this&&delete t[e],i.splice(n,1),i.length?t[e]=i[0]:delete r[e])},_remove:function(t,e){var i=this._getOwner(),n=this._project,r=this._index;return this._style&&this._style._dispose(),!(!i||(this._name&&this._removeNamed(),null!=r&&(n._activeLayer===this&&(n._activeLayer=this.getNextSibling()||this.getPreviousSibling()),z.splice(i._children,null,r,1)),this._installEvents(!1),t&&n._changes&&this._changed(5),e&&i._changed(11,this),this._parent=null))},remove:function(){return this._remove(!0,!0)},replaceWith:function(t){t=t&&t.insertBelow(this);return t&&this.remove(),t},removeChildren:function(t,e){if(!this._children)return null;t=t||0,e=z.pick(e,this._children.length);for(var i=z.splice(this._children,null,t,e-t),n=i.length-1;0<=n;n--)i[n]._remove(!0,!1);return 0<i.length&&this._changed(11),i},clear:"#removeChildren",reverseChildren:function(){if(this._children){this._children.reverse();for(var t=0,e=this._children.length;t<e;t++)this._children[t]._index=t;this._changed(11)}},isEmpty:function(t){var e=this._children,i=e?e.length:0;if(t){for(var n=0;n<i;n++)if(!e[n].isEmpty(t))return!1;return!0}return!i},isEditable:function(){for(var t=this;t;){if(!t._visible||t._locked)return!1;t=t._parent}return!0},hasFill:function(){return this.getStyle().hasFill()},hasStroke:function(){return this.getStyle().hasStroke()},hasShadow:function(){return this.getStyle().hasShadow()},_getOrder:function(t){function e(t){for(var e=[];e.unshift(t),t=t._parent;);return e}for(var i=e(this),n=e(t),r=0,s=Math.min(i.length,n.length);r<s;r++)if(i[r]!=n[r])return i[r]._index<n[r]._index?1:-1;return 0},hasChildren:function(){return this._children&&0<this._children.length},isInserted:function(){return!!this._parent&&this._parent.isInserted()},isAbove:function(t){return-1===this._getOrder(t)},isBelow:function(t){return 1===this._getOrder(t)},isParent:function(t){return this._parent===t},isChild:function(t){return t&&t._parent===this},isDescendant:function(t){for(var e=this;e=e._parent;)if(e===t)return!0;return!1},isAncestor:function(t){return!!t&&t.isDescendant(this)},isSibling:function(t){return this._parent===t._parent},isGroupedWith:function(t){for(var e=this._parent;e;){if(e._parent&&/^(Group|Layer|CompoundPath)$/.test(e._class)&&t.isDescendant(e))return!0;e=e._parent}return!1}},z.each(["rotate","scale","shear","skew"],function(i){var n="rotate"===i;this[i]=function(){var t=arguments,e=(n?z:P).read(t),t=P.read(t,0,{readNull:!0});return this.transform((new M)[i](e,t||this.getPosition(!0)))}},{translate:function(){var t=new M;return this.transform(t.translate.apply(t,arguments))},transform:function(t,e,i){var n=this._matrix,r=t&&!t.isIdentity(),s=i&&this._canApplyMatrix||this._applyMatrix&&(r||!n.isIdentity()||e&&this._children);if(r||s){r&&(!t.isInvertible()&&n.isInvertible()&&(n._backup=n.getValues()),n.prepend(t,!0),u=(o=this._style).getFillColor(!0),o=o.getStrokeColor(!0),u&&u.transform(t),o)&&o.transform(t),(s=s&&this._transformContent(n,e,i))&&((u=this._pivot)&&n._transformPoint(u,u,!0),n.reset(!0),i)&&this._canApplyMatrix&&(this._applyMatrix=!0);var a=this._bounds,o=this._position,e=((r||s)&&this._changed(25),r&&a&&t.decompose());if(e&&e.skewing.isZero()&&e.rotation%90==0){for(var h in a){var l=a[h];l.nonscaling?delete a[h]:!s&&l.internal||(h=l.rect,t._transformBounds(h,h))}var u=(this._bounds=a)[this._getBoundsCacheKey(this._boundsOptions||{})];u&&(this._position=this._getPositionFromBounds(u.rect))}else r&&o&&this._pivot&&(this._position=t._transformPoint(o,o))}return this},_transformContent:function(t,e,i){var n=this._children;if(n){for(var r=0,s=n.length;r<s;r++)n[r].transform(t,e,i);return!0}},globalToLocal:function(){return this.getGlobalMatrix(!0)._inverseTransform(P.read(arguments))},localToGlobal:function(){return this.getGlobalMatrix(!0)._transformPoint(P.read(arguments))},parentToLocal:function(){return this._matrix._inverseTransform(P.read(arguments))},localToParent:function(){return this._matrix._transformPoint(P.read(arguments))},fitBounds:function(t,e){t=x.read(arguments);var i=this.getBounds(),n=i.height/i.width,r=t.height/t.width,n=(e?r<n:n<r)?t.width/i.width:t.height/i.height,r=new x(new P,new O(i.width*n,i.height*n));r.setCenter(t.getCenter()),this.setBounds(r)}}),{_setStyles:function(t,e,i){var n,r,s=this._style,a=this._matrix;s.hasFill()&&(t.fillStyle=s.getFillColor().toCanvasStyle(t,a)),s.hasStroke()&&(t.strokeStyle=s.getStrokeColor().toCanvasStyle(t,a),t.lineWidth=s.getStrokeWidth(),a=s.getStrokeJoin(),r=s.getStrokeCap(),n=s.getMiterLimit(),a&&(t.lineJoin=a),r&&(t.lineCap=r),n&&(t.miterLimit=n),B.support.nativeDash)&&(a=s.getDashArray(),r=s.getDashOffset(),a)&&a.length&&("setLineDash"in t?(t.setLineDash(a),t.lineDashOffset=r):(t.mozDash=a,t.mozDashOffset=r)),s.hasShadow()&&(n=e.pixelRatio||1,r=(a=i._shiftless().prepend((new M).scale(n,n))).transform(new P(s.getShadowBlur(),0)),e=a.transform(this.getShadowOffset()),t.shadowColor=s.getShadowColor().toCanvasStyle(t),t.shadowBlur=r.getLength(),t.shadowOffsetX=e.x,t.shadowOffsetY=e.y)},draw:function(t,e,i){this._updateVersion=this._project._updateVersion;if(this._visible&&0!==this._opacity){var n=e.matrices,r=e.viewMatrix,s=this._matrix,a=n[n.length-1].appended(s);if(a.isInvertible()){r=r?r.appended(a):a,n.push(a),e.updateMatrix&&(this._globalMatrix=a);var o,h,l,a=this._blendMode,u=F.clamp(this._opacity,0,1),c="normal"===a,d=gt.nativeModes[a],c=c&&1===u||e.dontStart||e.clip||(d||c&&u<1)&&this._canComposite(),f=e.pixelRatio||1;if(!c){var p=this.getStrokeBounds(r);if(!p.width||!p.height)return void n.pop();l=e.offset,h=e.offset=p.getTopLeft().floor(),o=t,t=A.getContext(p.getSize().ceil().add(1).multiply(f)),1!==f&&t.scale(f,f)}t.save();var p=i?i.appended(s):this._canScaleStroke&&!this.getStrokeScaling(!0)&&r,i=!c&&e.clipItem,g=!p||i;c?(t.globalAlpha=u,d&&(t.globalCompositeOperation=a)):g&&t.translate(-h.x,-h.y),g&&(c?s:r).applyToContext(t),i&&e.clipItem.draw(t,e.extend({clip:!0})),p&&(t.setTransform(f,0,0,f,0,0),d=e.offset)&&t.translate(-d.x,-d.y),this._draw(t,e,r,p),t.restore(),n.pop(),e.clip&&!e.dontFinish&&t.clip(this.getFillRule()),c||(gt.process(a,t,o,u,h.subtract(l).multiply(f)),A.release(t),e.offset=l)}}},_isUpdated:function(t){var e,i=this._parent;return i instanceof G?i._isUpdated(t):(!(e=this._updateVersion===t)&&i&&i._visible&&i._isUpdated(t)&&(this._updateVersion=t,e=!0),e)},_drawSelection:function(t,e,i,n,r){var s=this._selection,a=1&s,o=2&s||a&&this._selectBounds,s=4&s;if(((a=this._drawSelected?a:!1)||o||s)&&this._isUpdated(r)){var r=this.getSelectedColor(!0)||(r=this.getLayer())&&r.getSelectedColor(!0),e=e.appended(this.getGlobalMatrix(!0)),h=i/2;if(t.strokeStyle=t.fillStyle=r?r.toCanvasStyle(t):"#009dec",a&&this._drawSelected(t,e,n),s)for(var r=this.getPosition(!0),a=this._parent,n=a?a.localToGlobal(r):r,l=n.x,u=n.y,c=(t.beginPath(),t.arc(l,u,h,0,2*Math.PI,!0),t.stroke(),[[0,-1],[1,0],[0,1],[-1,0]]),d=h,f=i+1,p=0;p<4;p++){var g=c[p],m=g[0],g=g[1];t.moveTo(l+m*d,u+g*d),t.lineTo(l+m*f,u+g*f),t.stroke()}if(o){var _=e._transformCorners(this.getInternalBounds());t.beginPath();for(p=0;p<8;p++)t[p?"lineTo":"moveTo"](_[p],_[++p]);t.closePath(),t.stroke();for(p=0;p<8;p++)t.fillRect(_[p]-h,_[++p]-h,i,i)}}},_canComposite:function(){return!1}},z.each(["down","drag","up","move"],function(e){this["removeOn"+z.capitalize(e)]=function(){var t={};return t[e]=!0,this.removeOn(t)}},{removeOn:function(t){for(var e in t){var i;t[e]&&(e="mouse"+e,(i=(i=this._project)._removeSets=i._removeSets||{})[e]=i[e]||{},i[e][this._id]=this)}return this}}),{tween:function(t,e,i){i||(i=e,e=t,t=null,i)||(i=e,e=null);var n=i&&i.easing,r=i&&i.start,i=null!=i&&("number"==typeof i?i:i.duration),s=new ft(this,t,e,i,n,r);return i&&this.on("frame",function t(e){s._handleFrame(1e3*e.time),s.running||this.off("frame",t)}),s},tweenTo:function(t,e){return this.tween(null,t,e)},tweenFrom:function(t,e){return this.tween(t,null,e)}}),g=V.extend({_class:"Group",_selectBounds:!1,_selectChildren:!0,_serializeFields:{children:[]},initialize:function(t){this._children=[],this._namedChildren={},this._initialize(t)||this.addChildren(Array.isArray(t)?t:arguments)},_changed:function t(e){t.base.call(this,e),2050&e&&(this._clipItem=j)},_getClipItem:function(){if((t=this._clipItem)===j){for(var t=null,e=this._children,i=0,n=e.length;i<n;i++)if(e[i]._clipMask){t=e[i];break}this._clipItem=t}return t},isClipped:function(){return!!this._getClipItem()},setClipped:function(t){var e=this.getFirstChild();e&&e.setClipMask(t)},_getBounds:function t(e,i){var n=this._getClipItem();return n?n._getCachedBounds(n._matrix.prepended(e),z.set({},i,{stroke:!1})):t.base.call(this,e,i)},_hitTestChildren:function t(e,i,n){var r=this._getClipItem();return(!r||r.contains(e))&&t.base.call(this,e,i,n,r)},_draw:function(t,e){for(var i=e.clip,n=!i&&this._getClipItem(),r=(e=e.extend({clipItem:n,clip:!1}),i?(t.beginPath(),e.dontStart=e.dontFinish=!0):n&&n.draw(t,e.extend({clip:!0})),this._children),s=0,a=r.length;s<a;s++){var o=r[s];o!==n&&o.draw(t,e)}}}),Z=g.extend({_class:"Layer",initialize:function(){g.apply(this,arguments)},_getOwner:function(){return this._parent||null!=this._index&&this._project},isInserted:function t(){return this._parent?t.base.call(this):null!=this._index},activate:function(){this._project._activeLayer=this},_hitTestSelf:function(){}}),f=V.extend({_class:"Shape",_applyMatrix:!1,_canApplyMatrix:!1,_canScaleStroke:!0,_serializeFields:{type:null,size:null,radius:null},initialize:function(t,e){this._initialize(t,e)},_equals:function(t){return this._type===t._type&&this._size.equals(t._size)&&z.equals(this._radius,t._radius)},copyContent:function(t){this.setType(t._type),this.setSize(t._size),this.setRadius(t._radius)},getType:function(){return this._type},setType:function(t){this._type=t},getShape:"#getType",setShape:"#setType",getSize:function(){var t=this._size;return new n(t.width,t.height,this,"setSize")},setSize:function(){var t,e,i,n=O.read(arguments);this._size?this._size.equals(n)||(t=this._type,e=n.width,i=n.height,"rectangle"===t?this._radius.set(O.min(this._radius,n.divide(2).abs())):"circle"===t?(e=i=(e+i)/2,this._radius=e/2):"ellipse"===t&&this._radius._set(e/2,i/2),this._size._set(e,i),this._changed(9)):this._size=n.clone()},getRadius:function(){var t=this._radius;return"circle"===this._type?t:new n(t.width,t.height,this,"setRadius")},setRadius:function(t){var e=this._type;if("circle"===e){if(t===this._radius)return;var i=2*t;this._radius=t,this._size._set(i,i)}else if(t=O.read(arguments),this._radius){if(this._radius.equals(t))return;this._radius.set(t),"rectangle"===e?(i=O.max(this._size,t.multiply(2)),this._size.set(i)):"ellipse"===e&&this._size._set(2*t.width,2*t.height)}else this._radius=t.clone();this._changed(9)},isEmpty:function(){return!1},toPath:function(t){var e=new W[z.capitalize(this._type)]({center:new P,size:this._size,radius:this._radius,insert:!1});return e.copyAttributes(this),B.settings.applyMatrix&&e.setApplyMatrix(!0),t!==j&&!t||e.insertAbove(this),e},toShape:"#clone",_asPathItem:function(){return this.toPath(!1)},_draw:function(t,e,i,n){var r,s,a,o,h,l=this._style,u=l.hasFill(),c=l.hasStroke(),d=e.dontFinish||e.clip,f=!n;(u||c||d)&&(a=this._type,o=this._radius,s="circle"===a,e.dontStart||t.beginPath(),f&&s?t.arc(0,0,o,0,2*Math.PI,!0):(r=s?o:o.width,s=s?o:o.height,h=(o=this._size).width,o=o.height,f&&"rectangle"===a&&0===r&&0===s?t.rect(-h/2,-o/2,h,o):(h=[-(f=h/2),-(a=o/2)+s,-f,(o=s*(h=.44771525016920644))-a,(h=r*h)-f,-a,-f+r,-a,f-r,-a,f-h,-a,f,o-a,f,-a+s,f,a-s,f,a-o,f-h,a,f-r,a,-f+r,a,h-f,a,-f,a-o,-f,a-s],n&&n.transform(h,h,32),t.moveTo(h[0],h[1]),t.bezierCurveTo(h[2],h[3],h[4],h[5],h[6],h[7]),f!==r&&t.lineTo(h[8],h[9]),t.bezierCurveTo(h[10],h[11],h[12],h[13],h[14],h[15]),a!==s&&t.lineTo(h[16],h[17]),t.bezierCurveTo(h[18],h[19],h[20],h[21],h[22],h[23]),f!==r&&t.lineTo(h[24],h[25]),t.bezierCurveTo(h[26],h[27],h[28],h[29],h[30],h[31]))),t.closePath()),d||!u&&!c||(this._setStyles(t,e,i),u&&(t.fill(l.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),c&&t.stroke())},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_getBounds:function(t,e){var i=new x(this._size).setCenter(0,0),n=this._style,n=e.stroke&&n.hasStroke()&&n.getStrokeWidth();return t&&(i=t._transformBounds(i)),n?i.expand(W._getStrokePadding(n,this._getStrokeMatrix(t,e))):i}},new function(){function d(t,e,i){var n=t._radius;if(!n.isZero())for(var r=t._size.divide(2),s=1;s<=4;s++){var a=new P(1<s&&s<4?-1:1,2<s?-1:1),o=a.multiply(r),h=o.subtract(a.multiply(n));if(new x(i?o.add(a.multiply(i)):o,h).contains(e))return{point:h,quadrant:s}}}function f(t,e,i,n){t=t.divide(e);return(!n||t.isInQuadrant(n))&&t.subtract(t.normalize()).multiply(e).divide(i).length<=1}return{_contains:function t(e){var i;return"rectangle"===this._type?(i=d(this,e))?e.subtract(i.point).divide(this._radius).getLength()<=1:t.base.call(this,e):e.divide(this.size).getLength()<=.5},_hitTestSelf:function t(e,i,n,r){var s,a,o,h=!1,l=this._style,u=i.stroke&&l.hasStroke(),c=i.fill&&l.hasFill();return(u||c)&&(c=this._type,s=this._radius,a=u?l.getStrokeWidth()/2:0,a=i._tolerancePadding.add(W._getStrokePadding(a,!l.getStrokeScaling()&&r)),h="rectangle"===c?(c=d(this,e,l=a.multiply(2)))?f(e.subtract(c.point),s,a,c.quadrant):(o=(c=new x(this._size).setCenter(0,0)).expand(l),c=c.expand(l.negate()),o._containsPoint(e)&&!c._containsPoint(e)):f(e,s,a)),h?new L(u?"stroke":"fill",this):t.base.apply(this,arguments)}}},{statics:new function(){function n(t,e,i,n,r){var s=z.create(f.prototype);return s._type=t,s._size=i,s._radius=n,s._initialize(z.getNamed(r),e),s}return{Circle:function(){var t=arguments,e=P.readNamed(t,"center"),i=z.readNamed(t,"radius");return n("circle",e,new O(2*i),i,t)},Rectangle:function(){var t=arguments,e=x.readNamed(t,"rectangle"),i=O.min(O.readNamed(t,"radius"),e.getSize(!0).divide(2));return n("rectangle",e.getCenter(!0),e.getSize(!0),i,t)},Ellipse:function(){var t=arguments,e=f._readEllipse(t),i=e.radius;return n("ellipse",e.center,i.multiply(2),i,t)},_readEllipse:function(t){var e;return t=z.hasNamed(t,"radius")?(e=P.readNamed(t,"center"),O.readNamed(t,"radius")):(e=(t=x.readNamed(t,"rectangle")).getCenter(!0),t.getSize(!0).divide(2)),{center:e,radius:t}}}}}),$=V.extend({_class:"Raster",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!1,handle:!1},_serializeFields:{crossOrigin:null,source:null},_prioritize:["crossOrigin"],_smoothing:"low",beans:!0,initialize:function(t,e){var i,n;this._initialize(t,e!==j&&P.read(arguments))||((n="string"==(n=typeof t)?I.getElementById(t):"object"==n?t:null)&&n!==V.NO_INSERT&&(n.getContext||null!=n.naturalHeight?i=n:n&&!(n=O.read(arguments)).isZero()&&(i=A.getCanvas(n))),i?this.setImage(i):this.setSource(t)),this._size||(this._size=new O,this._loaded=!1)},_equals:function(t){return this.getSource()===t.getSource()},copyContent:function(t){var e=t._image,i=t._canvas;e?this._setImage(e):i&&((e=A.getCanvas(t._size)).getContext("2d").drawImage(i,0,0),this._setImage(e)),this._crossOrigin=t._crossOrigin},getSize:function(){var t=this._size;return new n(t?t.width:0,t?t.height:0,this,"setSize")},setSize:function(t,e){var i,n=O.read(arguments);n.equals(this._size)?e&&this.clear():0<n.width&&0<n.height?(i=!e&&this.getElement(),this._setImage(A.getCanvas(n)),i&&this.getContext(!0).drawImage(i,0,0,n.width,n.height)):(this._canvas&&A.release(this._canvas),this._size=n.clone())},getWidth:function(){return this._size?this._size.width:0},setWidth:function(t){this.setSize(t,this.getHeight())},getHeight:function(){return this._size?this._size.height:0},setHeight:function(t){this.setSize(this.getWidth(),t)},getLoaded:function(){return this._loaded},isEmpty:function(){var t=this._size;return!t||0===t.width&&0===t.height},getResolution:function(){var t=this._matrix,e=new P(0,0).transform(t),i=new P(1,0).transform(t).subtract(e),t=new P(0,1).transform(t).subtract(e);return new O(72/i.getLength(),72/t.getLength())},getPpi:"#getResolution",getImage:function(){return this._image},setImage:function(e){var n=this;function i(t){var e=n.getView(),i=t&&t.type||"load";e&&n.responds(i)&&(B=e._scope,n.emit(i,new ot(t)))}this._setImage(e),this._loaded?setTimeout(i,0):e&&R.add(e,{load:function(t){n._setImage(e),i(t)},error:i})},_setImage:function(t){this._canvas&&A.release(this._canvas),t&&t.getContext?(this._image=null,this._canvas=t,this._loaded=!0):(this._image=t,this._canvas=null,this._loaded=!!(t&&t.src&&t.complete)),this._size=new O(t?t.naturalWidth||t.width:0,t?t.naturalHeight||t.height:0),this._context=null,this._changed(1033)},getCanvas:function(){if(!this._canvas){var e=A.getContext(this._size);try{this._image&&e.drawImage(this._image,0,0),this._canvas=e.canvas}catch(t){A.release(e)}}return this._canvas},setCanvas:"#setImage",getContext:function(t){return this._context||(this._context=this.getCanvas().getContext("2d")),t&&(this._image=null,this._changed(1025)),this._context},setContext:function(t){this._context=t},getSource:function(){var t=this._image;return t&&t.src||this.toDataURL()},setSource:function(t){var e=new b.Image,i=this._crossOrigin;i&&(e.crossOrigin=i),t&&(e.src=t),this.setImage(e)},getCrossOrigin:function(){var t=this._image;return t&&t.crossOrigin||this._crossOrigin||""},setCrossOrigin:function(t){this._crossOrigin=t;var e=this._image;e&&(e.crossOrigin=t)},getSmoothing:function(){return this._smoothing},setSmoothing:function(t){this._smoothing="string"==typeof t?t:t?"low":"off",this._changed(257)},getElement:function(){return this._canvas||this._loaded&&this._image}},{beans:!1,getSubCanvas:function(){var t=x.read(arguments),e=A.getContext(t.getSize());return e.drawImage(this.getCanvas(),t.x,t.y,t.width,t.height,0,0,t.width,t.height),e.canvas},getSubRaster:function(){var t=x.read(arguments),e=new $(V.NO_INSERT);return e._setImage(this.getSubCanvas(t)),e.translate(t.getCenter().subtract(this.getSize().divide(2))),e._matrix.prepend(this._matrix),e.insertAbove(this),e},toDataURL:function(){var t=this._image,t=t&&t.src;return/^data:/.test(t)?t:(t=this.getCanvas())?t.toDataURL.apply(t,arguments):null},drawImage:function(t){var e=P.read(arguments,1);this.getContext(!0).drawImage(t,e.x,e.y)},getAverageColor:function(t){if(t?t instanceof Q?n=(r=t).getBounds():"object"==typeof t&&("width"in t?n=new x(t):"x"in t&&(n=new x(t.x-.5,t.y-.5,1,1))):n=this.getBounds(),!n)return null;for(var t=Math.min(n.width,32),e=Math.min(n.height,32),i=$._sampleContext,n=(i?i.clearRect(0,0,33,33):i=$._sampleContext=A.getContext(new O(32)),i.save(),(new M).scale(t/n.width,e/n.height).translate(-n.x,-n.y)),r=(n.applyToContext(i),r&&r.draw(i,new z({clip:!0,matrices:[n]})),this._matrix.applyToContext(i),this.getElement()),n=this._size,s=(r&&i.drawImage(r,-n.width/2,-n.height/2),i.restore(),i.getImageData(.5,.5,Math.ceil(t),Math.ceil(e)).data),a=[0,0,0],o=0,h=0,l=s.length;h<l;h+=4){var u=s[h+3];o+=u,u/=255,a[0]+=s[h]*u,a[1]+=s[h+1]*u,a[2]+=s[h+2]*u}for(h=0;h<3;h++)a[h]/=o;return o?S.read(a):null},getPixel:function(){var t=P.read(arguments),t=this.getContext().getImageData(t.x,t.y,1,1).data;return new S("rgb",[t[0]/255,t[1]/255,t[2]/255],t[3]/255)},setPixel:function(){var t=arguments,e=P.read(t),t=S.read(t),i=t._convert("rgb"),t=t._alpha,n=this.getContext(!0),r=n.createImageData(1,1),s=r.data;s[0]=255*i[0],s[1]=255*i[1],s[2]=255*i[2],s[3]=null!=t?255*t:255,n.putImageData(r,e.x,e.y)},clear:function(){var t=this._size;this.getContext(!0).clearRect(0,0,t.width+1,t.height+1)},createImageData:function(){var t=O.read(arguments);return this.getContext().createImageData(t.width,t.height)},getImageData:function(){var t=x.read(arguments);return t.isEmpty()&&(t=new x(this._size)),this.getContext().getImageData(t.x,t.y,t.width,t.height)},putImageData:function(t){var e=P.read(arguments,1);this.getContext(!0).putImageData(t,e.x,e.y)},setImageData:function(t){this.setSize(t),this.getContext(!0).putImageData(t,0,0)},_getBounds:function(t,e){var i=new x(this._size).setCenter(0,0);return t?t._transformBounds(i):i},_hitTestSelf:function(t){var e;if(this._contains(t))return new L("pixel",e=this,{offset:t.add(e._size.divide(2)).round(),color:{get:function(){return e.getPixel(this.offset)}}})},_draw:function(t,e,i){var n=this.getElement();n&&0<n.width&&0<n.height&&(t.globalAlpha=F.clamp(this._opacity,0,1),this._setStyles(t,e,i),e=this._smoothing,c.setPrefixed(t,(i="off"===e)?"imageSmoothingEnabled":"imageSmoothingQuality",!i&&e),t.drawImage(n,-this._size.width/2,-this._size.height/2))},_canComposite:function(){return!0}}),Y=V.extend({_class:"SymbolItem",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!0},_serializeFields:{symbol:null},initialize:function(t,e){this._initialize(t,e!==j&&P.read(arguments,1))||this.setDefinition(t instanceof m?t:new m(t))},_equals:function(t){return this._definition===t._definition},copyContent:function(t){this.setDefinition(t._definition)},getDefinition:function(){return this._definition},setDefinition:function(t){this._definition=t,this._changed(9)},getSymbol:"#getDefinition",setSymbol:"#setDefinition",isEmpty:function(){return this._definition._item.isEmpty()},_getBounds:function(t,e){var i=this._definition._item;return i._getCachedBounds(i._matrix.prepended(t),e)},_hitTestSelf:function(t,e,i){e=e.extend({all:!1}),t=this._definition._item._hitTest(t,e,i);return t&&(t.item=this),t},_draw:function(t,e){this._definition._item.draw(t,e)}}),m=z.extend({_class:"SymbolDefinition",initialize:function(t,e){this._id=o.get(),this.project=B.project,t&&this.setItem(t,e)},_serialize:function(t,e){return e.add(this,function(){return z.serialize([this._class,this._item],t,!1,e)})},_changed:function(t){8&t&&V._clearBoundsCache(this),1&t&&this.project._changed(t)},getItem:function(){return this._item},setItem:function(t,e){t._symbol&&(t=t.clone()),this._item&&(this._item._symbol=null),(this._item=t).remove(),t.setSelected(!1),e||t.setPosition(new P),(t._symbol=this)._changed(9)},getDefinition:"#getItem",setDefinition:"#setItem",place:function(t){return new Y(this,t)},clone:function(){return new m(this._item.clone(!1))},equals:function(t){return t===this||t&&this._item.equals(t._item)||!1}}),L=z.extend({_class:"HitResult",initialize:function(t,e,i){this.type=t,this.item=e,i&&this.inject(i)},statics:{getOptions:function(t){t=t&&z.read(t);return new z({type:null,tolerance:B.settings.hitTolerance,fill:!t,stroke:!t,segments:!t,handles:!1,ends:!1,position:!1,center:!1,bounds:!1,guides:!1,selected:!1},t)}}}),q=z.extend({_class:"Segment",beans:!0,_selection:0,initialize:function(t,e,i,n,r,s){var a,o,h,l,u=arguments.length;0<u&&(null==t||"object"==typeof t?l=1===u&&t&&"point"in t?(a=t.point,o=t.handleIn,h=t.handleOut,t.selection):(a=t,o=e,h=i,n):(a=[t,e],o=i!==j?[i,n]:null,h=r!==j?[r,s]:null)),new X(a,this,"_point"),new X(o,this,"_handleIn"),new X(h,this,"_handleOut"),l&&this.setSelection(l)},_serialize:function(t,e){var i=this._point,n=this._selection,i=n||this.hasHandles()?[i,this._handleIn,this._handleOut]:i;return n&&i.push(n),z.serialize(i,t,!0,e)},_changed:function(t){var e,i,n,r=this._path;r&&(e=r._curves,i=this._index,e&&(t&&t!==this._point&&t!==this._handleIn||!(n=0<i?e[i-1]:r._closed?e[e.length-1]:null)||n._changed(),t&&t!==this._point&&t!==this._handleOut||!(n=e[i])||n._changed()),r._changed(41))},getPoint:function(){return this._point},setPoint:function(){this._point.set(P.read(arguments))},getHandleIn:function(){return this._handleIn},setHandleIn:function(){this._handleIn.set(P.read(arguments))},getHandleOut:function(){return this._handleOut},setHandleOut:function(){this._handleOut.set(P.read(arguments))},hasHandles:function(){return!this._handleIn.isZero()||!this._handleOut.isZero()},isSmooth:function(){var t=this._handleIn,e=this._handleOut;return!t.isZero()&&!e.isZero()&&t.isCollinear(e)},clearHandles:function(){this._handleIn._set(0,0),this._handleOut._set(0,0)},getSelection:function(){return this._selection},setSelection:function(t){var e=this._selection,i=this._path;this._selection=t=t||0,i&&t!==e&&(i._updateSelection(this,e,t),i._changed(257))},_changeSelection:function(t,e){var i=this._selection;this.setSelection(e?i|t:i&~t)},isSelected:function(){return!!(7&this._selection)},setSelected:function(t){this._changeSelection(7,t)},getIndex:function(){return this._index!==j?this._index:null},getPath:function(){return this._path||null},getCurve:function(){var t=this._path,e=this._index;return t&&(0<e&&!t._closed&&e===t._segments.length-1&&e--,t.getCurves()[e])||null},getLocation:function(){var t=this.getCurve();return t?new H(t,this===t._segment1?0:1):null},getNext:function(){var t=this._path&&this._path._segments;return t&&(t[this._index+1]||this._path._closed&&t[0])||null},smooth:function(t,e,i){var t=t||{},n=t.type,t=t.factor,r=this.getPrevious(),s=this.getNext(),a=(r||this)._point,o=this._point,h=(s||this)._point,l=a.getDistance(o),u=o.getDistance(h);if(n&&"catmull-rom"!==n){if("geometric"!==n)throw new Error("Smoothing method '"+n+"' not supported.");r&&s&&(n=a.subtract(h),f=(p=t===j?.4:t)*l/(l+u),e||this.setHandleIn(n.multiply(f)),i||this.setHandleOut(n.multiply(f-p)))}else{var c,d,n=t===j?.5:t,f=Math.pow(l,n),p=f*f,t=Math.pow(u,n),l=t*t;!e&&r&&(c=2*l+3*t*f+p,this.setHandleIn(0!==(d=3*t*(t+f))?new P((l*a._x+c*o._x-p*h._x)/d-o._x,(l*a._y+c*o._y-p*h._y)/d-o._y):new P)),!i&&s&&(c=2*p+3*f*t+l,this.setHandleOut(0!==(d=3*f*(f+t))?new P((p*h._x+c*o._x-l*a._x)/d-o._x,(p*h._y+c*o._y-l*a._y)/d-o._y):new P))}},getPrevious:function(){var t=this._path&&this._path._segments;return t&&(t[this._index-1]||this._path._closed&&t[t.length-1])||null},isFirst:function(){return!this._index},isLast:function(){var t=this._path;return t&&this._index===t._segments.length-1||!1},reverse:function(){var t=this._handleIn,e=this._handleOut,i=t.clone();t.set(e),e.set(i)},reversed:function(){return new q(this._point,this._handleOut,this._handleIn)},remove:function(){return!!this._path&&!!this._path.removeSegment(this._index)},clone:function(){return new q(this._point,this._handleIn,this._handleOut)},equals:function(t){return t===this||t&&this._class===t._class&&this._point.equals(t._point)&&this._handleIn.equals(t._handleIn)&&this._handleOut.equals(t._handleOut)||!1},toString:function(){var t=["point: "+this._point];return this._handleIn.isZero()||t.push("handleIn: "+this._handleIn),this._handleOut.isZero()||t.push("handleOut: "+this._handleOut),"{ "+t.join(", ")+" }"},transform:function(t){this._transformCoordinates(t,new Array(6),!0),this._changed()},interpolate:function(t,e,i){var n=1-i,r=t._point,s=e._point,a=t._handleIn,o=e._handleIn,e=e._handleOut,t=t._handleOut;this._point._set(n*r._x+i*s._x,n*r._y+i*s._y,!0),this._handleIn._set(n*a._x+i*o._x,n*a._y+i*o._y,!0),this._handleOut._set(n*t._x+i*e._x,n*t._y+i*e._y,!0),this._changed()},_transformCoordinates:function(t,e,i){var n=this._point,r=i&&this._handleIn.isZero()?null:this._handleIn,s=i&&this._handleOut.isZero()?null:this._handleOut,a=n._x,o=n._y,h=2;return e[0]=a,e[1]=o,r&&(e[h++]=r._x+a,e[h++]=r._y+o),s&&(e[h++]=s._x+a,e[h++]=s._y+o),t&&(t._transformCoordinates(e,e,h/2),a=e[0],o=e[1],i?(n._x=a,n._y=o,h=2,r&&(r._x=e[h++]-a,r._y=e[h++]-o),s&&(s._x=e[h++]-a,s._y=e[h++]-o)):(r||(e[h++]=a,e[h++]=o),s||(e[h++]=a,e[h++]=o))),e}}),X=P.extend({initialize:function(t,e,i){var n,r,s;t?(n=t[0])!==j?r=t[1]:((n=(s=t).x)===j&&(n=(s=P.read(arguments)).x),r=s.y,s=s.selected):n=r=0,this._x=n,this._y=r,(this._owner=e)[i]=this,s&&this.setSelected(!0)},_set:function(t,e){return this._x=t,this._y=e,this._owner._changed(this),this},getX:function(){return this._x},setX:function(t){this._x=t,this._owner._changed(this)},getY:function(){return this._y},setY:function(t){this._y=t,this._owner._changed(this)},isZero:function(){var t=F.isZero;return t(this._x)&&t(this._y)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(t){this._owner._changeSelection(this._getSelection(),t)},_getSelection:function(){var t=this._owner;return this===t._point?1:this===t._handleIn?2:this===t._handleOut?4:0}}),U=z.extend({_class:"Curve",beans:!0,initialize:function(t,e,i,n,r,s,a,o){var h,l,u,c,d,f,p=arguments.length;3===p?(this._path=t,h=e,l=i):p?1===p?"segment1"in t?(h=new q(t.segment1),l=new q(t.segment2)):"point1"in t?(u=t.point1,d=t.handle1,f=t.handle2,c=t.point2):Array.isArray(t)&&(u=[t[0],t[1]],c=[t[6],t[7]],d=[t[2]-t[0],t[3]-t[1]],f=[t[4]-t[6],t[5]-t[7]]):2===p?(h=new q(t),l=new q(e)):4===p?(u=t,d=e,f=i,c=n):8===p&&(u=[t,e],c=[a,o],d=[i-t,n-e],f=[r-a,s-o]):(h=new q,l=new q),this._segment1=h||new q(u,null,d),this._segment2=l||new q(c,f,null)},_serialize:function(t,e){return z.serialize(this.hasHandles()?[this.getPoint1(),this.getHandle1(),this.getHandle2(),this.getPoint2()]:[this.getPoint1(),this.getPoint2()],t,!0,e)},_changed:function(){this._length=this._bounds=j},clone:function(){return new U(this._segment1,this._segment2)},toString:function(){var t=["point1: "+this._segment1._point];return this._segment1._handleOut.isZero()||t.push("handle1: "+this._segment1._handleOut),this._segment2._handleIn.isZero()||t.push("handle2: "+this._segment2._handleIn),t.push("point2: "+this._segment2._point),"{ "+t.join(", ")+" }"},classify:function(){return U.classify(this.getValues())},remove:function(){var t,e,i=!1;return this._path&&(e=(t=this._segment2)._handleOut,i=t.remove())&&this._segment1._handleOut.set(e),i},getPoint1:function(){return this._segment1._point},setPoint1:function(){this._segment1._point.set(P.read(arguments))},getPoint2:function(){return this._segment2._point},setPoint2:function(){this._segment2._point.set(P.read(arguments))},getHandle1:function(){return this._segment1._handleOut},setHandle1:function(){this._segment1._handleOut.set(P.read(arguments))},getHandle2:function(){return this._segment2._handleIn},setHandle2:function(){this._segment2._handleIn.set(P.read(arguments))},getSegment1:function(){return this._segment1},getSegment2:function(){return this._segment2},getPath:function(){return this._path},getIndex:function(){return this._segment1._index},getNext:function(){var t=this._path&&this._path._curves;return t&&(t[this._segment1._index+1]||this._path._closed&&t[0])||null},getPrevious:function(){var t=this._path&&this._path._curves;return t&&(t[this._segment1._index-1]||this._path._closed&&t[t.length-1])||null},isFirst:function(){return!this._segment1._index},isLast:function(){var t=this._path;return t&&this._segment1._index===t._curves.length-1||!1},isSelected:function(){return this.getPoint1().isSelected()&&this.getHandle1().isSelected()&&this.getHandle2().isSelected()&&this.getPoint2().isSelected()},setSelected:function(t){this.getPoint1().setSelected(t),this.getHandle1().setSelected(t),this.getHandle2().setSelected(t),this.getPoint2().setSelected(t)},getValues:function(t){return U.getValues(this._segment1,this._segment2,t)},getPoints:function(){for(var t=this.getValues(),e=[],i=0;i<8;i+=2)e.push(new P(t[i],t[i+1]));return e}},{getLength:function(){return null==this._length&&(this._length=U.getLength(this.getValues(),0,1)),this._length},getArea:function(){return U.getArea(this.getValues())},getLine:function(){return new N(this._segment1._point,this._segment2._point)},getPart:function(t,e){return new U(U.getPart(this.getValues(),t,e))},getPartLength:function(t,e){return U.getLength(this.getValues(),t,e)},divideAt:function(t){return this.divideAtTime(t&&t.curve===this?t.time:this.getTimeAt(t))},divideAtTime:function(t,e){var i,n,r,s,a,o,h=null;return 1e-8<=t&&t<=1-1e-8&&(o=(t=U.subdivide(this.getValues(),t))[0],t=t[1],e=e||this.hasHandles(),i=this._segment1,n=this._segment2,r=this._path,e&&(i._handleOut._set(o[2]-o[0],o[3]-o[1]),n._handleIn._set(t[4]-t[6],t[5]-t[7])),s=o[6],a=o[7],o=new q(new P(s,a),e&&new P(o[4]-s,o[5]-a),e&&new P(t[2]-s,t[3]-a)),h=r?(r.insert(i._index+1,o),this.getNext()):(this._segment2=o,this._changed(),new U(o,n))),h},splitAt:function(t){var e=this._path;return e?e.splitAt(t):null},splitAtTime:function(t){return this.splitAt(this.getLocationAtTime(t))},divide:function(t,e){return this.divideAtTime(t===j?.5:e?t:this.getTimeAt(t))},split:function(t,e){return this.splitAtTime(t===j?.5:e?t:this.getTimeAt(t))},reversed:function(){return new U(this._segment2.reversed(),this._segment1.reversed())},clearHandles:function(){this._segment1._handleOut._set(0,0),this._segment2._handleIn._set(0,0)},statics:{getValues:function(t,e,i,n){var r=t._point,t=t._handleOut,s=e._handleIn,e=e._point,a=r.x,r=r.y,o=e.x,e=e.y,n=n?[a,r,a,r,o,e,o,e]:[a,r,a+t._x,r+t._y,o+s._x,e+s._y,o,e];return i&&i._transformCoordinates(n,n,4),n},subdivide:function(t,e){var i=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],t=t[7],l=1-(e=e===j?.5:e),u=l*i+e*r,c=l*n+e*s,r=l*r+e*a,s=l*s+e*o,a=l*a+e*h,o=l*o+e*t,d=l*u+e*r,f=l*c+e*s,r=l*r+e*a,s=l*s+e*o,p=l*d+e*r,l=l*f+e*s;return[[i,n,u,c,d,f,p,l],[p,l,r,s,a,o,h,t]]},getMonoCurves:function(t,e){var i=[],e=e?0:1,n=t[0+e],r=t[2+e],s=t[4+e],e=t[6+e];return!(r<=n==s<=r&&s<=r==e<=s||U.isStraight(t))&&(s=F.solveQuadratic(3*(r-s)-n+e,2*(n+s)-4*r,r-n,e=[],1e-8,1-1e-8))?(e.sort(),r=e[0],n=U.subdivide(t,r),i.push(n[0]),1<s&&(r=(e[1]-r)/(1-r),n=U.subdivide(n[1],r),i.push(n[0])),i.push(n[1])):i.push(t),i},solveCubic:function(t,e,i,n,r,s){var a=t[e],o=t[e+2],h=t[e+4],t=t[e+6],e=0;return e=a<i&&t<i&&o<i&&h<i||i<a&&i<t&&i<o&&i<h?e:F.solveCubic(t-a-(t=3*(o-a))-(h=3*(h-o)-t),h,t,a-i,n,r,s)},getTimeOf:function(t,e){var i=new P(t[0],t[1]),n=new P(t[6],t[7]);if(null===(e.isClose(i,1e-12)?0:e.isClose(n,1e-12)?1:null))for(var r=[e.x,e.y],s=[],a=0;a<2;a++)for(var o=U.solveCubic(t,a,r[a],s,0,1),h=0;h<o;h++){var l=s[h];if(e.isClose(U.getPoint(t,l),1e-7))return l}return e.isClose(i,1e-7)?0:e.isClose(n,1e-7)?1:null},getNearestTime:function(i,n){var t,e,r,s,a;if(U.isStraight(i))return t=i[0],e=i[1],0==(a=(r=i[6]-t)*r+(s=i[7]-e)*s)||(a=((n.x-t)*r+(n.y-e)*s)/a)<1e-12?0:.999999999999<a?1:U.getTimeOf(i,new P(t+a*r,e+a*s));var o=1/0,h=0;function l(t){var e;return 0<=t&&t<=1&&(e=n.getDistance(U.getPoint(i,t),!0))<o?(o=e,h=t,1):void 0}for(var u=0;u<=100;u++)l(u/100);for(var c=.005;1e-8<c;)l(h-c)||l(h+c)||(c/=2);return h},getPart:function(t,e,i){var n,r=i<e;return r&&(n=e,e=i,i=n),0<e&&(t=U.subdivide(t,e)[1]),i<1&&(t=U.subdivide(t,(i-e)/(1-e))[0]),r?[t[6],t[7],t[4],t[5],t[2],t[3],t[0],t[1]]:t},isFlatEnough:function(t,e){var i=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],t=t[7],r=3*r-2*i-h,s=3*s-2*n-t,a=3*a-2*h-i,h=3*o-2*t-n;return Math.max(r*r,a*a)+Math.max(s*s,h*h)<=16*e*e},getArea:function(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],t=t[7];return 3*((t-i)*(n+s)-(o-e)*(r+a)+r*(e-s)-n*(i-a)+t*(s+e/3)-o*(a+i/3))/20},getBounds:function(t){for(var e=t.slice(0,2),i=e.slice(),n=[0,0],r=0;r<2;r++)U._addBounds(t[r],t[r+2],t[r+4],t[r+6],r,0,e,i,n);return new x(e[0],e[1],i[0]-e[0],i[1]-e[1])},_addBounds:function(t,e,i,n,r,s,a,o,h){function l(t,e){var i=t-e,t=t+e;i<a[r]&&(a[r]=i),t>o[r]&&(o[r]=t)}var u=a[r]+(s/=2),c=o[r]-s;if(t<u||e<u||i<u||n<u||c<t||c<e||c<i||c<n)if(e<t!=e<n&&i<t!=i<n)l(t,0),l(n,0);else{var d=F.solveQuadratic(3*(e-i)-t+n,2*(t+i)-4*e,e-t,h);l(n,0);for(var f=0;f<d;f++){var p=h[f],g=1-p;1e-8<=p&&p<=1-1e-8&&l(g*g*g*t+3*g*g*p*e+3*g*p*p*i+p*p*p*n,s)}}}}},z.each(["getBounds","getStrokeBounds","getHandleBounds"],function(t){this[t]=function(){return this._bounds||(this._bounds={}),(this._bounds[t]||(this._bounds[t]=W[t]([this._segment1,this._segment2],!1,this._path))).clone()}},{}),z.each({isStraight:function(t,e,i,n){if(e.isZero()&&i.isZero())return!0;var r=n.subtract(t);if(!r.isZero()&&r.isCollinear(e)&&r.isCollinear(i)){var s=new N(t,n);if(s.getDistance(t.add(e))<1e-7&&s.getDistance(n.add(i))<1e-7)return t=r.dot(r),s=r.dot(e)/t,n=r.dot(i)/t,0<=s&&s<=1&&n<=0&&-1<=n}return!1},isLinear:function(t,e,i,n){n=n.subtract(t).divide(3);return e.equals(n)&&i.negate().equals(n)}},function(a,t){this[t]=function(t){var e=this._segment1,i=this._segment2;return a(e._point,e._handleOut,i._handleIn,i._point,t)},this.statics[t]=function(t,e){var i=t[0],n=t[1],r=t[6],s=t[7];return a(new P(i,n),new P(t[2]-i,t[3]-n),new P(t[4]-r,t[5]-s),new P(r,s),e)}},{statics:{},hasHandles:function(){return!this._segment1._handleOut.isZero()||!this._segment2._handleIn.isZero()},hasLength:function(t){return(!this.getPoint1().equals(this.getPoint2())||this.hasHandles())&&this.getLength()>(t||0)},isCollinear:function(t){return t&&this.isStraight()&&t.isStraight()&&this.getLine().isCollinear(t.getLine())},isHorizontal:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).y)<1e-8},isVertical:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).x)<1e-8}}),{beans:!1,getLocationAt:function(t,e){return this.getLocationAtTime(e?t:this.getTimeAt(t))},getLocationAtTime:function(t){return null!=t&&0<=t&&t<=1?new H(this,t):null},getTimeAt:function(t,e){return U.getTimeAt(this.getValues(),t,e)},getParameterAt:"#getTimeAt",getTimesWithTangent:function(){var t=P.read(arguments);return t.isZero()?[]:U.getTimesWithTangent(this.getValues(),t)},getOffsetAtTime:function(t){return this.getPartLength(0,t)},getLocationOf:function(){return this.getLocationAtTime(this.getTimeOf(P.read(arguments)))},getOffsetOf:function(){var t=this.getLocationOf.apply(this,arguments);return t?t.getOffset():null},getTimeOf:function(){return U.getTimeOf(this.getValues(),P.read(arguments))},getParameterOf:"#getTimeOf",getNearestLocation:function(){var t=P.read(arguments),e=this.getValues(),i=U.getNearestTime(e,t),e=U.getPoint(e,i);return new H(this,i,e,null,t.getDistance(e))},getNearestPoint:function(){var t=this.getNearestLocation.apply(this,arguments);return t&&t.getPoint()}},new function(){var t=["getPoint","getTangent","getNormal","getWeightedTangent","getWeightedNormal","getCurvature"];return z.each(t,function(n){this[n+"At"]=function(t,e){var i=this.getValues();return U[n](i,e?t:U.getTimeAt(i,t))},this[n+"AtTime"]=function(t){return U[n](this.getValues(),t)}},{statics:{_evaluateMethods:t}})},new function(){function u(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],t=t[7],h=9*(n-s)+3*(o-e),l=6*(e+s)-12*n,u=3*(n-e),c=9*(r-a)+3*(t-i),d=6*(i+a)-12*r,f=3*(r-i);return function(t){var e=(h*t+l)*t+u,t=(c*t+d)*t+f;return Math.sqrt(e*e+t*t)}}function c(t,e){return Math.max(2,Math.min(16,Math.ceil(32*Math.abs(e-t))))}function i(t,e,i,n){var r,s,a,o,h,l,u,c,d,f,p,g,m,_,v;return null==e||e<0||1<e?null:(f=t[0],m=t[1],r=t[2],s=t[3],p=t[4],g=t[5],a=t[6],t=t[7],(o=F.isZero)(r-f)&&o(s-m)&&(r=f,s=m),o(p-a)&&o(g-t)&&(p=a,g=t),l=a-f-(o=3*(r-f))-(h=3*(p-r)-o),d=t-m-(u=3*(s-m))-(c=3*(g-s)-u),0===i?(_=0===e?f:1===e?a:((l*e+h)*e+o)*e+f,v=0===e?m:1===e?t:((d*e+c)*e+u)*e+m):(0,v=e<1e-8?(_=o,u):1-1e-8<e?(_=3*(a-p),3*(t-g)):(_=(3*l*e+2*h)*e+o,(3*d*e+2*c)*e+u),n&&(0===_&&0===v&&(e<1e-8||1-1e-8<e)&&(_=p-r,v=g-s),f=Math.sqrt(_*_+v*v))&&(_/=f,v/=f),3===i&&(p=6*l*e+2*h,g=6*d*e+2*c,_=0!==(m=Math.pow(_*_+v*v,1.5))?(_*g-v*p)/m:0,v=0)),2===i?new P(v,-_):new P(_,v))}return{statics:{classify:function(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],t=t[7],h=n*(i-t)+r*(o-e)+e*t-i*o,n=3*(s*(r-i)+a*(e-n)+n*i-r*e),r=n-h,h=r-h+(e*(t-a)+i*(s-o)+o*a-t*s),e=Math.sqrt(h*h+r*r+n*n),i=0!==e?1/e:0,o=F.isZero,a="serpentine";function l(t,e,i){var n=e!==j,r=n&&0<e&&e<1,s=n&&0<i&&i<1;return!n||(r||s)&&("loop"!==t||r&&s)||(r=s=!(t="arch")),{type:t,roots:r||s?r&&s?e<i?[e,i]:[i,e]:[r?e:i]:null}}return r*=i,n*=i,o(h*=i)?o(r)?l(o(n)?"line":"quadratic"):l(a,n/(3*r)):o(t=3*r*r-4*h*n)?l("cusp",r/(2*h)):l(0<t?a:"loop",(r+(s=0<t?Math.sqrt(t/3):Math.sqrt(-t)))/(e=2*h),(r-s)/e)},getLength:function(t,e,i,n){var r,s;return e===j&&(e=0),i===j&&(i=1),U.isStraight(t)?(s=t,i<1&&(s=U.subdivide(s,i)[0],e/=i),r=(s=0<e?U.subdivide(s,e)[1]:s)[6]-s[0],s=s[7]-s[1],Math.sqrt(r*r+s*s)):F.integrate(n||u(t),e,i,c(e,i))},getTimeAt:function(t,e,i){var n,r,s,a,o,h,l;return i===j&&(i=e<0?1:0),0===e?i:(n=Math.abs,s=(r=0<e)?i:0,a=r?1:i,o=u(t),t=U.getLength(t,s,a,o),h=n(e)-t,n(h)<1e-12?r?a:s:1e-12<h?null:(l=0,F.findRoot(function(t){return l+=F.integrate(o,i,t,c(i,t)),i=t,l-e},o,i+e/t,s,a,32,1e-12)))},getPoint:function(t,e){return i(t,e,0,!1)},getTangent:function(t,e){return i(t,e,1,!0)},getWeightedTangent:function(t,e){return i(t,e,1,!1)},getNormal:function(t,e){return i(t,e,2,!0)},getWeightedNormal:function(t,e){return i(t,e,2,!1)},getCurvature:function(t,e){return i(t,e,3,!1).x},getPeaks:function(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=3*n-e-3*s+t[6],s=3*e-6*n+3*s,e=-3*e+3*n,n=3*r-i-3*a+t[7],t=3*i-6*r+3*a,a=-3*i+3*r,i=[];return F.solveCubic(9*(o*o+n*n),9*(o*s+t*n),2*(s*s+t*t)+3*(e*o+a*n),e*s+t*a,i,1e-8,1-1e-8),i.sort()}}}},new function(){function T(t,e,i,n,r,s,a){var o=!a&&i.getPrevious()===r,h=!a&&i!==r&&i.getNext()===r;null!==n&&(o?1e-8:0)<=n&&n<=(h?1-1e-8:1)&&null!==s&&(h?1e-8:0)<=s&&s<=(o?1-1e-8:1)&&(h=new H(i,n,null,a),o=new H(r,s,null,a),(h._intersection=o)._intersection=h,e&&!e(h)||H.insert(t,h,!0))}function I(t,e,i,n,r,s,a,o,h,l,u,c,d){var f,p,g,m,_,v,y,b,w,x,S,C,k,E,A;return 4096<=++h||40<=++o||(w=e[0],v=e[1],y=e[6],b=e[7],f=(p=0<(x=(_=N.getSignedDistance)(w,v,y,b,e[2],e[3]))*(S=_(w,v,y,b,e[4],e[5]))?.75:4/9)*Math.min(0,x,S),p=p*Math.max(0,x,S),v=(w=function(t,e,i,n){var r=[0,t],s=[1/3,e],a=[2/3,i],o=[1,n],e=e-(2*t+n)/3,i=i-(t+2*n)/3;n=e*i<0?[[r,s,o],[r,a,o]]:[2<=(t=e/i)?[r,s,o]:t<=.5?[r,a,o]:[r,s,a,o],[r,o]];return(e||i)<0?n.reverse():n}(C=_(w,v,y,b,t[0],t[1]),g=_(w,v,y,b,t[2],t[3]),m=_(w,v,y,b,t[4],t[5]),_=_(w,v,y,b,t[6],t[7])))[0],y=w[1],0===x&&0===S&&0===C&&0===g&&0===m&&0===_)||null==(b=L(v,y,f,p))||null==(w=L(v.reverse(),y.reverse(),f,p))||(x=l+(u-l)*b,S=l+(u-l)*w,Math.max(d-c,S-x)<1e-9?(k=(x+S)/2,A=(c+d)/2,T(r,s,a?n:i,a?A:k,a?i:n,a?k:A)):(t=U.getPart(t,b,w),C=d-c,h=.8<w-b?C<S-x?(k=(x+S)/2,h=I(e,(E=U.subdivide(t,.5))[0],n,i,r,s,!a,o,h,c,d,x,k),I(e,E[1],n,i,r,s,!a,o,h,c,d,k,S)):(A=(c+d)/2,h=I((E=U.subdivide(e,.5))[0],t,n,i,r,s,!a,o,h,c,A,x,S),I(E[1],t,n,i,r,s,!a,o,h,A,d,x,S)):0==C||1e-9<=C?I(e,t,n,i,r,s,!a,o,h,c,d,x,S):I(t,e,i,n,r,s,a,o,h,x,S,c,d))),h}function L(t,e,i,n){return t[0][1]<i?r(t,!0,i):e[0][1]>n?r(e,!1,n):t[0][0]}function r(t,e,i){for(var n=t[0][0],r=t[0][1],s=1,a=t.length;s<a;s++){var o=t[s][0],h=t[s][1];if(e?i<=h:h<=i)return h===i?o:n+(i-r)*(o-n)/(h-r);n=o,r=h}return null}function p(t,e,i,n,r){var s=F.isZero;if(s(n)&&s(r))return null===(s=U.getTimeOf(t,new P(e,i)))?[]:[s];for(var s=Math.atan2(-r,n),a=Math.sin(s),o=Math.cos(s),h=[],r=[],l=0;l<8;l+=2){var u=t[l]-e,c=t[l+1]-i;h.push(u*o-c*a,u*a+c*o)}return U.solveCubic(h,1,0,r,0,1),r}function v(t,e,i,n,r,s,a){for(var o=e[0],h=e[1],l=p(t,o,h,e[6]-o,e[7]-h),u=0,c=l.length;u<c;u++){var d=l[u],f=U.getPoint(t,d),f=U.getTimeOf(e,f);null!==f&&T(r,s,a?n:i,a?f:d,a?i:n,a?d:f)}}function y(t,e,i,n,r,s){var a=N.intersect(t[0],t[1],t[6],t[7],e[0],e[1],e[6],e[7]);a&&T(r,s,i,U.getTimeOf(t,a),n,U.getTimeOf(e,a))}function w(t,e,i,n,r,s){var a=Math.min,o=Math.max;if(o(t[0],t[2],t[4],t[6])+1e-12>a(e[0],e[2],e[4],e[6])&&a(t[0],t[2],t[4],t[6])-1e-12<o(e[0],e[2],e[4],e[6])&&o(t[1],t[3],t[5],t[7])+1e-12>a(e[1],e[3],e[5],e[7])&&a(t[1],t[3],t[5],t[7])-1e-12<o(e[1],e[3],e[5],e[7])){var h=b(t,e);if(h)for(var l=0;l<2;l++){var u=h[l];T(r,s,i,u[0],n,u[1],!0)}else{var a=U.isStraight(t),o=U.isStraight(e),c=a&&o,d=a&&!o,f=r.length;if((c?y:a||o?v:I)(d?e:t,d?t:e,d?n:i,d?i:n,r,s,d,0,0,0,1,0,1),!c||r.length===f)for(l=0;l<4;l++){var p=l>>1,g=1&l,m=6*p,_=6*g,m=new P(t[m],t[1+m]),_=new P(e[_],e[1+_]);m.isClose(_,1e-12)&&T(r,s,i,p,n,g)}}}return r}function x(t,e,i,n){t=U.classify(t);return"loop"===t.type&&T(i,n,e,(n=t.roots)[0],e,n[1]),i}function b(t,e){function i(t){var e=t[6]-t[0],t=t[7]-t[1];return e*e+t*t}var n=Math.abs,r=N.getDistance,s=1e-7,a=U.isStraight(t),o=U.isStraight(e),h=a&&o,l=i(t)<i(e),u=l?e:t,l=l?t:e,c=u[0],d=u[1],f=u[6]-c,p=u[7]-d;if(r(c,d,f,p,l[0],l[1],!0)<s&&r(c,d,f,p,l[6],l[7],!0)<s)!h&&r(c,d,f,p,u[2],u[3],!0)<s&&r(c,d,f,p,u[4],u[5],!0)<s&&r(c,d,f,p,l[2],l[3],!0)<s&&r(c,d,f,p,l[4],l[5],!0)<s&&(a=o=h=!0);else if(h)return null;if(a^o)return null;for(var g=[t,e],m=[],_=0;_<4&&m.length<2;_++){var v=1&_,y=1^v,b=_>>1,y=U.getTimeOf(g[v],new P(g[y][b?6:0],g[y][b?7:1]));if(null!=y&&(v=v?[b,y]:[y,b],!m.length||1e-8<n(v[0]-m[0][0])&&1e-8<n(v[1]-m[0][1]))&&m.push(v),2<_&&!m.length)break}return m=2!==m.length||!h&&(u=U.getPart(t,m[0][0],m[1][0]),n((r=U.getPart(e,m[0][1],m[1][1]))[2]-u[2])>s||n(r[3]-u[3])>s||n(r[4]-u[4])>s||n(r[5]-u[5])>s)?null:m}return{getIntersections:function(t){var e=this.getValues(),i=t&&t!==this&&t.getValues();return i?w(e,i,this,t,[]):x(e,this,[])},statics:{getOverlaps:b,getIntersections:function(t,e,i,n,r,s){for(var a=!e,o=t.length,h=(e=a?t:e).length,l=new Array(o),u=a?l:new Array(h),c=[],d=0;d<o;d++)l[d]=t[d].getValues(n);if(!a)for(d=0;d<h;d++)u[d]=e[d].getValues(r);for(var f=K.findCurveBoundsCollisions(l,u,1e-7),p=0;p<o;p++){var g=t[p],m=l[p],_=(a&&x(m,g,c,i),f[p]);if(_)for(var v=0;v<_.length;v++){if(s&&c.length)return c;var y,b=_[v];(!a||p<b)&&(y=e[b],w(m,u[b],g,y,c,i))}}return c},getCurveLineIntersections:p,getTimesWithTangent:function(t,e){var i,n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],t=t[7],u=(e=e.normalize()).x,e=e.y,l=3*l-9*o+9*s-3*n,t=3*t-9*h+9*a-3*r,o=6*o-12*s+6*n,h=6*h-12*a+6*r,s=3*s-3*n,n=3*a-3*r,a=2*l*e-2*t*u,r=[];return Math.abs(a)<F.CURVETIME_EPSILON?0!=(a=l*h-t*o)&&0<=(i=-(l*n-t*s)/a)&&i<=1&&r.push(i):(i=o*e-h*u,0<=(o=(o*o-4*l*s)*e*e+(-2*o*h+4*t*s+4*l*n)*u*e+(h*h-4*t*n)*u*u)&&0!=a&&(l=(-i+(s=Math.sqrt(o)))/a,0<=(e=-(i+s)/a)&&e<=1&&r.push(e),0<=l)&&l<=1&&r.push(l)),r}}}}),H=z.extend({_class:"CurveLocation",initialize:function(t,e,i,n,r){var s;.99999999<=e&&(s=t.getNext())&&(e=0,t=s),this._setCurve(t),this._time=e,this._point=i||t.getPointAtTime(e),this._overlap=n,this._distance=r,this._intersection=this._next=this._previous=null},_setPath:function(t){this._path=t,this._version=t?t._version:0},_setCurve:function(t){this._setPath(t._path),this._curve=t,this._segment=null,this._segment1=t._segment1,this._segment2=t._segment2},_setSegment:function(t){var e=t.getCurve();e?this._setCurve(e):(this._setPath(t._path),this._segment1=t,this._segment2=null),this._segment=t,this._time=t===this._segment1?0:1,this._point=t._point.clone()},getSegment:function(){var t,e,i=this._segment;return i||(t=this.getCurve(),0===(e=this.getTime())?i=t._segment1:1===e?i=t._segment2:null!=e&&(i=t.getPartLength(0,e)<t.getPartLength(e,1)?t._segment1:t._segment2),this._segment=i),i},getCurve:function(){var t=this._path,e=this;function i(t){t=t&&t.getCurve();if(t&&null!=(e._time=t.getTimeOf(e._point)))return e._setCurve(t),t}return t&&t._version!==this._version&&(this._time=this._offset=this._curveOffset=this._curve=null),this._curve||i(this._segment)||i(this._segment1)||i(this._segment2.getPrevious())},getPath:function(){var t=this.getCurve();return t&&t._path},getIndex:function(){var t=this.getCurve();return t&&t.getIndex()},getTime:function(){var t=this.getCurve(),e=this._time;return t&&null==e?this._time=t.getTimeOf(this._point):e},getParameter:"#getTime",getPoint:function(){return this._point},getOffset:function(){if(null==(t=this._offset)){var t=0,e=this.getPath(),i=this.getIndex();if(e&&null!=i)for(var n=e.getCurves(),r=0;r<i;r++)t+=n[r].getLength();this._offset=t+=this.getCurveOffset()}return t},getCurveOffset:function(){var t,e,i=this._curveOffset;return null==i&&(t=this.getCurve(),e=this.getTime(),this._curveOffset=i=null!=e&&t&&t.getPartLength(0,e)),i},getIntersection:function(){return this._intersection},getDistance:function(){return this._distance},divide:function(){var t=this.getCurve(),t=t&&t.divideAtTime(this.getTime());return t&&this._setSegment(t._segment1),t},split:function(){var t=this.getCurve(),e=t._path,t=t&&t.splitAtTime(this.getTime());return t&&this._setSegment(e.getLastSegment()),t},equals:function(t,e){var i,n,r,s,a=this===t;return!a&&t instanceof H&&(i=this.getCurve(),n=t.getCurve(),(i=i._path)===n._path)&&(r=(n=Math.abs)(this.getOffset()-t.getOffset()),s=!e&&this._intersection,e=!e&&t._intersection,a=(r<1e-7||i&&n(i.getLength()-r)<1e-7)&&(!s&&!e||s&&e&&s.equals(e,!0))),a},toString:function(){var t=[],e=this.getPoint(),i=w.instance,e=(e&&t.push("point: "+e),this.getIndex()),e=(null!=e&&t.push("index: "+e),this.getTime());return null!=e&&t.push("time: "+i.number(e)),null!=this._distance&&t.push("distance: "+i.number(this._distance)),"{ "+t.join(", ")+" }"},isTouching:function(){var t,e=this._intersection;return!(!e||!this.getTangent().isCollinear(e.getTangent())||(t=this.getCurve(),e=e.getCurve(),t.isStraight()&&e.isStraight()&&t.getLine().intersect(e.getLine())))},isCrossing:function(){var t=this._intersection;if(!t)return!1;var e=this.getTime(),i=t.getTime(),n=1-1e-8,r=1e-8<=e&&e<=n,s=1e-8<=i&&i<=n;if(r&&s)return!this.isTouching();var a=this.getCurve(),o=a&&e<1e-8?a.getPrevious():a,t=t.getCurve(),h=t&&i<1e-8?t.getPrevious():t;if(n<e&&(a=a.getNext()),n<i&&(t=t.getNext()),!(o&&a&&h&&t))return!1;var l=[];function u(t,e){var t=t.getValues(),i=U.classify(t).roots||U.getPeaks(t),n=i.length,t=U.getLength(t,e&&n?i[n-1]:0,!e&&n?i[0]:1);l.push(n?t:t/32)}function c(t,e,i){return e<i?e<t&&t<i:e<t||t<i}r||(u(o,!0),u(a,!1)),s||(u(h,!0),u(t,!1));var n=this.getPoint(),d=Math.min.apply(Math,l),e=r?a.getTangentAtTime(e):a.getPointAt(d).subtract(n),a=r?e.negate():o.getPointAt(-d).subtract(n),o=s?t.getTangentAtTime(i):t.getPointAt(d).subtract(n),i=s?o.negate():h.getPointAt(-d).subtract(n),t=a.getAngle(),s=e.getAngle(),h=i.getAngle(),d=o.getAngle();return!!(r?c(t,h,d)^c(s,h,d)&&c(t,d,h)^c(s,d,h):c(h,t,s)^c(d,t,s)&&c(h,s,t)^c(d,s,t))},hasOverlap:function(){return!!this._overlap}},z.each(U._evaluateMethods,function(t){var i=t+"At";this[t]=function(){var t=this.getCurve(),e=this.getTime();return null!=e&&t&&t[i](e,!0)}},{preserve:!0}),new function(){function n(r,s,t){var a=r.length,e=0,i=a-1;function n(t,e){for(var i=t+e;-1<=i&&i<=a;i+=e){var n=r[(i%a+a)%a];if(!s.getPoint().isClose(n.getPoint(),1e-7))break;if(s.equals(n))return n}return null}for(;e<=i;){var o=e+i>>>1,h=r[o];if(t&&(l=s.equals(h)?h:n(o,-1)||n(o,1)))return s._overlap&&(l._overlap=l._intersection._overlap=!0),l;var l=s.getPath(),u=h.getPath();(l!==u?l._id-u._id:s.getIndex()+s.getTime()-(h.getIndex()+h.getTime()))<0?i=o-1:e=1+o}return r.splice(e,0,s),s}return{statics:{insert:n,expand:function(t){for(var e=t.slice(),i=t.length-1;0<=i;i--)n(e,t[i]._intersection,!1);return e}}}}),Q=V.extend({_class:"PathItem",_selectBounds:!1,_canScaleStroke:!0,beans:!0,initialize:function(){},statics:{create:function(t){var e,i,n;return z.isPlainObject(t)?(i=t.segments,e=t.pathData):Array.isArray(t)?i=t:"string"==typeof t&&(e=t),i?n=(i=i[0])&&Array.isArray(i[0]):e&&(n=1<(e.match(/m/gi)||[]).length||/z\s*\S+/i.test(e)),new(n?G:W)(t)}},_asPathItem:function(){return this},isClockwise:function(){return 0<=this.getArea()},setClockwise:function(t){this.isClockwise()!=(t=!!t)&&this.reverse()},setPathData:function(t){var e,i,n=t&&t.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/gi),r=!1,s=new P,a=new P;function o(t,e){t=+c[t];return r&&(t+=s[e]),t}function h(t){return new P(o(t,"x"),o(t+1,"y"))}this.clear();for(var l=0,u=n&&n.length;l<u;l++){var c,d=n[l],f=d[0],p=f.toLowerCase(),g=(c=d.match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g))&&c.length,r=f===p;switch("z"!==e||/[mz]/.test(p)||this.moveTo(s),p){case"m":case"l":for(var m="m"===p,_=0;_<g;_+=2)this[m?"moveTo":"lineTo"](s=h(_)),m&&(a=s,m=!1);i=s;break;case"h":case"v":for(var v="h"===p?"x":"y",s=s.clone(),_=0;_<g;_++)s[v]=o(_,v),this.lineTo(s);i=s;break;case"c":for(_=0;_<g;_+=6)this.cubicCurveTo(h(_),i=h(_+2),s=h(_+4));break;case"s":for(_=0;_<g;_+=4)this.cubicCurveTo(/[cs]/.test(e)?s.multiply(2).subtract(i):s,i=h(_),s=h(_+2)),e=p;break;case"q":for(_=0;_<g;_+=4)this.quadraticCurveTo(i=h(_),s=h(_+2));break;case"t":for(_=0;_<g;_+=2)this.quadraticCurveTo(i=/[qt]/.test(e)?s.multiply(2).subtract(i):s,s=h(_)),e=p;break;case"a":for(_=0;_<g;_+=7)this.arcTo(s=h(_+5),new O(+c[_],+c[_+1]),+c[_+2],+c[_+4],+c[_+3]);break;case"z":this.closePath(1e-12),s=a}e=p}},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_contains:function(t){t=t.isInside(this.getBounds({internal:!0,handle:!0}))?this._getWinding(t):{};return t.onPath||!!("evenodd"===this.getFillRule()?1&t.windingL||1&t.windingR:t.winding)},getIntersections:function(t,e,i,n){var r=this===t||!t,s=this._matrix._orNullIfIdentity(),i=r?s:(i||t._matrix)._orNullIfIdentity();return r||this.getBounds(s).intersects(t.getBounds(i),1e-12)?U.getIntersections(this.getCurves(),!r&&t.getCurves(),e,s,i,n):[]},getCrossings:function(t){return this.getIntersections(t,function(t){return t.isCrossing()})},getNearestLocation:function(){for(var t=P.read(arguments),e=this.getCurves(),i=1/0,n=null,r=0,s=e.length;r<s;r++){var a=e[r].getNearestLocation(t);a._distance<i&&(i=a._distance,n=a)}return n},getNearestPoint:function(){var t=this.getNearestLocation.apply(this,arguments);return t&&t.getPoint()},interpolate:function(t,e,i){var n=!this._children,r=n?"_segments":"_children",s=t[r],a=e[r],o=this[r];if(!s||!a||s.length!==a.length)throw new Error("Invalid operands in interpolate() call: "+t+", "+e);var r=o.length,h=a.length;if(r<h)for(var l=n?q:W,u=r;u<h;u++)this.add(new l);else h<r&&this[n?"removeSegments":"removeChildren"](h,r);for(u=0;u<h;u++)o[u].interpolate(s[u],a[u],i);n&&(this.setClosed(t._closed),this._changed(9))},compare:function(t){var e=!1;if(t){for(var i=this._children||[this],n=t._children?t._children.slice():[t],t=i.length,r=n.length,s=[],a=0,o=(e=!0,K.findItemBoundsCollisions(i,n,F.GEOMETRIC_EPSILON)),h=t-1;0<=h&&e;h--){var l=i[h],e=!1,u=o[h];if(u)for(var c=u.length-1;0<=c&&!e;c--)l.compare(n[u[c]])&&(s[u[c]]||(s[u[c]]=!0,a++),e=!0)}e=e&&a===r}return e}}),W=Q.extend({_class:"Path",_serializeFields:{segments:[],closed:!1},initialize:function(t){this._closed=!1,this._segments=[],this._version=0;var e=arguments,e=Array.isArray(t)?"object"==typeof t[0]?t:e:!t||t.size!==j||t.x===j&&t.point===j?null:e;e&&0<e.length?this.setSegments(e):(this._curves=j,this._segmentSelection=0,e||"string"!=typeof t||(this.setPathData(t),t=null)),this._initialize(!e&&t)},_equals:function(t){return this._closed===t._closed&&z.equals(this._segments,t._segments)},copyContent:function(t){this.setSegments(t._segments),this._closed=t._closed},_changed:function t(e){if(t.base.call(this,e),8&e){if(this._length=this._area=j,32&e)this._version++;else if(this._curves)for(var i=0,n=this._curves.length;i<n;i++)this._curves[i]._changed()}else 64&e&&(this._bounds=j)},getStyle:function(){var t=this._parent;return(t instanceof G?t:this)._style},getSegments:function(){return this._segments},setSegments:function(t){var e,i=this.isFullySelected(),n=t&&t.length;this._segments.length=0,this._segmentSelection=0,this._curves=j,n&&("boolean"==typeof(e=t[n-1])&&(this.setClosed(e),n--),this._add(q.readList(t,0,{},n))),i&&this.setFullySelected(!0)},getFirstSegment:function(){return this._segments[0]},getLastSegment:function(){return this._segments[this._segments.length-1]},getCurves:function(){var t=this._curves,e=this._segments;if(!t)for(var i=this._countCurves(),t=this._curves=new Array(i),n=0;n<i;n++)t[n]=new U(this,e[n],e[n+1]||e[0]);return t},getFirstCurve:function(){return this.getCurves()[0]},getLastCurve:function(){var t=this.getCurves();return t[t.length-1]},isClosed:function(){return this._closed},setClosed:function(t){var e;this._closed!=(t=!!t)&&(this._closed=t,this._curves&&(e=this._curves.length=this._countCurves(),t)&&(this._curves[e-1]=new U(this,this._segments[e-1],this._segments[0])),this._changed(41))}},{beans:!0,getPathData:function(i,t){var n,r,s,a,o,h,l,u,e=this._segments,c=e.length,d=new w(t),f=new Array(6),p=!0,g=[];function m(t,e){t._transformCoordinates(i,f),n=f[0],r=f[1],p?(g.push("M"+d.pair(n,r)),p=!1):(o=f[2],h=f[3],o===n&&h===r&&l===s&&u===a?e||(t=n-s,e=r-a,g.push(0==t?"v"+d.number(e):0==e?"h"+d.number(t):"l"+d.pair(t,e))):g.push("c"+d.pair(l-s,u-a)+" "+d.pair(o-s,h-a)+" "+d.pair(n-s,r-a))),s=n,a=r,l=f[4],u=f[5]}if(!c)return"";for(var _=0;_<c;_++)m(e[_]);return this._closed&&0<c&&(m(e[0],!0),g.push("z")),g.join("")},isEmpty:function(){return!this._segments.length},_transformContent:function(t){for(var e=this._segments,i=new Array(6),n=0,r=e.length;n<r;n++)e[n]._transformCoordinates(t,i,!0);return!0},_add:function(t,e){for(var i=this._segments,n=this._curves,r=t.length,s=null==e,e=s?i.length:e,a=0;a<r;a++){var o=t[a];(o=o._path?t[a]=o.clone():o)._path=this,o._index=e+a,o._selection&&this._updateSelection(o,0,o._selection)}if(s)z.push(i,t);else{i.splice.apply(i,[e,0].concat(t));for(var a=e+r,h=i.length;a<h;a++)i[a]._index=a}if(n){var s=this._countCurves(),l=0<e&&e+r-1===s?e-1:e,u=l,c=Math.min(l+r,s);t._curves&&(n.splice.apply(n,[l,0].concat(t._curves)),u+=t._curves.length);for(a=u;a<c;a++)n.splice(a,0,new U(this,null,null));this._adjustCurves(l,c)}return this._changed(41),t},_adjustCurves:function(t,e){for(var i,n=this._segments,r=this._curves,s=t;s<e;s++)(i=r[s])._path=this,i._segment1=n[s],i._segment2=n[s+1]||n[0],i._changed();(i=r[this._closed&&!t?n.length-1:t-1])&&(i._segment2=n[t]||n[0],i._changed()),(i=r[e])&&(i._segment1=n[e],i._changed())},_countCurves:function(){var t=this._segments.length;return!this._closed&&0<t?t-1:t},add:function(t){var e=arguments;return 1<e.length&&"number"!=typeof t?this._add(q.readList(e)):this._add([q.read(e)])[0]},insert:function(t,e){var i=arguments;return 2<i.length&&"number"!=typeof e?this._add(q.readList(i,1),t):this._add([q.read(i,1)],t)[0]},addSegment:function(){return this._add([q.read(arguments)])[0]},insertSegment:function(t){return this._add([q.read(arguments,1)],t)[0]},addSegments:function(t){return this._add(q.readList(t))},insertSegments:function(t,e){return this._add(q.readList(e),t)},removeSegment:function(t){return this.removeSegments(t,t+1)[0]||null},removeSegments:function(t,e,i){t=t||0,e=z.pick(e,this._segments.length);var n=this._segments,r=this._curves,s=n.length,a=n.splice(t,e-t),o=a.length;if(o){for(var h=0;h<o;h++){var l=a[h];l._selection&&this._updateSelection(l,l._selection,0),l._index=l._path=null}for(var h=t,u=n.length;h<u;h++)n[h]._index=h;if(r){for(e=0<t&&e===s+(this._closed?1:0)?t-1:t,h=(r=r.splice(e,o)).length-1;0<=h;h--)r[h]._path=null;i&&(a._curves=r.slice(1)),this._adjustCurves(e,e)}this._changed(41)}return a},clear:"#removeSegments",hasHandles:function(){for(var t=this._segments,e=0,i=t.length;e<i;e++)if(t[e].hasHandles())return!0;return!1},clearHandles:function(){for(var t=this._segments,e=0,i=t.length;e<i;e++)t[e].clearHandles()},getLength:function(){if(null==this._length){for(var t=this.getCurves(),e=0,i=0,n=t.length;i<n;i++)e+=t[i].getLength();this._length=e}return this._length},getArea:function(){if(null==(i=this._area)){for(var t=this._segments,e=this._closed,i=0,n=0,r=t.length;n<r;n++){var s=n+1===r;i+=U.getArea(U.getValues(t[n],t[s?0:n+1],null,s&&!e))}this._area=i}return i},isFullySelected:function(){var t=this._segments.length;return this.isSelected()&&0<t&&this._segmentSelection===7*t},setFullySelected:function(t){t&&this._selectSegments(!0),this.setSelected(t)},setSelection:function t(e){1&e||this._selectSegments(!1),t.base.call(this,e)},_selectSegments:function(t){var e=this._segments,i=e.length,n=t?7:0;this._segmentSelection=n*i;for(var r=0;r<i;r++)e[r]._selection=n},_updateSelection:function(t,e,i){t._selection=i,0<(this._segmentSelection+=i-e)&&this.setSelected(!0)},divideAt:function(t){var t=this.getLocationAt(t);return t&&(t=t.getCurve().divideAt(t.getCurveOffset()))?t._segment1:null},splitAt:function(t){var e,t=this.getLocationAt(t),i=t&&t.index,t=t&&t.time,n=(1-1e-8<t&&(i++,t=0),this.getCurves());return 0<=i&&i<n.length?(1e-8<=t&&n[i++].divideAtTime(t),n=this.removeSegments(i,this._segments.length,!0),this._closed?(this.setClosed(!1),e=this):((e=new W(V.NO_INSERT)).insertAbove(this),e.copyAttributes(this)),e._add(n,0),this.addSegment(n[0]),e):null},split:function(t,e){t=e===j?t:(t=this.getCurves()[t])&&t.getLocationAtTime(e);return null!=t?this.splitAt(t):null},join:function(t,e){e=e||0;if(t&&t!==this){var i=t._segments,n=this.getLastSegment(),r=t.getLastSegment();if(!r)return this;n&&n._point.isClose(r._point,e)&&t.reverse();var s=t.getFirstSegment();n&&n._point.isClose(s._point,e)?(n.setHandleOut(s._handleOut),this._add(i.slice(1))):((n=this.getFirstSegment())&&n._point.isClose(s._point,e)&&t.reverse(),r=t.getLastSegment(),n&&n._point.isClose(r._point,e)?(n.setHandleIn(r._handleIn),this._add(i.slice(0,i.length-1),0)):this._add(i.slice())),t._closed&&this._add([i[0]]),t.remove()}s=this.getFirstSegment(),n=this.getLastSegment();return s!==n&&s._point.isClose(n._point,e)&&(s.setHandleIn(n._handleIn),n.remove(),this.setClosed(!0)),this},reduce:function(t){for(var e=this.getCurves(),i=t&&t.simplify,n=i?1e-7:0,r=e.length-1;0<=r;r--){var s=e[r];!s.hasHandles()&&(!s.hasLength(n)||i&&s.isCollinear(s.getNext()))&&s.remove()}return this},reverse:function(){this._segments.reverse();for(var t=0,e=this._segments.length;t<e;t++){var i=this._segments[t],n=i._handleIn;i._handleIn=i._handleOut,i._handleOut=n,i._index=t}this._curves=null,this._changed(9)},flatten:function(t){for(var e=new J(this,t||.25,256,!0).parts,i=e.length,n=[],r=0;r<i;r++)n.push(new q(e[r].curve.slice(0,2)));!this._closed&&0<i&&n.push(new q(e[i-1].curve.slice(6))),this.setSegments(n)},simplify:function(t){t=new tt(this).fit(t||2.5);return t&&this.setSegments(t),!!t},smooth:function(t){var r=this,e=t||{},t=e.type||"asymmetric",i=this._segments,s=i.length,a=this._closed;function n(t,e){var i=t&&t.index;if(null!=i){var n=t.path;if(n&&n!==r)throw new Error(t._class+" "+i+" of "+n+" is not part of "+r);e&&t instanceof U&&i++}else i="number"==typeof t?t:e;return Math.min(i<0&&a?i%s:i<0?i+s:i,s-1)}var o=a&&e.from===j&&e.to===j,h=n(e.from,0),l=n(e.to,s-1);if(l<h&&(a?h-=s:(c=h,h=l,l=c)),/^(?:asymmetric|continuous)$/.test(t)){var u="asymmetric"===t,c=Math.min,t=l-h+1,d=t-1,t=o?c(t,4):1,f=t,p=[];if(a||(f=c(1,h),t=c(1,s-l-1)),!((d+=f+t)<=1)){for(var g=0,m=h-f;g<=d;g++,m++)p[g]=i[(m<0?m+s:m)%s]._point;for(var _=d-1,v=[T=p[0]._x+2*p[1]._x],y=[I=p[0]._y+2*p[1]._y],b=[A=2],w=[],x=[],g=1;g<d;g++)var S=g<_,C=S?4:u?3:8,k=S?2:u?0:1,E=(S||u?1:2)/A,A=b[g]=(S?4:u?2:7)-E,T=v[g]=C*p[g]._x+k*p[g+1]._x-E*T,I=y[g]=C*p[g]._y+k*p[g+1]._y-E*I;w[_]=v[_]/b[_],x[_]=y[_]/b[_];for(g=d-2;0<=g;g--)w[g]=(v[g]-w[g+1])/b[g],x[g]=(y[g]-x[g+1])/b[g];w[d]=(3*p[d]._x-w[_])/2,x[d]=(3*p[d]._y-x[_])/2;for(var g=f,L=d-t,m=h;g<=L;g++,m++){var P=i[m<0?m+s:m],O=P._point,M=w[g]-O._x,O=x[g]-O._y;(o||g<L)&&P.setHandleOut(M,O),(o||f<g)&&P.setHandleIn(-M,-O)}}}else for(g=h;g<=l;g++)i[g<0?g+s:g].smooth(e,!o&&g===h,!o&&g===l)},toShape:function(t){var a,e,i,n,r,s,o,h;return this._closed&&(a=this._segments,!this.hasHandles()&&4===a.length&&l(0,2)&&l(1,3)&&(o=(s=a[s=1]).getPrevious(),h=s.getNext(),o._handleOut.isZero())&&s._handleIn.isZero()&&s._handleOut.isZero()&&h._handleIn.isZero()&&s._point.subtract(o._point).isOrthogonal(h._point.subtract(s._point))?(e=f.Rectangle,i=new O(c(0,3),c(0,1)),r=a[1]._point.add(a[2]._point).divide(2)):8===a.length&&u(0)&&u(2)&&u(4)&&u(6)&&l(1,5)&&l(3,7)?(e=f.Rectangle,n=(i=new O(c(1,6),c(0,3))).subtract(new O(c(0,7),c(1,2))).divide(2),r=a[3]._point.add(a[4]._point).divide(2)):4===a.length&&u(0)&&u(1)&&u(2)&&u(3)&&(n=F.isZero(c(0,2)-c(1,3))?(e=f.Circle,c(0,2)/2):(e=f.Ellipse,new O(c(2,0)/2,c(3,1)/2)),r=a[1]._point),e)?((h=new e({center:o=this.getPosition(!0),size:i,radius:n,insert:!1})).copyAttributes(this,!0),h._matrix.prepend(this._matrix),h.rotate(r.subtract(o).getAngle()+90),t!==j&&!t||h.insertAbove(this),h):null;function l(t,e){var t=a[t],i=t.getNext(),e=a[e],n=e.getNext();return t._handleOut.isZero()&&i._handleIn.isZero()&&e._handleOut.isZero()&&n._handleIn.isZero()&&i._point.subtract(t._point).isCollinear(n._point.subtract(e._point))}function u(t){var e,t=a[t],i=t.getNext(),n=t._handleOut,r=i._handleIn,s=.5522847498307936;if(n.isOrthogonal(r))return t=t._point,i=i._point,(e=new N(t,n,!0).intersect(new N(i,r,!0),!0))&&F.isZero(n.getLength()/e.subtract(t).getLength()-s)&&F.isZero(r.getLength()/e.subtract(i).getLength()-s)}function c(t,e){return a[t]._point.getDistance(a[e]._point)}},toPath:"#clone",compare:function t(e){if(!e||e instanceof G)return t.base.call(this,e);var i=this.getCurves(),n=e.getCurves(),r=i.length,s=n.length;if(!r||!s)return r==s;for(var a,o,h=i[0].getValues(),l=[],u=0,c=0,d=0;d<s;d++){var f=n[d].getValues();if(l.push(f),m=U.getOverlaps(h,f)){a=!d&&0<m[0][0]?s-1:d,o=m[0][1];break}}for(var p,g=Math.abs,f=l[a];h&&f;){var m=U.getOverlaps(h,f);if(m)if(g(m[0][0]-c)<1e-8){1===(c=m[1][0])&&(h=++u<r?i[u].getValues():null,c=0);var _=m[0][1];if(g(_-o)<1e-8){if(p=p||[a,_],1===(o=m[1][1])&&(f=l[a=++a>=s?0:a]||n[a].getValues(),o=0),h)continue;return p[0]===a&&p[1]===o}}break}return!1},_hitTestSelf:function(i,r,t,n){var s,a,o,h,e,l,u=this,c=this.getStyle(),d=this._segments,f=d.length,p=this._closed,g=r._tolerancePadding,m=g,_=r.stroke&&c.hasStroke(),v=r.fill&&c.hasFill(),y=r.curves,b=_?c.getStrokeWidth()/2:v&&0<r.tolerance||y?0:null;function w(t,e){return i.subtract(t).divide(e).length<=1}function x(t,e,i){if(!r.selected||e.isSelected()){var n=t._point;if(w(e=e!==n?e.add(n):e,m))return new L(i,u,{segment:t,point:e})}}function S(t,e){return(e||r.segments)&&x(t,t._point,"segment")||!e&&r.handles&&(x(t,t._handleIn,"handle-in")||x(t,t._handleOut,"handle-out"))}function C(t){h.add(t)}function k(t){var e=p||0<t._index&&t._index<f-1;return"round"===(e?s:a)?w(t._point,m):(h=new W({internal:!0,closed:!0}),e?t.isSmooth()||W._addBevelJoin(t,s,b,o,null,n,C,!0):"square"===a&&W._addSquareCap(t,a,b,null,n,C,!0),!h.isEmpty()&&(h.contains(i)||(e=h.getNearestLocation(i))&&w(e.getPoint(),g)))}if(null!==b&&(0<b?(s=c.getStrokeJoin(),a=c.getStrokeCap(),o=c.getMiterLimit(),m=m.add(W._getStrokePadding(b,n))):s=a="round"),!r.ends||r.segments||p){if(r.segments||r.handles)for(var E=0;E<f;E++)if(e=S(d[E]))return e}else if(e=S(d[0],!0)||S(d[f-1],!0))return e;if(null!==b&&((l=this.getNearestLocation(i))&&(0===(c=l.getTime())||1===c&&1<f?k(l.getSegment())||(l=null):w(l.getPoint(),m)||(l=null)),!l&&"miter"===s&&1<f))for(E=0;E<f;E++){var A=d[E];if(i.getDistance(A._point)<=o*b&&k(A)){l=A.getLocation();break}}return!l&&v&&this._contains(i)||l&&!_&&!y?new L("fill",this):l?new L(_?"stroke":"curve",this,{location:l,point:l.getPoint()}):null}},z.each(U._evaluateMethods,function(e){this[e+"At"]=function(t){t=this.getLocationAt(t);return t&&t[e]()}},{beans:!1,getLocationOf:function(){for(var t=P.read(arguments),e=this.getCurves(),i=0,n=e.length;i<n;i++){var r=e[i].getLocationOf(t);if(r)return r}return null},getOffsetOf:function(){var t=this.getLocationOf.apply(this,arguments);return t?t.getOffset():null},getLocationAt:function(t){if("number"==typeof t){for(var e=this.getCurves(),i=0,n=0,r=e.length;n<r;n++){var s=i,a=e[n];if(t<(i+=a.getLength()))return a.getLocationAt(t-s)}if(0<e.length&&t<=this.getLength())return new H(e[e.length-1],1)}else if(t&&t.getPath&&t.getPath()===this)return t;return null},getOffsetsWithTangent:function(){var t=P.read(arguments);if(t.isZero())return[];for(var e=[],i=0,n=this.getCurves(),r=0,s=n.length;r<s;r++){for(var a=n[r],o=a.getTimesWithTangent(t),h=0,l=o.length;h<l;h++){var u=i+a.getOffsetAtTime(o[h]);e.indexOf(u)<0&&e.push(u)}i+=a.length}return e}}),new function(){function _(n,t,r){var s,a,o,h,l,u,c,d,e=t._segments,i=e.length,f=new Array(6),p=!0;function g(t){var e,i;a=r?(t._transformCoordinates(r,f),s=f[0],f[1]):(e=t._point,s=e._x,e._y),p?(n.moveTo(s,a),p=!1):(u=r?(l=f[2],f[3]):(i=t._handleIn,l=s+i._x,a+i._y),l===s&&u===a&&c===o&&d===h?n.lineTo(s,a):n.bezierCurveTo(c,d,l,u,s,a)),o=s,h=a,d=r?(c=f[4],f[5]):(i=t._handleOut,c=o+i._x,h+i._y)}for(var m=0;m<i;m++)g(e[m]);t._closed&&0<i&&g(e[0])}return{_draw:function(t,e,i,n){var r=e.dontStart,s=e.dontFinish||e.clip,a=this.getStyle(),o=a.hasFill(),h=a.hasStroke(),l=a.getDashArray(),u=!B.support.nativeDash&&h&&l&&l.length;function c(t){return l[(t%u+u)%u]}if(r||t.beginPath(),(o||h&&!u||s)&&(_(t,this,n),this._closed)&&t.closePath(),!s&&(o||h)&&(this._setStyles(t,e,i),o&&(t.fill(a.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),h)){if(u){r||t.beginPath();for(var d,f=new J(this,.25,32,!1,n),p=f.length,g=-a.getDashOffset(),m=0;0<g;)g-=c(m--)+c(m--);for(;g<p;)d=g+c(m++),(0<g||0<d)&&f.drawPart(t,Math.max(g,0),Math.max(d,0)),g=d+c(m++)}t.stroke()}},_drawSelected:function(t,e){t.beginPath(),_(t,this,e),t.stroke();var i=t,n=this._segments,r=e,s=B.settings.handleSize;if(!(s<=0))for(var a,o,h=s/2,l=s-2,u=h-1,c=new Array(6),d=0,f=n.length;d<f;d++){var p=n[d],g=p._selection;p._transformCoordinates(r,c),a=c[0],o=c[1],2&g&&m(2),4&g&&m(4),i.fillRect(a-h,o-h,s,s),0<l&&!(1&g)&&(p=i.fillStyle,i.fillStyle="#ffffff",i.fillRect(a-u,o-u,l,l),i.fillStyle=p)}function m(t){var e=c[t],t=c[t+1];a==e&&o==t||(i.beginPath(),i.moveTo(a,o),i.lineTo(e,t),i.stroke(),i.beginPath(),i.arc(e,t,h,0,2*Math.PI,!0),i.fill())}}}},new function(){function L(t){t=t._segments;if(t.length)return t[t.length-1];throw new Error("Use a moveTo() command first")}return{moveTo:function(){var t=this._segments;1===t.length&&this.removeSegment(0),t.length||this._add([new q(P.read(arguments))])},moveBy:function(){throw new Error("moveBy() is unsupported on Path items.")},lineTo:function(){this._add([new q(P.read(arguments))])},cubicCurveTo:function(){var t=arguments,e=P.read(t),i=P.read(t),t=P.read(t),n=L(this);n.setHandleOut(e.subtract(n._point)),this._add([new q(t,i.subtract(t))])},quadraticCurveTo:function(){var t=arguments,e=P.read(t),t=P.read(t),i=L(this)._point;this.cubicCurveTo(e.add(i.subtract(e).multiply(1/3)),e.add(t.subtract(e).multiply(1/3)),t)},curveTo:function(){var t=arguments,e=P.read(t),i=P.read(t),t=z.pick(z.read(t),.5),n=1-t,r=L(this)._point,e=e.subtract(r.multiply(n*n)).subtract(i.multiply(t*t)).divide(2*t*n);if(e.isNaN())throw new Error("Cannot put a curve through points with parameter = "+t);this.quadraticCurveTo(e,i)},arcTo:function(){var t,e=arguments,i=Math.abs,n=Math.sqrt,r=L(this),s=r._point,a=P.read(e),o=z.peek(e);if("boolean"==typeof(o=z.pick(o,!0)))var h=(c=s.add(a).divide(2)).add(c.subtract(s).rotate(o?-90:90));else if(z.remain(e)<=2)h=a,a=P.read(e);else if(!s.equals(a)){var l=O.read(e),u=F.isZero;if(u(l.width)||u(l.height))return this.lineTo(a);var u=z.read(e),o=!!z.read(e),e=!!z.read(e),c=s.add(a).divide(2),d=(T=s.subtract(c).rotate(-u)).x,f=T.y,p=i(l.width),l=i(l.height),g=p*p,m=l*l,_=d*d,v=f*f,y=n(_/g+v/m);if(1<y&&(g=(p*=y)*p,m=(l*=y)*l),(y=i(y=(g*m-g*v-m*_)/(g*v+m*_))<1e-12?0:y)<0)throw new Error("Cannot create an arc with the given arguments");b=new P(p*f/l,-l*d/p).multiply((e==o?-1:1)*n(y)).rotate(u).add(c),g=(w=(t=(new M).translate(b).rotate(u).scale(p,l))._inverseTransform(s)).getDirectedAngle(t._inverseTransform(a)),!o&&0<g?g-=360:o&&g<0&&(g+=360)}if(h){var b,v=new N(s.add(h).divide(2),h.subtract(s).rotate(90),!0),m=new N(h.add(a).divide(2),a.subtract(h).rotate(90),!0),_=new N(s,a),f=_.getSide(h);if(!(b=v.intersect(m,!0))){if(f)throw new Error("Cannot create an arc with the given arguments");return this.lineTo(a)}var w,g=(w=s.subtract(b)).getDirectedAngle(a.subtract(b)),d=_.getSide(b,!0);0===d?g=f*i(g):f===d&&(g+=g<0?360:-360)}if(g){for(var e=i(g),x=360<=e?4:Math.ceil((e-1e-5)/90),S=g/x,n=S*Math.PI/360,C=4/3*Math.sin(n)/(1+Math.cos(n)),k=[],E=0;E<=x;E++){var A,T=a,I=null;E<x&&(I=w.rotate(90).multiply(C),t?(T=t._transformPoint(w),I=t._transformPoint(w.add(I)).subtract(T)):T=b.add(w)),E?(A=w.rotate(-90).multiply(C),t&&(A=t._transformPoint(w.add(A)).subtract(T)),k.push(new q(T,A,I))):r.setHandleOut(I),w=w.rotate(S)}this._add(k)}},lineBy:function(){var t=P.read(arguments),e=L(this)._point;this.lineTo(e.add(t))},curveBy:function(){var t=arguments,e=P.read(t),i=P.read(t),t=z.read(t),n=L(this)._point;this.curveTo(n.add(e),n.add(i),t)},cubicCurveBy:function(){var t=arguments,e=P.read(t),i=P.read(t),t=P.read(t),n=L(this)._point;this.cubicCurveTo(n.add(e),n.add(i),n.add(t))},quadraticCurveBy:function(){var t=arguments,e=P.read(t),t=P.read(t),i=L(this)._point;this.quadraticCurveTo(i.add(e),i.add(t))},arcBy:function(){var t=arguments,e=L(this)._point,i=e.add(P.read(t)),n=z.pick(z.peek(t),!0);"boolean"==typeof n?this.arcTo(i,n):this.arcTo(i,e.add(P.read(t)))},closePath:function(t){this.setClosed(!0),this.join(this,t)}}},{_getBounds:function(t,e){var i=e.handle?"getHandleBounds":e.stroke?"getStrokeBounds":"getBounds";return W[i](this._segments,this._closed,this,t,e)},statics:{getBounds:function(t,e,i,n,r,s){var a=t[0];if(!a)return new x;var o=new Array(6),h=a._transformCoordinates(n,new Array(6)),l=h.slice(0,2),u=l.slice(),c=new Array(2);function d(t){t._transformCoordinates(n,o);for(var e=0;e<2;e++)U._addBounds(h[e],h[e+4],o[e+2],o[e],e,s?s[e]:0,l,u,c);t=h;h=o,o=t}for(var f=1,p=t.length;f<p;f++)d(t[f]);return e&&d(a),new x(l[0],l[1],u[0]-l[0],u[1]-l[1])},getStrokeBounds:function(t,e,i,n,r){var s=i.getStyle(),a=s.hasStroke(),o=s.getStrokeWidth(),h=a&&i._getStrokeMatrix(n,r),l=a&&W._getStrokePadding(o,h),u=W.getBounds(t,e,i,n,r,l);if(a){var c=o/2,d=s.getStrokeJoin(),i=s.getStrokeCap(),f=s.getMiterLimit(),p=new x(new O(l)),g=t.length-(e?0:1);if(0<g){for(var m=1;m<g;m++)y(t[m],d);e?y(t[0],d):(b(t[0],i),b(t[t.length-1],i))}}return u;function _(t){u=u.include(t)}function v(t){u=u.unite(p.setCenter(t._point.transform(n)))}function y(t,e){"round"===e||t.isSmooth()?v(t):W._addBevelJoin(t,e,c,f,n,h,_)}function b(t,e){"round"===e?v(t):W._addSquareCap(t,e,c,n,h,_)}},_getStrokePadding:function(t,e){var i,n,r,s,a;return e?(i=new P(t,0).transform(e),e=new P(0,t).transform(e),a=i.getAngleInRadians(),i=i.getLength(),e=e.getLength(),n=Math.sin(a),r=Math.cos(a),a=Math.tan(a),s=Math.atan2(e*a,i),a=Math.atan2(e,a*i),[Math.abs(i*Math.cos(s)*r+e*Math.sin(s)*n),Math.abs(e*Math.sin(a)*r+i*Math.cos(a)*n)]):[t,t]},_addBevelJoin:function(t,e,i,n,r,s,a,o){var t=t.getCurve(),h=t.getPrevious(),r=t.getPoint1().transform(r),h=h.getNormalAtTime(1).multiply(i).transform(s),t=t.getNormalAtTime(0).multiply(i).transform(s),s=h.getDirectedAngle(t);(s<0||180<=s)&&(h=h.negate(),t=t.negate()),o&&a(r),a(r.add(h)),"miter"===e&&(s=new N(r.add(h),new P(-h.y,h.x),!0).intersect(new N(r.add(t),new P(-t.y,t.x),!0),!0))&&r.getDistance(s)<=n*i&&a(s),a(r.add(t))},_addSquareCap:function(t,e,i,n,r,s,a){n=t._point.transform(n),t=t.getLocation(),t=t.getNormal().multiply(0===t.getTime()?i:-i).transform(r);"square"===e&&(a&&(s(n.subtract(t)),s(n.add(t))),n=n.add(t.rotate(-90))),s(n.add(t)),s(n.subtract(t))},getHandleBounds:function(t,e,i,n,r){for(var s,a,o,h=i.getStyle(),l=(r.stroke&&h.hasStroke()&&(i=i._getStrokeMatrix(n,r),o=r=h.getStrokeWidth()/2,"miter"===h.getStrokeJoin()&&(o=r*h.getMiterLimit()),"square"===h.getStrokeCap()&&(o=Math.max(o,r*Math.SQRT2)),s=W._getStrokePadding(r,i),a=W._getStrokePadding(o,i)),new Array(6)),u=1/0,c=-u,d=u,f=c,p=0,g=t.length;p<g;p++){t[p]._transformCoordinates(n,l);for(var m=0;m<6;m+=2){var _=m?s:a,v=_?_[0]:0,_=_?_[1]:0,y=l[m],b=l[m+1],w=y-v,y=y+v,v=b-_,b=b+_;w<u&&(u=w),c<y&&(c=y),v<d&&(d=v),f<b&&(f=b)}}return new x(u,d,c-u,f-d)}}}),G=(W.inject({statics:new function(){var l=.5522847498307936,a=[new q([-1,0],[0,l],[0,-l]),new q([0,-1],[-l,0],[l,0]),new q([1,0],[0,-l],[0,l]),new q([0,1],[l,0],[-l,0])];function u(t,e,i){var i=z.getNamed(i),n=new W(i&&(1==i.insert?V.INSERT:0==i.insert?V.NO_INSERT:null));return n._add(t),n._closed=e,n.set(i,V.INSERT)}function n(t,e,i){for(var n=new Array(4),r=0;r<4;r++){var s=a[r];n[r]=new q(s._point.multiply(e).add(t),s._handleIn.multiply(e),s._handleOut.multiply(e))}return u(n,!0,i)}return{Line:function(){var t=arguments;return u([new q(P.readNamed(t,"from")),new q(P.readNamed(t,"to"))],!1,t)},Circle:function(){var t=arguments,e=P.readNamed(t,"center"),i=z.readNamed(t,"radius");return n(e,new O(i),t)},Rectangle:function(){var t,e,i=arguments,n=x.readNamed(i,"rectangle"),r=O.readNamed(i,"radius",0,{readNull:!0}),s=n.getBottomLeft(!0),a=n.getTopLeft(!0),o=n.getTopRight(!0),h=n.getBottomRight(!0);return u(!r||r.isZero()?[new q(s),new q(a),new q(o),new q(h)]:(n=(r=O.min(r,n.getSize(!0).divide(2))).width,r=r.height,t=n*l,e=r*l,[new q(s.add(n,0),null,[-t,0]),new q(s.subtract(0,r),[0,e]),new q(a.add(0,r),null,[0,-e]),new q(a.add(n,0),[-t,0],null),new q(o.subtract(n,0),null,[t,0]),new q(o.add(0,r),[0,-e],null),new q(h.subtract(0,r),null,[0,e]),new q(h.subtract(n,0),[t,0])]),!0,i)},RoundRectangle:"#Rectangle",Ellipse:function(){var t=arguments,e=f._readEllipse(t);return n(e.center,e.radius,t)},Oval:"#Ellipse",Arc:function(){var t=arguments,e=P.readNamed(t,"from"),i=P.readNamed(t,"through"),n=P.readNamed(t,"to"),t=z.getNamed(t),r=new W(t&&0==t.insert&&V.NO_INSERT);return r.moveTo(e),r.arcTo(i,n),r.set(t)},RegularPolygon:function(){for(var t=arguments,e=P.readNamed(t,"center"),i=z.readNamed(t,"sides"),n=z.readNamed(t,"radius"),r=360/i,s=i%3==0,a=new P(0,s?-n:n),o=s?-1:.5,h=new Array(i),l=0;l<i;l++)h[l]=new q(e.add(a.rotate((l+o)*r)));return u(h,!0,t)},Star:function(){for(var t=arguments,e=P.readNamed(t,"center"),i=2*z.readNamed(t,"points"),n=z.readNamed(t,"radius1"),r=z.readNamed(t,"radius2"),s=360/i,a=new P(0,-1),o=new Array(i),h=0;h<i;h++)o[h]=new q(e.add(a.rotate(s*h).multiply(h%2?r:n)));return u(o,!0,t)}}}}),Q.extend({_class:"CompoundPath",_serializeFields:{children:[]},beans:!0,initialize:function(t){this._children=[],this._namedChildren={},this._initialize(t)||("string"==typeof t?this.setPathData(t):this.addChildren(Array.isArray(t)?t:arguments))},insertChildren:function t(e,i){var n=i,r=n[0];r&&"number"==typeof r[0]&&(n=[n]);for(var s=i.length-1;0<=s;s--){var a=n[s];n!==i||a instanceof W||(n=z.slice(n)),Array.isArray(a)?n[s]=new W({segments:a,insert:!1}):a instanceof G&&(n.splice.apply(n,[s,1].concat(a.removeChildren())),a.remove())}return t.base.call(this,e,n)},reduce:function t(e){for(var i,n=this._children,r=n.length-1;0<=r;r--)(i=n[r].reduce(e)).isEmpty()&&i.remove();return n.length?t.base.call(this):((i=new W(V.NO_INSERT)).copyAttributes(this),i.insertAbove(this),this.remove(),i)},isClosed:function(){for(var t=this._children,e=0,i=t.length;e<i;e++)if(!t[e]._closed)return!1;return!0},setClosed:function(t){for(var e=this._children,i=0,n=e.length;i<n;i++)e[i].setClosed(t)},getFirstSegment:function(){var t=this.getFirstChild();return t&&t.getFirstSegment()},getLastSegment:function(){var t=this.getLastChild();return t&&t.getLastSegment()},getCurves:function(){for(var t=this._children,e=[],i=0,n=t.length;i<n;i++)z.push(e,t[i].getCurves());return e},getFirstCurve:function(){var t=this.getFirstChild();return t&&t.getFirstCurve()},getLastCurve:function(){var t=this.getLastChild();return t&&t.getLastCurve()},getArea:function(){for(var t=this._children,e=0,i=0,n=t.length;i<n;i++)e+=t[i].getArea();return e},getLength:function(){for(var t=this._children,e=0,i=0,n=t.length;i<n;i++)e+=t[i].getLength();return e},getPathData:function(t,e){for(var i=this._children,n=[],r=0,s=i.length;r<s;r++){var a=i[r],o=a._matrix;n.push(a.getPathData(t&&!o.isIdentity()?t.appended(o):t,e))}return n.join("")},_hitTestChildren:function t(e,i,n){return t.base.call(this,e,i.class===W||"path"===i.type?i:z.set({},i,{fill:!1}),n)},_draw:function(t,e,i,n){var r=this._children;if(r.length){e=e.extend({dontStart:!0,dontFinish:!0}),t.beginPath();for(var s=0,a=r.length;s<a;s++)r[s].draw(t,e,n);e.clip||(this._setStyles(t,e,i),(i=this._style).hasFill()&&(t.fill(i.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),i.hasStroke()&&t.stroke())}},_drawSelected:function(t,e,i){for(var n=this._children,r=0,s=n.length;r<s;r++){var a=n[r],o=a._matrix;i[a._id]||a._drawSelected(t,o.isIdentity()?e:e.appended(o))}}},new function(){function i(t,e){t=t._children;if(e&&!t.length)throw new Error("Use a moveTo() command first");return t[t.length-1]}return z.each(["lineTo","cubicCurveTo","quadraticCurveTo","curveTo","arcTo","lineBy","cubicCurveBy","quadraticCurveBy","curveBy","arcBy"],function(e){this[e]=function(){var t=i(this,!0);t[e].apply(t,arguments)}},{moveTo:function(){var t=i(this),e=t&&t.isEmpty()?t:new W(V.NO_INSERT);e!==t&&this.addChild(e),e.moveTo.apply(e,arguments)},moveBy:function(){var t=i(this,!0),t=t&&t.getLastSegment(),e=P.read(arguments);this.moveTo(t?e.add(t._point):e)},closePath:function(t){i(this,!0).closePath(t)}})},z.each(["reverse","flatten","simplify","smooth"],function(s){this[s]=function(t){for(var e,i=this._children,n=0,r=i.length;n<r;n++)e=i[n][s](t)||e;return e}},{}))),J=(Q.inject(new function(){var O=Math.min,M=Math.max,N=Math.abs,S={unite:{1:!0,2:!0},intersect:{2:!0},subtract:{1:!0},exclude:{1:!0,"-1":!0}};function C(t){return t._children||[t]}function k(t,e){var i=t.clone(!1).reduce({simplify:!0}).transform(null,!0,!0);if(e){for(var n=C(i),r=0,s=n.length;r<s;r++)(t=n[r])._closed||t.isEmpty()||(t.closePath(1e-12),t.getFirstSegment().setHandleIn(0,0),t.getLastSegment().setHandleOut(0,0));i=i.resolveCrossings().reorient("nonzero"===i.getFillRule(),!0)}return i}function E(t,e,i,n,r){var s=new G(V.NO_INSERT);return s.addChildren(t,!0),s=s.reduce({simplify:e}),r&&0==r.insert||s.insertAbove(n&&i.isSibling(n)&&i.getIndex()<n.getIndex()?n:i),s.copyAttributes(i,!0),s}function A(t){return t.hasOverlap()||t.isCrossing()}function i(t,e,i,n){if(n&&(0==n.trace||n.stroke)&&/^(subtract|intersect)$/.test(i))return T(t,e,i);var r,s=k(t,!0),a=e&&t!==e&&k(e,!0),o=S[i],h=(o[i]=!0,a&&(o.subtract||o.exclude)^(a.isClockwise()^s.isClockwise())&&a.reverse(),P(H.expand(s.getIntersections(a,A)))),i=C(s),l=a&&C(a),u=[],c=[];function d(t){for(var e=0,i=t.length;e<i;e++){var n=t[e];z.push(u,n._segments),z.push(c,n.getCurves()),n._overlapsOnly=!0}}function f(t){for(var e=[],i=0,n=t&&t.length;i<n;i++)e.push(c[t[i]]);return e}if(h.length){d(i),l&&d(l);for(var p=new Array(c.length),g=0,m=c.length;g<m;g++)p[g]=c[g].getValues();for(var _=K.findCurveBoundsCollisions(p,p,0,!0),v={},g=0;g<c.length;g++){var y=c[g],b=y._path._id;(v[b]=v[b]||{})[y.getIndex()]={hor:f(_[g].hor),ver:f(_[g].ver)}}for(g=0,m=h.length;g<m;g++)D(h[g]._segment,s,a,v,o);for(g=0,m=u.length;g<m;g++){var w=u[g],x=w._intersection;w._winding||D(w,s,a,v,o),x&&x._overlap||(w._path._overlapsOnly=!1)}r=B(u,o)}else r=L(l?i.concat(l):i.slice(),function(t){return!!o[t]});return E(r,!0,t,e,n)}function T(t,e,i){var n=k(t),r=k(e),s=n.getIntersections(r,A),a="subtract"===i,o="divide"===i,h={},l=[];function u(t){return!h[t._id]&&(o||r.contains(t.getPointAt(t.getLength()/2))^a)&&(l.unshift(t),h[t._id]=!0)}for(var c=s.length-1;0<=c;c--){var d=s[c].split();d&&(u(d)&&d.getFirstSegment().setHandleIn(0,0),n.getLastSegment().setHandleOut(0,0))}return u(n),E(l,!1,t,e)}function x(t,e){for(var i=t;i;){if(i===e)return;i=i._previous}for(;t._next&&t._next!==e;)t=t._next;if(!t._next){for(;e._previous;)e=e._previous;(t._next=e)._previous=t}}function I(t){for(var e=t.length-1;0<=e;e--)t[e].clearHandles()}function L(t,e,i){var n=t&&t.length;if(n){var r=z.each(t,function(t,e){this[t._id]={container:null,winding:t.isClockwise()?1:-1,index:e}},{}),s=t.slice().sort(function(t,e){return N(e.getArea())-N(t.getArea())}),a=s[0],o=K.findItemBoundsCollisions(s,null,F.GEOMETRIC_EPSILON);null==i&&(i=a.isClockwise());for(var h=0;h<n;h++){var l,u=s[h],c=r[u._id],d=0,f=o[h];if(f)for(var p=null,g=f.length-1;0<=g;g--)if(f[g]<h){var p=p||u.getInteriorPoint(),m=s[f[g]];if(m.contains(p)){var _=r[m._id],d=_.winding;c.winding+=d,c.container=_.exclude?_.container:m;break}}e(c.winding)===e(d)?(c.exclude=!0,t[c.index]=null):(l=c.container,u.setClockwise(l?!l.isClockwise():i))}}return t}function P(t,e,i){var n,r,s,a=e&&[],o=!1,h=i||[],l=i&&{};function u(t){return t._path._id+"."+t._segment1._index}for(var c=(i&&i.length)-1;0<=c;c--)(d=i[c])._path&&(l[u(d)]=!0);for(c=t.length-1;0<=c;c--){var d,f=t[c],p=f._time,g=p,m=e&&!e(f);if((d=f._curve)&&(d!==r?(o=!d.hasHandles()||l&&l[u(d)],n=[],s=null,r=d):1e-8<=s&&(p/=s)),m)n&&n.push(f);else{if(e&&a.unshift(f),s=g,p<1e-8)_=d._segment1;else if(1-1e-8<p)_=d._segment2;else{m=d.divideAtTime(p,!0);o&&h.push(d,m);for(var _=m._segment1,v=n.length-1;0<=v;v--){var y=n[v];y._time=(y._time-p)/(1-p)}}f._setSegment(_);var b=_._intersection,g=f._intersection;if(b){x(b,g);for(var w=b;w;)x(w._intersection,b),w=w._next}else _._intersection=g}}return i||I(h),a||t}function R(l,u,c,d,f){var t,e=Array.isArray(u)?u:u[c?"hor":"ver"],p=c?1:0,g=1^p,i=[l.x,l.y],m=i[p],_=i[g],v=1e-6,y=m-1e-9,b=m+1e-9,n=0,r=0,w=0,x=0,S=!1,s=!1,C=1,k=[];function a(t){var e=t[g+0],i=t[g+2],n=t[g+4],r=t[g+6];if(_<=M(e,i,n,r)&&_>=O(e,i,n,r))for(var s,e=t[p+0],i=t[p+2],n=t[p+4],r=t[p+6],a=y>M(e,i,n,r)||b<O(e,i,n,r)?[t]:U.getMonoCurves(t,c),o=0,h=a.length;o<h;o++)if(s=function(t){var e=t[g+0],i=t[g+6];if(!(_<O(e,i)||_>M(e,i))){var n,r,s=t[p+0],a=t[p+2],o=t[p+4],h=t[p+6];if(e!==i)return o=0===(a=_===e?0:_!==i&&!(y>M(s,a,o,h)||b<O(s,a,o,h))&&0<U.solveCubic(t,g,_,k,0,1)?k[0]:1)?s:1===a?h:U.getPoint(t,a)[c?"y":"x"],i=i<e?1:-1,n=I[g]>I[g+6]?1:-1,r=I[p+6],_!==e?(o<y?w+=i:b<o?x+=i:S=!0,m-v<o&&o<m+v&&(C/=2)):(i!=n?s<y?w+=i:b<s&&(x+=i):s!=r&&(r<b&&b<o?(x+=i,S=!0):y<r&&o<y&&(w+=i,S=!0)),C/=4),I=t,!f&&y<o&&o<b&&0===U.getTangent(t,a)[c?"x":"y"]&&R(l,u,!c,d,!0);(s<b&&y<h||h<b&&y<s)&&(S=!0)}}(a[o]))return s}for(var o=0,h=e.length;o<h;o++){var E=e[o],A=E._path,T=E.getValues();if(!(o&&e[o-1]._path===A||(I=null,A._closed||(t=U.getValues(A.getLastCurve().getSegment2(),E.getSegment1(),null,!d))[g]!==t[g+6]&&(I=t),I)))for(var I=T,L=A.getLastCurve();L&&L!==E;){var P=L.getValues();if(P[g]!==P[g+6]){I=P;break}L=L.getPrevious()}if(T=a(T))return T;if(o+1===h||e[o+1]._path!==A){if(t&&(T=a(t)))return T;n+=w=!S||w||x?w:x=A.isClockwise(d)^c?1:-1,r+=x,w=x=0,S=S&&!(s=!0),t=null}}return n=N(n),r=N(r),{winding:M(n,r),windingL:n,windingR:r,quality:C,onPath:s}}function D(t,e,i,n,r){var s=[],a=t,o=0;do{}while((m=t.getCurve())&&(c=m.getLength(),s.push({segment:t,curve:m,length:c}),o+=c),(t=t.getNext())&&!t._intersection&&t!==a);for(var h=[.5,.25,.75],l={winding:0,quality:-1},u=0;u<h.length&&l.quality<.5;u++)for(var c=o*h[u],d=0,f=s.length;d<f;d++){var p=s[d],g=p.length;if(c<=g){var m,p=(m=p.curve)._path,_=p._parent,_=_ instanceof G?_:p,v=F.clamp(m.getTimeAt(c),.001,.999),y=m.getPointAtTime(v),v=N(m.getTangentAtTime(v).y)<Math.SQRT1_2,b=null;if(r.subtract&&i){var w=(_===e?i:e)._getWinding(y,v,!0);if(_===e&&w.winding||_===i&&!w.winding){if(w.quality<1)continue;b={winding:0,quality:1}}}(b=b||R(y,n[p._id][m.getIndex()],v,!0)).quality>l.quality&&(l=b);break}c-=g}for(d=s.length-1;0<=d;d--)s[d].segment._winding=l}function B(t,e){var h,i=[];function l(t){return!(!t||t._visited||e&&(!e[(t=t._winding||{}).winding]||e.unite&&2===t.winding&&t.windingL&&t.windingR))}function u(t){if(t)for(var e=0,i=h.length;e<i;e++)if(t===h[e])return!0;return!1}function n(t){for(var e=t._segments,i=0,n=e.length;i<n;i++)e[i]._visited=!0}t.sort(function(t,e){var i=t._intersection,n=e._intersection,r=!(!i||!i._overlap),s=!(!n||!n._overlap),a=t._path,o=e._path;return r^s?r?1:-1:!i^!n?i?1:-1:a!==o?a._id-o._id:t._index-e._index});for(var r=0,s=t.length;r<s;r++){var a,o,c,d,f,p=t[r],g=l(p),m=null,_=!1,v=!0,y=[];for(g&&p._path._overlapsOnly&&(d=p._path,f=p._intersection._segment._path,d.compare(f))&&(d.getArea()&&i.push(d.clone(!1)),n(d),n(f),g=!1);g;){var b=!m,w=function(s,a){var t=s._intersection,e=t,o=[];function i(t,e){for(;t&&t!==e;){var i,n=t._segment,r=n&&n._path;r&&(i=(r=n.getNext()||r.getFirstSegment())._intersection,n!==s&&(u(n)||u(r)||r&&l(n)&&(l(r)||i&&l(i._segment)))&&o.push(n),a)&&h.push(n),t=t._next}}if(a&&(h=[s]),t){for(i(t);t&&t._previous;)t=t._previous;i(t,e)}return o}(p,b),x=w.shift(),S=!(_=!b&&(u(p)||u(x)))&&x;if(b&&(m=new W(V.NO_INSERT),a=null),_){(p.isFirst()||p.isLast())&&(v=p._path._closed),p._visited=!0;break}if(S&&a&&(y.push(a),a=null),a||(S&&w.push(p),a={start:m._segments.length,crossings:w,visited:o=[],handleIn:c}),!l(p=S?x:p)){m.removeSegments(a.start);for(var C=0,k=o.length;C<k;C++)o[C]._visited=!1;for(o.length=0;(p=a&&a.crossings.shift())&&p._path||(p=null,(a=y.pop())&&(o=a.visited,c=a.handleIn)),a&&!l(p););if(!p)break}b=p.getNext();m.add(new q(p._point,c,b&&p._handleOut)),p._visited=!0,o.push(p),p=b||p._path.getFirstSegment(),c=b&&b._handleIn}_&&(v&&(m.getFirstSegment().setHandleIn(c),m.setClosed(v)),0!==m.getArea())&&i.push(m)}return i}return{_getWinding:function(t,e,i){return R(t,this.getCurves(),e,i)},unite:function(t,e){return i(this,t,"unite",e)},intersect:function(t,e){return i(this,t,"intersect",e)},subtract:function(t,e){return i(this,t,"subtract",e)},exclude:function(t,e){return i(this,t,"exclude",e)},divide:function(t,e){return e&&(0==e.trace||e.stroke)?T(this,t,"divide"):E([this.subtract(t,e),this.intersect(t,e)],!0,this,t,e)},resolveCrossings:function(){var t=this._children,e=t||[this];function i(t,e){t=t&&t._intersection;return t&&t._overlap&&t._path===e}var n=!1,r=!1,s=this.getIntersections(null,function(t){return t.hasOverlap()?n=!0:t.isCrossing()&&(r=!0)}),a=n&&r&&[],s=H.expand(s);if(n)for(var o=P(s,function(t){return t.hasOverlap()},a),h=o.length-1;0<=h;h--){var l=o[h],u=l._path,l=l._segment,c=l.getPrevious(),d=l.getNext();i(c,u)&&i(d,u)&&(l.remove(),c._handleOut._set(0,0),d._handleIn._set(0,0),c===l||c.getCurve().hasLength()||(d._handleIn.set(c._handleIn),c.remove()))}r&&(P(s,n&&function(t){var e=t.getCurve(),i=t.getSegment(),t=t._intersection,n=t._curve,t=t._segment;if(e&&n&&e._path&&n._path)return!0;i&&(i._intersection=null),t&&(t._intersection=null)},a),a&&I(a),e=B(z.each(e,function(t){z.push(this,t._segments)},[])));var f,s=e.length;return 1<s&&t?(e!==t&&this.setChildren(e),f=this):1!==s||t||(e[0]!==this&&this.setSegments(e[0].removeSegments()),f=this),f||((f=new G(V.NO_INSERT)).addChildren(e),(f=f.reduce()).copyAttributes(this),this.replaceWith(f)),f},reorient:function(e,t){var i=this._children;return i&&i.length?this.setChildren(L(this.removeChildren(),function(t){return!!(e?t:1&t)},t)):t!==j&&this.setClockwise(t),this},getInteriorPoint:function(){var t=this.getBounds().getCenter(!0);if(!this.contains(t)){for(var e=this.getCurves(),i=t.y,n=[],r=[],s=0,a=e.length;s<a;s++){var o=e[s].getValues(),h=o[1],l=o[3],u=o[5],c=o[7];if(i>=O(h,l,u,c)&&i<=M(h,l,u,c))for(var d=U.getMonoCurves(o),f=0,p=d.length;f<p;f++){var g=d[f],m=g[1],_=g[7];m!==_&&(m<=i&&i<=_||_<=i&&i<=m)&&(m=i===m?g[0]:i===_?g[6]:1===U.solveCubic(g,1,i,r,0,1)?U.getPoint(g,r[0]).x:(g[0]+g[6])/2,n.push(m))}}1<n.length&&(n.sort(function(t,e){return t-e}),t.x=(n[0]+n[1])/2)}return t}}}),z.extend({_class:"PathFlattener",initialize:function(t,o,e,h,i){var n,r=[],l=[],u=0,c=1/(e||32),s=t._segments,a=s[0];function d(t,e){e=U.getValues(t,e,i);r.push(e),function t(e,i,n,r){{var s,a;!(c<r-n)||h&&U.isStraight(e)||U.isFlatEnough(e,o||.25)?(a=e[6]-e[0],s=e[7]-e[1],0<(a=Math.sqrt(a*a+s*s))&&(u+=a,l.push({offset:u,curve:e,index:i,time:r}))):(s=U.subdivide(e,.5),a=(n+r)/2,t(s[0],i,n,a),t(s[1],i,a,r))}}(e,t._index,0,1)}for(var f=1,p=s.length;f<p;f++)d(a,n=s[f]),a=n;t._closed&&d(n||a,s[0]),this.curves=r,this.parts=l,this.length=u,this.index=0},_get:function(t){for(var e,i=this.parts,n=i.length,r=this.index;(e=r)&&!(i[--r].offset<t););for(;e<n;e++){var s,a,o=i[e];if(o.offset>=t)return s=(a=i[(this.index=e)-1])&&a.index===o.index?a.time:0,a=a?a.offset:0,{index:o.index,time:s+(o.time-s)*(t-a)/(o.offset-a)}}return{index:i[n-1].index,time:1}},drawPart:function(t,e,i){for(var n=this._get(e),r=this._get(i),s=n.index,a=r.index;s<=a;s++){var o=U.getPart(this.curves[s],s===n.index?n.time:0,s===r.index?r.time:1);s===n.index&&t.moveTo(o[0],o[1]),t.bezierCurveTo.apply(t,o.slice(2))}}},z.each(U._evaluateMethods,function(e){this[e+"At"]=function(t){t=this._get(t);return U[e](this.curves[t.index],t.time)}},{}))),tt=z.extend({initialize:function(t){for(var e,i=this.points=[],n=t._segments,t=t._closed,r=0,s=n.length;r<s;r++){var a=n[r].point;e&&e.equals(a)||i.push(e=a.clone())}t&&(i.unshift(i[i.length-1]),i.push(i[1])),this.closed=t},fit:function(t){var e=this.points,i=e.length,n=null;return 0<i&&(n=[new q(e[0])],1<i)&&(this.fitCubic(n,t,0,i-1,e[1].subtract(e[0]),e[i-2].subtract(e[i-1])),this.closed)&&(n.shift(),n.pop()),n},fitCubic:function(t,e,i,n,r,s){var a,o,h=this.points;if(n-i==1)m=h[i],a=h[n],o=m.getDistance(a)/3,this.addCurve(t,[m,m.add(r.normalize(o)),a.add(s.normalize(o)),a]);else{for(var l,u=this.chordLengthParameterize(i,n),c=Math.max(e,e*e),d=!0,f=0;f<=4;f++){var p=this.generateBezier(i,n,u,r,s),g=this.findMaxError(i,n,p,u);if(g.error<e&&d)return void this.addCurve(t,p);if(l=g.index,g.error>=c)break;d=this.reparameterize(i,n,u,p),c=g.error}var m=h[l-1].subtract(h[l+1]);this.fitCubic(t,e,i,l,r,m),this.fitCubic(t,e,l,n,m.negate(),s)}},addCurve:function(t,e){t[t.length-1].setHandleOut(e[1].subtract(e[0])),t.push(new q(e[3],e[2].subtract(e[3])))},generateBezier:function(t,e,i,n,r){for(var s=Math.abs,a=this.points,o=a[t],h=a[e],l=[[0,0],[0,0]],u=[0,0],c=0,d=e-t+1;c<d;c++){var f=i[c],p=1-f,g=3*f*p,m=p*p*p,p=g*p,g=g*f,f=f*f*f,_=n.normalize(p),v=r.normalize(g),m=a[t+c].subtract(o.multiply(m+p)).subtract(h.multiply(g+f));l[0][0]+=_.dot(_),l[0][1]+=_.dot(v),l[1][0]=l[0][1],l[1][1]+=v.dot(v),u[0]+=_.dot(m),u[1]+=v.dot(m)}var y,b,w,x,S,e=l[0][0]*l[1][1]-l[1][0]*l[0][1],e=(1e-12<s(e)?(b=l[0][0]*u[1]-l[1][0]*u[0],y=(u[0]*l[1][1]-u[1]*l[0][1])/e,b=b/e):(e=l[0][0]+l[0][1],w=l[1][0]+l[1][1],y=b=1e-12<s(e)?u[0]/e:1e-12<s(w)?u[1]/w:0),h.getDistance(o)),s=1e-12*e;return y<s||b<s?y=b=e/3:(w=h.subtract(o),x=n.normalize(y),S=r.normalize(b),x.dot(w)-S.dot(w)>e*e&&(y=b=e/3,x=S=null)),[o,o.add(x||n.normalize(y)),h.add(S||r.normalize(b)),h]},reparameterize:function(t,e,i,n){for(var r=t;r<=e;r++)i[r-t]=this.findRoot(n,this.points[r],i[r-t]);for(var r=1,s=i.length;r<s;r++)if(i[r]<=i[r-1])return!1;return!0},findRoot:function(t,e,i){for(var n=[],r=[],s=0;s<=2;s++)n[s]=t[s+1].subtract(t[s]).multiply(3);for(s=0;s<=1;s++)r[s]=n[s+1].subtract(n[s]).multiply(2);var a=this.evaluate(3,t,i),o=this.evaluate(2,n,i),h=this.evaluate(1,r,i),a=a.subtract(e),e=o.dot(o)+a.dot(h);return F.isMachineZero(e)?i:i-a.dot(o)/e},evaluate:function(t,e,i){for(var n=e.slice(),r=1;r<=t;r++)for(var s=0;s<=t-r;s++)n[s]=n[s].multiply(1-i).add(n[s+1].multiply(i));return n[0]},chordLengthParameterize:function(t,e){for(var i=[0],n=t+1;n<=e;n++)i[n-t]=i[n-t-1]+this.points[n].getDistance(this.points[n-1]);for(var n=1,r=e-t;n<=r;n++)i[n]/=i[r];return i},findMaxError:function(t,e,i,n){for(var r=Math.floor((e-t+1)/2),s=0,a=t+1;a<e;a++){var o=this.evaluate(3,i,n[a-t]).subtract(this.points[a]),o=o.x*o.x+o.y*o.y;s<=o&&(s=o,r=a)}return{error:s,index:r}}}),et=V.extend({_class:"TextItem",_applyMatrix:!1,_canApplyMatrix:!1,_serializeFields:{content:null},_boundsOptions:{stroke:!1,handle:!1},initialize:function(t){this._content="",this._lines=[];var e=t&&z.isPlainObject(t)&&t.x===j&&t.y===j;this._initialize(e&&t,!e&&P.read(arguments))},_equals:function(t){return this._content===t._content},copyContent:function(t){this.setContent(t._content)},getContent:function(){return this._content},setContent:function(t){this._content=""+t,this._lines=this._content.split(/\r\n|\n|\r/gm),this._changed(521)},isEmpty:function(){return!this._content},getCharacterStyle:"#getStyle",setCharacterStyle:"#setStyle",getParagraphStyle:"#getStyle",setParagraphStyle:"#setStyle"}),it=et.extend({_class:"PointText",initialize:function(){et.apply(this,arguments)},getPoint:function(){var t=this._matrix.getTranslation();return new l(t.x,t.y,this,"setPoint")},setPoint:function(){var t=P.read(arguments);this.translate(t.subtract(this._matrix.getTranslation()))},_draw:function(t,e,i){if(this._content){this._setStyles(t,e,i);var n=this._lines,e=this._style,r=e.hasFill(),s=e.hasStroke(),a=e.getLeading(),o=t.shadowColor;t.font=e.getFontStyle(),t.textAlign=e.getJustification();for(var h=0,l=n.length;h<l;h++){t.shadowColor=o;var u=n[h];r&&(t.fillText(u,0,0),t.shadowColor="rgba(0,0,0,0)"),s&&t.strokeText(u,0,0),t.translate(0,a)}}},_getBounds:function(t,e){var i=this._style,n=this._lines,r=n.length,s=i.getJustification(),a=i.getLeading(),i=this.getView().getTextWidth(i.getFontStyle(),n),n=0,s=("left"!==s&&(n-=i/("center"===s?2:1)),new x(n,r?-.75*a:0,i,r*a));return t?t._transformBounds(s,s):s}}),S=z.extend(new function(){var _,v={gray:["gray"],rgb:["red","green","blue"],hsb:["hue","saturation","brightness"],hsl:["hue","saturation","lightness"],gradient:["gradient","origin","destination","highlight"]},y={},b={transparent:[0,0,0,0]};var r=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]],i={"rgb-hsb":function(t,e,i){var n=Math.max(t,e,i),r=n-Math.min(t,e,i);return[0==r?0:60*(n==t?(e-i)/r+(e<i?6:0):n==e?(i-t)/r+2:(t-e)/r+4),0===n?0:r/n,n]},"hsb-rgb":function(t,e,i){t=(t/60%6+6)%6;var n=Math.floor(t),t=t-n,i=[i,i*(1-e),i*(1-e*t),i*(1-e*(1-t))];return[i[(n=r[n])[0]],i[n[1]],i[n[2]]]},"rgb-hsl":function(t,e,i){var n=Math.max(t,e,i),r=Math.min(t,e,i),s=n-r,a=0==s,o=(n+r)/2;return[a?0:60*(n==t?(e-i)/s+(e<i?6:0):n==e?(i-t)/s+2:(t-e)/s+4),a?0:o<.5?s/(n+r):s/(2-n-r),o]},"hsl-rgb":function(t,e,i){if(0===e)return[i,i,i];for(var n=[(t=(t/360%1+1)%1)+1/3,t,t-1/3],r=i<.5?i*(1+e):i+e-i*e,s=2*i-r,a=[],o=0;o<3;o++){var h=n[o];h<0&&(h+=1),1<h&&--h,a[o]=6*h<1?s+6*(r-s)*h:2*h<1?r:3*h<2?s+(r-s)*(2/3-h)*6:s}return a},"rgb-gray":function(t,e,i){return[.2989*t+.587*e+.114*i]},"gray-rgb":function(t){return[t,t,t]},"gray-hsb":function(t){return[0,0,t]},"gray-hsl":function(t){return[0,0,t]},"gradient-rgb":function(){return[]},"rgb-gradient":function(){return[]}};return z.each(v,function(t,s){y[s]=[],z.each(t,function(t,e){var i=z.capitalize(t),n=/^(hue|saturation)$/.test(t),r=y[s][e]="gradient"===s?"gradient"===t?function(t){var e=this._components[0];return e!==(t=nt.read(Array.isArray(t)?t:arguments,0,{readNull:!0}))&&(e&&e._removeOwner(this),t)&&t._addOwner(this),t}:function(){return P.read(arguments,0,{readNull:"highlight"===t,clone:!0})}:function(t){return null==t||isNaN(t)?0:+t};this["get"+i]=function(){return(this._type===s||n&&/^hs[bl]$/.test(this._type)?this._components:this._convert(s))[e]},this["set"+i]=function(t){this._type===s||n&&/^hs[bl]$/.test(this._type)||(this._components=this._convert(s),this._properties=v[s],this._type=s),this._components[e]=r.call(this,t),this._changed()}},this)},{_class:"Color",_readIndex:!0,initialize:function t(e){var i,n,r=arguments,s=this.__read,a=0,o=null!=(e=Array.isArray(e)?(r=e)[0]:e)&&typeof e;if("string"===o&&e in v&&(h=e,e=r[1],Array.isArray(e)?(i=e,u=r[2]):(s&&(a=1),r=z.slice(r,1),o=typeof e)),!i){if(n="number"===o?r:"object"===o&&null!=e.length?e:null){var h=h||(3<=n.length?"rgb":"gray"),l=v[h].length,u=n[l];s&&(a+=n===arguments?l+(null!=u?1:0):1),n.length>l&&(n=z.slice(n,0,l))}else if("string"===o){l=function(t){var e=t.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})([\da-f]{2})?$/i)||t.match(/^#([\da-f])([\da-f])([\da-f])([\da-f])?$/i),i="rgb";if(e)for(var n=e[4]?4:3,r=new Array(n),s=0;s<n;s++){var a=e[s+1];r[s]=parseInt(1==a.length?a+a:a,16)/255}else if(e=t.match(/^(rgb|hsl)a?\((.*)\)$/)){i=e[1],r=e[2].trim().split(/[,\s]+/g);for(var o="hsl"===i,s=0,h=Math.min(r.length,4);s<h;s++){var l,u=r[s],a=parseFloat(u);o?0===s?(l=u.match(/([a-z]*)$/)[1],a*={turn:360,rad:180/Math.PI,grad:.9}[l]||1):s<3&&(a/=100):s<3&&(a/=/%$/.test(u)?100:255),r[s]=a}}else{var c,d=b[t];r=(d=d||(T?(_||((_=A.getContext(1,1,{willReadFrequently:!0})).globalCompositeOperation="copy"),_.fillStyle="rgba(0,0,0,0)",_.fillStyle=t,_.fillRect(0,0,1,1),c=_.getImageData(0,0,1,1).data,b[t]=[c[0]/255,c[1]/255,c[2]/255]):[0,0,0])).slice()}return[i,r]}(e);h=l[0],4===(i=l[1]).length&&(u=i[3],i.length--)}else if("object"===o)if(e.constructor===t){if(h=e._type,i=e._components.slice(),u=e._alpha,"gradient"===h)for(var c=1,d=i.length;c<d;c++){var f=i[c];f&&(i[c]=f.clone())}}else if(e.constructor===nt)h="gradient",n=r;else{h="hue"in e?"lightness"in e?"hsl":"hsb":"gradient"in e||"stops"in e||"radial"in e?"gradient":"gray"in e?"gray":"rgb";var p=v[h],g=y[h];this._components=i=[];for(c=0,d=p.length;c<d;c++)null==(m=e[p[c]])&&!c&&"gradient"===h&&"stops"in e&&(m={stops:e.stops,radial:e.radial}),null!=(m=g[c].call(this,m))&&(i[c]=m);u=e.alpha}s&&h&&(a=1)}if(this._type=h||"rgb",!i){this._components=i=[];for(var m,c=0,d=(g=y[this._type]).length;c<d;c++)null!=(m=g[c].call(this,n&&n[c]))&&(i[c]=m)}return this._components=i,this._properties=v[this._type],this._alpha=u,s&&(this.__read=a),this},set:"#initialize",_serialize:function(t,e){var i=this.getComponents();return z.serialize(/^(gray|rgb)$/.test(this._type)?i:[this._type].concat(i),t,!0,e)},_changed:function(){this._canvasStyle=null,this._owner&&(this._setter?this._owner[this._setter](this):this._owner._changed(129))},_convert:function(t){var e;return this._type===t?this._components.slice():(e=i[this._type+"-"+t])?e.apply(this,this._components):i["rgb-"+t].apply(this,i[this._type+"-rgb"].apply(this,this._components))},convert:function(t){return new S(t,this._convert(t),this._alpha)},getType:function(){return this._type},setType:function(t){this._components=this._convert(t),this._properties=v[t],this._type=t},getComponents:function(){var t=this._components.slice();return null!=this._alpha&&t.push(this._alpha),t},getAlpha:function(){return null!=this._alpha?this._alpha:1},setAlpha:function(t){this._alpha=null==t?null:Math.min(Math.max(t,0),1),this._changed()},hasAlpha:function(){return null!=this._alpha},equals:function(t){var e=z.isPlainValue(t,!0)?S.read(arguments):t;return e===this||e&&this._class===e._class&&this._type===e._type&&this.getAlpha()===e.getAlpha()&&z.equals(this._components,e._components)||!1},toString:function(){for(var t=this._properties,e=[],i="gradient"===this._type,n=w.instance,r=0,s=t.length;r<s;r++){var a=this._components[r];null!=a&&e.push(t[r]+": "+(i?a:n.number(a)))}return null!=this._alpha&&e.push("alpha: "+n.number(this._alpha)),"{ "+e.join(", ")+" }"},toCSS:function(t){var e=this._convert("rgb"),i=t||null==this._alpha?1:this._alpha;function n(t){return Math.round(255*(t<0?0:1<t?1:t))}return e=[n(e[0]),n(e[1]),n(e[2])],i<1&&e.push(i<0?0:i),t?"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+e[2]).toString(16).slice(1):(4==e.length?"rgba(":"rgb(")+e.join(",")+")"},toCanvasStyle:function(t,e){if(this._canvasStyle)return this._canvasStyle;if("gradient"!==this._type)return this._canvasStyle=this.toCSS();var i,n=this._components,r=n[0],s=r._stops,a=n[1],o=n[2],n=n[3],e=e&&e.inverted();e&&(a=e._transformPoint(a),o=e._transformPoint(o),n=n&&e._transformPoint(n)),i=r._radial?(e=o.getDistance(a),r=(n=n&&(r=n.subtract(a)).getLength()>e?a.add(r.normalize(e-.1)):n)||a,t.createRadialGradient(r.x,r.y,0,a.x,a.y,e)):t.createLinearGradient(a.x,a.y,o.x,o.y);for(var h=0,l=s.length;h<l;h++){var u=s[h],c=u._offset;i.addColorStop(null==c?h/(l-1):c,u._color.toCanvasStyle())}return this._canvasStyle=i},transform:function(t){if("gradient"===this._type){for(var e=this._components,i=1,n=e.length;i<n;i++){var r=e[i];t._transformPoint(r,r,!0)}this._changed()}},statics:{_types:v,random:function(){var t=Math.random;return new S(t(),t(),t())},_setOwner:function(t,e,i){return t&&!(t=t._owner&&e&&t._owner!==e?t.clone():t)._owner^!e&&(t._owner=e||null,t._setter=i||null),t}}})},new function(){return z.each({add:function(t,e){return t+e},subtract:function(t,e){return t-e},multiply:function(t,e){return t*e},divide:function(t,e){return t/e}},function(a,t){this[t]=function(t){t=S.read(arguments);for(var e=this._type,i=this._components,n=t._convert(e),r=0,s=i.length;r<s;r++)n[r]=a(i[r],n[r]);return new S(e,n,null!=this._alpha?a(this._alpha,t.getAlpha()):null)}},{})}),nt=z.extend({_class:"Gradient",initialize:function(t,e){this._id=o.get(),t&&z.isPlainObject(t)&&(this.set(t),t=e=null),null==this._stops&&this.setStops(t||["white","black"]),null==this._radial&&this.setRadial("string"==typeof e&&"radial"===e||e||!1)},_serialize:function(t,e){return e.add(this,function(){return z.serialize([this._stops,this._radial],t,!0,e)})},_changed:function(){for(var t=0,e=this._owners&&this._owners.length;t<e;t++)this._owners[t]._changed()},_addOwner:function(t){this._owners||(this._owners=[]),this._owners.push(t)},_removeOwner:function(t){t=this._owners?this._owners.indexOf(t):-1;-1!=t&&(this._owners.splice(t,1),this._owners.length||(this._owners=j))},clone:function(){for(var t=[],e=0,i=this._stops.length;e<i;e++)t[e]=this._stops[e].clone();return new nt(t,this._radial)},getStops:function(){return this._stops},setStops:function(t){if(t.length<2)throw new Error("Gradient stop list needs to contain at least two stops.");var e=this._stops;if(e)for(var i=0,n=e.length;i<n;i++)e[i]._owner=j;for(i=0,n=(e=this._stops=rt.readList(t,0,{clone:!0})).length;i<n;i++)e[i]._owner=this;this._changed()},getRadial:function(){return this._radial},setRadial:function(t){this._radial=t,this._changed()},equals:function(t){if(t===this)return!0;if(t&&this._class===t._class){var e=this._stops,i=t._stops,n=e.length;if(n===i.length){for(var r=0;r<n;r++)if(!e[r].equals(i[r]))return!1;return!0}}return!1}}),rt=z.extend({_class:"GradientStop",initialize:function(t,e){var i=t,n=e;"object"==typeof t&&e===j&&(Array.isArray(t)&&"number"!=typeof t[0]?(i=t[0],n=t[1]):("color"in t||"offset"in t||"rampPoint"in t)&&(i=t.color,n=t.offset||t.rampPoint||0)),this.setColor(i),this.setOffset(n)},clone:function(){return new rt(this._color.clone(),this._offset)},_serialize:function(t,e){var i=this._color,n=this._offset;return z.serialize(null==n?[i]:[i,n],t,!0,e)},_changed:function(){this._owner&&this._owner._changed(129)},getOffset:function(){return this._offset},setOffset:function(t){this._offset=t,this._changed()},getRampPoint:"#getOffset",setRampPoint:"#setOffset",getColor:function(){return this._color},setColor:function(){S._setOwner(this._color,null),this._color=S._setOwner(S.read(arguments,0),this,"setColor"),this._changed()},equals:function(t){return t===this||t&&this._class===t._class&&this._color.equals(t._color)&&this._offset==t._offset||!1}}),st=z.extend(new function(){var n={fillColor:null,fillRule:"nonzero",strokeColor:null,strokeWidth:1,strokeCap:"butt",strokeJoin:"miter",strokeScaling:!0,miterLimit:10,dashOffset:0,dashArray:[],shadowColor:null,shadowBlur:0,shadowOffset:new P,selectedColor:null},r=z.set({},n,{fontFamily:"sans-serif",fontWeight:"normal",fontSize:12,leading:null,justification:"left"}),s=z.set({},r,{fillColor:new S}),i={strokeWidth:193,strokeCap:193,strokeJoin:193,strokeScaling:201,miterLimit:193,fontFamily:9,fontWeight:9,fontSize:9,font:9,leading:9,justification:9},a={beans:!0},f={_class:"Style",beans:!0,initialize:function(t,e,i){this._values={},this._owner=e,this._project=e&&e._project||i||B.project,this._defaults=!e||e instanceof g?r:e instanceof et?s:n,t&&this.set(t)}};return z.each(r,function(t,h){var l=/Color$/.test(h),u="shadowOffset"===h,e=z.capitalize(h),o=i[h],c="set"+e,d="get"+e;f[c]=function(t){var e,i=this._owner,n=i&&i._children,r=n&&0<n.length&&!(i instanceof G);if(r)for(var s=0,a=n.length;s<a;s++)n[s]._style[c](t);("selectedColor"===h||!r)&&h in this._defaults&&(e=this._values[h])!==t&&(l&&(e&&(S._setOwner(e,null),e._canvasStyle=null),t)&&t.constructor===S&&(t=S._setOwner(t,i,r&&c)),this._values[h]=t,i)&&i._changed(o||129)},f[d]=function(t){var e,i=this._owner,n=i&&i._children,r=n&&0<n.length&&!(i instanceof G);if(r&&!t)for(var s=0,a=n.length;s<a;s++){var o=n[s]._style[d]();if(s){if(!z.equals(e,o))return j}else e=o}else h in this._defaults&&((e=this._values[h])===j?(e=this._defaults[h])&&e.clone&&(e=e.clone()):!(t=l?S:u?P:null)||e&&e.constructor===t||(this._values[h]=e=t.read([e],0,{readNull:!0,clone:!0})));return e=e&&l?S._setOwner(e,i,r&&c):e},a[d]=function(t){return this._style[d](t)},a[c]=function(t){this._style[c](t)}}),z.each({Font:"FontFamily",WindingRule:"FillRule"},function(t,e){var i="get"+e,e="set"+e;f[i]=a[i]="#get"+t,f[e]=a[e]="#set"+t}),V.inject(a),f},{set:function(t){var e,i=t instanceof st,n=i?t._values:t;if(n)for(var r in n)r in this._defaults&&(e=n[r],this[r]=e&&i&&e.clone?e.clone():e)},equals:function(t){function e(t,e,i){var n,r=t._values,s=e._values,a=e._defaults;for(n in r){var o=r[n],h=s[n];if(!(i&&n in s||z.equals(o,h===j?a[n]:h)))return!1}return!0}return t===this||t&&this._class===t._class&&e(this,t)&&e(t,this,!0)||!1},_dispose:function(){var t=this.getFillColor();t&&(t._canvasStyle=null),(t=this.getStrokeColor())&&(t._canvasStyle=null),(t=this.getShadowColor())&&(t._canvasStyle=null)},hasFill:function(){var t=this.getFillColor();return!!t&&0<t.alpha},hasStroke:function(){var t=this.getStrokeColor();return!!t&&0<t.alpha&&0<this.getStrokeWidth()},hasShadow:function(){var t=this.getShadowColor();return!!t&&0<t.alpha&&(0<this.getShadowBlur()||!this.getShadowOffset().isZero())},getView:function(){return this._project._view},getFontStyle:function(){var t=this.getFontSize();return this.getFontWeight()+" "+t+(/[a-z]/i.test(t+"")?" ":"px ")+this.getFontFamily()},getFont:"#getFontFamily",setFont:"#setFontFamily",getLeading:function t(){var e=t.base.call(this),i=this.getFontSize();return/pt|em|%|px/.test(i)&&(i=this.getView().getPixelSize(i)),null!=e?e:1.2*i}}),c=new function(){function r(t,e,i,n){for(var r=["","webkit","moz","Moz","ms","o"],s=e[0].toUpperCase()+e.substring(1),a=0;a<6;a++){var o=r[a],o=o?o+s:e;if(o in t){if(!i)return t[o];t[o]=n;break}}}return{getStyles:function(t){var e=t&&9!==t.nodeType?t.ownerDocument:t,e=e&&e.defaultView;return e&&e.getComputedStyle(t,"")},getBounds:function(t,e){var i,n=t.ownerDocument,r=n.body,s=n.documentElement;try{i=t.getBoundingClientRect()}catch(t){i={left:0,top:0,width:0,height:0}}var t=i.left-(s.clientLeft||r.clientLeft||0),a=i.top-(s.clientTop||r.clientTop||0);return e||(t+=(e=n.defaultView).pageXOffset||s.scrollLeft||r.scrollLeft,a+=e.pageYOffset||s.scrollTop||r.scrollTop),new x(t,a,i.width,i.height)},getViewportBounds:function(t){var t=t.ownerDocument,e=t.defaultView,t=t.documentElement;return new x(0,0,e.innerWidth||t.clientWidth,e.innerHeight||t.clientHeight)},getOffset:function(t,e){return c.getBounds(t,e).getPoint()},getSize:function(t){return c.getBounds(t,!0).getSize()},isInvisible:function(t){return c.getSize(t).equals(new O(0,0))},isInView:function(t){return!c.isInvisible(t)&&c.getViewportBounds(t).intersects(c.getBounds(t,!0))},isInserted:function(t){return I.body.contains(t)},getPrefixed:function(t,e){return t&&r(t,e)},setPrefixed:function(t,e,i){if("object"==typeof e)for(var n in e)r(t,n,!0,e[n]);else r(t,e,!0,i)}}},R={add:function(t,e){if(t)for(var i in e)for(var n=e[i],r=i.split(/[\s,]+/g),s=0,a=r.length;s<a;s++){var o=r[s];t.addEventListener(o,n,t===I&&("touchstart"===o||"touchmove"===o)&&{passive:!1})}},remove:function(t,e){if(t)for(var i in e)for(var n=e[i],r=i.split(/[\s,]+/g),s=0,a=r.length;s<a;s++)t.removeEventListener(r[s],n,!1)},getPoint:function(t){t=t.targetTouches?(t.targetTouches.length?t.targetTouches:t.changedTouches)[0]:t;return new P(t.pageX||t.clientX+I.documentElement.scrollLeft,t.pageY||t.clientY+I.documentElement.scrollTop)},getTarget:function(t){return t.target||t.srcElement},getRelatedTarget:function(t){return t.relatedTarget||t.toElement},getOffset:function(t,e){return R.getPoint(t).subtract(c.getOffset(e||R.getTarget(t)))}},D=(R.requestAnimationFrame=new function(){var e,n=c.getPrefixed(T,"requestAnimationFrame"),r=!1,s=[];function a(){var t=s;s=[];for(var e=0,i=t.length;e<i;e++)t[e]();(r=n&&s.length)&&n(a)}return function(t){s.push(t),n?r||(n(a),r=!0):e=e||setInterval(a,1e3/60)}},z.extend(t,{_class:"View",initialize:function t(e,i){function n(t){return i[t]||parseInt(i.getAttribute(t),10)}function r(){var t=c.getSize(i);return t.isNaN()||t.isZero()?new O(n("width"),n("height")):t}var s,a,o,h,l;T&&i?(this._id=i.getAttribute("id"),null==this._id&&i.setAttribute("id",this._id="paper-view-"+t._id++),R.add(i,this._viewEvents),c.setPrefixed(i.style,{userDrag:s="none",userSelect:s,touchCallout:s,contentZooming:s,tapHighlightColor:"rgba(0,0,0,0)"}),u.hasAttribute(i,"resize")&&R.add(T,(a=this)._windowEvents={resize:function(){a.setViewSize(r())}}),s=r(),u.hasAttribute(i,"stats")&&"undefined"!=typeof Stats&&(this._stats=new Stats,h=(o=this._stats.domElement).style,l=c.getOffset(i),h.position="absolute",h.left=l.x+"px",h.top=l.y+"px",I.body.appendChild(o))):(s=new O(i),i=null),this._project=e,this._scope=e._scope,this._element=i,this._pixelRatio||(this._pixelRatio=T&&T.devicePixelRatio||1),this._setElementSize(s.width,s.height),this._viewSize=s,t._views.push(this),((t._viewsById[this._id]=this)._matrix=new M)._owner=this,t._focused||(t._focused=this),this._frameItems={},this._frameItemCount=0,this._itemEvents={native:{},virtual:{}},this._autoUpdate=!B.agent.node,this._needsUpdate=!1},remove:function(){if(!this._project)return!1;D._focused===this&&(D._focused=null),D._views.splice(D._views.indexOf(this),1),delete D._viewsById[this._id];var t=this._project;return t._view===this&&(t._view=null),R.remove(this._element,this._viewEvents),R.remove(T,this._windowEvents),this._element=this._project=null,this.off("frame"),this._animate=!1,this._frameItems={},!0},_events:z.each(V._itemHandlers.concat(["onResize","onKeyDown","onKeyUp"]),function(t){this[t]={}},{onFrame:{install:function(){this.play()},uninstall:function(){this.pause()}}}),_animate:!1,_time:0,_count:0,getAutoUpdate:function(){return this._autoUpdate},setAutoUpdate:function(t){(this._autoUpdate=t)&&this.requestUpdate()},update:function(){},draw:function(){this.update()},requestUpdate:function(){var e;this._requested||(e=this,R.requestAnimationFrame(function(){var t;e._requested=!1,e._animate&&(e.requestUpdate(),t=e._element,c.getPrefixed(I,"hidden")&&"true"!==u.getAttribute(t,"keepalive")||!c.isInView(t)||e._handleFrame()),e._autoUpdate&&e.update()}),this._requested=!0)},play:function(){this._animate=!0,this.requestUpdate()},pause:function(){this._animate=!1},_handleFrame:function(){B=this._scope;var t=Date.now()/1e3,e=this._last?t-this._last:0;this._last=t,this.emit("frame",new z({delta:e,time:this._time+=e,count:this._count++})),this._stats&&this._stats.update()},_animateItem:function(t,e){var i=this._frameItems;e?(i[t._id]={item:t,time:0,count:0},1==++this._frameItemCount&&this.on("frame",this._handleFrameItems)):(delete i[t._id],0==--this._frameItemCount&&this.off("frame",this._handleFrameItems))},_handleFrameItems:function(t){for(var e in this._frameItems){e=this._frameItems[e];e.item.emit("frame",new z(t,{time:e.time+=t.delta,count:e.count++}))}},_changed:function(){this._project._changed(4097),this._bounds=this._decomposed=j},getElement:function(){return this._element},getPixelRatio:function(){return this._pixelRatio},getResolution:function(){return 72*this._pixelRatio},getViewSize:function(){var t=this._viewSize;return new n(t.width,t.height,this,"setViewSize")},setViewSize:function(){var t=O.read(arguments),e=t.subtract(this._viewSize);e.isZero()||(this._setElementSize(t.width,t.height),this._viewSize.set(t),this._changed(),this.emit("resize",{size:t,delta:e}),this._autoUpdate&&this.update())},_setElementSize:function(t,e){var i=this._element;i&&(i.width!==t&&(i.width=t),i.height!==e)&&(i.height=e)},getBounds:function(){return this._bounds||(this._bounds=this._matrix.inverted()._transformBounds(new x(new P,this._viewSize))),this._bounds},getSize:function(){return this.getBounds().getSize()},isVisible:function(){return c.isInView(this._element)},isInserted:function(){return c.isInserted(this._element)},getPixelSize:function(t){var e,i,n=this._element;return n?(n=n.parentNode,(i=I.createElement("div")).style.fontSize=t,n.appendChild(i),e=parseFloat(c.getStyles(i).fontSize),n.removeChild(i)):e=parseFloat(e),e},getTextWidth:function(t,e){return 0}},z.each(["rotate","scale","shear","skew"],function(i){var n="rotate"===i;this[i]=function(){var t=arguments,e=(n?z:P).read(t),t=P.read(t,0,{readNull:!0});return this.transform((new M)[i](e,t||this.getCenter(!0)))}},{_decompose:function(){return this._decomposed||(this._decomposed=this._matrix.decompose())},translate:function(){var t=new M;return this.transform(t.translate.apply(t,arguments))},getCenter:function(){return this.getBounds().getCenter()},setCenter:function(){var t=P.read(arguments);this.translate(this.getCenter().subtract(t))},getZoom:function(){var t=this._decompose().scaling;return(t.x+t.y)/2},setZoom:function(t){this.transform((new M).scale(t/this.getZoom(),this.getCenter()))},getRotation:function(){return this._decompose().rotation},setRotation:function(t){var e=this.getRotation();null!=e&&null!=t&&this.rotate(t-e)},getScaling:function(){var t=this._decompose().scaling;return new l(t.x,t.y,this,"setScaling")},setScaling:function(){var t=this.getScaling(),e=P.read(arguments,0,{clone:!0,readNull:!0});t&&e&&this.scale(e.x/t.x,e.y/t.y)},getMatrix:function(){return this._matrix},setMatrix:function(){var t=this._matrix;t.set.apply(t,arguments)},transform:function(t){this._matrix.append(t)},scrollBy:function(){this.translate(P.read(arguments).negate())}}),{projectToView:function(){return this._matrix._transformPoint(P.read(arguments))},viewToProject:function(){return this._matrix._inverseTransform(P.read(arguments))},getEventPoint:function(t){return this.viewToProject(R.getOffset(t,this._element))}},{statics:{_views:[],_viewsById:{},_id:0,create:function(t,e){return I&&"string"==typeof e&&(e=I.getElementById(e)),new(T?at:D)(t,e)}}},new function(){var n,r,p,s,t,e,i,a,o,g,m,l,_,v,y,b,w,x,S,C,k,h;if(T)return s=p=!1,(o=T.navigator).pointerEnabled||o.msPointerEnabled?(t="pointerdown MSPointerDown",e="pointermove MSPointerMove",i="pointerup pointercancel MSPointerUp MSPointerCancel"):(t="touchstart",e="touchmove",i="touchend touchcancel","ontouchstart"in T&&o.userAgent.match(/mobile|tablet|ip(ad|hone|od)|android|silk/i)||(t+=" mousedown",e+=" mousemove",i+=" mouseup")),o={mouseout:function(t){var e,i,n,r=D._focused,s=R.getRelatedTarget(t);!r||s&&"HTML"!==s.nodeName||(e=(s=R.getOffset(t,r._element)).x,i=(n=Math.abs)(e),s.x=n(n=i-(1<<25))<i?n*(e<0?-1:1):e,d(r,t,r.viewToProject(s)))},scroll:c},(a={})[t]=function(t){var e=D._focused=u(t);p||(p=!0,e._handleMouseEvent("mousedown",t))},o[e]=function(t){var e,i=D._focused;s||((e=u(t))?i!==e&&(i&&d(i,t),n=n||i,i=D._focused=r=e):r&&r===i&&(n&&!n.isInserted()&&(n=null),i=D._focused=n,n=null,c())),i&&d(i,t)},o[t]=function(){s=!0},o[i]=function(t){var e=D._focused;e&&p&&e._handleMouseEvent("mouseup",t),s=p=!1},R.add(I,o),R.add(T,{load:c}),m=g=!1,_=!(l={doubleclick:"click",mousedrag:"mousemove"}),h={mousedown:{mousedown:1,mousedrag:1,click:1,doubleclick:1},mouseup:{mouseup:1,mousedrag:1,click:1,doubleclick:1},mousemove:{mousedrag:1,mousemove:1,mouseenter:1,mouseleave:1}},{_viewEvents:a,_handleMouseEvent:function(t,e,i){var n=this._itemEvents,r=n.native[t],s="mousemove"===t,a=this._scope.tool,o=this;function h(t){return n.virtual[t]||o.responds(t)||a&&a.responds(t)}s&&p&&h("mousedrag")&&(t="mousedrag"),i=i||this.getEventPoint(e);var l=this.getBounds().contains(i),u=r&&l&&o._project.hitTest(i,{tolerance:0,fill:!0,stroke:!0}),u=u&&u.item||null,c=!1,d={};if(d[t.substr(5)]=!0,r&&u!==w&&(w&&E(w,null,"mouseleave",e,i),u&&E(u,null,"mouseenter",e,i),w=u),_^l&&(E(this,null,l?"mouseenter":"mouseleave",e,i),c=!0),!l&&!d.drag||i.equals(y)||(A(this,u,s?t:"mousemove",e,i,y),c=!0),_=l,d.down&&l||d.up&&v){if(A(this,u,t,e,i,v),d.down){if(k=u===S&&Date.now()-C<300,b=S=u,!m&&u){for(var f=u;f&&!f.responds("mousedrag");)f=f._parent;f&&(x=u)}v=i}else d.up&&(m||u!==b||(C=Date.now(),A(this,u,k?"doubleclick":"click",e,i,v),k=!1),b=x=null);c=!(_=!1)}y=i,c&&a&&(g=a._handleMouseEvent(t,e,i,d)||g),!1!==e.cancelable&&(g&&!d.move||d.down&&h("mouseup"))&&e.preventDefault()},_handleKeyEvent:function(e,i,n,r){var s,a=this._scope,t=a.tool;function o(t){t.responds(e)&&(B=a,t.emit(e,s=s||new ht(e,i,n,r)))}this.isVisible()&&(o(this),t)&&t.responds(e)&&o(t)},_countItemEvent:function(t,e){var i,n=this._itemEvents,r=n.native,n=n.virtual;for(i in h)r[i]=(r[i]||0)+(h[i][t]||0)*e;n[t]=(n[t]||0)+e},statics:{updateFocus:c,_resetState:function(){p=s=g=_=!1,n=r=v=y=b=w=x=S=C=k=null}}};function u(t){t=R.getTarget(t);return t.getAttribute&&D._viewsById[t.getAttribute("id")]}function c(){var t=D._focused;if(!t||!t.isVisible())for(var e=0,i=D._views.length;e<i;e++)if((t=D._views[e]).isVisible()){D._focused=r=t;break}}function d(t,e,i){t._handleMouseEvent("mousemove",e,i)}function E(t,n,e,r,s,a,i){var o,h=!1;for(;t&&t!==i&&!function t(e,i){if(e.responds(i)){if(o=o||new ut(i,r,s,n||e,a?s.subtract(a):null),e.emit(i,o)&&(g=!0,o.prevented&&(m=!0),o.stopped))return h=!0}else if(i=l[i])return t(e,i)}(t,e);)t=t._parent;return h}function A(t,e,i,n,r,s){t._project.removeOn(i),m=g=!1,x&&E(x,null,i,n,r,s)||e&&e!==x&&!e.isDescendant(x)&&E(e,null,"mousedrag"===i?"mousemove":i,n,r,s,x)||E(t,x||e||t,i,n,r,s)}})),at=D.extend({_class:"CanvasView",initialize:function(t,e){if(!(e instanceof T.HTMLCanvasElement)){var i=O.read(arguments,1);if(i.isZero())throw new Error("Cannot create CanvasView with the provided argument: "+z.slice(arguments,1));e=A.getCanvas(i)}var n,i=this._context=e.getContext("2d");i.save(),this._pixelRatio=1,/^off|false$/.test(u.getAttribute(e,"hidpi"))||(n=T.devicePixelRatio||1,i=c.getPrefixed(i,"backingStorePixelRatio")||1,this._pixelRatio=n/i),D.call(this,t,e),this._needsUpdate=!0},remove:function t(){return this._context.restore(),t.base.call(this)},_setElementSize:function t(e,i){var n,r,s=this._pixelRatio;t.base.call(this,e*s,i*s),1!==s&&(r=this._element,n=this._context,u.hasAttribute(r,"resize")||((r=r.style).width=e+"px",r.height=i+"px"),n.restore(),n.save(),n.scale(s,s))},getContext:function(){return this._context},getPixelSize:function t(e){var i,n,r=B.agent;return r&&r.firefox?i=t.base.call(this,e):(n=(r=this._context).font,r.font=e+" serif",i=parseFloat(r.font),r.font=n),i},getTextWidth:function(t,e){var i=this._context,n=i.font,r=0;i.font=t;for(var s=0,a=e.length;s<a;s++)r=Math.max(r,i.measureText(e[s]).width);return i.font=n,r},update:function(){var t,e,i;return!(!this._needsUpdate||(t=this._project,e=this._context,i=this._viewSize,e.clearRect(0,0,i.width+1,i.height+1),t&&t.draw(e,this._matrix,this._pixelRatio),this._needsUpdate=!1))}}),ot=z.extend({_class:"Event",initialize:function(t){this.event=t,this.type=t&&t.type},prevented:!1,stopped:!1,preventDefault:function(){this.prevented=!0,this.event.preventDefault()},stopPropagation:function(){this.stopped=!0,this.event.stopPropagation()},stop:function(){this.stopPropagation(),this.preventDefault()},getTimeStamp:function(){return this.event.timeStamp},getModifiers:function(){return lt.modifiers}}),ht=ot.extend({_class:"KeyEvent",initialize:function(t,e,i,n){this.type=t,this.event=e,this.key=i,this.character=n},toString:function(){return"{ type: '"+this.type+"', key: '"+this.key+"', character: '"+this.character+"', modifiers: "+this.getModifiers()+" }"}}),lt=new function(){var h,n,i={"\t":"tab"," ":"space","\b":"backspace","":"delete",Spacebar:"space",Del:"delete",Win:"meta",Esc:"escape"},r={tab:"\t",space:" ",enter:"\r"},l={},u={},c=new z({shift:!1,control:!1,alt:!1,meta:!1,capsLock:!1,space:!1}).inject({option:{get:function(){return this.alt}},command:{get:function(){var t=B&&B.agent;return t&&t.mac?this.meta:this.control}}});function s(t){var e=t.key||t.keyIdentifier,e=/^U\+/.test(e)?String.fromCharCode(parseInt(e.substr(2),16)):/^Arrow[A-Z]/.test(e)?e.substr(5):"Unidentified"===e||e===j?String.fromCharCode(t.keyCode):e;return i[e]||(1<e.length?z.hyphenate(e):e.toLowerCase())}function d(t,e,i,n){var r,s=D._focused;if((l[e]=t)?u[e]=i:delete u[e],1<e.length&&(r=z.camelize(e))in c){c[r]=t;var a=B&&B.agent;if("meta"===r&&a&&a.mac)if(t)h={};else{for(var o in h)o in u&&d(!1,o,h[o],n);h=null}}else t&&h&&(h[e]=i);s&&s._handleKeyEvent(t?"keydown":"keyup",n,e,i)}return R.add(I,{keydown:function(t){var e=s(t),i=B&&B.agent;1<e.length||i&&i.chrome&&(t.altKey||i.mac&&t.metaKey||!i.mac&&t.ctrlKey)?d(!0,e,r[e]||(1<e.length?"":e),t):n=e},keypress:function(t){var e,i;n&&(e=s(t),i=32<=(i=t.charCode)?String.fromCharCode(i):1<e.length?"":e,d(!0,e=e!==n?i.toLowerCase():e,i,t),n=null)},keyup:function(t){var e=s(t);e in u&&d(!1,e,u[e],t)}}),R.add(T,{blur:function(t){for(var e in u)d(!1,e,u[e],t)}}),{modifiers:c,isDown:function(t){return!!l[t]}}},ut=ot.extend({_class:"MouseEvent",initialize:function(t,e,i,n,r){this.type=t,this.event=e,this.point=i,this.target=n,this.delta=r},toString:function(){return"{ type: '"+this.type+"', point: "+this.point+", target: "+this.target+(this.delta?", delta: "+this.delta:"")+", modifiers: "+this.getModifiers()+" }"}}),ct=ot.extend({_class:"ToolEvent",_item:null,initialize:function(t,e,i){this.tool=t,this.type=e,this.event=i},_choosePoint:function(t,e){return t||(e?e.clone():null)},getPoint:function(){return this._choosePoint(this._point,this.tool._point)},setPoint:function(t){this._point=t},getLastPoint:function(){return this._choosePoint(this._lastPoint,this.tool._lastPoint)},setLastPoint:function(t){this._lastPoint=t},getDownPoint:function(){return this._choosePoint(this._downPoint,this.tool._downPoint)},setDownPoint:function(t){this._downPoint=t},getMiddlePoint:function(){return!this._middlePoint&&this.tool._lastPoint?this.tool._point.add(this.tool._lastPoint).divide(2):this._middlePoint},setMiddlePoint:function(t){this._middlePoint=t},getDelta:function(){return!this._delta&&this.tool._lastPoint?this.tool._point.subtract(this.tool._lastPoint):this._delta},setDelta:function(t){this._delta=t},getCount:function(){return this.tool[/^mouse(down|up)$/.test(this.type)?"_downCount":"_moveCount"]},setCount:function(t){this.tool[/^mouse(down|up)$/.test(this.type)?"downCount":"count"]=t},getItem:function(){if(!this._item){var t=this.tool._scope.project.hitTest(this.getPoint());if(t){for(var e=t.item,i=e._parent;/^(Group|CompoundPath)$/.test(i._class);)i=(e=i)._parent;this._item=e}}return this._item},setItem:function(t){this._item=t},toString:function(){return"{ type: "+this.type+", point: "+this.getPoint()+", count: "+this.getCount()+", modifiers: "+this.getModifiers()+" }"}}),dt=e.extend({_class:"Tool",_list:"tools",_reference:"tool",_events:["onMouseDown","onMouseUp","onMouseDrag","onMouseMove","onActivate","onDeactivate","onEditOptions","onKeyDown","onKeyUp"],initialize:function(t){e.call(this),this._moveCount=-1,this._downCount=-1,this.set(t)},getMinDistance:function(){return this._minDistance},setMinDistance:function(t){null!=(this._minDistance=t)&&null!=this._maxDistance&&t>this._maxDistance&&(this._maxDistance=t)},getMaxDistance:function(){return this._maxDistance},setMaxDistance:function(t){this._maxDistance=t,null!=this._minDistance&&null!=t&&t<this._minDistance&&(this._minDistance=t)},getFixedDistance:function(){return this._minDistance==this._maxDistance?this._minDistance:null},setFixedDistance:function(t){this._minDistance=this._maxDistance=t},_handleMouseEvent:function(t,e,a,o){B=this._scope,o.drag&&!this.responds(t)&&(t="mousemove");var h=o.move||o.drag,i=this.responds(t),n=this.minDistance,r=this.maxDistance,s=!1,l=this;function u(t,e){var i=a,n=h?l._point:l._downPoint||i;if(h){if(0<=l._moveCount&&i.equals(n))return;if(n&&(null!=t||null!=e)){var r=i.subtract(n),s=r.getLength();if(s<(t||0))return;e&&(i=n.add(r.normalize(Math.min(s,e))))}l._moveCount++}return l._point=i,l._lastPoint=n||i,o.down&&(l._moveCount=-1,l._downPoint=i,l._downCount++),1}function c(){i&&(s=l.emit(t,new ct(l,t,e))||s)}if(o.down)u(),c();else if(o.up)u(null,r),c();else if(i)for(;u(n,r);)c();return s}}),ft=z.extend(t,{_class:"Tween",statics:{easings:new z({linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:2*(2-t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}})},initialize:function t(e,i,n,r,s,a){this.object=e;var e=typeof s,o="function"==e,e=(this.type=o?e:"string"==e?s:"linear",this.easing=o?s:t.easings[this.type],this.duration=r,this.running=!1,this._then=null,this._startTime=null,i||n);this._keys=e?Object.keys(e):[],this._parsedKeys=this._parseKeys(this._keys),this._from=e&&this._getState(i),this._to=e&&this._getState(n),!1!==a&&this.start()},then:function(t){return this._then=t,this},start:function(){return this._startTime=null,this.running=!0,this},stop:function(){return this.running=!1,this},update:function(e){if(this.running){1<=e&&(e=1,this.running=!1);function t(t){return"function"==typeof t?t(i,e):t}for(var i=this.easing(e),n=this._keys,r=0,s=n&&n.length;r<s;r++){var a=n[r],o=t(this._from[a]),h=t(this._to[a]),h=o&&h&&o.__add&&h.__add?h.__subtract(o).__multiply(i).__add(o):(h-o)*i+o;this._setProperty(this._parsedKeys[a],h)}this.responds("update")&&this.emit("update",new z({progress:e,factor:i})),!this.running&&this._then&&this._then(this.object)}return this},_events:{onUpdate:{}},_handleFrame:function(t){var e=this._startTime,i=e?(t-e)/this.duration:0;e||(this._startTime=t),this.update(i)},_getState:function(t){for(var e=this._keys,i={},n=0,r=e.length;n<r;n++){var s,a=e[n],o=this._parsedKeys[a],h=this._getProperty(o);t?(s=this._resolveValue(h,t[a]),this._setProperty(o,s),s=(s=this._getProperty(o))&&s.clone?s.clone():s,this._setProperty(o,h)):s=h&&h.clone?h.clone():h,i[a]=s}return i},_resolveValue:function(t,e){if(e){if(Array.isArray(e)&&2===e.length)return(i=e[0])&&i.match&&i.match(/^[+\-\*\/]=/)?this._calculate(t,i[0],e[1]):e;if("string"==typeof e){var i=e.match(/^[+\-*/]=(.*)/);if(i)return i=JSON.parse(i[1].replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:/g,'"$2": ')),this._calculate(t,e[0],i)}}return e},_calculate:function(t,e,i){return B.PaperScript.calculateBinary(t,e,i)},_parseKeys:function(t){for(var e={},i=0,n=t.length;i<n;i++){var r=t[i],s=r.replace(/\.([^.]*)/g,"/$1").replace(/\[['"]?([^'"\]]*)['"]?\]/g,"/$1");e[r]=s.split("/")}return e},_getProperty:function(t,e){for(var i=this.object,n=0,r=t.length-(e||0);n<r&&i;n++)i=i[t[n]];return i},_setProperty:function(t,e){var i=this._getProperty(t,1);i&&(i[t[t.length-1]]=e)}}),pt=function(i){var n=new b.XMLHttpRequest;return n.open((i.method||"get").toUpperCase(),i.url,z.pick(i.async,!0)),i.mimeType&&n.overrideMimeType(i.mimeType),n.onload=function(){var t=n.status;0===t||200===t?i.onLoad&&i.onLoad.call(n,n.responseText):n.onerror()},n.onerror=function(){var t=n.status,e='Could not load "'+i.url+'" (Status: '+t+")";if(!i.onError)throw new Error(e);i.onError(e,t)},n.send(null)},A=z.exports.CanvasProvider={canvases:[],getCanvas:function(t,e,i){if(!T)return null;var n,r=!0,i=("object"==typeof t&&(e=t.height,t=t.width),this.canvases.length?n=this.canvases.pop():(n=I.createElement("canvas"),r=!1),n.getContext("2d",i||{}));if(i)return n.width===t&&n.height===e?r&&i.clearRect(0,0,t+1,e+1):(n.width=t,n.height=e),i.save(),n;throw new Error("Canvas "+n+" is unable to provide a 2D context.")},getContext:function(t,e,i){t=this.getCanvas(t,e,i);return t?t.getContext("2d",i||{}):null},release:function(t){t=t&&t.canvas?t.canvas:t;t&&t.getContext&&(t.getContext("2d").restore(),this.canvases.push(t))}},gt=new function(){var p,g,m,_,v,y,b,w,x,S,C,a=Math.min,o=Math.max,t=Math.abs;function s(t,e,i){return.2989*t+.587*e+.114*i}function e(t,e,i,n){var r=n-s(t,e,i),n=s(x=t+r,S=e+r,C=i+r),t=a(x,S,C),e=o(x,S,C);t<0&&(x=n+(x-n)*n/(i=n-t),S=n+(S-n)*n/i,C=n+(C-n)*n/i),255<e&&(x=n+(x-n)*(r=255-n)/(t=e-n),S=n+(S-n)*r/t,C=n+(C-n)*r/t)}function i(t,e,i){return o(t,e,i)-a(t,e,i)}function n(t,e,i,n){var r=[t,e,i],s=o(t,e,i),i=a(t,e,i),t=0===a(i=i===t?0:i===e?1:2,s=s===t?0:s===e?1:2)?1===o(i,s)?2:1:0;r[i]<r[s]?(r[t]=(r[t]-r[i])*n/(r[s]-r[i]),r[s]=n):r[t]=r[s]=0,r[i]=0,x=r[0],S=r[1],C=r[2]}var k={multiply:function(){x=v*p/255,S=y*g/255,C=b*m/255},screen:function(){x=v+p-v*p/255,S=y+g-y*g/255,C=b+m-b*m/255},overlay:function(){x=v<128?2*v*p/255:255-2*(255-v)*(255-p)/255,S=y<128?2*y*g/255:255-2*(255-y)*(255-g)/255,C=b<128?2*b*m/255:255-2*(255-b)*(255-m)/255},"soft-light":function(){var t=p*v/255;x=t+v*(255-(255-v)*(255-p)/255-t)/255,S=(t=g*y/255)+y*(255-(255-y)*(255-g)/255-t)/255,C=(t=m*b/255)+b*(255-(255-b)*(255-m)/255-t)/255},"hard-light":function(){x=p<128?2*p*v/255:255-2*(255-p)*(255-v)/255,S=g<128?2*g*y/255:255-2*(255-g)*(255-y)/255,C=m<128?2*m*b/255:255-2*(255-m)*(255-b)/255},"color-dodge":function(){x=0===v?0:255===p?255:a(255,255*v/(255-p)),S=0===y?0:255===g?255:a(255,255*y/(255-g)),C=0===b?0:255===m?255:a(255,255*b/(255-m))},"color-burn":function(){x=255===v?255:0===p?0:o(0,255-255*(255-v)/p),S=255===y?255:0===g?0:o(0,255-255*(255-y)/g),C=255===b?255:0===m?0:o(0,255-255*(255-b)/m)},darken:function(){x=v<p?v:p,S=y<g?y:g,C=b<m?b:m},lighten:function(){x=p<v?v:p,S=g<y?y:g,C=m<b?b:m},difference:function(){(x=v-p)<0&&(x=-x),(S=y-g)<0&&(S=-S),(C=b-m)<0&&(C=-C)},exclusion:function(){x=v+p*(255-v-v)/255,S=y+g*(255-y-y)/255,C=b+m*(255-b-b)/255},hue:function(){n(p,g,m,i(v,y,b)),e(x,S,C,s(v,y,b))},saturation:function(){n(v,y,b,i(p,g,m)),e(x,S,C,s(v,y,b))},luminosity:function(){e(v,y,b,s(p,g,m))},color:function(){e(p,g,m,s(v,y,b))},add:function(){x=a(v+p,255),S=a(y+g,255),C=a(b+m,255)},subtract:function(){x=o(v-p,0),S=o(y-g,0),C=o(b-m,0)},average:function(){x=(v+p)/2,S=(y+g)/2,C=(b+m)/2},negation:function(){x=255-t(255-p-v),S=255-t(255-g-y),C=255-t(255-m-b)}},E=this.nativeModes=z.each(["source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","lighter","darker","copy","xor"],function(t){this[t]=!0},{}),r=A.getContext(1,1,{willReadFrequently:!0});r&&(z.each(k,function(t,e){var i="darken"===e,n=!1;r.save();try{r.fillStyle=i?"#300":"#a00",r.fillRect(0,0,1,1),r.globalCompositeOperation=e,r.globalCompositeOperation===e&&(r.fillStyle=i?"#a00":"#300",r.fillRect(0,0,1,1),n=r.getImageData(0,0,1,1).data[0]!==i?170:51)}catch(t){}r.restore(),E[e]=n}),A.release(r)),this.process=function(t,e,i,n,r){var s=e.canvas,a="normal"===t;if(a||E[t])i.save(),i.setTransform(1,0,0,1,0,0),i.globalAlpha=n,a||(i.globalCompositeOperation=t),i.drawImage(s,r.x,r.y),i.restore();else{var o=k[t];if(o){for(var a=i.getImageData(r.x,r.y,s.width,s.height),h=a.data,l=e.getImageData(0,0,s.width,s.height).data,u=0,c=h.length;u<c;u+=4){p=l[u],v=h[u],g=l[u+1],y=h[u+1],m=l[u+2],b=h[u+2],_=l[u+3],w=h[u+3],o();var d=_*n/255,f=1-d;h[u]=d*x+f*v,h[u+1]=d*S+f*y,h[u+2]=d*C+f*b,h[u+3]=_*n+f*w}i.putImageData(a,r.x,r.y)}}}},_=new function(){var n="http://www.w3.org/2000/svg",t="http://www.w3.org/2000/xmlns",e="http://www.w3.org/1999/xlink",a={href:e,xlink:t,xmlns:t+"/","xmlns:xlink":t+"/"};function r(t,e,i){for(var n in e){var r=e[n],s=a[n];"number"==typeof r&&i&&(r=i.number(r)),s?t.setAttributeNS(s,n,r):t.setAttribute(n,r)}return t}return{svg:n,xmlns:t,xlink:e,create:function(t,e,i){return r(I.createElementNS(n,t),e,i)},get:function(t,e){var i=a[e];return"null"===(i=i?t.getAttributeNS(i,e):t.getAttribute(e))?null:i},set:r}},mt=z.each({fillColor:["fill","color"],fillRule:["fill-rule","string"],strokeColor:["stroke","color"],strokeWidth:["stroke-width","number"],strokeCap:["stroke-linecap","string"],strokeJoin:["stroke-linejoin","string"],strokeScaling:["vector-effect","lookup",{true:"none",false:"non-scaling-stroke"},function(t,e){return!e&&(t instanceof Q||t instanceof f||t instanceof et)}],miterLimit:["stroke-miterlimit","number"],dashArray:["stroke-dasharray","array"],dashOffset:["stroke-dashoffset","number"],fontFamily:["font-family","string"],fontWeight:["font-weight","string"],fontSize:["font-size","number"],justification:["text-anchor","lookup",{left:"start",center:"middle",right:"end"}],opacity:["opacity","number"],blendMode:["mix-blend-mode","style"]},function(t,e){var i=z.capitalize(e),n=t[2];this[e]={type:t[1],property:e,attribute:t[0],toSVG:n,fromSVG:n&&z.each(n,function(t,e){this[t]=e},{}),exportFilter:t[3],get:"get"+i,set:"set"+i}},{});function d(t,e,i){var n,r,s=new z,a=t.getTranslation();return e&&(t.isInvertible()?(n=(t=t._shiftless())._inverseTransform(a),a=null):n=new P,s[i?"cx":"x"]=n.x,s[i?"cy":"y"]=n.y),t.isIdentity()||((e=t.decompose())?(i=[],n=e.rotation,r=e.scaling,e=e.skewing,a&&!a.isZero()&&i.push("translate("+p.point(a)+")"),n&&i.push("rotate("+p.number(n)+")"),F.isZero(r.x-1)&&F.isZero(r.y-1)||i.push("scale("+p.point(r)+")"),e.x&&i.push("skewX("+p.number(e.x)+")"),e.y&&i.push("skewY("+p.number(e.y)+")"),s.transform=i.join(" ")):s.transform="matrix("+t.getValues().join(",")+")"),s}function _t(t,e){for(var i=d(t._matrix),n=t._children,r=_.create("g",i,p),s=0,a=n.length;s<a;s++){var o,h=n[s],l=St(h,e);l&&(h.isClipMask()?((o=_.create("clipPath")).appendChild(l),wt(h,o,"clip"),_.set(r,{"clip-path":"url(#"+o.id+")"})):r.appendChild(l))}return r}function vt(t){var e,i=t._type,n=t._radius,r=d(t._matrix,!0,"rectangle"!==i);return(n="rectangle"===i&&(i="rect",e=(t=t._size).width,t=t.height,r.x-=e/2,r.y-=t/2,r.width=e,r.height=t,n.isZero())?null:n)&&("circle"===i?r.r=n:(r.rx=n.width,r.ry=n.height)),_.create(i,r,p)}function yt(r,t,e){var s={},a=!e&&r.getParent(),o=[];return null!=r._name&&(s.id=r._name),z.each(mt,function(t){var e=t.get,i=t.type,n=r[e]();(t.exportFilter?!t.exportFilter(r,n):a&&z.equals(a[e](),n))||("color"===i&&null!=n&&(e=n.getAlpha())<1&&(s[t.attribute+"-opacity"]=e),"style"===i?o.push(t.attribute+": "+n):s[t.attribute]=null==n?"none":"color"===i?n.gradient?function(t){var e=bt(t,"color");if(!e){for(var i,n,r=t.getGradient(),s=r._radial,a=t.getOrigin(),o=t.getDestination(),h=(s?(i={cx:a.x,cy:a.y,r:a.getDistance(o)},(n=t.getHighlight())&&(i.fx=n.x,i.fy=n.y)):i={x1:a.x,y1:a.y,x2:o.x,y2:o.y},i.gradientUnits="userSpaceOnUse",e=_.create((s?"radial":"linear")+"Gradient",i,p),r._stops),l=0,u=h.length;l<u;l++){var c=h[l],d=c._color,f=d.getAlpha(),c=c._offset;i={offset:null==c?l/(u-1):c},d&&(i["stop-color"]=d.toCSS(!0)),f<1&&(i["stop-opacity"]=f),e.appendChild(_.create("stop",i,p))}wt(t,e,"color")}return"url(#"+e.id+")"}(n):n.toCSS(!0):"array"===i?n.join(","):"lookup"===i?t.toSVG[n]:n)}),o.length&&(s.style=o.join(";")),1===s.opacity&&delete s.opacity,r._visible||(s.visibility="hidden"),_.set(t,s,p)}function bt(t,e){return s=s||{ids:{},svgs:{}},t&&s.svgs[e+"-"+(t._id||t.__id||(t.__id=o.get("svg")))]}function wt(t,e,i){s||bt();var n=s.ids[i]=(s.ids[i]||0)+1;e.id=i+"-"+n,s.svgs[i+"-"+(t._id||t.__id)]=e}function xt(t,e){var i=t,n=null;if(s){for(var r in i="svg"===t.nodeName.toLowerCase()&&t,s.svgs)n||(i||(i=_.create("svg")).appendChild(t),n=i.insertBefore(_.create("defs"),i.firstChild)),n.appendChild(s.svgs[r]);s=null}return e.asString?(new b.XMLSerializer).serializeToString(i):i}function St(t,e,i){var n,r=a[t._class],r=r&&r(t,e);return r&&((n=e.onExport)&&(r=n(t,r,e)||r),n=JSON.stringify(t._data))&&"{}"!==n&&"null"!==n&&r.setAttribute("data-paper-data",n),r&&yt(t,r,i)}function Ct(t){return p=new w((t=t||{}).precision),t}function v(t,e,i,n,r,s){t=_.get(t,e)||s,s=null==t?n?null:i?"":0:i?t:parseFloat(t);return/%\s*$/.test(t)?s/100*(r?1:C[/x|^width/.test(e)?"width":"height"]):s}function y(t,e,i,n,r,s,a){return e=v(t,e||"x",!1,n,r,s),i=v(t,i||"y",!1,n,r,a),!n||null!=e&&null!=i?new P(e,i):null}function kt(t,e,i,n,r){return e=v(t,e||"width",!1,n,r),i=v(t,i||"height",!1,n,r),!n||null!=e&&null!=i?new O(e,i):null}function Et(t,e,i){return"none"===t?null:"number"===e?parseFloat(t):"array"===e?t?t.split(/[\s,]+/g).map(parseFloat):[]:"color"===e?Nt(t)||t:"lookup"===e?i[t]:t}function At(t,e,i,n){var r=t.childNodes,s="clippath"===e,e="defs"===e,a=new g,o=a._project,h=o._currentStyle,l=[];if(s||e||(a=Mt(a,t,n),o._currentStyle=a._style.clone()),n)for(var u=t.querySelectorAll("defs"),c=0,d=u.length;c<d;c++)Rt(u[c],i,!1);for(c=0,d=r.length;c<d;c++){var f=r[c];1!==f.nodeType||/^defs$/i.test(f.nodeName)||!(f=Rt(f,i,!1))||f instanceof m||l.push(f)}return a.addChildren(l),s&&(a=Mt(a.reduce(),t,n)),o._currentStyle=h,(s||e)&&(a.remove(),a=null),a}function Tt(t,e){for(var i=t.getAttribute("points").match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g),n=[],r=0,s=i.length;r<s;r+=2)n.push(new P(parseFloat(i[r]),parseFloat(i[r+1])));t=new W(n);return"polygon"===e&&t.closePath(),t}function It(t,e){var i,n=(v(t,"href",!0)||"").substring(1),e="radialgradient"===e;if(n)(i=k[n].getGradient())._radial^e&&((i=i.clone())._radial=e);else{for(var r=t.childNodes,s=[],a=0,o=r.length;a<o;a++){var h=r[a];1===h.nodeType&&s.push(Mt(new rt,h))}i=new nt(s,e)}var l,u,c,n="userSpaceOnUse"!==v(t,"gradientUnits",!0);return e?(u=(l=y(t,"cx","cy",!1,n,"50%","50%")).add(v(t,"r",!1,!1,n,"50%"),0),c=y(t,"fx","fy",!0,n)):(l=y(t,"x1","y1",!1,n,"0%","0%"),u=y(t,"x2","y2",!1,n,"100%","0%")),Mt(new S(i,l,u,c),t)._scaleToBounds=n,null}function Lt(t,e,i,n){if(t.transform){for(var r=(n.getAttribute(i)||"").split(/\)\s*/g),s=new M,a=0,o=r.length;a<o;a++){var h=r[a];if(!h)break;for(var h=h.split(/\(\s*/),l=h[0],u=h[1].split(/[\s,]+/g),c=0,d=u.length;c<d;c++)u[c]=parseFloat(u[c]);switch(l){case"matrix":s.append(new M(u[0],u[1],u[2],u[3],u[4],u[5]));break;case"rotate":s.rotate(u[0],u[1]||0,u[2]||0);break;case"translate":s.translate(u[0],u[1]||0);break;case"scale":s.scale(u);break;case"skewX":s.skew(u[0],0);break;case"skewY":s.skew(0,u[0])}}t.transform(s)}}function Pt(t,e,i){i="fill-opacity"===i?"getFillColor":"getStrokeColor",t=t[i]&&t[i]();t&&t.setAlpha(parseFloat(e))}function Ot(t,e,i){var n=t.attributes[e],n=n&&n.value;return!n&&t.style&&(e=z.camelize(e),(n=t.style[e])||i.node[e]===i.parent[e]||(n=i.node[e])),n?"none"===n?null:n:j}function Mt(n,r,t){var e=r.parentNode,s={node:c.getStyles(r)||{},parent:!t&&!/^defs$/i.test(e.tagName)&&c.getStyles(e)||{}};return z.each(i,function(t,e){var i=Ot(r,e,s);n=i!==j&&t(n,i,e,r,s)||n}),n}function Nt(t){t=t&&t.match(/\((?:["'#]*)([^"')]+)/),t=t&&t[1],t=t&&k[T?t.replace(T.location.href.split("#")[0]+"#",""):t];return t&&t._scaleToBounds&&((t=t.clone())._scaleToBounds=!0),t}function Rt(t,e,i){var n,r,s,a=t.nodeName.toLowerCase(),o="#document"!==a,h=I.body,l=(i&&o&&(C=B.getView().getSize(),C=kt(t,null,null,!0)||C,n=_.create("svg",{style:"stroke-width: 1px; stroke-miterlimit: 10"}),r=t.parentNode,s=t.nextSibling,n.appendChild(t),h.appendChild(n)),B.settings),u=l.applyMatrix,c=l.insertItems,d=(l.applyMatrix=!1,l.insertItems=!1,E[a]),d=d&&d(t,a,e,i)||null;return l.insertItems=c,l.applyMatrix=u,d&&(!o||d instanceof g||(d=Mt(d,t,i)),a=e.onImport,c=o&&t.getAttribute("data-paper-data"),a&&(d=a(t,d,e)||d),e.expandShapes&&d instanceof f&&(d.remove(),d=d.toPath()),c)&&(d._data=JSON.parse(c)),n&&(h.removeChild(n),r)&&(s?r.insertBefore(t,s):r.appendChild(t)),i&&(k={},d)&&z.pick(e.applyMatrix,u)&&d.matrix.apply(!0,!0),d}function Dt(n,r,s){if(!n)return null;r="function"==typeof r?{onLoad:r}:r||{};var t,a=B,o=null;function e(t){try{var e="object"==typeof t?t:(new b.DOMParser).parseFromString(t.trim(),"image/svg+xml");if(!e.nodeName)throw e=null,new Error("Unsupported SVG source: "+n);B=a,o=Rt(e,r,!0),r&&!1===r.insert||s._insertItem(j,o);var i=r.onLoad;i&&i(o,t)}catch(t){h(t)}}function h(t,e){var i=r.onError;if(!i)throw new Error(t);i(t,e)}if("string"!=typeof n||/^[\s\S]*</.test(n)){if("undefined"!=typeof File&&n instanceof File)return(t=new FileReader).onload=function(){e(t.result)},t.onerror=function(){h(t.error)},t.readAsText(n);e(n)}else{var i=I.getElementById(n);i?e(i):pt({url:n,async:!0,onLoad:e,onError:h})}return o}a={Group:_t,Layer:_t,Raster:function(t,e){var i=d(t._matrix,!0),n=t.getSize(),r=t.getImage();return i.x-=n.width/2,i.y-=n.height/2,i.width=n.width,i.height=n.height,i.href=0==e.embedImages&&r&&r.src||t.toDataURL(),_.create("image",i,p)},Path:function(t,e){if(h=e.matchShapes){var i=t.toShape(!1);if(i)return vt(i)}var n=t._segments,r=n.length,i=d(t._matrix);if(h&&2<=r&&!t.hasHandles())if(2<r){for(var s=t._closed?"polygon":"polyline",a=[],o=0;o<r;o++)a.push(p.point(n[o]._point));i.points=a.join(" ")}else{s="line";var h=n[0]._point,l=n[1]._point;i.set({x1:h.x,y1:h.y,x2:l.x,y2:l.y})}else s="path",i.d=t.getPathData(null,e.precision);return _.create(s,i,p)},Shape:vt,CompoundPath:function(t,e){var i=d(t._matrix);return(t=t.getPathData(null,e.precision))&&(i.d=t),_.create("path",i,p)},SymbolItem:function(t,e){var i=d(t._matrix,!0),n=bt(t=t._definition,"symbol"),r=t._item,s=r.getStrokeBounds();return n||((n=_.create("symbol",{viewBox:p.rectangle(s)})).appendChild(St(r,e)),wt(t,n,"symbol")),i.href="#"+n.id,i.x+=s.x,i.y+=s.y,i.width=s.width,i.height=s.height,i.overflow="visible",_.create("use",i,p)},PointText:function(t){var e=_.create("text",d(t._matrix,!0),p);return e.textContent=t._content,e}},V.inject({exportSVG:function(t){return xt(St(this,t=Ct(t),!0),t)}}),h.inject({exportSVG:function(t){t=Ct(t);var e=this._children,i=this.getView(),n=z.pick(t.bounds,"view"),r=t.matrix||"view"===n&&i._matrix,r=r&&M.read([r]),i="view"===n?new x([0,0],i.getViewSize()):"content"===n?V._getBounds(e,r,{stroke:!0}).rect:x.read([n],0,{readNull:!0}),n={version:"1.1",xmlns:_.svg,"xmlns:xlink":_.xlink},i=(i&&(n.width=i.width,n.height=i.height,i.x||0===i.x||i.y||0===i.y)&&(n.viewBox=p.rectangle(i)),_.create("svg",n,p)),s=i;r&&!r.isIdentity()&&(s=i.appendChild(_.create("g",d(r),p)));for(var a=0,o=e.length;a<o;a++)s.appendChild(St(e[a],t,!0));return xt(i,t)}}),k={},E={"#document":function(t,e,i,n){for(var r=t.childNodes,s=0,a=r.length;s<a;s++){var o=r[s];if(1===o.nodeType)return Rt(o,i,n)}},g:At,svg:At,clippath:At,polygon:Tt,polyline:Tt,path:function(t){return Q.create(t.getAttribute("d"))},lineargradient:It,radialgradient:It,image:function(e){var t=new $(v(e,"href",!0));return t.on("load",function(){var t=kt(e),t=(this.setSize(t),y(e).add(t.divide(2)));this._matrix.append((new M).translate(t))}),t},symbol:function(t,e,i,n){return new m(At(t,e,i,n),!0)},defs:At,use:function(t){var e=(v(t,"href",!0)||"").substring(1),e=k[e],t=y(t);return e?e instanceof m?e.place(t):e.clone().translate(t):null},circle:function(t){return new f.Circle(y(t,"cx","cy"),v(t,"r"))},ellipse:function(t){return new f.Ellipse({center:y(t,"cx","cy"),radius:kt(t,"rx","ry")})},rect:function(t){return new f.Rectangle(new x(y(t),kt(t)),kt(t,"rx","ry"))},line:function(t){return new W.Line(y(t,"x1","y1"),y(t,"x2","y2"))},text:function(t){var e=new it(y(t).add(y(t,"dx","dy")));return e.setContent(t.textContent.trim()||""),e},switch:At},i=z.set(z.each(mt,function(i){this[i.attribute]=function(t,e){t[i.set]&&(t[i.set](Et(e,i.type,i.fromSVG)),"color"===i.type)&&(e=t[i.get]())&&e._scaleToBounds&&(t=t.getBounds(),e.transform((new M).translate(t.getPoint()).scale(t.getSize())))}},{}),{id:function(t,e){(k[e]=t).setName&&t.setName(e)},"clip-path":function(t,e){e=Nt(e);if(e){if((e=e.clone()).setClipMask(!0),!(t instanceof g))return new g(e,t);t.insertChild(0,e)}},gradientTransform:Lt,transform:Lt,"fill-opacity":Pt,"stroke-opacity":Pt,visibility:function(t,e){t.setVisible&&t.setVisible("visible"===e)},display:function(t,e){t.setVisible&&t.setVisible(null!==e)},"stop-color":function(t,e){t.setColor&&t.setColor(e)},"stop-opacity":function(t,e){t._color&&t._color.setAlpha(parseFloat(e))},offset:function(t,e){var i;t.setOffset&&(i=e.match(/(.*)%$/),t.setOffset(i?i[1]/100:parseFloat(e)))},viewBox:function(t,e,i,n,r){var s,a,e=new x(Et(e,"array")),o=kt(n,null,null,!0);t instanceof g?(s=o?o.divide(e.getSize()):1,s=(new M).scale(s).translate(e.getPoint().negate()),a=t):t instanceof m&&(o&&e.setSize(o),a=t._item),a&&("visible"!==Ot(n,"overflow",r)&&((o=new f.Rectangle(e)).setClipMask(!0),a.addChild(o)),s)&&a.transform(s)}}),V.inject({importSVG:function(t,e){return Dt(t,e,this)}}),h.inject({importSVG:function(t,e){return this.activate(),Dt(t,e,this)}}),z.exports.PaperScript=function(){var t,e,i=this,n=i.acorn;if(!n&&void 0!==Bt)try{n=Bt("acorn")}catch(t){}function _(t,e){return(i.acorn||n).parse(t,e)}n||(n=r={},t=this,e=function(t){"use strict";t.version="0.5.0",t.parse=function(t,e){p=String(t),d=p.length,s(e),se();var t=f.program,i=(K=x=g,f.locations&&(h=new a),Z=S=null,c=[],M(),t||D()),n=!0;for(t||(i.body=[]);v!==l;){var r=V();i.body.push(r),n&&ve(r)&&ge(!0),n=!1}return B(i,"Program")};var f,p,d,i,n=t.defaultOptions={ecmaVersion:5,strictSemicolons:!1,allowTrailingCommas:!0,forbidReserved:!1,allowReturnOutsideFunction:!1,locations:!1,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null};function s(t){for(var e in f=t||{},n)Object.prototype.hasOwnProperty.call(f,e)||(f[e]=n[e]);i=f.sourceFile||null}var g,m,_,H,W,v,y,G,b,w,K,x,h,Z,c,S,r=t.getLineInfo=function(t,e){for(var i=1,n=0;;){ie.lastIndex=n;var r=ie.exec(t);if(!(r&&r.index<e))break;++i,n=r.index+r[0].length}return{line:i,column:e-n}};function C(t,e){var i=r(p,t),e=(e+=" ("+i.line+":"+i.column+")",new SyntaxError(e));throw e.pos=t,e.loc=i,e.raisedAt=g,e}t.tokenize=function(t,e){p=String(t),d=p.length,s(e),se();var i={};function n(t){return x=_,M(t),i.start=m,i.end=_,i.startLoc=H,i.endLoc=W,i.type=v,i.value=y,i}return n.jumpTo=function(t,e){var i;if(g=t,f.locations)for(b=1,w=ie.lastIndex=0;(i=ie.exec(p))&&i.index<t;)++b,w=i.index+i[0].length;G=e,oe()},n};var e,$=[],Y={type:"num"},X={type:"regexp"},Q={type:"string"},k={type:"name"},l={type:"eof"},J={keyword:"break"},tt={keyword:"case",beforeExpr:!0},et={keyword:"catch"},it={keyword:"continue"},nt={keyword:"debugger"},rt={keyword:"default"},st={keyword:"do",isLoop:!0},at={keyword:"else",beforeExpr:!0},ot={keyword:"finally"},ht={keyword:"for",isLoop:!0},lt={keyword:"function"},ut={keyword:"if"},ct={keyword:"return",beforeExpr:!0},dt={keyword:"switch"},ft={keyword:"throw",beforeExpr:!0},pt={keyword:"try"},gt={keyword:"var"},mt={keyword:"while",isLoop:!0},_t={keyword:"with"},vt={keyword:"new",beforeExpr:!0},yt={keyword:"this"},bt={keyword:"null",atomValue:null},wt={keyword:"true",atomValue:!0},xt={keyword:"false",atomValue:!1},St={keyword:"in",binop:7,beforeExpr:!0},u={break:J,case:tt,catch:et,continue:it,debugger:nt,default:rt,do:st,else:at,finally:ot,for:ht,function:lt,if:ut,return:ct,switch:dt,throw:ft,try:pt,var:gt,while:mt,with:_t,null:bt,true:wt,false:xt,new:vt,in:St,instanceof:{keyword:"instanceof",binop:7,beforeExpr:!0},this:yt,typeof:{keyword:"typeof",prefix:!0,beforeExpr:!0},void:{keyword:"void",prefix:!0,beforeExpr:!0},delete:{keyword:"delete",prefix:!0,beforeExpr:!0}},Ct={type:"[",beforeExpr:!0},kt={type:"]"},Et={type:"{",beforeExpr:!0},E={type:"}"},A={type:"(",beforeExpr:!0},T={type:")"},I={type:",",beforeExpr:!0},L={type:";",beforeExpr:!0},At={type:":",beforeExpr:!0},Tt={type:"."},It={type:"?",beforeExpr:!0},Lt={binop:10,beforeExpr:!0},Pt={isAssign:!0,beforeExpr:!0},P={isAssign:!0,beforeExpr:!0},Ot={postfix:!0,prefix:!0,isUpdate:!0},Mt={prefix:!0,beforeExpr:!0},Nt={binop:1,beforeExpr:!0},Rt={binop:2,beforeExpr:!0},Dt={binop:3,beforeExpr:!0},Bt={binop:4,beforeExpr:!0},jt={binop:5,beforeExpr:!0},zt={binop:6,beforeExpr:!0},Ft={binop:7,beforeExpr:!0},Vt={binop:8,beforeExpr:!0},qt={binop:9,prefix:!0,beforeExpr:!0},Ut={binop:10,beforeExpr:!0};for(e in t.tokTypes={bracketL:Ct,bracketR:kt,braceL:Et,braceR:E,parenL:A,parenR:T,comma:I,semi:L,colon:At,dot:Tt,question:It,slash:Lt,eq:Pt,name:k,eof:l,num:Y,regexp:X,string:Q},u)t.tokTypes["_"+e]=u[e];function Ht(t){t=t.split(" ");var i="",e=[];t:for(var n=0;n<t.length;++n){for(var r=0;r<e.length;++r)if(e[r][0].length==t[n].length){e[r].push(t[n]);continue t}e.push([t[n]])}function s(t){if(1==t.length)return i+="return str === "+JSON.stringify(t[0])+";";i+="switch(str){";for(var e=0;e<t.length;++e)i+="case "+JSON.stringify(t[e])+":";i+="return true}return false;"}if(3<e.length){e.sort(function(t,e){return e.length-t.length}),i+="switch(str.length){";for(n=0;n<e.length;++n){var a=e[n];i+="case "+a[0].length+":",s(a)}i+="}"}else s(t);return new Function("str",i)}var Wt,Gt=Ht("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"),Kt=Ht("class enum extends super const export import"),Zt=Ht("implements interface let package private protected public static yield"),$t=Ht("eval arguments"),Yt=Ht("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"),Xt=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Qt="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Jt=new RegExp("["+Qt+"]"),te=new RegExp("["+Qt+"̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]"),ee=/[\n\r\u2028\u2029]/,ie=/\r\n|[\n\r\u2028\u2029]/g,ne=t.isIdentifierStart=function(t){return t<65?36===t:t<91||(t<97?95===t:t<123||170<=t&&Jt.test(String.fromCharCode(t)))},re=t.isIdentifierChar=function(t){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||170<=t&&te.test(String.fromCharCode(t))))};function a(){this.line=b,this.column=g-w}function se(){b=1,g=w=0,G=!0,oe()}function O(t,e){_=g,f.locations&&(W=new a),v=t,oe(),y=e,G=t.beforeExpr}function ae(){for(var t=g,e=f.onComment&&f.locations&&new a,i=p.charCodeAt(g+=2);g<d&&10!==i&&13!==i&&8232!==i&&8233!==i;)++g,i=p.charCodeAt(g);f.onComment&&f.onComment(!1,p.slice(t+2,g),t,g,e,f.locations&&new a)}function oe(){for(;g<d;){var t,e=p.charCodeAt(g);if(32===e)++g;else if(13===e)++g,10===(t=p.charCodeAt(g))&&++g,f.locations&&(++b,w=g);else if(10===e||8232===e||8233===e)++g,f.locations&&(++b,w=g);else if(8<e&&e<14)++g;else if(47===e)if(42===(t=p.charCodeAt(g+1))){i=s=r=n=void 0;var i,n=f.onComment&&f.locations&&new a,r=g,s=p.indexOf("*/",g+=2);if(-1===s&&C(g-2,"Unterminated comment"),g=s+2,f.locations)for(ie.lastIndex=r;(i=ie.exec(p))&&i.index<g;)++b,w=i.index+i[0].length;f.onComment&&f.onComment(!0,p.slice(r+2,s),r,g,n,f.locations&&new a)}else{if(47!==t)break;ae()}else{if(160!==e&&!(5760<=e&&Xt.test(String.fromCharCode(e))))break;++g}}}function he(t){switch(t){case 46:return 48<=(c=p.charCodeAt(g+1))&&c<=57?ce(!0):(++g,O(Tt));case 40:return++g,O(A);case 41:return++g,O(T);case 59:return++g,O(L);case 44:return++g,O(I);case 91:return++g,O(Ct);case 93:return++g,O(kt);case 123:return++g,O(Et);case 125:return++g,O(E);case 58:return++g,O(At);case 63:return++g,O(It);case 48:c=p.charCodeAt(g+1);if(120===c||88===c){g+=2;var e=ue(16);null==e&&C(m+2,"Expected hexadecimal number");ne(p.charCodeAt(g))&&C(g,"Identifier directly after number");return O(Y,e);return}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return ce(!1);case 34:case 39:var i=t;g++;for(var n="";;){d<=g&&C(m,"Unterminated string constant");var r=p.charCodeAt(g);if(r===i)return++g,O(Q,n);if(92===r){r=p.charCodeAt(++g);var s=/^[0-7]+/.exec(p.slice(g,g+3));for(s=s&&s[0];s&&255<parseInt(s,8);)s=s.slice(0,-1);if(++g,s="0"===s?null:s)S&&C(g-2,"Octal literal in strict mode"),n+=String.fromCharCode(parseInt(s,8)),g+=s.length-1;else switch(r){case 110:n+="\n";break;case 114:n+="\r";break;case 120:n+=String.fromCharCode(de(2));break;case 117:n+=String.fromCharCode(de(4));break;case 85:n+=String.fromCharCode(de(8));break;case 116:n+="\t";break;case 98:n+="\b";break;case 118:n+="\v";break;case 102:n+="\f";break;case 48:n+="\0";break;case 13:10===p.charCodeAt(g)&&++g;case 10:f.locations&&(w=g,++b);break;default:n+=String.fromCharCode(r)}}else 13!==r&&10!==r&&8232!==r&&8233!==r||C(m,"Unterminated string constant"),n+=String.fromCharCode(r),++g}return;case 47:return e=p.charCodeAt(g+1),G?(++g,le()):61===e?N(P,2):N(Lt,1);case 37:case 42:return 61===p.charCodeAt(g+1)?N(P,2):N(Ut,1);case 124:case 38:return l=t,(u=p.charCodeAt(g+1))===l?N(124===l?Nt:Rt,2):61===u?N(P,2):N(124===l?Dt:jt,1);case 94:return 61===p.charCodeAt(g+1)?N(P,2):N(Bt,1);case 43:case 45:return u=t,(l=p.charCodeAt(g+1))===u?45==l&&62==p.charCodeAt(g+2)&&ee.test(p.slice(x,g))?(g+=3,ae(),oe(),M()):N(Ot,2):61===l?N(P,2):N(qt,1);case 60:case 62:return a=t,o=p.charCodeAt(g+1),h=1,o===a?(h=62===a&&62===p.charCodeAt(g+2)?3:2,61===p.charCodeAt(g+h)?N(P,h+1):N(Vt,h)):33==o&&60==a&&45==p.charCodeAt(g+2)&&45==p.charCodeAt(g+3)?(g+=4,ae(),oe(),M()):(61===o&&(h=61===p.charCodeAt(g+2)?3:2),N(Ft,h));case 61:case 33:return a=t,61===p.charCodeAt(g+1)?N(zt,61===p.charCodeAt(g+2)?3:2):N(61===a?Pt:Mt,1);case 126:return N(Mt,1)}var a,o,h,l,u,c;return!1}function M(t){if(t?g=m+1:m=g,f.locations&&(H=new a),t)return le();if(d<=g)return O(l);t=p.charCodeAt(g);if(ne(t)||92===t)return pe();var e=he(t);if(!1===e){t=String.fromCharCode(t);if("\\"===t||Jt.test(t))return pe();C(g,"Unexpected character '"+t+"'")}return e}function N(t,e){var i=p.slice(g,g+e);g+=e,O(t,i)}function le(){for(var t,e,i=g;;){d<=g&&C(i,"Unterminated regular expression");var n=p.charAt(g);if(ee.test(n)&&C(i,"Unterminated regular expression"),t)t=!1;else{if("["===n)e=!0;else if("]"===n&&e)e=!1;else if("/"===n&&!e)break;t="\\"===n}++g}var r=p.slice(i,g),s=(++g,fe());s&&!/^[gmsiy]*$/.test(s)&&C(i,"Invalid regexp flag");try{var a=new RegExp(r,s)}catch(t){t instanceof SyntaxError&&C(i,t.message),C(t)}return O(X,a)}function ue(t,e){for(var i=g,n=0,r=0,s=null==e?1/0:e;r<s;++r){var a=p.charCodeAt(g),a=97<=a?a-97+10:65<=a?a-65+10:48<=a&&a<=57?a-48:1/0;if(t<=a)break;++g,n=n*t+a}return g===i||null!=e&&g-i!==e?null:n}function ce(t){var e,i=g,n=!1,r=48===p.charCodeAt(g),t=(t||null!==ue(10)||C(i,"Invalid number"),46===p.charCodeAt(g)&&(++g,ue(10),n=!0),p.charCodeAt(g)),t=(69!==t&&101!==t||(43!==(t=p.charCodeAt(++g))&&45!==t||++g,null===ue(10)&&C(i,"Invalid number"),n=!0),ne(p.charCodeAt(g))&&C(g,"Identifier directly after number"),p.slice(i,g));return n?e=parseFloat(t):r&&1!==t.length?/[89]/.test(t)||S?C(i,"Invalid number"):e=parseInt(t,8):e=parseInt(t,10),O(Y,e)}function de(t){t=ue(16,t);return null===t&&C(m,"Bad character escape sequence"),t}function fe(){for(var t,e=!(Wt=!1),i=g;;){var n=p.charCodeAt(g);if(re(n))Wt&&(t+=p.charAt(g)),++g;else{if(92!==n)break;Wt||(t=p.slice(i,g)),Wt=!0,117!=p.charCodeAt(++g)&&C(g,"Expecting Unicode escape sequence \\uXXXX"),++g;var n=de(4),r=String.fromCharCode(n);r||C(g-1,"Invalid Unicode escape"),(e?ne:re)(n)||C(g-4,"Invalid Unicode escape"),t+=r}e=!1}return Wt?t:p.slice(i,g)}function pe(){var t=fe(),e=k;return O(e=!Wt&&Yt(t)?u[t]:e,t)}function R(){K=m,x=_,h=W,M()}function ge(t){if(S=t,g=m,f.locations)for(;g<w;)w=p.lastIndexOf("\n",w-2)+1,--b;oe(),M()}function me(){this.type=null,this.start=m,this.end=null}function _e(){this.start=H,(this.end=null)!==i&&(this.source=i)}function D(){var t=new me;return f.locations&&(t.loc=new _e),f.directSourceFile&&(t.sourceFile=f.directSourceFile),f.ranges&&(t.range=[m,0]),t}function o(t){var e=new me;return e.start=t.start,f.locations&&(e.loc=new _e,e.loc.start=t.loc.start),f.ranges&&(e.range=[t.range[0],0]),e}function B(t,e){return t.type=e,t.end=x,f.locations&&(t.loc.end=h),f.ranges&&(t.range[1]=x),t}function ve(t){return 5<=f.ecmaVersion&&"ExpressionStatement"===t.type&&"Literal"===t.expression.type&&"use strict"===t.expression.value}function j(t){return v===t&&(R(),1)}function ye(){return!f.strictSemicolons&&(v===l||v===E||ee.test(p.slice(x,m)))}function be(){j(L)||ye()||F()}function z(t){(v===t?R:F)()}function F(){C(m,"Unexpected token")}function we(t){"Identifier"!==t.type&&"MemberExpression"!==t.type&&C(t.start,"Assigning to rvalue"),S&&"Identifier"===t.type&&$t(t.name)&&C(t.start,"Assigning to "+t.name+" in strict mode")}var xe={kind:"loop"},Se={kind:"switch"};function V(){(v===Lt||v===P&&"/="==y)&&M(!0);var t,e,i,n=v,r=D();switch(n){case J:case it:R();var s=n===J;j(L)||ye()?r.label=null:(v!==k?F:(r.label=U(),be))();for(var a=0;a<c.length;++a){var o=c[a];if(null==r.label||o.name===r.label.name){if(null!=o.kind&&(s||"loop"===o.kind))break;if(r.label&&s)break}}return a===c.length&&C(r.start,"Unsyntactic "+n.keyword),B(r,s?"BreakStatement":"ContinueStatement");case nt:return R(),be(),B(r,"DebuggerStatement");case st:return R(),c.push(xe),r.body=V(),c.pop(),z(mt),r.test=Ce(),be(),B(r,"DoWhileStatement");case ht:return(R(),c.push(xe),z(A),v===L)?Ee(r,null):(v===gt?(u=D(),R(),Te(u,!0),B(u,"VariableDeclaration"),1===u.declarations.length&&j(St)?Ae:Ee):(u=q(!1,!0),j(St)?(we(u),Ae):Ee))(r,u);case lt:return R(),Ne(r,!0);case ut:return R(),r.test=Ce(),r.consequent=V(),r.alternate=j(at)?V():null,B(r,"IfStatement");case ct:return Z||f.allowReturnOutsideFunction||C(m,"'return' outside of function"),R(),j(L)||ye()?r.argument=null:(r.argument=q(),be()),B(r,"ReturnStatement");case dt:R(),r.discriminant=Ce(),r.cases=[],z(Et),c.push(Se);for(;v!=E;)v===tt||v===rt?(i=v===tt,t&&B(t,"SwitchCase"),r.cases.push(t=D()),t.consequent=[],R(),i?t.test=q():(e&&C(K,"Multiple default clauses"),e=!0,t.test=null),z(At)):(t||F(),t.consequent.push(V()));return t&&B(t,"SwitchCase"),R(),c.pop(),B(r,"SwitchStatement");case ft:return R(),ee.test(p.slice(x,m))&&C(x,"Illegal newline after throw"),r.argument=q(),be(),B(r,"ThrowStatement");case pt:return R(),r.block=ke(),r.handler=null,v===et&&(u=D(),R(),z(A),u.param=U(),S&&$t(u.param.name)&&C(u.param.start,"Binding "+u.param.name+" in strict mode"),z(T),u.guard=null,u.body=ke(),r.handler=B(u,"CatchClause")),r.guardedHandlers=$,r.finalizer=j(ot)?ke():null,r.handler||r.finalizer||C(r.start,"Missing catch or finally clause"),B(r,"TryStatement");case gt:return R(),Te(r),be(),B(r,"VariableDeclaration");case mt:return R(),r.test=Ce(),c.push(xe),r.body=V(),c.pop(),B(r,"WhileStatement");case _t:return S&&C(m,"'with' in strict mode"),R(),r.object=Ce(),r.body=V(),B(r,"WithStatement");case Et:return ke();case L:return R(),B(r,"EmptyStatement");default:var h=y,l=q();if(n===k&&"Identifier"===l.type&&j(At)){for(a=0;a<c.length;++a)c[a].name===h&&C(l.start,"Label '"+h+"' is already declared");var u=v.isLoop?"loop":v===dt?"switch":null;return c.push({name:h,kind:u}),r.body=V(),c.pop(),r.label=l,B(r,"LabeledStatement")}return r.expression=l,be(),B(r,"ExpressionStatement")}}function Ce(){z(A);var t=q();return z(T),t}function ke(t){var e,i=D(),n=!0,r=!1;for(i.body=[],z(Et);!j(E);){var s=V();i.body.push(s),n&&t&&ve(s)&&(e=r,ge(r=!0)),n=!1}return r&&!e&&ge(!1),B(i,"BlockStatement")}function Ee(t,e){return t.init=e,z(L),t.test=v===L?null:q(),z(L),t.update=v===T?null:q(),z(T),t.body=V(),c.pop(),B(t,"ForStatement")}function Ae(t,e){return t.left=e,t.right=q(),z(T),t.body=V(),c.pop(),B(t,"ForInStatement")}function Te(t,e){for(t.declarations=[],t.kind="var";;){var i=D();if(i.id=U(),S&&$t(i.id.name)&&C(i.id.start,"Binding "+i.id.name+" in strict mode"),i.init=j(Pt)?q(!0,e):null,t.declarations.push(B(i,"VariableDeclarator")),!j(I))break}}function q(t,e){var i=Ie(e);if(t||v!==I)return i;var n=o(i);for(n.expressions=[i];j(I);)n.expressions.push(Ie(e));return B(n,"SequenceExpression")}function Ie(t){var e,i=function(t){var e=function(t){return function t(e,i,n){var r=v.binop;if(null!=r&&(!n||v!==St)){var s,a;if(i<r)return(s=o(e)).left=e,s.operator=y,a=v,R(),s.right=t(Le(),r,n),r=B(s,a===Nt||a===Rt?"LogicalExpression":"BinaryExpression"),t(r,i,n)}return e}(Le(),-1,t)}(t);{var i;if(j(It))return(i=o(e)).test=e,i.consequent=q(!0),z(At),i.alternate=q(!0,t),B(i,"ConditionalExpression")}return e}(t);return v.isAssign?((e=o(i)).operator=y,e.left=i,R(),e.right=Ie(t),we(i),B(e,"AssignmentExpression")):i}function Le(){var t;if(v.prefix)return e=D(),t=v.isUpdate,e.operator=y,e.prefix=!0,G=!0,R(),e.argument=Le(),t?we(e.argument):S&&"delete"===e.operator&&"Identifier"===e.argument.type&&C(e.start,"Deleting local variable in strict mode"),B(e,t?"UpdateExpression":"UnaryExpression");for(var e,i=Pe(Oe());v.postfix&&!ye();)(e=o(i)).operator=y,e.prefix=!1,we(e.argument=i),R(),i=B(e,"UpdateExpression");return i}function Pe(t,e){var i;return j(Tt)?((i=o(t)).object=t,i.property=U(!0),i.computed=!1,Pe(B(i,"MemberExpression"),e)):j(Ct)?((i=o(t)).object=t,i.property=q(),i.computed=!0,z(kt),Pe(B(i,"MemberExpression"),e)):!e&&j(A)?((i=o(t)).callee=t,i.arguments=Re(T,!1),Pe(B(i,"CallExpression"),e)):t}function Oe(){switch(v){case yt:var t=D();return R(),B(t,"ThisExpression");case k:return U();case Y:case Q:case X:return(t=D()).value=y,t.raw=p.slice(m,_),R(),B(t,"Literal");case bt:case wt:case xt:return(t=D()).value=v.atomValue,t.raw=v.keyword,R(),B(t,"Literal");case A:var e=H,i=m,n=(R(),q());return n.start=i,n.end=_,f.locations&&(n.loc.start=e,n.loc.end=W),f.ranges&&(n.range=[i,_]),z(T),n;case Ct:t=D();return R(),t.elements=Re(kt,!0,!0),B(t,"ArrayExpression");case Et:var r=D(),s=!0,a=!1;for(r.properties=[],R();!j(E);){if(s)s=!1;else if(z(I),f.allowTrailingCommas&&j(E))break;var o,h={key:Me()},l=!1;if(j(At)?(h.value=q(!0),o=h.kind="init"):5<=f.ecmaVersion&&"Identifier"===h.key.type&&("get"===h.key.name||"set"===h.key.name)?(l=a=!0,o=h.kind=h.key.name,h.key=Me(),v!==A&&F(),h.value=Ne(D(),!1)):F(),"Identifier"===h.key.type&&(S||a))for(var u=0;u<r.properties.length;++u){var c,d=r.properties[u];d.key.name===h.key.name&&(c=!((c=o==d.kind||l&&"init"===d.kind||"init"===o&&("get"===d.kind||"set"===d.kind))&&!S&&"init"===o&&"init"===d.kind)&&c)&&C(h.key.start,"Redefinition of property")}r.properties.push(h)}return B(r,"ObjectExpression");case lt:t=D();return R(),Ne(t,!1);case vt:e=D();return R(),e.callee=Pe(Oe(),!0),j(A)?e.arguments=Re(T,!1):e.arguments=$,B(e,"NewExpression");default:F()}}function Me(){return v===Y||v===Q?Oe():U(!0)}function Ne(t,e){v===k?t.id=U():e?F():t.id=null,t.params=[];var i=!0;for(z(A);!j(T);)i?i=!1:z(I),t.params.push(U());var n=Z,r=c;if(Z=!0,c=[],t.body=ke(!0),Z=n,c=r,S||t.body.body.length&&ve(t.body.body[0]))for(var s=t.id?-1:0;s<t.params.length;++s){var a=s<0?t.id:t.params[s];if((Zt(a.name)||$t(a.name))&&C(a.start,"Defining '"+a.name+"' in strict mode"),0<=s)for(var o=0;o<s;++o)a.name===t.params[o].name&&C(a.start,"Argument name clash in strict mode")}return B(t,e?"FunctionDeclaration":"FunctionExpression")}function Re(t,e,i){for(var n=[],r=!0;!j(t);){if(r)r=!1;else if(z(I),e&&f.allowTrailingCommas&&j(t))break;n.push(i&&v===I?null:q(!0))}return n}function U(t){var e=D();return t&&"everywhere"==f.forbidReserved&&(t=!1),v===k?(!t&&(f.forbidReserved&&(3===f.ecmaVersion?Gt:Kt)(y)||S&&Zt(y))&&-1==p.slice(m,_).indexOf("\\")&&C(m,"The keyword '"+y+"' is reserved"),e.name=y):t&&v.keyword?e.name=v.keyword:F(),G=!1,R(),B(e,"Identifier")}},"object"==typeof r&&"object"==typeof r?e(r):"function"==typeof define&&define.amd?define(["exports"],e):e(t.acorn||(t.acorn={})),n.version)||(n=null);var v={"+":"__add","-":"__subtract","*":"__multiply","/":"__divide","%":"__modulo","==":"__equals","!=":"__equals"},y={"-":"__negate","+":"__self"},r=z.each(["add","subtract","multiply","divide","modulo","equals","negate"],function(t){this["__"+t]="#"+t},{__self:function(){return this}});function p(t,e,i){var n=v[e];if(t&&t[n])return n=t[n](i),"!="===e?!n:n;switch(e){case"+":return t+i;case"-":return t-i;case"*":return t*i;case"/":return t/i;case"%":return t%i;case"==":return t==i;case"!=":return t!=i}}function g(t,e){var i=y[t];if(e&&e[i])return e[i]();switch(t){case"+":return+e;case"-":return-e}}function m(h,t){var s,e,i,n,r,a,o,l,u,c;return h?(s=[],e=(t=t||{}).url||"",i=t.sourceMaps,n=t.paperFeatures||{},r=t.source||h,t=t.offset||0,o=(a=B.agent).versionNumber,l=!1,u=/\r\n|\n|\r/gm,i&&(a.chrome&&30<=o||a.webkit&&537.76<=o||a.firefox&&23<=o||a.node)&&(a.node?t-=2:T&&e&&!T.location.href.indexOf(e)&&(t=(c=I.getElementsByTagName("html")[0].innerHTML).substr(0,c.indexOf(h)+1).match(u).length+1),(c=["AA"+function(t){var e="";for(t=(Math.abs(t)<<1)+(t<0?1:0);t||!e;){var i=31&t;(t>>=5)&&(i|=32),e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[i]}return e}((l=0<t&&!(a.chrome&&36<=o||a.safari&&600<=o||a.firefox&&40<=o||a.node))?0:t)+"A"]).length=(h.match(u)||[]).length+1+(l?t:0),c={version:3,file:e,names:[],mappings:c.join(";AACA"),sourceRoot:"",sources:[e],sourcesContent:[r]}),!1===n.operatorOverloading&&!1===n.moduleExports||m(_(h,{ranges:!0,preserveParens:!0,sourceType:"module"}),null,n),c&&(l&&(h=new Array(t+1).join("\n")+h),/^(inline|both)$/.test(i)&&(h+="\n//# sourceMappingURL=data:application/json;base64,"+b.btoa(unescape(encodeURIComponent(JSON.stringify(c))))),h+="\n//# sourceURL="+(e||"paperscript")),{url:e,source:r,code:h,map:c}):"";function d(t){for(var e=0,i=s.length;e<i;e++){var n=s[e];if(n[0]>=t)break;t+=n[1]}return t}function f(t){return h.substring(d(t.range[0]),d(t.range[1]))}function p(t,e){for(var i=d(t.range[0]),t=d(t.range[1]),n=0,r=s.length-1;0<=r;r--)if(i>s[r][0]){n=r+1;break}s.splice(n,0,[i,e.length-t+i]),h=h.substring(0,i)+e+h.substring(t)}function g(t,e){switch(t.type){case"UnaryExpression":t.operator in y&&"Literal"!==t.argument.type&&(i=f(t.argument),p(t,'$__("'+t.operator+'", '+i+")"));break;case"BinaryExpression":t.operator in v&&"Literal"!==t.left.type&&(n=f(t.left),r=f(t.right),a=t.left,o=t.right,a=h.substring(d(a.range[1]),d(o.range[0])),o=t.operator,p(t,"__$__("+n+","+a.replace(new RegExp("\\"+o),'"'+o+'"')+", "+r+")"));break;case"UpdateExpression":case"AssignmentExpression":var i,n,r,s,a=e&&e.type;"ForStatement"===a||"BinaryExpression"===a&&/^[=!<>]/.test(e.operator)||"MemberExpression"===a&&e.computed||("UpdateExpression"===t.type?(o=(i=f(t.argument))+" = "+(s="__$__("+i+', "'+t.operator[0]+'", 1)'),t.prefix?o="("+o+")":"AssignmentExpression"!==a&&"VariableDeclarator"!==a&&"BinaryExpression"!==a||(o=i+"; "+(o=f(e.left||e.id)===i?s:o)),p(t,o)):/^.=$/.test(t.operator)&&"Literal"!==t.left.type&&(n=f(t.left),r=f(t.right),s=n+" = __$__("+n+', "'+t.operator[0]+'", '+r+")",p(t,/^\(.*\)$/.test(f(t))?"("+s+")":s)))}var a,o}function m(t,e,i){if(t){for(var n in t)if("range"!==n&&"loc"!==n){var r=t[n];if(Array.isArray(r))for(var s=0,a=r.length;s<a;s++)m(r[s],t,i);else r&&"object"==typeof r&&m(r,t,i)}if(!1!==i.operatorOverloading&&g(t,e),!1!==i.moduleExports){var o=t;switch(o.type){case"ExportDefaultDeclaration":p({range:[o.start,o.declaration.start]},"module.exports = ");break;case"ExportNamedDeclaration":var h,l=o.declaration,u=o.specifiers;l?(h=l.declarations)&&(h.forEach(function(t){p(t,"module.exports."+f(t))}),p({range:[o.start,l.start+l.kind.length]},"")):u&&(h=u.map(function(t){t=f(t);return"module.exports."+t+" = "+t+"; "}).join(""))&&p(o,h)}}}}}function o(n,t,e){var i,r=(B=t).getView(),s=/\btool\.\w+|\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)\b/.test(n)&&!/\bnew\s+Tool\b/.test(n)?new dt:null,a=s?s._events:[],o=["onFrame","onResize"].concat(a),h=[],l=[],e="object"==typeof n?n:m(n,e);function u(t,e){for(var i in t)!e&&/^_/.test(i)||!new RegExp("([\\b\\s\\W]|^)"+i.replace(/\$/g,"\\$")+"\\b").test(n)||(h.push(i),l.push(t[i]))}n=e.code,u({__$__:p,$__:g,paper:t,tool:s},!0),u(t),n="var module = { exports: {} }; "+n;var c,d,e=z.each(o,function(t){new RegExp("\\s+"+t+"\\b").test(n)&&(h.push(t),this.push("module.exports."+t+" = "+t+";"))},[]).join("\n"),o=(e&&(n+="\n"+e),n+="\nreturn module.exports;",B.agent);I&&(o.chrome||o.firefox&&o.versionNumber<40)?(c=I.createElement("script"),d=I.head||I.getElementsByTagName("head")[0],o.firefox&&(n="\n"+n),c.appendChild(I.createTextNode("document.__paperscript__ = function("+h+") {"+n+"\n}")),d.appendChild(c),i=I.__paperscript__,delete I.__paperscript__,d.removeChild(c)):i=Function(h,n);var f=(e=i&&i.apply(t,l))||{};return z.each(a,function(t){var e=f[t];e&&(s[t]=e)}),r&&(f.onResize&&r.setOnResize(f.onResize),r.emit("resize",{size:r.size,delta:new P}),f.onFrame&&r.setOnFrame(f.onFrame),r.requestUpdate()),e}function s(t){if(/^text\/(?:x-|)paperscript$/.test(t.type)&&"true"!==u.getAttribute(t,"ignore")){var e,i=u.getAttribute(t,"canvas"),n=I.getElementById(i),r=t.src||t.getAttribute("data-src"),s=u.hasAttribute(t,"async"),a="data-paper-scope";if(n)return e=u.get(n.getAttribute(a))||(new u).setup(n),n.setAttribute(a,e._id),r?pt({url:r,async:s,mimeType:"text/plain",onLoad:function(t){o(t,e,r)}}):o(t.innerHTML,e,t.baseURI),t.setAttribute("data-paper-ignore","true"),e;throw new Error('Unable to find canvas with id "'+i+'"')}}function a(){z.each(I&&I.getElementsByTagName("script"),s)}return P.inject(r),O.inject(r),S.inject(r),T&&("complete"===I.readyState?setTimeout(a):R.add(T,{load:a})),{compile:m,execute:o,load:function(t){return t?s(t):a()},parse:_,calculateBinary:p,calculateUnary:g}}.call(this);var B=new(u.inject(z.exports,{Base:z,Numerical:F,Key:lt,DomEvent:R,DomElement:c,document:I,window:T,Symbol:m,PlacedSymbol:Y}));return B.agent.node&&Bt("./node/extend.js")(B),"function"==typeof define&&define.amd?define("paper",B):"object"==typeof jt&&jt&&(jt.exports=B),B}).call(this,"object"==typeof self?self:null)},{"./node/extend.js":8,"./node/self.js":8,acorn:5}],33:[function(t,e,i){var n,r,e=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}function o(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return(n=setTimeout)(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}var h,l=[],u=!1,c=-1;function d(){u&&h&&(u=!1,h.length?l=h.concat(l):c=-1,l.length)&&f()}function f(){if(!u){for(var t=o(d),e=(u=!0,l.length);e;){for(h=l,l=[];++c<e;)h&&h[c].run();c=-1,e=l.length}h=null,u=!1,!function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return(r=clearTimeout)(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}e.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new p(t,e)),1!==l.length||u||o(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=g,e.addListener=g,e.once=g,e.off=g,e.removeListener=g,e.removeAllListeners=g,e.emit=g,e.prependListener=g,e.prependOnceListener=g,e.listeners=function(t){return[]},e.binding=function(t){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(t){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},{}],34:[function(t,e,i){"use strict";e.exports=function(t,e,i,n){e=e||"&",i=i||"=";var r={};if("string"==typeof t&&0!==t.length){var s=/\+/g,e=(t=t.split(e),1e3),a=(n&&"number"==typeof n.maxKeys&&(e=n.maxKeys),t.length);0<e&&e<a&&(a=e);for(var o=0;o<a;++o){var h,l=t[o].replace(s,"%20"),u=l.indexOf(i),u=0<=u?(h=l.substr(0,u),l.substr(u+1)):(h=l,""),l=decodeURIComponent(h),u=decodeURIComponent(u);Object.prototype.hasOwnProperty.call(r,l)?c(r[l])?r[l].push(u):r[l]=[r[l],u]:r[l]=u}}return r};var c=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],35:[function(t,e,i){"use strict";function s(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}e.exports=function(i,n,r,t){return n=n||"&",r=r||"=","object"==typeof(i=null===i?void 0:i)?o(h(i),function(t){var e=encodeURIComponent(s(t))+r;return a(i[t])?o(i[t],function(t){return e+encodeURIComponent(s(t))}).join(n):e+encodeURIComponent(s(i[t]))}).join(n):t?encodeURIComponent(s(t))+r+encodeURIComponent(s(i)):""};var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var i=[],n=0;n<t.length;n++)i.push(e(t[n],n));return i}var h=Object.keys||function(t){var e,i=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.push(e);return i}},{}],36:[function(t,e,i){"use strict";i.decode=i.parse=t("./decode"),i.encode=i.stringify=t("./encode")},{"./decode":34,"./encode":35}],37:[function(t,e,i){var n=t("buffer"),r=n.Buffer;function s(t,e){for(var i in t)e[i]=t[i]}function a(t,e,i){return r(t,e,i)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(s(n,i),i.Buffer=a),a.prototype=Object.create(r.prototype),s(r,a),a.from=function(t,e,i){if("number"==typeof t)throw new TypeError("Argument must not be a number");return r(t,e,i)},a.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError("Argument must be a number");t=r(t);return void 0!==e?"string"==typeof i?t.fill(e,i):t.fill(e):t.fill(0),t},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:11}],38:[function(n,t,r){!function(l){!function(){var a=n("./lib/request"),t=n("./lib/response"),o=n("xtend"),e=n("builtin-status-codes"),h=n("url"),i=r;i.request=function(t,e){t="string"==typeof t?h.parse(t):o(t);var i=-1===l.location.protocol.search(/^https?:$/)?"http:":"",i=t.protocol||i,n=t.hostname||t.host,r=t.port,s=t.path||"/",i=(n&&-1!==n.indexOf(":")&&(n="["+n+"]"),t.url=(n?i+"//"+n:"")+(r?":"+r:"")+s,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{},new a(t));return e&&i.on("response",e),i},i.get=function(t,e){t=i.request(t,e);return t.end(),t},i.ClientRequest=a,i.IncomingMessage=t.IncomingMessage,i.Agent=function(){},i.Agent.defaultMaxSockets=4,i.globalAgent=new i.Agent,i.STATUS_CODES=e,i.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":40,"./lib/response":41,"builtin-status-codes":12,url:58,xtend:61}],39:[function(t,e,s){!function(r){!function(){var e;function i(){if(void 0===e)if(r.XMLHttpRequest){e=new r.XMLHttpRequest;try{e.open("GET",r.XDomainRequest?"/":"https://example.com")}catch(t){e=null}}else e=null;return e}function t(t){var e=i();if(e)try{return e.responseType=t,e.responseType===t}catch(t){}return!1}function n(t){return"function"==typeof t}s.fetch=n(r.fetch)&&n(r.ReadableStream),s.writableStream=n(r.WritableStream),s.abortController=n(r.AbortController),s.arraybuffer=s.fetch||t("arraybuffer"),s.msstream=!s.fetch&&t("ms-stream"),s.mozchunkedarraybuffer=!s.fetch&&t("moz-chunked-arraybuffer"),s.overrideMimeType=s.fetch||!!i()&&n(i().overrideMimeType),e=null}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],40:[function(a,o,t){!function(u,c,s){!function(){var h=a("./capability"),t=a("inherits"),e=a("./response"),r=a("readable-stream"),i=e.IncomingMessage,l=e.readyStates;e=o.exports=function(e){var t,i=this,n=(r.Writable.call(i),i._opts=e,i._body=[],i._headers={},e.auth&&i.setHeader("Authorization","Basic "+s.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){i.setHeader(t,e.headers[t])}),!0);if("disable-fetch"===e.mode||"requestTimeout"in e&&!h.abortController)t=!(n=!1);else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!h.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}i._mode=(t=t,n=n,h.fetch&&n?"fetch":h.mozchunkedarraybuffer?"moz-chunked-arraybuffer":h.msstream?"ms-stream":h.arraybuffer&&t?"arraybuffer":"text"),i._fetchTimer=null,i._socketTimeout=null,i._socketTimer=null,i.on("finish",function(){i._onFinish()})};t(e,r.Writable),e.prototype.setHeader=function(t,e){var i=t.toLowerCase();-1===n.indexOf(i)&&(this._headers[i]={name:t,value:e})},e.prototype.getHeader=function(t){t=this._headers[t.toLowerCase()];return t?t.value:null},e.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},e.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,i=("timeout"in t&&0!==t.timeout&&e.setTimeout(t.timeout),e._headers),n=null,r=("GET"!==t.method&&"HEAD"!==t.method&&(n=new Blob(e._body,{type:(i["content-type"]||{}).value||""})),[]);if(Object.keys(i).forEach(function(t){var e=i[t].name,t=i[t].value;Array.isArray(t)?t.forEach(function(t){r.push([e,t])}):r.push([e,t])}),"fetch"===e._mode){var s,a=null;h.abortController&&(a=(s=new AbortController).signal,e._fetchAbortController=s,"requestTimeout"in t)&&0!==t.requestTimeout&&(e._fetchTimer=c.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout)),c.fetch(e._opts.url,{method:e._opts.method,headers:r,body:n||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:a}).then(function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()},function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)})}else{var o=e._xhr=new c.XMLHttpRequest;try{o.open(e._opts.method,e._opts.url,!0)}catch(t){return void u.nextTick(function(){e.emit("error",t)})}"responseType"in o&&(o.responseType=e._mode),"withCredentials"in o&&(o.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(o.timeout=t.requestTimeout,o.ontimeout=function(){e.emit("requestTimeout")}),r.forEach(function(t){o.setRequestHeader(t[0],t[1])}),e._response=null,o.onreadystatechange=function(){switch(o.readyState){case l.LOADING:case l.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(o.onprogress=function(){e._onXHRProgress()}),o.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{o.send(n)}catch(t){u.nextTick(function(){e.emit("error",t)})}}}},e.prototype._onXHRProgress=function(){this._resetTimers(!1),function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){}}(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress(this._resetTimers.bind(this)))},e.prototype._connect=function(){var e=this;e._destroyed||(e._response=new i(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},e.prototype._write=function(t,e,i){this._body.push(t),i()},e.prototype._resetTimers=function(t){var e=this;c.clearTimeout(e._socketTimer),e._socketTimer=null,t?(c.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=c.setTimeout(function(){e.emit("timeout")},e._socketTimeout))},e.prototype.abort=e.prototype.destroy=function(t){this._destroyed=!0,this._resetTimers(!0),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort(),t&&this.emit("error",t)},e.prototype.end=function(t,e,i){"function"==typeof t&&(i=t,t=void 0),r.Writable.prototype.end.call(this,t,e,i)},e.prototype.setTimeout=function(t,e){e&&this.once("timeout",e),this._socketTimeout=t,this._resetTimers(!1)},e.prototype.flushHeaders=function(){},e.prototype.setNoDelay=function(){},e.prototype.setSocketKeepAlive=function(){};var n=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}.call(this)}.call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},a("buffer").Buffer)},{"./capability":39,"./response":41,_process:33,buffer:11,inherits:20,"readable-stream":56}],41:[function(i,t,n){!function(l,u,c){!function(){var a=i("./capability"),t=i("inherits"),o=i("readable-stream"),h=n.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},e=n.IncomingMessage=function(t,e,i,n){var r=this;if(o.Readable.call(r),r._mode=i,r.headers={},r.rawHeaders=[],r.trailers={},r.rawTrailers=[],r.on("end",function(){l.nextTick(function(){r.emit("close")})}),"fetch"===i){if(r._fetchResponse=e,r.url=e.url,r.statusCode=e.status,r.statusMessage=e.statusText,e.headers.forEach(function(t,e){r.headers[e.toLowerCase()]=t,r.rawHeaders.push(e,t)}),a.writableStream){var i=new WritableStream({write:function(i){return n(!1),new Promise(function(t,e){r._destroyed?e():r.push(c.from(i))?t():r._resumeFetch=t})},close:function(){n(!0),r._destroyed||r.push(null)},abort:function(t){n(!0),r._destroyed||r.emit("error",t)}});try{return void e.body.pipeTo(i).catch(function(t){n(!0),r._destroyed||r.emit("error",t)})}catch(t){}}var s=e.body.getReader();!function e(){s.read().then(function(t){r._destroyed||(n(t.done),t.done?r.push(null):(r.push(c.from(t.value)),e()))}).catch(function(t){n(!0),r._destroyed||r.emit("error",t)})}()}else r._xhr=t,r._pos=0,r.url=t.responseURL,r.statusCode=t.status,r.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach(function(t){var e,t=t.match(/^([^:]+):\s*(.*)/);t&&("set-cookie"===(e=t[1].toLowerCase())?(void 0===r.headers[e]&&(r.headers[e]=[]),r.headers[e].push(t[2])):void 0!==r.headers[e]?r.headers[e]+=", "+t[2]:r.headers[e]=t[2],r.rawHeaders.push(t[1],t[2]))}),r._charset="x-user-defined",a.overrideMimeType||((i=r.rawHeaders["mime-type"])&&(e=i.match(/;\s*charset=([^;])(;|$)/))&&(r._charset=e[1].toLowerCase()),r._charset)||(r._charset="utf-8")};t(e,o.Readable),e.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},e.prototype._onXHRProgress=function(t){var e=this,i=e._xhr,n=null;switch(e._mode){case"text":if((n=i.responseText).length>e._pos){var r=n.substr(e._pos);if("x-user-defined"===e._charset){for(var s=c.alloc(r.length),a=0;a<r.length;a++)s[a]=255&r.charCodeAt(a);e.push(s)}else e.push(r,e._charset);e._pos=n.length}break;case"arraybuffer":i.readyState===h.DONE&&i.response&&(n=i.response,e.push(c.from(new Uint8Array(n))));break;case"moz-chunked-arraybuffer":n=i.response,i.readyState===h.LOADING&&n&&e.push(c.from(new Uint8Array(n)));break;case"ms-stream":var o,n=i.response;i.readyState===h.LOADING&&((o=new u.MSStreamReader).onprogress=function(){o.result.byteLength>e._pos&&(e.push(c.from(new Uint8Array(o.result.slice(e._pos)))),e._pos=o.result.byteLength)},o.onload=function(){t(!0),e.push(null)},o.readAsArrayBuffer(n))}e._xhr.readyState===h.DONE&&"ms-stream"!==e._mode&&(t(!0),e.push(null))}}.call(this)}.call(this,i("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./capability":39,_process:33,buffer:11,inherits:20,"readable-stream":56}],42:[function(t,e,i){"use strict";var n={};function r(t,r,e){var i=function(n){var t,e;function i(t,e,i){return n.call(this,(t=t,e=e,i=i,"string"==typeof r?r:r(t,e,i)))||this}return e=n,(t=i).prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e,i}(e=e||Error);i.prototype.name=e.name,i.prototype.code=t,n[t]=i}function h(t,e){var i;return Array.isArray(t)?(i=t.length,t=t.map(function(t){return String(t)}),2<i?"one of ".concat(e," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])):"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,i){var n,r,s,a,o;return"string"==typeof e&&(a="not ",e.substr(!s||s<0?0:+s,a.length)===a)?(n="must not be",e=e.replace(/^not /,"")):n="must be",s=t,a=" argument",(void 0===o||o>s.length)&&(o=s.length),s=(s.substring(o-a.length,o)===a?"The ".concat(t," "):(o=(r="number"!=typeof r?0:r)+(s=".").length>(o=t).length||-1===o.indexOf(s,r)?"argument":"property",'The "'.concat(t,'" ').concat(o," "))).concat(n," ").concat(h(e,"type")),s+=". Received type ".concat(typeof i)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],43:[function(u,c,t){!function(l){!function(){"use strict";var t=Object.keys||function(t){var e,i=[];for(e in t)i.push(e);return i},e=(c.exports=a,u("./_stream_readable")),i=u("./_stream_writable");u("inherits")(a,e);for(var n=t(i.prototype),r=0;r<n.length;r++){var s=n[r];a.prototype[s]||(a.prototype[s]=i.prototype[s])}function a(t){if(!(this instanceof a))return new a(t);e.call(this,t),i.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen)&&(this.allowHalfOpen=!1,this.once("end",o))}function o(){this._writableState.ended||l.nextTick(h,this)}function h(t){t.end()}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}.call(this)}.call(this,u("_process"))},{"./_stream_readable":45,"./_stream_writable":47,_process:33,inherits:20}],44:[function(t,e,i){"use strict";e.exports=r;var n=t("./_stream_transform");function r(t){if(!(this instanceof r))return new r(t);n.call(this,t)}t("inherits")(r,n),r.prototype._transform=function(t,e,i){i(null,t)}},{"./_stream_transform":46,inherits:20}],45:[function(z,F,t){!function(B,j){!function(){"use strict";function p(t,e){return t.listeners(e).length}(F.exports=b).ReadableState=y,z("events").EventEmitter;var n,r=z("./internal/streams/stream"),u=z("buffer").Buffer,c=j.Uint8Array||function(){};var s,t,i,e=z("util"),g=e&&e.debuglog?e.debuglog("stream"):function(){},a=z("./internal/streams/buffer_list"),e=z("./internal/streams/destroy"),o=z("./internal/streams/state").getHighWaterMark,h=z("../errors").codes,d=h.ERR_INVALID_ARG_TYPE,f=h.ERR_STREAM_PUSH_AFTER_EOF,l=h.ERR_METHOD_NOT_IMPLEMENTED,m=h.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,_=(z("inherits")(b,r),e.errorOrDestroy),v=["error","close","destroy","pause","resume"];function y(t,e,i){n=n||z("./_stream_duplex"),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=o(this,t,"readableHighWaterMark",i),this.buffer=new a,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(s=s||z("string_decoder/").StringDecoder,this.decoder=new s(t.encoding),this.encoding=t.encoding)}function b(t){if(n=n||z("./_stream_duplex"),!(this instanceof b))return new b(t);var e=this instanceof n;this._readableState=new y(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy)&&(this._destroy=t.destroy),r.call(this)}function w(t,e,i,n,r){g("readableAddChunk",e);var s,a,o,h,l=t._readableState;if(null===e)l.reading=!1,a=t,o=l,g("onEofChunk"),o.ended||(o.decoder&&(h=o.decoder.end())&&h.length&&(o.buffer.push(h),o.length+=o.objectMode?1:h.length),o.ended=!0,o.sync?k(a):(o.needReadable=!1,o.emittedReadable||(o.emittedReadable=!0,E(a))));else if(s=r?s:function(t,e){var i;!function(t){return u.isBuffer(t)||t instanceof c}(e)&&"string"!=typeof e&&void 0!==e&&!t.objectMode&&(i=new d("chunk",["string","Buffer","Uint8Array"],e));return i}(l,e))_(t,s);else if(l.objectMode||e&&0<e.length)if("string"==typeof e||l.objectMode||Object.getPrototypeOf(e)===u.prototype||(h=e,e=u.from(h)),n)l.endEmitted?_(t,new m):x(t,l,e,!0);else if(l.ended)_(t,new f);else{if(l.destroyed)return!1;l.reading=!1,!l.decoder||i||(e=l.decoder.write(e),l.objectMode)||0!==e.length?x(t,l,e,!1):A(t,l)}else n||(l.reading=!1,A(t,l));return!l.ended&&(l.length<l.highWaterMark||0===l.length)}function x(t,e,i,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,n?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&k(t)),A(t,e)}Object.defineProperty(b.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),b.prototype.destroy=e.destroy,b.prototype._undestroy=e.undestroy,b.prototype._destroy=function(t,e){e(t)},b.prototype.push=function(t,e){var i,n=this._readableState;return n.objectMode?i=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=u.from(t,e),e=""),i=!0),w(this,t,e,!1,i)},b.prototype.unshift=function(t){return w(this,t,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(t){for(var e=new(s=s||z("string_decoder/").StringDecoder)(t),i=(this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding,this._readableState.buffer.head),n="";null!==i;)n+=e.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var S=1073741824;function C(t,e){var i;return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?(e.flowing&&e.length?e.buffer.head.data:e).length:(t>e.highWaterMark&&(e.highWaterMark=(S<=(i=t)?i=S:(i--,i=(i=(i=(i=(i|=i>>>1)|i>>>2)|i>>>4)|i>>>8)|i>>>16,i++),i)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function k(t){var e=t._readableState;g("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(g("emitReadable",e.flowing),e.emittedReadable=!0,B.nextTick(E,t))}function E(t){var e=t._readableState;g("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,O(t)}function A(t,e){e.readingMore||(e.readingMore=!0,B.nextTick(T,t,e))}function T(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var i=e.length;if(g("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}function I(t){var e=t._readableState;e.readableListening=0<t.listenerCount("readable"),e.resumeScheduled&&!e.paused?e.flowing=!0:0<t.listenerCount("data")&&t.resume()}function L(t){g("readable nexttick read 0"),t.read(0)}function P(t,e){g("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),O(t),e.flowing&&!e.reading&&t.read(0)}function O(t){var e=t._readableState;for(g("flow",e.flowing);e.flowing&&null!==t.read(););}function M(t,e){var i;return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i)}function N(t){var e=t._readableState;g("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,B.nextTick(D,e,t))}function D(t,e){g("endReadableNT",t.endEmitted,t.length),t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy&&(!(t=e._writableState)||t.autoDestroy&&t.finished)&&e.destroy())}function R(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1}b.prototype.read=function(t){g("read",t),t=parseInt(t,10);var e,i=this._readableState,n=t;return 0!==t&&(i.emittedReadable=!1),0===t&&i.needReadable&&((0!==i.highWaterMark?i.length>=i.highWaterMark:0<i.length)||i.ended)?(g("read: emitReadable",i.length,i.ended),(0===i.length&&i.ended?N:k)(this),null):0===(t=C(t,i))&&i.ended?(0===i.length&&N(this),null):(e=i.needReadable,g("need readable",e),(0===i.length||i.length-t<i.highWaterMark)&&g("length less than watermark",e=!0),i.ended||i.reading?g("reading or ended",e=!1):e&&(g("do read"),i.reading=!0,i.sync=!0,0===i.length&&(i.needReadable=!0),this._read(i.highWaterMark),i.sync=!1,i.reading||(t=C(n,i))),null===(e=0<t?M(t,i):null)?(i.needReadable=i.length<=i.highWaterMark,t=0):(i.length-=t,i.awaitDrain=0),0===i.length&&(i.ended||(i.needReadable=!0),n!==t)&&i.ended&&N(this),null!==e&&this.emit("data",e),e)},b.prototype._read=function(t){_(this,new l("_read()"))},b.prototype.pipe=function(i,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=i;break;case 1:r.pipes=[r.pipes,i];break;default:r.pipes.push(i)}r.pipesCount+=1,g("pipe count=%d opts=%j",r.pipesCount,t);t=(!t||!1!==t.end)&&i!==B.stdout&&i!==B.stderr?a:f;function s(t,e){g("onunpipe"),t===n&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,g("cleanup"),i.removeListener("close",c),i.removeListener("finish",d),i.removeListener("drain",o),i.removeListener("error",u),i.removeListener("unpipe",s),n.removeListener("end",a),n.removeListener("end",f),n.removeListener("data",l),h=!0,!r.awaitDrain||i._writableState&&!i._writableState.needDrain||o())}function a(){g("onend"),i.end()}r.endEmitted?B.nextTick(t):n.once("end",t),i.on("unpipe",s);e=n;var e,o=function(){var t=e._readableState;g("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&p(e,"data")&&(t.flowing=!0,O(e))},h=(i.on("drain",o),!1);function l(t){g("ondata");t=i.write(t);g("dest.write",t),!1===t&&((1===r.pipesCount&&r.pipes===i||1<r.pipesCount&&-1!==R(r.pipes,i))&&!h&&(g("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function u(t){g("onerror",t),f(),i.removeListener("error",u),0===p(i,"error")&&_(i,t)}function c(){i.removeListener("finish",d),f()}function d(){g("onfinish"),i.removeListener("close",c),f()}function f(){g("unpipe"),n.unpipe(i)}return n.on("data",l),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener(e,i);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]:t.on(e,i)}(i,"error",u),i.once("close",c),i.once("finish",d),i.emit("pipe",n),r.flowing||(g("pipe resume"),n.resume()),i},b.prototype.unpipe=function(t){var e=this._readableState,i={hasUnpiped:!1};if(0!==e.pipesCount)if(1===e.pipesCount)t&&t!==e.pipes||(t=t||e.pipes,e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,i));else if(t){var n=R(e.pipes,t);-1!==n&&(e.pipes.splice(n,1),--e.pipesCount,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,i))}else{var r=e.pipes,s=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a<s;a++)r[a].emit("unpipe",this,{hasUnpiped:!1})}return this},b.prototype.addListener=b.prototype.on=function(t,e){var e=r.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=0<this.listenerCount("readable"),!1!==i.flowing&&this.resume()):"readable"!==t||i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,g("on readable",i.length,i.reading),i.length?k(this):i.reading||B.nextTick(L,this)),e},b.prototype.removeListener=function(t,e){e=r.prototype.removeListener.call(this,t,e);return"readable"===t&&B.nextTick(I,this),e},b.prototype.removeAllListeners=function(t){var e=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||B.nextTick(I,this),e},b.prototype.resume=function(){var t,e,i=this._readableState;return i.flowing||(g("resume"),i.flowing=!i.readableListening,t=this,(e=i).resumeScheduled)||(e.resumeScheduled=!0,B.nextTick(P,t,e)),i.paused=!1,this},b.prototype.pause=function(){return g("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(g("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},b.prototype.wrap=function(e){var t,i=this,n=this._readableState,r=!1;for(t in e.on("end",function(){var t;g("wrapped end"),n.decoder&&!n.ended&&(t=n.decoder.end())&&t.length&&i.push(t),i.push(null)}),e.on("data",function(t){g("wrapped data"),n.decoder&&(t=n.decoder.write(t)),n.objectMode&&null==t||(n.objectMode||t&&t.length)&&!i.push(t)&&(r=!0,e.pause())}),e)void 0===this[t]&&"function"==typeof e[t]&&(this[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t));for(var s=0;s<v.length;s++)e.on(v[s],this.emit.bind(this,v[s]));return this._read=function(t){g("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(b.prototype[Symbol.asyncIterator]=function(){return(t=void 0===t?z("./internal/streams/async_iterator"):t)(this)}),Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(b.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(b.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),b._fromList=M,Object.defineProperty(b.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(b.from=function(t,e){return(i=void 0===i?z("./internal/streams/from"):i)(b,t,e)})}.call(this)}.call(this,z("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":42,"./_stream_duplex":43,"./internal/streams/async_iterator":48,"./internal/streams/buffer_list":49,"./internal/streams/destroy":50,"./internal/streams/from":52,"./internal/streams/state":54,"./internal/streams/stream":55,_process:33,buffer:11,events:17,inherits:20,"string_decoder/":57,util:8}],46:[function(t,e,i){"use strict";e.exports=h;var e=t("../errors").codes,n=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,s=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=e.ERR_TRANSFORM_WITH_LENGTH_0,o=t("./_stream_duplex");function h(t){if(!(this instanceof h))return new h(t);o.call(this,t),this._transformState={afterTransform:function(t,e){var i=this._transformState,n=(i.transforming=!1,i.writecb);if(null===n)return this.emit("error",new r);i.writechunk=null,(i.writecb=null)!=e&&this.push(e),n(t),(i=this._readableState).reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush)&&(this._flush=t.flush),this.on("prefinish",l)}function l(){var i=this;"function"!=typeof this._flush||this._readableState.destroyed?u(this,null,null):this._flush(function(t,e){u(i,t,e)})}function u(t,e,i){if(e)return t.emit("error",e);if(null!=i&&t.push(i),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;t.push(null)}t("inherits")(h,o),h.prototype.push=function(t,e){return this._transformState.needTransform=!1,o.prototype.push.call(this,t,e)},h.prototype._transform=function(t,e,i){i(new n("_transform()"))},h.prototype._write=function(t,e,i){var n=this._transformState;n.writecb=i,n.writechunk=t,n.writeencoding=e,!n.transforming&&(i=this._readableState,n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)},h.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},h.prototype._destroy=function(t,e){o.prototype._destroy.call(this,t,function(t){e(t)})}},{"../errors":42,"./_stream_duplex":43,inherits:20}],47:[function(L,P,t){!function(T,I){!function(){"use strict";function c(s){var a=this;this.next=null,this.entry=null,this.finish=function(){var t=a,e=s,i=void 0,n=t.entry;for(t.entry=null;n;){var r=n.callback;e.pendingcb--,r(i),n=n.next}e.corkedRequestsFree.next=t}}(P.exports=w).WritableState=b;var i,t={deprecate:L("util-deprecate")},n=L("./internal/streams/stream"),l=L("buffer").Buffer,u=I.Uint8Array||function(){};var r,e=L("./internal/streams/destroy"),s=L("./internal/streams/state").getHighWaterMark,a=L("../errors").codes,d=a.ERR_INVALID_ARG_TYPE,o=a.ERR_METHOD_NOT_IMPLEMENTED,f=a.ERR_MULTIPLE_CALLBACK,h=a.ERR_STREAM_CANNOT_PIPE,p=a.ERR_STREAM_DESTROYED,g=a.ERR_STREAM_NULL_VALUES,m=a.ERR_STREAM_WRITE_AFTER_END,_=a.ERR_UNKNOWN_ENCODING,v=e.errorOrDestroy;function y(){}function b(t,u,e){i=i||L("./_stream_duplex"),t=t||{},"boolean"!=typeof e&&(e=u instanceof i),this.objectMode=!!t.objectMode,e&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=s(this,t,"writableHighWaterMark",e),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;e=(this.destroyed=!1)===t.decodeStrings;this.decodeStrings=!e,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){var e=u,i=e._writableState,n=i.sync,r=i.writecb;if("function"!=typeof r)throw new f;var s,a,o,h,l=i;l.writing=!1,l.writecb=null,l.length-=l.writelen,l.writelen=0,t?(l=e,a=n,o=t,h=r,--(s=i).pendingcb,a?(T.nextTick(h,o),T.nextTick(A,l,s),l._writableState.errorEmitted=!0,v(l,o)):(h(o),l._writableState.errorEmitted=!0,v(l,o),A(l,s))):((t=k(i)||e.destroyed)||i.corked||i.bufferProcessing||!i.bufferedRequest||C(e,i),n?T.nextTick(S,e,i,t,r):S(e,i,t,r))},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}L("inherits")(w,n),b.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e};try{Object.defineProperty(b.prototype,"buffer",{get:t.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}function w(t){var e=this instanceof(i=i||L("./_stream_duplex"));if(!e&&!r.call(w,this))return new w(t);this._writableState=new b(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final)&&(this._final=t.final),n.call(this)}function x(t,e,i,n,r,s,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new p("write")):i?t._writev(r,e.onwrite):t._write(r,s,e.onwrite),e.sync=!1}function S(t,e,i,n){var r;i||(i=t,0===(r=e).length&&r.needDrain&&(r.needDrain=!1,i.emit("drain"))),e.pendingcb--,n(),A(t,e)}function C(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){for(var n=e.bufferedRequestCount,r=new Array(n),n=e.corkedRequestsFree,s=(n.entry=i,0),a=!0;i;)(r[s]=i).isBuf||(a=!1),i=i.next,s+=1;r.allBuffers=a,x(t,e,!0,e.length,r,"",n.finish),e.pendingcb++,e.lastBufferedRequest=null,n.next?(e.corkedRequestsFree=n.next,n.next=null):e.corkedRequestsFree=new c(e),e.bufferedRequestCount=0}else{for(;i;){var o=i.chunk,h=i.encoding,l=i.callback;if(x(t,e,!1,e.objectMode?1:o.length,o,h,l),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function k(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(e,i){e._final(function(t){i.pendingcb--,t&&v(e,t),i.prefinished=!0,e.emit("prefinish"),A(e,i)})}function A(t,e){var i,n,r=k(e);return r&&(i=t,(n=e).prefinished||n.finalCalled||("function"!=typeof i._final||n.destroyed?(n.prefinished=!0,i.emit("prefinish")):(n.pendingcb++,n.finalCalled=!0,T.nextTick(E,i,n))),0===e.pendingcb)&&(e.finished=!0,t.emit("finish"),e.autoDestroy)&&(!(i=t._readableState)||i.autoDestroy&&i.endEmitted)&&t.destroy(),r}"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(r=Function.prototype[Symbol.hasInstance],Object.defineProperty(w,Symbol.hasInstance,{value:function(t){return!!r.call(this,t)||this===w&&t&&t._writableState instanceof b}})):r=function(t){return t instanceof this},w.prototype.pipe=function(){v(this,new h)},w.prototype.write=function(t,e,i){var n,r,s,a=this._writableState,o=!1,h=!a.objectMode&&(h=t,l.isBuffer(h)||h instanceof u);return h&&!l.isBuffer(t)&&(n=t,t=l.from(n)),"function"==typeof e&&(i=e,e=null),e=h?"buffer":e||a.defaultEncoding,"function"!=typeof i&&(i=y),a.ending?(n=this,r=i,s=new m,v(n,s),T.nextTick(r,s)):(h||function(t,e,i,n){var r;if(null===i?r=new g:"string"==typeof i||e.objectMode||(r=new d("chunk",["string","Buffer"],i)),!r)return 1;v(t,r),T.nextTick(n,r)}(this,a,t,i))&&(a.pendingcb++,o=function(t,e,i,n,r,s){i||(a=function(t,e,i){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,i));return e}(e,n,r),n!==a&&(i=!0,r="buffer",n=a));var a=e.objectMode?1:n.length,o=(e.length+=a,e.length<e.highWaterMark);o||(e.needDrain=!0);{var h;e.writing||e.corked?(h=e.lastBufferedRequest,e.lastBufferedRequest={chunk:n,encoding:r,isBuf:i,callback:s,next:null},h?h.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1):x(t,e,!1,a,n,r,s)}return o}(this,a,h,t,e,i)),o},w.prototype.cork=function(){this._writableState.corked++},w.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||C(this,t))},w.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase()))return this._writableState.defaultEncoding=t,this;throw new _(t)},Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),w.prototype._write=function(t,e,i){i(new o("_write()"))},w.prototype._writev=null,w.prototype.end=function(t,e,i){var n=this._writableState;if("function"==typeof t?(i=t,e=t=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),!n.ending){t=this,e=n,n=i;e.ending=!0,A(t,e),n&&(e.finished?T.nextTick(n):t.once("finish",n)),e.ended=!0,t.writable=!1}return this},Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),w.prototype.destroy=e.destroy,w.prototype._undestroy=e.undestroy,w.prototype._destroy=function(t,e){e(t)}}.call(this)}.call(this,L("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":42,"./_stream_duplex":43,"./internal/streams/destroy":50,"./internal/streams/state":54,"./internal/streams/stream":55,_process:33,buffer:11,inherits:20,"util-deprecate":60}],48:[function(n,m,t){!function(g){!function(){"use strict";var t;function i(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}var r=n("./end-of-stream"),s=Symbol("lastResolve"),a=Symbol("lastReject"),o=Symbol("error"),h=Symbol("ended"),l=Symbol("lastPromise"),u=Symbol("handlePromise"),c=Symbol("stream");function d(t,e){return{value:t,done:e}}function f(t){var e,i=t[s];null!==i&&null!==(e=t[c].read())&&(t[l]=null,t[s]=null,t[a]=null,i(d(e,!1)))}var e=Object.getPrototypeOf(function(){}),p=Object.setPrototypeOf((i(t={get stream(){return this[c]},next:function(){var i=this,t=this[o];if(null!==t)return Promise.reject(t);if(this[h])return Promise.resolve(d(void 0,!0));if(this[c].destroyed)return new Promise(function(t,e){g.nextTick(function(){i[o]?e(i[o]):t(d(void 0,!0))})});var e,n,r,t=this[l];if(t)e=new Promise((n=t,r=this,function(t,e){n.then(function(){r[h]?t(d(void 0,!0)):r[u](t,e)},e)}));else{t=this[c].read();if(null!==t)return Promise.resolve(d(t,!1));e=new Promise(this[u])}return this[l]=e}},Symbol.asyncIterator,function(){return this}),i(t,"return",function(){var t=this;return new Promise(function(e,i){t[c].destroy(null,function(t){t?i(t):e(d(void 0,!0))})})}),t),e);m.exports=function(t){var e,n=Object.create(p,(i(e={},c,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,o,{value:null,writable:!0}),i(e,h,{value:t._readableState.endEmitted,writable:!0}),i(e,u,{value:function(t,e){var i=n[c].read();i?(n[l]=null,n[s]=null,n[a]=null,t(d(i,!1))):(n[s]=t,n[a]=e)},writable:!0}),e));return n[l]=null,r(t,function(t){var e;t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code?(null!==(e=n[a])&&(n[l]=null,n[s]=null,n[a]=null,e(t)),n[o]=t):(null!==(e=n[s])&&(n[l]=null,n[s]=null,e(d(void 0,!(n[a]=null)))),n[h]=!0)}),t.on("readable",function(t){g.nextTick(f,t)}.bind(null,n)),n}}.call(this)}.call(this,n("_process"))},{"./end-of-stream":51,_process:33}],49:[function(t,e,i){"use strict";function s(e,t){var i,n=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)),n}function r(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach(function(t){var e,i;e=n,i=r[t=t],t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(r,t))})}return n}function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var o=t("buffer").Buffer,h=t("util").inspect,l=h&&h.custom||"inspect";e.exports=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}var e,i,n;return e=t,(i=[{key:"push",value:function(t){t={data:t,next:null};0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(t){t={data:t,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){var t;if(0!==this.length)return t=this.head.data,1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,i,n=o.allocUnsafe(t>>>0),r=this.head,s=0;r;)e=r.data,i=s,o.prototype.copy.call(e,n,i),s+=r.data.length,r=r.next;return n}},{key:"consume",value:function(t,e){var i;return t<this.head.data.length?(i=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):i=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,i=1,n=e.data;for(t-=n.length;e=e.next;){var r=e.data,s=t>r.length?r.length:t;if(s===r.length?n+=r:n+=r.slice(0,t),0===(t-=s)){s===r.length?(++i,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e).data=r.slice(s);break}++i}return this.length-=i,n}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),i=this.head,n=1;for(i.data.copy(e),t-=i.data.length;i=i.next;){var r=i.data,s=t>r.length?r.length:t;if(r.copy(e,e.length-t,0,s),0===(t-=s)){s===r.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i).data=r.slice(s);break}++n}return this.length-=n,e}},{key:l,value:function(t,e){return h(this,r({},e,{depth:0,customInspect:!1}))}}])&&a(e.prototype,i),n&&a(e,n),t}()},{buffer:11,util:8}],50:[function(t,e,i){!function(h){!function(){"use strict";function s(t,e){o(t,e),a(t)}function a(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function o(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var i=this,n=this._readableState&&this._readableState.destroyed,r=this._writableState&&this._writableState.destroyed;return n||r?e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,h.nextTick(o,this,t)):h.nextTick(o,this,t)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?i._writableState?i._writableState.errorEmitted?h.nextTick(a,i):(i._writableState.errorEmitted=!0,h.nextTick(s,i,t)):h.nextTick(s,i,t):e?(h.nextTick(a,i),e(t)):h.nextTick(a,i)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var i=t._readableState,n=t._writableState;i&&i.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}}.call(this)}.call(this,t("_process"))},{_process:33}],51:[function(t,e,i){"use strict";var _=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function v(){}e.exports=function t(e,i,n){var r,s,a,o,h,l,u,c,d,f,p,g,m;return"function"==typeof i?t(e,null,i):(r=n||v,s=!1,n=function(){if(!s){s=!0;for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];r.apply(this,e)}},a=(i=i||{}).readable||!1!==i.readable&&e.readable,o=i.writable||!1!==i.writable&&e.writable,h=function(){e.writable||u()},l=e._writableState&&e._writableState.finished,u=function(){l=!(o=!1),a||n.call(e)},c=e._readableState&&e._readableState.endEmitted,d=function(){c=!(a=!1),o||n.call(e)},f=function(t){n.call(e,t)},p=function(){var t;return a&&!c?(e._readableState&&e._readableState.ended||(t=new _),n.call(e,t)):o&&!l?(e._writableState&&e._writableState.ended||(t=new _),n.call(e,t)):void 0},g=function(){e.req.on("finish",u)},(m=e).setHeader&&"function"==typeof m.abort?(e.on("complete",u),e.on("abort",p),e.req?g():e.on("request",g)):o&&!e._writableState&&(e.on("end",h),e.on("close",h)),e.on("end",d),e.on("finish",u),!1!==i.error&&e.on("error",f),e.on("close",p),function(){e.removeListener("complete",u),e.removeListener("abort",p),e.removeListener("request",g),e.req&&e.req.removeListener("finish",u),e.removeListener("end",h),e.removeListener("close",h),e.removeListener("finish",u),e.removeListener("end",d),e.removeListener("error",f),e.removeListener("close",p)})}},{"../../../errors":42}],52:[function(t,e,i){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],53:[function(h,t,e){"use strict";var l;var i=h("../../../errors").codes,o=i.ERR_MISSING_ARGS,u=i.ERR_STREAM_DESTROYED;function c(t){if(t)throw t}function d(i,t,e,n){r=n,s=!1;var r,s,a=!(n=function(){s||(s=!0,r.apply(void 0,arguments))}),o=(i.on("close",function(){a=!0}),(l=void 0===l?h("./end-of-stream"):l)(i,{readable:t,writable:e},function(t){if(t)return n(t);a=!0,n()}),!1);return function(t){var e;if(!a&&!o)return o=!0,(e=i).setHeader&&"function"==typeof e.abort?i.abort():"function"==typeof i.destroy?i.destroy():void n(t||new u("pipe"))}}function f(t){t()}function p(t,e){return t.pipe(e)}t.exports=function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];var i,r,s=!(i=n).length||"function"!=typeof i[i.length-1]?c:i.pop();if((n=Array.isArray(n[0])?n[0]:n).length<2)throw new o("streams");var a=n.map(function(t,e){var i=e<n.length-1;return d(t,i,0<e,function(t){r=r||t,t&&a.forEach(f),i||(a.forEach(f),s(r))})});return n.reduce(p)}},{"../../../errors":42,"./end-of-stream":51}],54:[function(t,e,i){"use strict";var a=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,i,n){s=n,r=i;var r,s=null!=(e=e).highWaterMark?e.highWaterMark:s?e[r]:null;if(null==s)return t.objectMode?16:16384;if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new a(n?i:"highWaterMark",s);return Math.floor(s)}}},{"../../../errors":42}],55:[function(t,e,i){e.exports=t("events").EventEmitter},{events:17}],56:[function(t,e,i){(((i=e.exports=t("./lib/_stream_readable.js")).Stream=i).Readable=i).Writable=t("./lib/_stream_writable.js"),i.Duplex=t("./lib/_stream_duplex.js"),i.Transform=t("./lib/_stream_transform.js"),i.PassThrough=t("./lib/_stream_passthrough.js"),i.finished=t("./lib/internal/streams/end-of-stream.js"),i.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":43,"./lib/_stream_passthrough.js":44,"./lib/_stream_readable.js":45,"./lib/_stream_transform.js":46,"./lib/_stream_writable.js":47,"./lib/internal/streams/end-of-stream.js":51,"./lib/internal/streams/pipeline.js":53}],57:[function(t,e,i){"use strict";var n=t("safe-buffer").Buffer,r=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"==typeof e||n.isEncoding!==r&&r(t))return e||t;throw new Error("Unknown encoding: "+t)}function a(t){var e;switch(this.encoding=s(t),this.encoding){case"utf16le":this.text=l,this.end=u,e=4;break;case"utf8":this.fillLast=h,e=4;break;case"base64":this.text=c,this.end=d,e=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function h(t){var e,i=this.lastTotal-this.lastNeed,n=(e=this,128!=(192&(n=t)[0])?(e.lastNeed=0,"�"):1<e.lastNeed&&1<n.length?128!=(192&n[1])?(e.lastNeed=1,"�"):2<e.lastNeed&&2<n.length&&128!=(192&n[2])?(e.lastNeed=2,"�"):void 0:void 0);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,i,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,i,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1);e=t.toString("utf16le",e);if(e){var i=e.charCodeAt(e.length-1);if(55296<=i&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],e.slice(0,-1)}return e}function u(t){var e,t=t&&t.length?this.write(t):"";return this.lastNeed?(e=this.lastTotal-this.lastNeed,t+this.lastChar.toString("utf16le",0,e)):t}function c(t,e){var i=(t.length-e)%3;return 0==i?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,1==i?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}function d(t){t=t&&t.length?this.write(t):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}(i.StringDecoder=a).prototype.write=function(t){if(0===t.length)return"";var e,i;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""},a.prototype.end=function(t){t=t&&t.length?this.write(t):"";return this.lastNeed?t+"�":t},a.prototype.text=function(t,e){var i=function(t,e,i){var n=e.length-1;if(!(n<i)){var r=o(e[n]);if(0<=r)return 0<r&&(t.lastNeed=r-1),r;if(!(--n<i||-2===r)){if(0<=(r=o(e[n])))return 0<r&&(t.lastNeed=r-2),r;if(!(--n<i||-2===r)&&0<=(r=o(e[n])))return 0<r&&(2===r?r=0:t.lastNeed=r-3),r}}return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;i=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},a.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":37}],58:[function(t,e,i){"use strict";var S=t("punycode"),C=t("./util");function w(){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}i.parse=r,i.resolve=function(t,e){return r(t,!1,!0).resolve(e)},i.resolveObject=function(t,e){return t?r(t,!1,!0).resolveObject(e):e},i.format=function(t){C.isString(t)&&(t=r(t));return t instanceof w?t.format():w.prototype.format.call(t)},i.Url=w;var k=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,E=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,i=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),A=["'"].concat(i),T=["%","/","?",";","#"].concat(A),I=["/","?","#"],L=/^[+a-z0-9A-Z_-]{0,63}$/,P=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,O={javascript:!0,"javascript:":!0},M={javascript:!0,"javascript:":!0},N={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},R=t("querystring");function r(t,e,i){var n;return t&&C.isObject(t)&&t instanceof w?t:((n=new w).parse(t,e,i),n)}w.prototype.parse=function(t,e,i){if(!C.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),n=-1!==n&&n<t.indexOf("#")?"?":"#",r=t.split(n);r[0]=r[0].replace(/\\/g,"/");var s=(s=t=r.join(n)).trim();if(!i&&1===t.split("#").length){r=E.exec(s);if(r)return this.path=s,this.href=s,this.pathname=r[1],r[2]?(this.search=r[2],this.query=e?R.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var a,n=k.exec(s);if(n&&(a=(n=n[0]).toLowerCase(),this.protocol=a,s=s.substr(n.length)),!(i||n||s.match(/^\/\/[^@\/]+@[^@\/]+/))||!(b="//"===s.substr(0,2))||n&&M[n]||(s=s.substr(2),this.slashes=!0),!M[n]&&(b||n&&!N[n])){for(var o=-1,h=0;h<I.length;h++)-1!==(l=s.indexOf(I[h]))&&(-1===o||l<o)&&(o=l);-1!==(t=-1===o?s.lastIndexOf("@"):s.lastIndexOf("@",o))&&(r=s.slice(0,t),s=s.slice(t+1),this.auth=decodeURIComponent(r));for(var l,o=-1,h=0;h<T.length;h++)-1!==(l=s.indexOf(T[h]))&&(-1===o||l<o)&&(o=l);-1===o&&(o=s.length),this.host=s.slice(0,o),s=s.slice(o),this.parseHost(),this.hostname=this.hostname||"";i="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!i)for(var u=this.hostname.split(/\./),h=0,c=u.length;h<c;h++){var d=u[h];if(d&&!d.match(L)){for(var f="",p=0,g=d.length;p<g;p++)127<d.charCodeAt(p)?f+="x":f+=d[p];if(!f.match(L)){var m=u.slice(0,h),_=u.slice(h+1),v=d.match(P);v&&(m.push(v[1]),_.unshift(v[2])),_.length&&(s="/"+_.join(".")+s),this.hostname=m.join(".");break}}}255<this.hostname.length?this.hostname="":this.hostname=this.hostname.toLowerCase(),i||(this.hostname=S.toASCII(this.hostname));var y=this.port?":"+this.port:"",b=this.hostname||"";this.host=b+y,this.href+=this.host,i&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0])&&(s="/"+s)}if(!O[a])for(h=0,c=A.length;h<c;h++){var w,x=A[h];-1!==s.indexOf(x)&&((w=encodeURIComponent(x))===x&&(w=escape(x)),s=s.split(x).join(w))}n=s.indexOf("#"),-1!==n&&(this.hash=s.substr(n),s=s.slice(0,n)),t=s.indexOf("?");return-1!==t?(this.search=s.substr(t),this.query=s.substr(t+1),e&&(this.query=R.parse(this.query)),s=s.slice(0,t)):e&&(this.search="",this.query={}),s&&(this.pathname=s),N[a]&&this.hostname&&!this.pathname&&(this.pathname="/"),(this.pathname||this.search)&&(y=this.pathname||"",r=this.search||"",this.path=y+r),this.href=this.format(),this},w.prototype.format=function(){var t=this.auth||"",e=(t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@"),this.protocol||""),i=this.pathname||"",n=this.hash||"",r=!1,s="",t=(this.host?r=t+this.host:this.hostname&&(r=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port)&&(r+=":"+this.port),this.query&&C.isObject(this.query)&&Object.keys(this.query).length&&(s=R.stringify(this.query)),this.search||s&&"?"+s||"");return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||N[e])&&!1!==r?(r="//"+(r||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):r=r||"",n&&"#"!==n.charAt(0)&&(n="#"+n),t&&"?"!==t.charAt(0)&&(t="?"+t),e+r+(i=i.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(t=t.replace("#","%23"))+n},w.prototype.resolve=function(t){return this.resolveObject(r(t,!1,!0)).format()},w.prototype.resolveObject=function(t){C.isString(t)&&((d=new w).parse(t,!1,!0),t=d);for(var e=new w,i=Object.keys(this),n=0;n<i.length;n++){var r=i[n];e[r]=this[r]}if(e.hash=t.hash,""!==t.href)if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var o=s[a];"protocol"!==o&&(e[o]=t[o])}N[e.protocol]&&e.hostname&&!e.pathname&&(e.path=e.pathname="/")}else if(t.protocol&&t.protocol!==e.protocol)if(N[t.protocol]){if(e.protocol=t.protocol,t.host||M[t.protocol])e.pathname=t.pathname;else{for(var h=(t.pathname||"").split("/");h.length&&!(t.host=h.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),e.pathname=h.join("/")}e.search=t.search,e.query=t.query,e.host=t.host||"",e.auth=t.auth,e.hostname=t.hostname||t.host,e.port=t.port,(e.pathname||e.search)&&(d=e.pathname||"",f=e.search||"",e.path=d+f),e.slashes=e.slashes||t.slashes}else for(var l=Object.keys(t),u=0;u<l.length;u++){var c=l[u];e[c]=t[c]}else{var d=e.pathname&&"/"===e.pathname.charAt(0),f=t.host||t.pathname&&"/"===t.pathname.charAt(0),d=f||d||e.host&&t.pathname,p=d,g=e.pathname&&e.pathname.split("/")||[],h=t.pathname&&t.pathname.split("/")||[],m=e.protocol&&!N[e.protocol];if(m&&(e.hostname="",e.port=null,e.host&&(""===g[0]?g[0]=e.host:g.unshift(e.host)),e.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===h[0]?h[0]=t.host:h.unshift(t.host)),t.host=null),d=d&&(""===h[0]||""===g[0])),f)e.host=(t.host||""===t.host?t:e).host,e.hostname=(t.hostname||""===t.hostname?t:e).hostname,e.search=t.search,e.query=t.query,g=h;else if(h.length)(g=g||[]).pop(),g=g.concat(h),e.search=t.search,e.query=t.query;else if(!C.isNullOrUndefined(t.search))return m&&(e.hostname=e.host=g.shift(),b=!!(e.host&&0<e.host.indexOf("@"))&&e.host.split("@"))&&(e.auth=b.shift(),e.host=e.hostname=b.shift()),e.search=t.search,e.query=t.query,C.isNull(e.pathname)&&C.isNull(e.search)||(e.path=(e.pathname||"")+(e.search||"")),e.href=e.format(),e;if(g.length){for(var _=g.slice(-1)[0],f=(e.host||t.host||1<g.length)&&("."===_||".."===_)||""===_,v=0,y=g.length;0<=y;y--)"."===(_=g[y])?g.splice(y,1):".."===_?(g.splice(y,1),v++):v&&(g.splice(y,1),v--);if(!d&&!p)for(;v--;)g.unshift("..");!d||""===g[0]||g[0]&&"/"===g[0].charAt(0)||g.unshift(""),f&&"/"!==g.join("/").substr(-1)&&g.push("");var b,p=""===g[0]||g[0]&&"/"===g[0].charAt(0);m&&(e.hostname=e.host=!p&&g.length?g.shift():"",b=!!(e.host&&0<e.host.indexOf("@"))&&e.host.split("@"))&&(e.auth=b.shift(),e.host=e.hostname=b.shift()),(d=d||e.host&&g.length)&&!p&&g.unshift(""),g.length?e.pathname=g.join("/"):(e.pathname=null,e.path=null),C.isNull(e.pathname)&&C.isNull(e.search)||(e.path=(e.pathname||"")+(e.search||"")),e.auth=t.auth||e.auth,e.slashes=e.slashes||t.slashes}else e.pathname=null,e.search?e.path="/"+e.search:e.path=null}return e.href=e.format(),e},w.prototype.parseHost=function(){var t=this.host,e=n.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":59,punycode:10,querystring:36}],59:[function(t,e,i){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],60:[function(t,i,e){!function(e){!function(){function n(t){try{if(!e.localStorage)return}catch(t){return}t=e.localStorage[t];return null!=t&&"true"===String(t).toLowerCase()}i.exports=function(t,e){if(n("noDeprecation"))return t;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],61:[function(t,e,i){e.exports=function(){for(var t={},e=0;e<arguments.length;e++){var i,n=arguments[e];for(i in n)r.call(n,i)&&(t[i]=n[i])}return t};var r=Object.prototype.hasOwnProperty},{}],62:[function(u,c,t){!function(l){!function(){"use strict";const e=u("https");var t=u("@tarekraafat/autocomplete.js");let s={};var i="#search-id";let r=10;const a=document.querySelector(i),n=()=>{let r={};return new Promise((i,n)=>{var t=a.getAttribute("data-npc");t||i([]),e.get(t,t=>{let e=[];t.on("data",t=>{e.push(t)}),t.on("error",t=>n(t)),t.on("end",()=>{JSON.parse(l.concat(e).toString()).forEach(t=>{r[t.loc]||(r[t.loc]=[]),r[t.loc].push(t.name),s[t.name]=s[t.name]&&-1==s[t.name].indexOf(t.loc)?s[t.name].concat([t.loc]):[t.loc]}),i(r)})})})};let o,h=(o=new t({selector:i,data:{src:async()=>{await n();let t=Object.keys(s);return t=t.map(t=>({value:s[t],text:t}))},keys:["text"],cache:!0},resultItem:{tag:"a",class:"dropdown-item",selected:"active",highlight:!0},resultsList:{tag:"div",class:"npc-autocomplete dropdown-menu show",maxResults:void 0,destination:"#search .advancedAutoComplete"},submit:!1}),!0);document.querySelector(i).addEventListener("selection",function(t){t.detail.selection.value instanceof Function?t.detail.selection.value():(t.detail.selection.value&&(a.value=t.detail.selection.value.value),a.form.requestSubmit())}),document.querySelector(i).addEventListener("keyup",t=>{13==t.keyCode&&(h&&o.select(0),""===a.value.trim()||isNaN(a.value)||a.form.requestSubmit())}),document.querySelector(i).addEventListener("navigate",t=>{h=!1}),document.querySelector(i).addEventListener("results",function(n){let t=n.detail.results;var e=t.length;0<e&&(t.sort((t,e)=>{var t=t.value.text.toLowerCase(),e=e.value.text.toLowerCase(),i=n.detail.query.toLowerCase();return t.startsWith(i)&&!e.startsWith(i)?-1:!t.startsWith(n.detail.query)&&e.startsWith(i)?1:t.localeCompare(e)}),t=t.slice(0,r),e>r)&&t.push({value:function(){var t=r+10;o.start(),r=t},match:"Więcej..."}),n.detail.results=t}),a.addEventListener("input",t=>{r=10}),c.exports={downloadNpc:n,findNpc:t=>{return null!=(t=s[t])&&t}}}.call(this)}.call(this,u("buffer").Buffer)},{"@tarekraafat/autocomplete.js":4,buffer:11,https:18}],63:[function(t,e,i){"use strict";t("paper");e.exports={Preview:class{constructor(t,e){this.map=t,this.preview=document.querySelector(".preview-container"),this.previewImgContainer=document.querySelector(".preview"),this.previewImg=document.querySelector(".preview-img"),this.previewPanContainer=document.querySelector(".preview-pan-container"),this.previewPan=document.querySelector(".preview-pan"),this.pageControls=e}init(t){return this.controls=t,this.view=t.renderer.paper.view,window.view=this.view,this.backgroundLayer=t.renderer.backgroundLayer,window.pv=this,window.backgroundLayer=this.backgroundLayer,this.baseBounds={left:this.view.bounds.left,top:this.view.bounds.top},new Promise((i,t)=>{setTimeout(()=>{var t=this.view.size.width/this.backgroundLayer.bounds.width,e=this.view.size.height/this.backgroundLayer.bounds.height;this.view.size.width>this.view.size.height?(this.previewImg.style.maxWidth=100*t+"%",this.previewImg.style.maxHeight="100%"):(this.previewImg.style.maxWidth="100%",this.previewImg.style.maxHeight=100*e+"%"),this.previewImg.setAttribute("src",this.map.toDataURL()),this.previewImg.addEventListener("load",()=>{this.previewPanContainer.style.width=this.previewImg.width+"px",this.previewPanContainer.style.height=this.previewImg.height+"px",this.update(),i()},{once:!0}),this.preview.style.opacity=0,this.previewImgContainer.style.background=this.controls.renderer.settings.mapBackground,this.previewImg.style.background=this.controls.renderer.settings.mapBackground},10)})}update(){var t;this.pageControls.settings.preview&&(this.preview.style.opacity=1,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.preview.style.opacity=0,4e3),t=this.view.minZoom/this.view.zoom,this.previewPan.style.width=100*t+"%",this.previewPan.style.height=100*t+"%",this.previewPan.style.left=-((this.baseBounds.left-this.view.bounds.left)/this.view.bounds.width)*(100*t)+"%",this.previewPan.style.top=-((this.baseBounds.top-this.view.bounds.top)/this.view.bounds.height)*(100*t)+"%")}}}},{paper:32}],64:[function(t,e,i){!function(s){!function(){"use strict";const r=t("https");e.exports={downloadVersion:(t,e)=>new Promise((i,n)=>{r.get(e.replace("%tag%",t),t=>{let e=[];t.on("data",t=>{e.push(t)}),t.on("error",t=>n(t)),t.on("end",()=>{var t=JSON.parse(s.concat(e).toString());i(t)})})}),downloadTags:t=>new Promise((i,n)=>{r.get(t,t=>{let e=[];t.on("data",t=>{e.push(t)}),t.on("error",t=>n(t)),t.on("end",()=>{var t=JSON.parse(s.concat(e).toString());i(t.map(t=>t.tag_name))})})})}}.call(this)}.call(this,t("buffer").Buffer)},{buffer:11,https:18}]},{},[1]);
|
|
1
|
+
!function n(r,s,a){function o(e,t){if(!s[e]){if(!r[e]){var i="function"==typeof require&&require;if(!t&&i)return i(e,!0);if(h)return h(e,!0);throw(t=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",t}i=s[e]={exports:{}},r[e][0].call(i.exports,function(t){return o(r[e][1][t]||t)},i,i.exports,n,r,s,a)}return s[e].exports}for(var h="function"==typeof require&&require,t=0;t<a.length;t++)o(a[t]);return o}({1:[function(t,e,i){"use strict";var n=u(t("@andreasremdt/simple-translator")),r=u(t("bootstrap")),a=t("mudlet-map-renderer"),s=t("./preview"),o=t("./versions"),h=u(t("color-convert")),l=t("./npc");function u(t){return t&&t.__esModule?t:{default:t}}const c=["#CC99C9","#9EC1CF","#9EE09E","#FDFD97","#FEB144","#FF6663"];let d=0;var f=new n.default({defaultLanguage:"pl",detectLanguage:!0,selector:"[data-i18n]",debug:!1,registerGlobally:"__",persist:!0,persistKey:"preferred_language",filesLocation:"i18n"});if(window.translator=f,""!==location.hostname)f.fetch(["pl"],!1).then(t=>{let e={};document.querySelectorAll("[data-i18n]").forEach(t=>{e[t.getAttribute("data-i18n")]=t.innerHTML}),f.add("pl",{...e,...t})}).catch(t=>console.log("Cannot fetch translations. "+t.message)),f.fetch(["en"]).then(()=>{f.translatePageTo()}).catch(t=>console.log("Cannot fetch translations. "+t.message));else if("undefined"!=typeof translations){let e={};document.querySelectorAll("[data-i18n]").forEach(t=>{e[t.getAttribute("data-i18n")]=t.innerHTML}),f.add("pl",{...e,...translations.pl}),f.add("en",translations.en)}t=new URLSearchParams(window.location.search);const p=Object.fromEntries(t.entries()),g=window.location.origin+window.location.pathname;let m={},_=((0,l.downloadNpc)().then(t=>m=t),localStorage.getItem("position"));_=_&&JSON.parse(_);let v=new class{constructor(t){this.map=document.querySelector("#map"),this.map.addEventListener("roomSelected",t=>this.selectRoom(t.detail)),this.map.addEventListener("roomDeselected",()=>this.deselectRoom()),this.map.addEventListener("zoom",t=>this.adjustZoomBar(t.detail)),this.map.addEventListener("zoom",t=>this.zoom=t.detail.zoom),this.map.addEventListener("zoom",t=>this.preview.update()),this.map.addEventListener("drag",t=>this.preview.update()),this.map.addEventListener("goToArea",t=>setTimeout(()=>{t.detail.id&&this.findRoom(t.detail.id)})),this.reader=t,this.select=document.querySelector("#area"),this.infoBox=document.querySelector(".info-box"),this.levels=document.querySelector(".levels"),this.saveImageButton=document.querySelector(".save-image"),this.saveSvgImageButton=document.querySelector(".save-image-svg"),this.copyImageButton=document.querySelector(".copy-image"),this.zoomButtons=document.querySelectorAll(".zoom-controls .btn"),this.toastContainer=document.querySelector(".toast"),this.searchModal=document.querySelector("#search"),this.search=document.querySelector(".search-form"),this.findPathForm=document.querySelector(".findpath-form"),this.findPathModal=document.querySelector("#findpath"),this.helpModal=document.querySelector("#help"),this.zoomBar=document.querySelector(".progress-container"),this.settingsModal=document.querySelector("#settings"),this.settingsForm=document.querySelector("#settings form"),this.resetSettingsButton=document.querySelector("#settings button[type='reset']"),this.versions=document.querySelector("#versions"),this.releaseDescription=document.querySelector(".release-description"),this.settings=new a.Settings,this.preview=new s.Preview(this.map,this),this.versionBadge=document.querySelector(".version-number"),this.languageSelector=document.querySelector(".lang-dropdown"),this.currentLanguageFlag=document.querySelector(".current-language-flag"),this.pathBox=document.querySelector(".path-box ul"),this.areaModal=document.getElementById("area-info"),this.zIndex=0,this.settings.optimizeDrag=!0,this.settings.preview=!0;var t=localStorage.getItem("settings");t&&Object.assign(this.settings,JSON.parse(t)),this.versions&&(this.versions.addEventListener("change",t=>{this.replaceVersion(t.target.value),this.releaseDescription.innerHTML=t.target.selectedOptions[0].getAttribute("data-description"),r.default.Modal.getInstance(this.helpModal).hide()}),this.helpModal.addEventListener("shown.bs.modal",()=>{0==this.versions.children.length&&(0,o.downloadTags)(this.versions.getAttribute("data-tags")).then(t=>{t.forEach(t=>{var e=document.createElement("option");e.setAttribute("value",t.tag_name),e.setAttribute("data-description",t.body.replaceAll("\n\n","\n")),e.innerHTML=t.tag_name,this.versions.append(e)}),this.releaseDescription.innerHTML=this.versions.firstChild.getAttribute("data-description")})})),null!=(t=this.saveImageButton)&&t.addEventListener("click",()=>this.saveImage()),null!=(t=this.saveSvgImageButton)&&t.addEventListener("click",t=>{t.preventDefault(),this.downloadImage()}),null!=(t=this.copyImageButton)&&t.addEventListener("click",()=>this.copyImage()),this.zoomButtons.forEach(t=>t.addEventListener("click",t=>{t=parseFloat(t.currentTarget.getAttribute("data-factor"));this.renderer.controls.deltaZoom(t)})),this.search.addEventListener("submit",t=>{t.preventDefault(),this.submitSearch(t)}),null!=(t=this.findPathForm)&&t.addEventListener("submit",t=>{t.preventDefault(),this.submitPathFind(t)}),null!=(t=this.findPathModal)&&t.addEventListener("shown.bs.modal",()=>{this.findPathModal.querySelector("input").focus()}),this.searchModal.addEventListener("shown.bs.modal",()=>{this.searchModal.querySelector("input").focus()}),this.settingsModal.addEventListener("show.bs.modal",()=>{this.populateSettings(this.settings)}),this.settingsModal.addEventListener("shown.bs.modal",()=>{this.settingsModal.querySelector("input").focus()}),this.settingsForm.addEventListener("submit",t=>{t.preventDefault(),this.handleSaveSettings()}),this.resetSettingsButton.addEventListener("click",t=>{t.preventDefault(),this.resetSettings()}),null!=(t=this.areaModal)&&t.addEventListener("show.bs.modal",()=>{this.populateAreaInfo(this.areaId,this.zIndex)}),window.addEventListener("resize",()=>{this.render()}),this.translatePage(),this.languageSelector.querySelectorAll("a").forEach(e=>{e.addEventListener("click",t=>{t.preventDefault(),this.translatePage(e.getAttribute("data-lang"))})}),this.paths={}}init(){let t=37,e=0;p.loc?(this.findRoom(p.loc),history.replaceState(null,null,g)):(p.area?(t=p.area,history.replaceState(null,null,g)):null!==_&&_.area&&(t=_.area,e=_.zIndex),this.renderArea(t,e))}handleSaveSettings(){var t=this.settingsModal.querySelectorAll("input");let n={};t.forEach(t=>{var e=t.getAttribute("name"),i=t.getAttribute("type");n[e]="checkbox"===i?t.checked:"number"===i?parseInt(t.value):t.value}),Object.assign(this.settings,n),this.showToast(f.translateForKey("settings-saved",f.currentLanguage)),r.default.Modal.getInstance(this.settingsModal).hide(),this.saveSettings(),this.render(!0)}saveSettings(){localStorage.setItem("settings",JSON.stringify(this.settings))}render(t){return this.renderArea(this.select.value,this.zIndex,t)}renderArea(n,r,s){return new Promise((i,t)=>{var e;this.areaId!==n||this.zIndex!==r||s?(this.map.addEventListener("renderComplete",(t,e)=>{this.preview.init(t.detail.controls).then(()=>i())},{once:!0}),this.areaId=n,this.zIndex=r,localStorage.setItem("position",JSON.stringify({area:n,zIndex:r})),document.querySelector("body").style.background=this.settings.mapBackground,e=this.reader.getArea(n,r),this.renderer&&this.renderer.clear(),this.renderer=new a.Renderer(this.map,this.reader,e,this.reader.getColors(),this.settings),this.select.value=n,this.populateLevelButtons(e.getLevels(),r),this.hideRoomInfo(),Object.entries(this.paths).forEach(([t,e])=>{e.remove();var[e,t]=t.split("#");this.findPath(e,t)}),this.renderer.clearHighlight(),this.settings.keepZoomLevel&&this.zoom&&this.renderer.controls.setZoom(this.zoom)):i()})}genericSetup(){document.querySelectorAll(".btn").forEach(t=>t.addEventListener("click",()=>t.blur()))}populateLevelButtons(t,e){if(this.levels.innerHTML="",!(t.size<=1)){t=Array.from(t).sort(function(t,e){return t-e});if(10<t.length){var i,n=document.createElement("div"),r=(n.classList.add("dropdown"),document.createElement("button")),s=(r.classList.add("btn","btn-secondary","dropdown-toggle"),r.setAttribute("type","button"),r.setAttribute("data-bs-toggle","dropdown"),r.append(document.createTextNode(e)),document.createElement("div"));s.classList.add("dropdown-menu"),n.append(r),n.append(s);for(i of t){var a=document.createElement("a");a.classList.add("dropdown-item","btn-level"),a.setAttribute("href","#"),a.setAttribute("data-level",i),a.append(document.createTextNode(i)),s.append(a)}this.levels.append(n)}else for(var o of t){var h=document.createElement("button");h.setAttribute("type","button"),h.setAttribute("data-level",o),h.classList.add("btn","btn-level"),o===e?h.classList.add("btn-primary"):h.classList.add("btn-secondary"),h.append(document.createTextNode(o)),this.levels.append(h)}this.levels.querySelectorAll(".btn-level").forEach(t=>{t.addEventListener("click",t=>{t.preventDefault();t=parseInt(t.target.getAttribute("data-level"));this.renderArea(this.select.value,t)})})}}populateAreaInfo(t,e){t=this.reader.getArea(t,e);this.areaModal.querySelector(".area-name").innerHTML=`${t.areaName} (id: ${t.areaId})`,this.areaModal.querySelector(".area-room-count").innerHTML=Object.keys(t.rooms).length;let a=this.areaModal.querySelector(".area-exits");a.innerHTML="",Object.values(t.rooms).flatMap(t=>this.getAreaExits(t)).forEach(([t,e])=>{var i=this.reader.getAreaByRoomId(e),n=document.createElement("li"),r=document.createElement("a"),t=(r.setAttribute("href","#"),r.setAttribute("data-room",t),r.appendChild(document.createTextNode(t)),r.addEventListener("click",t=>{t.preventDefault(),this.findRoom(parseInt(t.currentTarget.getAttribute("data-room")))}),document.createTextNode(" -> ")),s=document.createElement("a");s.setAttribute("href","#"),s.setAttribute("data-room",e),s.appendChild(document.createTextNode(`${e} (${i.areaName})`)),s.addEventListener("click",t=>{t.preventDefault(),this.findRoom(parseInt(t.currentTarget.getAttribute("data-room")))}),n.append(r,t,s),a.appendChild(n)})}getAreaExits(e){let i=[];return Object.values(e.exits).filter(t=>this.isExitTarget(t)).forEach(t=>i.push([e.id,t])),Object.values(e.specialExits).filter(t=>this.isExitTarget(t)).forEach(t=>i.push([e.id,t])),i}isExitTarget(t){t=this.reader.getRoomById(t);return parseInt(t.areaId)!==this.renderer.area.areaId}populateSelectBox(){this.select.querySelectorAll("option").forEach(t=>t.remove()),this.reader.getAreas().filter(t=>0<t.rooms.length&&void 0!==t.areaName&&""!==t.areaName).sort((t,e)=>{t=t.areaName.toLowerCase(),e=e.areaName.toLowerCase();return t<e?-1:e<t?1:0}).forEach((t,e)=>{t.rooms.length&&this.select.append(new Option(t.areaName,t.areaId))}),this.select.addEventListener("change",t=>{this.renderArea(t.target.value,0)})}submitSearch(){r.default.Modal.getInstance(this.searchModal).hide();var t=this.search.querySelectorAll("input");let e={};if(t.forEach(t=>{e[t.name]=t.value,t.value=""}),void 0!==e.roomId){let t=e.roomId.split(",");isNaN(t[0])&&(t=(0,l.findNpc)(t)),this.findRooms(t)}}submitPathFind(){r.default.Modal.getInstance(this.findPathModal).hide();var t=this.findPathForm.querySelectorAll("input");let e={};t.forEach(t=>{e[t.name]=t.value,t.value=""}),this.findPath(e["start-loc"],e["end-loc"])&&this.findRoom(e["start-loc"])}findRoom(t){var e;t&&(void 0!==(e=this.reader.getAreaByRoomId(t))?this.renderArea(e.areaId,e.zIndex).then(()=>{this.renderer.controls.setZoom(1),this.renderer.controls.centerRoom(t)}):this.showToast(f.translateForKey("location-not-found",f.currentLanguage)))}findRooms(t){var e=this.reader.getAreaByRoomId(t[0]);void 0!==e?this.renderArea(e.areaId,e.zIndex).then(()=>{this.renderer.controls.centerRoom(t[0]),this.renderer.controls.setZoom(1),this.renderer.clearHighlight(),t.forEach(t=>{this.renderer.renderHighlight(t)})}):this.showToast(f.translateForKey("location-not-found",f.currentLanguage))}findPath(e,i){let n=e+"#"+i;var r=null!=(r=null==(r=this.pathBox.querySelector(`[data-path-key='${n}'] input[type='color']`))?void 0:r.value)?r:c[d++%c.length];if(this.paths[n]=this.renderer.controls.renderPath(e,i,h.default.hex.rgb(r).map(t=>t/255)),this.paths[n]){if(!this.pathBox.querySelector(`[data-path-key='${n}']`)){let t=document.createElement("li");t.classList.add("list-group-item","d-inline-flex","align-items-center","position-relative"),t.setAttribute("data-path-key",n);var s=document.createElement("input"),r=(s.setAttribute("type","color"),s.classList.add("small-color","me-2"),s.value=r,s.addEventListener("input",t=>{this.paths[n].strokeColor=t.target.value}),t.appendChild(s),t.appendChild(document.createTextNode(e+" -> "+i)),document.createElement("span"));return r.classList.add("badge","bg-secondary","position-absolute","end-0","me-2"),r.appendChild(document.createTextNode(f.translateForKey("delete",f.currentLanguage))),r.onclick=()=>{this.paths[n].remove(),delete this.paths[n],t.remove(),0===Object.keys(this.paths).length&&this.pathBox.parentNode.classList.add("invisible")},t.appendChild(r),this.pathBox.appendChild(t),this.pathBox.parentNode.classList.remove("invisible"),!0}}else delete this.paths[n],this.showToast(f.translateForKey("no-path",f.currentLanguage)),d--}adjustZoomBar(t){t=(t.zoom-t.minZoom)/(10-t.minZoom);this.zoomBar.querySelector(".progress-bar").style.width=100*t+"%",this.zoomBar.classList.contains("visible")?void 0!==this.progressTimeout&&(clearTimeout(this.progressTimeout),this.progressTimeout=void 0):(this.zoomBar.classList.add("visible"),this.zoomBar.classList.remove("hidden")),this.progressTimeout=setTimeout(()=>{this.zoomBar.classList.add("hidden"),this.zoomBar.classList.remove("visible")},3e3)}selectRoom(t){this.showRoomInfo(t)}deselectRoom(){this.hideRoomInfo()}showRoomInfo(t){var e=null!=(e=this.reader.getColors()[t.env])?e:[114,1,0];this.infoBox.style.border=`2px solid rgba(${e[0]}, ${e[1]}, ${e[2]}, 0.5)`,this.infoBox.style.display="initial",this.infoBox.querySelector(".room-id").innerHTML=t.id,this.infoBox.querySelector(".room-link").setAttribute("href",g+"?loc="+t.id),this.infoBox.querySelector(".room-name").innerHTML=t.name,this.infoBox.querySelector(".room-env").innerHTML=t.env,this.infoBox.querySelector(".coord-x").innerHTML=t.x,this.infoBox.querySelector(".coord-y").innerHTML=t.y,this.infoBox.querySelector(".coord-z").innerHTML=t.z,this.infoBox.querySelector(".room-hash").innerHTML="",this.infoBox.querySelector(".room-hash").innerHTML=null!=(e=t.hash)?e:"",this.infoExitsGroup(this.infoBox.querySelector(".exits"),t.exits),this.infoExitsGroup(this.infoBox.querySelector(".special"),t.specialExits),this.userDataGroup(this.infoBox.querySelector(".userData"),t.userData),this.npcDataGroup(this.infoBox.querySelector(".npc"),m[t.id]||{})}userDataGroup(t,e){var i,n=t.querySelector("ul");n.innerHTML="";let r=!1;for(i in e){r=!0;var s=document.createElement("li"),a=(s.classList=["user-data"],document.createElement("p")),o=(a.append(i+":"),document.createElement("p"));o.append(""+e[i].replaceAll("\\n","\n")),o.className="value",s.append(a,o),n.append(s)}t.style.display=r?"initial":"none"}infoExitsGroup(t,e){var i,n=t.querySelector("ul");n.innerHTML="";let r=!1;for(i in e)r=!0,n.append(this.infoExit(i,e[i]));t.style.display=r?"initial":"none"}npcDataGroup(t,e){var i,n=t.querySelector("ul");n.innerHTML="";let r=!1;for(i in e){r=!0;var s=document.createElement("li");s.append(document.createTextNode(e[i])),n.append(s)}t.style.display=r?"initial":"none"}infoExit(t,e){var i=document.createElement("li"),n=document.createElement("span"),t=(n.setAttribute("data-i18n",t),n.innerHTML=this.translateDir(t),i.append(n),i.append(document.createTextNode(": ")),document.createElement("a")),n=(t.setAttribute("href","#"),t.setAttribute("data-room",e),t.innerHTML=e,t.addEventListener("click",t=>{t.preventDefault(),this.findRoom(parseInt(t.currentTarget.getAttribute("data-room")))}),i.append(t),this.reader.getRoomById(e));return parseInt(n.areaId)!==this.renderer.area.areaId&&(t=this.reader.getAreaProperties(n.areaId),i.append(document.createTextNode(" -> ")),(e=document.createElement("a")).setAttribute("href","#"),e.setAttribute("data-room",n.id),e.innerHTML=t.areaName,e.addEventListener("click",t=>{t.preventDefault(),this.findRoom(parseInt(t.currentTarget.getAttribute("data-room")))}),i.append(e)),i}showToast(t){this.toastContainer.querySelector(".toast-body").innerHTML=t,r.default.Toast.getOrCreateInstance(this.toastContainer).show()}translateDir(t){var e;return null!=(e=f.translateForKey(t))?e:t}translatePage(t){this.currentLanguageFlag.classList.remove("flag-"+f.currentLanguage),t&&f.translatePageTo(t),this.currentLanguageFlag.classList.add("flag-"+f.currentLanguage)}hideRoomInfo(){this.infoBox.style.display="none"}populateSettings(t){for(var e in t){var i=this.settingsModal.querySelector("input[name='"+e+"']");i&&("checkbox"===i.getAttribute("type")?i.checked=t[e]:"color"===i.getAttribute("type")?i.value=t[e].toCSS?t[e].toCSS(!0):t[e]:i.value=t[e])}}resetSettings(){var t=new a.Settings;t.preview=!0,t.optimizeDrag=!0,this.populateSettings(t)}saveImage(){var t=document.createElement("a");t.setAttribute("href",this.map.toDataURL()),t.setAttribute("download",this.renderer.area.areaName+".png"),document.querySelector("body").append(t),t.click(),t.remove()}downloadImage(){var t,e=document.createElement("a");e.setAttribute("href",(t=this.renderer.exportSvg(),"data:image/svg+xml,"+encodeURIComponent(t).replace(/'/g,"%27").replace(/"/g,"%22"))),e.setAttribute("download",this.renderer.area.areaName+".svg"),document.querySelector("body").append(e),e.click(),e.remove()}copyImage(){"undefined"!=typeof ClipboardItem?(this.map.toBlob(t=>navigator.clipboard.write([new ClipboardItem({"image/png":t})])),this.showToast(f.translateForKey("copied",f.currentLanguage))):this.showToast(f.translateForKey("no-clipboard",f.currentLanguage))}move(t,e){this.renderer.controls.move(t,e),this.preview.update()}goDirection(t){t=t;var e=void 0!==(e=function(t,e){for(var i in t)if(t.hasOwnProperty(i)&&t[i]===e)return i}(y,t))?e:t;this.renderer.controls.selected&&this.findRoom(this.renderer.controls.selected.exits[e])}registerKeyBoard(){let e={Numpad1:"sw",Numpad2:"s",Numpad3:"se",Numpad4:"w",Numpad6:"e",Numpad7:"nw",Numpad8:"n",Numpad9:"ne",NumpadMultiply:"u",NumpadDivide:"d"};window.addEventListener("keydown",t=>{this.settings.disableKeyBinds||("F1"===t.code&&(t.preventDefault(),this.showHelp()),t.ctrlKey&&"KeyF"===t.code&&(t.preventDefault(),this.showSearch()))}),window.addEventListener("resize",()=>{this.render(!0)}),window.addEventListener("keydown",t=>{document.querySelector("input:focus")||this.settings.disableKeyBinds||(t.ctrlKey&&"KeyS"===t.code&&(this.saveImage(),t.preventDefault()),"Equal"===t.code&&(this.renderer.controls.deltaZoom(1.1),t.preventDefault()),"Minus"===t.code&&(this.renderer.controls.deltaZoom(.9),t.preventDefault()),"ArrowUp"===t.code&&(this.move(0,-1),t.preventDefault()),"ArrowDown"===t.code&&(this.move(0,1),t.preventDefault()),"ArrowLeft"===t.code&&(this.move(-1,0),t.preventDefault()),"ArrowRight"===t.code&&(this.move(1,0),t.preventDefault()),e.hasOwnProperty(t.code)&&(this.goDirection(e[t.code]),t.preventDefault()))})}showHelp(){r.default.Modal.getOrCreateInstance(this.helpModal).show()}showSearch(){r.default.Modal.getOrCreateInstance(this.searchModal).show()}replaceVersion(e){(0,o.downloadVersion)(e,this.versions.getAttribute("data-files")).then(t=>{this.reader=new a.MapReader(t,colors),this.populateSelectBox(),this.renderArea(v.areaId,v.zIndex,!0).then(()=>this.showToast("Przeładowano wersję na "+e)),this.versionBadge.innerHTML="v"+e,this.versionBadge.style.display="initial"})}}(new a.MapReader(mapData,colors)),y=((window.controls=v).genericSetup(),v.populateSelectBox(),v.init(),v.registerKeyBoard(),{north:"n",south:"s",east:"e",west:"w",northeast:"ne",northwest:"nw",southeast:"se",southwest:"sw",up:"u",down:"d"})},{"./npc":62,"./preview":63,"./versions":64,"@andreasremdt/simple-translator":2,bootstrap:7,"color-convert":14,"mudlet-map-renderer":21}],2:[function(f,p,t){!function(c,d){!function(){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var e,i,r,s,l={INVALID_PARAM_LANGUAGE:function(t){return"Invalid parameter for `language` provided. Expected a string, but got ".concat(n(t),".")},INVALID_PARAM_JSON:function(t){return"Invalid parameter for `json` provided. Expected an object, but got ".concat(n(t),".")},EMPTY_PARAM_LANGUAGE:function(){return"The parameter for `language` can't be an empty string."},EMPTY_PARAM_JSON:function(){return"The parameter for `json` must have at least one key/value pair."},INVALID_PARAM_KEY:function(t){return"Invalid parameter for `key` provided. Expected a string, but got ".concat(n(t),".")},NO_LANGUAGE_REGISTERED:function(t){return'No translation for language "'.concat(t,'" has been added, yet. Make sure to register that language using the `.add()` method first.')},TRANSLATION_NOT_FOUND:function(t,e){return'No translation found for key "'.concat(t,'" in language "').concat(e,'". Is there a key/value in your translation file?')},INVALID_PARAMETER_SOURCES:function(t){return"Invalid parameter for `sources` provided. Expected either a string or an array, but got ".concat(n(t),".")},FETCH_ERROR:function(t){return'Could not fetch "'.concat(t.url,'": ').concat(t.status," (").concat(t.statusText,")")},INVALID_ENVIRONMENT:function(){return"You are trying to execute the method `translatePageTo()`, which is only available in the browser. Your environment is most likely Node.js"},MODULE_NOT_FOUND:function(t){return t},MISMATCHING_ATTRIBUTES:function(t,e,i){return'The attributes "data-i18n" and "data-i18n-attr" must contain the same number of keys.\n\nValues in `data-i18n`: ('.concat(t.length,") `").concat(t.join(" "),"`\nValues in `data-i18n-attr`: (").concat(e.length,") `").concat(e.join(" "),"`\n\nThe HTML element is:\n").concat(i.outerHTML)},INVALID_OPTIONS:function(t){return"Invalid config passed to the `Translator` constructor. Expected an object, but got ".concat(n(t),". Using default config instead.")}};function a(o){return function(e){if(o)try{for(var i=l[e],t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new TypeError(i?i.apply(void 0,n):"Unhandled Error")}catch(t){i=t.stack.split(/\n/g)[1].split(/@/),s=(a=2,function(t){if(Array.isArray(t))return t}(s=i)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,s=[],a=!0,o=!1;try{for(i=i.call(t);!(a=(n=i.next()).done)&&(s.push(n.value),!e||s.length!==e);a=!0);}catch(t){o=!0,r=t}finally{try{a||null==i.return||i.return()}finally{if(o)throw r}}return s}}(s,a)||function(t,e){var i;if(t)return"string"==typeof t?h(t,e):"Map"===(i="Object"===(i=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:i)||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?h(t,e):void 0}(s,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=s[0],s=s[1];console.error("".concat(t.message,"\n\nThis error happened in the method `").concat(a,"` from: `").concat(s,"`.\n\nIf you don't want to see these error messages, turn off debugging by passing `{ debug: false }` to the constructor.\n\nError code: ").concat(e,"\n\nCheck out the documentation for more details about the API:\nhttps://github.com/andreasremdt/simple-translator#usage\n "))}var s,a}}function o(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=this,i=o;if(!(e instanceof i))throw new TypeError("Cannot call a class as a function");this.debug=a(!0),"object"==n(t)&&!Array.isArray(t)||(this.debug("INVALID_OPTIONS",t),t={}),this.languages=new Map,this.config=Object.assign(o.defaultConfig,t);e=this.config,i=e.debug,t=e.registerGlobally,e=e.detectLanguage;this.debug=a(i),t&&(this._globalObject[t]=this.translateForKey.bind(this)),e&&"browser"==this._env&&this._detectLanguage()}function u(t){return e.apply(this,arguments)}i=o,r=[{key:"_globalObject",get:function(){return"browser"==this._env?window:d}},{key:"_env",get:function(){return"undefined"==typeof window&&void 0!==p&&p.exports?"node":"browser"}},{key:"_detectLanguage",value:function(){var t=window.localStorage?localStorage.getItem(this.config.persistKey):void 0;t?this.config.defaultLanguage=t:(t=navigator.languages?navigator.languages[0]:navigator.language,this.config.defaultLanguage=t.substr(0,2))}},{key:"_getValueFromJSON",value:function(t,e){e=this.languages.get(e);return t.split(".").reduce(function(t,e){return t?t[e]:null},e)}},{key:"_replace",value:function(n,r){var t,s=this,e=null==(e=n.getAttribute("data-i18n"))?void 0:e.split(/\s/g),a=null==n||null==(t=n.getAttribute("data-i18n-attr"))?void 0:t.split(/\s/g);a&&e.length!=a.length&&this.debug("MISMATCHING_ATTRIBUTES",e,a,n),e.forEach(function(t,e){var i=s._getValueFromJSON(t,r),e=a?a[e]:"innerHTML";i?"innerHTML"==e?n[e]=i:n.setAttribute(e,i):s.debug("TRANSLATION_NOT_FOUND",t,r)})}},{key:"translatePageTo",value:function(){var t,e=this,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.config.defaultLanguage;"node"!=this._env?"string"==typeof i?0!=i.length?this.languages.has(i)?((t="string"==typeof this.config.selector?Array.from(document.querySelectorAll(this.config.selector)):this.config.selector).length&&0<t.length?t.forEach(function(t){return e._replace(t,i)}):null==t.length&&this._replace(t,i),this._currentLanguage=i,document.documentElement.lang=i,this.config.persist&&window.localStorage&&localStorage.setItem(this.config.persistKey,i)):this.debug("NO_LANGUAGE_REGISTERED",i):this.debug("EMPTY_PARAM_LANGUAGE"):this.debug("INVALID_PARAM_LANGUAGE",i):this.debug("INVALID_ENVIRONMENT")}},{key:"translateForKey",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.config.defaultLanguage;return"string"!=typeof t?(this.debug("INVALID_PARAM_KEY",t),null):this.languages.has(e)?this._getValueFromJSON(t,e)||(this.debug("TRANSLATION_NOT_FOUND",t,e),null):(this.debug("NO_LANGUAGE_REGISTERED",e),null)}},{key:"add",value:function(t,e){return"string"!=typeof t?this.debug("INVALID_PARAM_LANGUAGE",t):0==t.length?this.debug("EMPTY_PARAM_LANGUAGE"):Array.isArray(e)||"object"!=n(e)?this.debug("INVALID_PARAM_JSON",e):0==Object.keys(e).length?this.debug("EMPTY_PARAM_JSON"):this.languages.set(t,e),this}},{key:"remove",value:function(t){return"string"!=typeof t?this.debug("INVALID_PARAM_LANGUAGE",t):0==t.length?this.debug("EMPTY_PARAM_LANGUAGE"):this.languages.delete(t),this}},{key:"fetch",value:(e=function(r){var e,s=this,a=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];return Array.isArray(r)||"string"==typeof r?(e=(r=Array.isArray(r)?r:[r]).map(function(t){var t=t.replace(/\.json$/,"").replace(/^\//,""),e=s.config.filesLocation.replace(/\/$/,"");return"".concat(e,"/").concat(t,".json")}),"browser"==this._env?Promise.all(e.map(function(t){return fetch(t)})).then(function(t){return Promise.all(t.map(function(t){if(t.ok)return t.json();s.debug("FETCH_ERROR",t)}))}).then(function(t){return t=t.filter(function(t){return t}),a&&t.forEach(function(t,e){s.add(r[e],t)}),1<t.length?t:t[0]}):"node"==this._env?new Promise(function(t){var n=[];e.forEach(function(t,e){try{var i=JSON.parse(f("fs").readFileSync(c.cwd()+t,"utf-8"));a&&s.add(r[e],i),n.push(i)}catch(t){s.debug("MODULE_NOT_FOUND",t.message)}}),t(1<n.length?n:n[0])}):void 0):(this.debug("INVALID_PARAMETER_SOURCES",r),null)},u.toString=function(){return e.toString()},u)},{key:"setDefaultLanguage",value:function(t){if("string"==typeof t){if(0!=t.length)return this.languages.has(t)?void(this.config.defaultLanguage=t):(this.debug("NO_LANGUAGE_REGISTERED",t),null);this.debug("EMPTY_PARAM_LANGUAGE")}else this.debug("INVALID_PARAM_LANGUAGE",t)}},{key:"currentLanguage",get:function(){return this._currentLanguage||this.config.defaultLanguage}},{key:"defaultLanguage",get:function(){return this.config.defaultLanguage}}],s=[{key:"defaultConfig",get:function(){return{defaultLanguage:"en",detectLanguage:!0,selector:"[data-i18n]",debug:!1,registerGlobally:"__",persist:!1,persistKey:"preferred_language",filesLocation:"/i18n"}}}],t(i.prototype,r),t(i,s),p.exports=o}.call(this)}.call(this,f("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:33,fs:9}],3:[function(t,e,At){!function(Et){!function(){"use strict";function y(t){var e;return null==t?window:"[object Window]"!==t.toString()?(e=t.ownerDocument)&&e.defaultView||window:t}function g(t){return t instanceof y(t).Element||t instanceof Element}function h(t){return t instanceof y(t).HTMLElement||t instanceof HTMLElement}function s(t){return"undefined"!=typeof ShadowRoot&&(t instanceof y(t).ShadowRoot||t instanceof ShadowRoot)}Object.defineProperty(At,"__esModule",{value:!0});var E=Math.max,A=Math.min,b=Math.round;function a(){var t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function k(){return!/^((?!chrome|android).)*safari/i.test(a())}function c(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),r=1,s=1;e&&h(t)&&(r=0<t.offsetWidth&&b(n.width)/t.offsetWidth||1,s=0<t.offsetHeight&&b(n.height)/t.offsetHeight||1);e=(g(t)?y(t):window).visualViewport,t=!k()&&i,i=(n.left+(t&&e?e.offsetLeft:0))/r,t=(n.top+(t&&e?e.offsetTop:0))/s,e=n.width/r,r=n.height/s;return{width:e,height:r,top:t,right:i+e,bottom:t+r,left:i,x:i,y:t}}function d(t){t=y(t);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function l(t){return t?(t.nodeName||"").toLowerCase():null}function w(t){return((g(t)?t.ownerDocument:t.document)||window.document).documentElement}function f(t){return c(w(t)).left+d(t).scrollLeft}function x(t){return y(t).getComputedStyle(t)}function u(t){var t=x(t),e=t.overflow,i=t.overflowX,t=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+t+i)}function q(t,e,i){void 0===i&&(i=!1);var n=h(e),r=h(e)&&(a=(r=e).getBoundingClientRect(),s=b(a.width)/r.offsetWidth||1,a=b(a.height)/r.offsetHeight||1,1!==s||1!==a),s=w(e),a=c(t,r,i),t={scrollLeft:0,scrollTop:0},o={x:0,y:0};return!n&&i||("body"===l(e)&&!u(s)||(t=(n=e)!==y(n)&&h(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:d(n)),h(e)?((o=c(e,!0)).x+=e.clientLeft,o.y+=e.clientTop):s&&(o.x=f(s))),{x:a.left+t.scrollLeft-o.x,y:a.top+t.scrollTop-o.y,width:a.width,height:a.height}}function T(t){var e=c(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function o(t){return"html"===l(t)?t:t.assignedSlot||t.parentNode||(s(t)?t.host:null)||w(t)}function m(t,e){void 0===e&&(e=[]);var i=function t(e){return 0<=["html","body","#document"].indexOf(l(e))?e.ownerDocument.body:h(e)&&u(e)?e:t(o(e))}(t),t=i===(null==(t=t.ownerDocument)?void 0:t.body),n=y(i),n=t?[n].concat(n.visualViewport||[],u(i)?i:[]):i,i=e.concat(n);return t?i:i.concat(m(o(n)))}function r(t){return h(t)&&"fixed"!==x(t).position?t.offsetParent:null}function I(t){for(var e,i=y(t),n=r(t);n&&(e=n,0<=["table","td","th"].indexOf(l(e)))&&"static"===x(n).position;)n=r(n);return(!n||"html"!==l(n)&&("body"!==l(n)||"static"!==x(n).position))&&(n||function(t){var e=/firefox/i.test(a()),i=/Trident/i.test(a());if(!i||!h(t)||"fixed"!==x(t).position){var n=o(t);for(s(n)&&(n=n.host);h(n)&&["html","body"].indexOf(l(n))<0;){var r=x(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}}return null}(t))||i}var L="top",P="bottom",O="right",M="left",N="auto",R=[L,P,O,M],D="start",S="end",U="clippingParents",H="viewport",p="popper",W="reference",G=R.reduce(function(t,e){return t.concat([e+"-"+D,e+"-"+S])},[]),K=[].concat(R,[N]).reduce(function(t,e){return t.concat([e,e+"-"+D,e+"-"+S])},[]),Z=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function $(t){var i=new Map,n=new Set,r=[];return t.forEach(function(t){i.set(t.name,t)}),t.forEach(function(t){n.has(t.name)||!function e(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){n.has(t)||(t=i.get(t))&&e(t)}),r.push(t)}(t)}),r}function _(t){for(var e=arguments.length,i=new Array(1<e?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return[].concat(i).reduce(function(t,e){return t.replace(/%s/,e)},t)}var v='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',Y='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',X=["name","enabled","phase","fn","effect","requires","options"];function B(t){return t.split("-")[0]}function Q(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&s(i)){var n=e;do{if(n&&t.isSameNode(n))return!0}while(n=n.parentNode||n.host)}return!1}function J(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function tt(t,e,i){return e===H?J((r=i,a=y(n=t),o=w(n),a=a.visualViewport,h=o.clientWidth,o=o.clientHeight,u=l=0,a&&(h=a.width,o=a.height,(s=k())||!s&&"fixed"===r)&&(l=a.offsetLeft,u=a.offsetTop),{width:h,height:o,x:l+f(n),y:u})):g(e)?((r=c(s=e,!1,"fixed"===(r=i))).top=r.top+s.clientTop,r.left=r.left+s.clientLeft,r.bottom=r.top+s.clientHeight,r.right=r.left+s.clientWidth,r.width=s.clientWidth,r.height=s.clientHeight,r.x=r.left,r.y=r.top,r):J((a=w(t),h=w(a),o=d(a),l=null==(l=a.ownerDocument)?void 0:l.body,n=E(h.scrollWidth,h.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),u=E(h.scrollHeight,h.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),a=-o.scrollLeft+f(a),o=-o.scrollTop,"rtl"===x(l||h).direction&&(a+=E(h.clientWidth,l?l.clientWidth:0)-n),{width:n,height:u,x:a,y:o}));var n,r,s,a,o,h,l,u}function et(i,t,e,n){var r,s="clippingParents"===t?(a=m(o(s=i)),g(r=0<=["absolute","fixed"].indexOf(x(s).position)&&h(s)?I(s):s)?a.filter(function(t){return g(t)&&Q(t,r)&&"body"!==l(t)}):[]):[].concat(t),a=[].concat(s,[e]),t=a[0],e=a.reduce(function(t,e){e=tt(i,e,n);return t.top=E(e.top,t.top),t.right=A(e.right,t.right),t.bottom=A(e.bottom,t.bottom),t.left=E(e.left,t.left),t},tt(i,t,n));return e.width=e.right-e.left,e.height=e.bottom-e.top,e.x=e.left,e.y=e.top,e}function j(t){return t.split("-")[1]}function it(t){return 0<=["top","bottom"].indexOf(t)?"x":"y"}function nt(t){var e,i=t.reference,n=t.element,t=t.placement,r=t?B(t):null,t=t?j(t):null,s=i.x+i.width/2-n.width/2,a=i.y+i.height/2-n.height/2;switch(r){case L:e={x:s,y:i.y-n.height};break;case P:e={x:s,y:i.y+i.height};break;case O:e={x:i.x+i.width,y:a};break;case M:e={x:i.x-n.width,y:a};break;default:e={x:i.x,y:i.y}}var o=r?it(r):null;if(null!=o){var h="y"===o?"height":"width";switch(t){case D:e[o]=e[o]-(i[h]/2-n[h]/2);break;case S:e[o]=e[o]+(i[h]/2-n[h]/2)}}return e}function rt(){return{top:0,right:0,bottom:0,left:0}}function st(t){return Object.assign({},rt(),t)}function at(i,t){return t.reduce(function(t,e){return t[e]=i,t},{})}function z(t,e){var n,e=e=void 0===e?{}:e,i=e.placement,i=void 0===i?t.placement:i,r=e.strategy,r=void 0===r?t.strategy:r,s=e.boundary,s=void 0===s?U:s,a=e.rootBoundary,a=void 0===a?H:a,o=e.elementContext,o=void 0===o?p:o,h=e.altBoundary,h=void 0!==h&&h,e=e.padding,e=void 0===e?0:e,e=st("number"!=typeof e?e:at(e,R)),l=t.rects.popper,h=t.elements[h?o===p?W:p:o],h=et(g(h)?h:h.contextElement||w(t.elements.popper),s,a,r),s=c(t.elements.reference),a=nt({reference:s,element:l,strategy:"absolute",placement:i}),r=J(Object.assign({},l,a)),l=o===p?r:s,u={top:h.top-l.top+e.top,bottom:l.bottom-h.bottom+e.bottom,left:h.left-l.left+e.left,right:l.right-h.right+e.right},a=t.modifiersData.offset;return o===p&&a&&(n=a[i],Object.keys(u).forEach(function(t){var e=0<=[O,P].indexOf(t)?1:-1,i=0<=[L,P].indexOf(t)?"y":"x";u[t]+=n[i]*e})),u}var ot="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",ht={placement:"bottom",modifiers:[],strategy:"absolute"};function lt(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function t(t){var t=t=void 0===t?{}:t,e=t.defaultModifiers,f=void 0===e?[]:e,e=t.defaultOptions,p=void 0===e?ht:e;return function(a,o,e){void 0===e&&(e=p);var i,n,h={placement:"bottom",orderedModifiers:[],options:Object.assign({},ht,p),modifiersData:{},elements:{reference:a,popper:o},attributes:{},styles:{}},l=[],u=!1,c={state:h,setOptions:function(t){var i,e,n,r,s,t="function"==typeof t?t(h.options):t,t=(d(),h.options=Object.assign({},p,h.options,t),h.scrollParents={reference:g(a)?m(a):a.contextElement?m(a.contextElement):[],popper:m(o)},t=[].concat(f,h.options.modifiers),e=t.reduce(function(t,e){var i=t[e.name];return t[e.name]=i?Object.assign({},i,e,{options:Object.assign({},i.options,e.options),data:Object.assign({},i.data,e.data)}):e,t},{}),t=Object.keys(e).map(function(t){return e[t]}),i=$(t),Z.reduce(function(t,e){return t.concat(i.filter(function(t){return t.phase===e}))},[]));return h.orderedModifiers=t.filter(function(t){return t.enabled}),"production"!==Et.env.NODE_ENV&&(t=[].concat(t,h.options.modifiers),r=function(t){return t.name},s=new Set,t=t.filter(function(t){t=r(t);if(!s.has(t))return s.add(t),!0}),(n=t).forEach(function(i){[].concat(Object.keys(i),X).filter(function(t,e,i){return i.indexOf(t)===e}).forEach(function(t){switch(t){case"name":"string"!=typeof i.name&&console.error(_(v,String(i.name),'"name"','"string"','"'+String(i.name)+'"'));break;case"enabled":"boolean"!=typeof i.enabled&&console.error(_(v,i.name,'"enabled"','"boolean"','"'+String(i.enabled)+'"'));break;case"phase":Z.indexOf(i.phase)<0&&console.error(_(v,i.name,'"phase"',"either "+Z.join(", "),'"'+String(i.phase)+'"'));break;case"fn":"function"!=typeof i.fn&&console.error(_(v,i.name,'"fn"','"function"','"'+String(i.fn)+'"'));break;case"effect":null!=i.effect&&"function"!=typeof i.effect&&console.error(_(v,i.name,'"effect"','"function"','"'+String(i.fn)+'"'));break;case"requires":null==i.requires||Array.isArray(i.requires)||console.error(_(v,i.name,'"requires"','"array"','"'+String(i.requires)+'"'));break;case"requiresIfExists":Array.isArray(i.requiresIfExists)||console.error(_(v,i.name,'"requiresIfExists"','"array"','"'+String(i.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+i.name+'" modifier, valid properties are '+X.map(function(t){return'"'+t+'"'}).join(", ")+'; but "'+t+'" was provided.')}i.requires&&i.requires.forEach(function(e){null==n.find(function(t){return t.name===e})&&console.error(_(Y,String(i.name),e,e))})})}),B(h.options.placement)!==N||h.orderedModifiers.find(function(t){return"flip"===t.name})||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" ")),[(t=x(o)).marginTop,t.marginRight,t.marginBottom,t.marginLeft].some(function(t){return parseFloat(t)}))&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" ")),h.orderedModifiers.forEach(function(t){var e=t.name,i=t.options,t=t.effect;"function"==typeof t&&(t=t({state:h,name:e,instance:c,options:void 0===i?{}:i}),l.push(t||function(){}))}),c.update()},forceUpdate:function(){if(!u){var t=h.elements,e=t.reference,t=t.popper;if(lt(e,t)){h.rects={reference:q(e,I(t),"fixed"===h.options.strategy),popper:T(t)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(t){return h.modifiersData[t.name]=Object.assign({},t.data)});for(var i,n,r,s=0,a=0;a<h.orderedModifiers.length;a++){if("production"!==Et.env.NODE_ENV&&100<(s+=1)){console.error("Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.");break}!0===h.reset?(h.reset=!1,a=-1):(i=(r=h.orderedModifiers[a]).fn,n=r.options,r=r.name,"function"==typeof i&&(h=i({state:h,options:void 0===n?{}:n,name:r,instance:c})||h))}}else"production"!==Et.env.NODE_ENV&&console.error(ot)}},update:(i=function(){return new Promise(function(t){c.forceUpdate(),t(h)})},function(){return n=n||new Promise(function(t){Promise.resolve().then(function(){n=void 0,t(i())})})}),destroy:function(){d(),u=!0}};return lt(a,o)?c.setOptions(e).then(function(t){!u&&e.onFirstUpdate&&e.onFirstUpdate(t)}):"production"!==Et.env.NODE_ENV&&console.error(ot),c;function d(){l.forEach(function(t){return t()}),l=[]}}}var C={passive:!0};var e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=(t=t.options).scroll,r=void 0===n||n,s=void 0===(n=t.resize)||n,a=y(e.elements.popper),o=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&o.forEach(function(t){t.addEventListener("scroll",i.update,C)}),s&&a.addEventListener("resize",i.update,C),function(){r&&o.forEach(function(t){t.removeEventListener("scroll",i.update,C)}),s&&a.removeEventListener("resize",i.update,C)}},data:{}};var i={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,t=t.name;e.modifiersData[t]=nt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},ut={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ct(t){var e,i,n,r=t.popper,s=t.popperRect,a=t.placement,o=t.variation,h=t.offsets,l=t.position,u=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,t=t.isFixed,f=h.x,f=void 0===f?0:f,p=h.y,p=void 0===p?0:p,g="function"==typeof d?d({x:f,y:p}):{x:f,y:p},g=(f=g.x,p=g.y,h.hasOwnProperty("x")),h=h.hasOwnProperty("y"),m=M,_=L,v=window,r=(c&&(i="clientHeight",e="clientWidth",(n=I(r))===y(r)&&"static"!==x(n=w(r)).position&&"absolute"===l&&(i="scrollHeight",e="scrollWidth"),a!==L&&(a!==M&&a!==O||o!==S)||(_=P,p=(p-((t&&n===v&&v.visualViewport?v.visualViewport.height:n[i])-s.height))*(u?1:-1)),a!==M&&(a!==L&&a!==P||o!==S)||(m=O,f=(f-((t&&n===v&&v.visualViewport?v.visualViewport.width:n[e])-s.width))*(u?1:-1))),Object.assign({position:l},c&&ut)),t=!0===d?(a=(i={x:f,y:p}).x,i=i.y,o=window.devicePixelRatio||1,{x:b(a*o)/o||0,y:b(i*o)/o||0}):{x:f,y:p};return f=t.x,p=t.y,u?Object.assign({},r,((n={})[_]=h?"0":"",n[m]=g?"0":"",n.transform=(v.devicePixelRatio||1)<=1?"translate("+f+"px, "+p+"px)":"translate3d("+f+"px, "+p+"px, 0)",n)):Object.assign({},r,((e={})[_]=h?p+"px":"",e[m]=g?f+"px":"",e.transform="",e))}var n={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e,i=t.state,t=t.options,n=void 0===(n=t.gpuAcceleration)||n,r=void 0===(r=t.adaptive)||r,t=void 0===(t=t.roundOffsets)||t,n=("production"!==Et.env.NODE_ENV&&(e=x(i.elements.popper).transitionProperty||"",r)&&["transform","top","right","bottom","left"].some(function(t){return 0<=e.indexOf(t)})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',"\n\n",'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.","\n\n","We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" ")),{placement:B(i.placement),variation:j(i.placement),popper:i.elements.popper,popperRect:i.rects.popper,gpuAcceleration:n,isFixed:"fixed"===i.options.strategy});null!=i.modifiersData.popperOffsets&&(i.styles.popper=Object.assign({},i.styles.popper,ct(Object.assign({},n,{offsets:i.modifiersData.popperOffsets,position:i.options.strategy,adaptive:r,roundOffsets:t})))),null!=i.modifiersData.arrow&&(i.styles.arrow=Object.assign({},i.styles.arrow,ct(Object.assign({},n,{offsets:i.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:t})))),i.attributes.popper=Object.assign({},i.attributes.popper,{"data-popper-placement":i.placement})},data:{}};var dt={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var r=t.state;Object.keys(r.elements).forEach(function(t){var e=r.styles[t]||{},i=r.attributes[t]||{},n=r.elements[t];h(n)&&l(n)&&(Object.assign(n.style,e),Object.keys(i).forEach(function(t){var e=i[t];!1===e?n.removeAttribute(t):n.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow),function(){Object.keys(n.elements).forEach(function(t){var e=n.elements[t],i=n.attributes[t]||{},t=Object.keys((n.styles.hasOwnProperty(t)?n.styles:r)[t]).reduce(function(t,e){return t[e]="",t},{});h(e)&&l(e)&&(Object.assign(e.style,t),Object.keys(i).forEach(function(t){e.removeAttribute(t)}))})}},requires:["computeStyles"]};var ft={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var a=t.state,e=t.options,t=t.name,o=void 0===(e=e.offset)?[0,0]:e,e=K.reduce(function(t,e){var i,n,r,s;return t[e]=(e=e,i=a.rects,n=o,r=B(e),s=0<=[M,L].indexOf(r)?-1:1,e=(i="function"==typeof n?n(Object.assign({},i,{placement:e})):n)[0]||0,n=(i[1]||0)*s,0<=[M,O].indexOf(r)?{x:n,y:e}:{x:e,y:n}),t},{}),i=(n=e[a.placement]).x,n=n.y;null!=a.modifiersData.popperOffsets&&(a.modifiersData.popperOffsets.x+=i,a.modifiersData.popperOffsets.y+=n),a.modifiersData[t]=e}},pt={left:"right",right:"left",bottom:"top",top:"bottom"};function F(t){return t.replace(/left|right|bottom|top/g,function(t){return pt[t]})}var gt={start:"end",end:"start"};function mt(t){return t.replace(/start|end/g,function(t){return gt[t]})}var _t={name:"flip",enabled:!0,phase:"main",fn:function(t){var c=t.state,e=t.options,t=t.name;if(!c.modifiersData[t]._skip){for(var i=e.mainAxis,n=void 0===i||i,i=e.altAxis,r=void 0===i||i,i=e.fallbackPlacements,d=e.padding,f=e.boundary,p=e.rootBoundary,s=e.altBoundary,a=e.flipVariations,g=void 0===a||a,m=e.allowedAutoPlacements,a=c.options.placement,e=B(a),i=i||(e===a||!g?[F(a)]:B(i=a)===N?[]:(e=F(i),[mt(i),e,mt(e)])),o=[a].concat(i).reduce(function(t,e){return t.concat(B(e)===N?(i=c,n=(t=t=void 0===(t={placement:e,boundary:f,rootBoundary:p,padding:d,flipVariations:g,allowedAutoPlacements:m})?{}:t).placement,r=t.boundary,s=t.rootBoundary,a=t.padding,o=t.flipVariations,h=void 0===(t=t.allowedAutoPlacements)?K:t,l=j(n),t=l?o?G:G.filter(function(t){return j(t)===l}):R,0===(n=t.filter(function(t){return 0<=h.indexOf(t)})).length&&(n=t,"production"!==Et.env.NODE_ENV)&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")),u=n.reduce(function(t,e){return t[e]=z(i,{placement:e,boundary:r,rootBoundary:s,padding:a})[B(e)],t},{}),Object.keys(u).sort(function(t,e){return u[t]-u[e]})):e);var i,n,r,s,a,o,h,l,u},[]),h=c.rects.reference,l=c.rects.popper,u=new Map,_=!0,v=o[0],y=0;y<o.length;y++){var b=o[y],w=B(b),x=j(b)===D,S=0<=[L,P].indexOf(w),C=S?"width":"height",k=z(c,{placement:b,boundary:f,rootBoundary:p,altBoundary:s,padding:d}),S=S?x?O:M:x?P:L,x=(h[C]>l[C]&&(S=F(S)),F(S)),C=[];if(n&&C.push(k[w]<=0),r&&C.push(k[S]<=0,k[x]<=0),C.every(function(t){return t})){v=b,_=!1;break}u.set(b,C)}if(_)for(var E=g?3:1;0<E;E--)if("break"===function(e){var t=o.find(function(t){t=u.get(t);if(t)return t.slice(0,e).every(function(t){return t})});if(t)return v=t,"break"}(E))break;c.placement!==v&&(c.modifiersData[t]._skip=!0,c.placement=v,c.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function V(t,e,i){return E(t,A(e,i))}var vt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e,i,n,r,s,a,o,h,l,u=t.state,c=t.options,t=t.name,d=void 0===(d=c.mainAxis)||d,f=void 0!==(f=c.altAxis)&&f,p=c.boundary,g=c.rootBoundary,m=c.altBoundary,_=c.padding,v=void 0===(v=c.tether)||v,c=void 0===(c=c.tetherOffset)?0:c,p=z(u,{boundary:p,rootBoundary:g,padding:_,altBoundary:m}),g=B(u.placement),m=!(_=j(u.placement)),y=it(g),b="x"===y?"y":"x",w=u.modifiersData.popperOffsets,x=u.rects.reference,S=u.rects.popper,c="number"==typeof(c="function"==typeof c?c(Object.assign({},u.rects,{placement:u.placement})):c)?{mainAxis:c,altAxis:c}:Object.assign({mainAxis:0,altAxis:0},c),C=u.modifiersData.offset?u.modifiersData.offset[u.placement]:null,k={x:0,y:0};w&&(d&&(d="y"===y?"height":"width",a=(o=w[y])+p[i="y"===y?L:M],h=o-p[l="y"===y?P:O],e=v?-S[d]/2:0,r=(_===D?x:S)[d],_=_===D?-S[d]:-x[d],s=u.elements.arrow,s=v&&s?T(s):{width:0,height:0},i=(n=u.modifiersData["arrow#persistent"]?u.modifiersData["arrow#persistent"].padding:rt())[i],n=n[l],l=V(0,x[d],s[d]),s=m?x[d]/2-e-l-i-c.mainAxis:r-l-i-c.mainAxis,r=m?-x[d]/2+e+l+n+c.mainAxis:_+l+n+c.mainAxis,m=(i=u.elements.arrow&&I(u.elements.arrow))?"y"===y?i.clientTop||0:i.clientLeft||0:0,_=o+r-(e=null!=(d=null==C?void 0:C[y])?d:0),l=V(v?A(a,o+s-e-m):a,o,v?E(h,_):h),w[y]=l,k[y]=l-o),f&&(n="y"==b?"height":"width",r=(i=w[b])+p["x"===y?L:M],d=i-p["x"===y?P:O],s=-1!==[L,M].indexOf(g),m=null!=(e=null==C?void 0:C[b])?e:0,a=s?r:i-x[n]-S[n]-m+c.altAxis,_=s?i+x[n]+S[n]-m-c.altAxis:d,o=v&&s?(h=V(h=a,i,l=_),l<h?l:h):V(v?a:r,i,v?_:d),w[b]=o,k[b]=o-i),u.modifiersData[t]=k)},requiresIfExists:["offset"]};var yt={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i,n,r,s=t.state,a=t.name,t=t.options,o=s.elements.arrow,h=s.modifiersData.popperOffsets,l=it(u=B(s.placement)),u=0<=[M,O].indexOf(u)?"height":"width";o&&h&&(t=t.padding,i=s,i=st("number"!=typeof(t="function"==typeof t?t(Object.assign({},i.rects,{placement:i.placement})):t)?t:at(t,R)),t=T(o),r="y"===l?L:M,n="y"===l?P:O,e=s.rects.reference[u]+s.rects.reference[l]-h[l]-s.rects.popper[u],h=h[l]-s.rects.reference[l],o=(o=I(o))?"y"===l?o.clientHeight||0:o.clientWidth||0:0,r=i[r],i=o-t[u]-i[n],r=V(r,n=o/2-t[u]/2+(e/2-h/2),i),s.modifiersData[a]=((o={})[l]=r,o.centerOffset=r-n,o))},effect:function(t){var e=t.state;null==(t=void 0===(t=t.options.element)?"[data-popper-arrow]":t)||"string"==typeof t&&!(t=e.elements.popper.querySelector(t))||("production"===Et.env.NODE_ENV||h(t)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" ")),Q(e.elements.popper,t)?e.elements.arrow=t:"production"!==Et.env.NODE_ENV&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" ")))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bt(t,e,i){return{top:t.top-e.height-(i=void 0===i?{x:0,y:0}:i).y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function wt(e){return[L,O,P,M].some(function(t){return 0<=e[t]})}var xt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,t=t.name,i=e.rects.reference,n=e.rects.popper,r=e.modifiersData.preventOverflow,s=z(e,{elementContext:"reference"}),a=z(e,{altBoundary:!0}),s=bt(s,i),i=bt(a,n,r),a=wt(s),n=wt(i);e.modifiersData[t]={referenceClippingOffsets:s,popperEscapeOffsets:i,isReferenceHidden:a,hasPopperEscaped:n},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":a,"data-popper-escaped":n})}},St=t({defaultModifiers:[e,i,n,dt]}),Ct=[e,i,n,dt,ft,_t,vt,yt,xt],kt=t({defaultModifiers:Ct});At.applyStyles=dt,At.arrow=yt,At.computeStyles=n,At.createPopper=kt,At.createPopperLite=St,At.defaultModifiers=Ct,At.detectOverflow=z,At.eventListeners=e,At.flip=_t,At.hide=xt,At.offset=ft,At.popperGenerator=t,At.popperOffsets=i,At.preventOverflow=vt}.call(this)}.call(this,t("_process"))},{_process:33}],4:[function(t,e,i){var n=this,r=function(){"use strict";function e(e,t){var i,n=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)),n}function g(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?e(Object(r),!0).forEach(function(t){var e,i;e=n,i=r[t=t],t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(r,t))})}return n}function h(t){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}()||u(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){var i;if(t)return"string"==typeof t?n(t,e):"Map"===(i="Object"===(i=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:i)||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function l(t){return"string"==typeof t?document.querySelector(t):t()}function c(i,t,e){var n=(e=e||{}).mode,r=e.diacritics,s=e.highlight,a=_(t,r);if(t=String(t),i=_(i,r),"loose"===n){var o=(i=i.replace(/ /g,"")).length,h=0,e=Array.from(t).map(function(t,e){return h<o&&a[e]===i[h]&&(t=s?v(t,s):t,h++),t}).join("");if(h===o)return e}else{r=a.indexOf(i);if(~r)return i=t.substring(r,r+i.length),s?t.replace(i,v(i,s)):t}}function d(t){k(t.cursor+1,t)}function f(t){k(t.cursor-1,t)}function p(t,e,i){(i=0<=i?i:t.cursor)<0||(t.feedback.event=e,x(t,i),y("selection",t),C(t))}var m=function(t,e){var i,n="string"==typeof t?document.createElement(t):t;for(i in e){var r,s=e[i];"inside"===i?s.append(n):"dest"===i?l(s[0]).insertAdjacentElement(s[1],n):"around"===i?((r=s).parentNode.insertBefore(n,r),n.append(r),null!=r.getAttribute("autofocus")&&r.focus()):i in n?n[i]=s:n.setAttribute(i,s)}return n},_=function(t,e){return t=String(t).toLowerCase(),e?t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").normalize("NFC"):t},v=function(t,e){return m("mark",g({innerHTML:t},"string"==typeof e&&{class:e})).outerHTML},y=function(t,e){e.input.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e.feedback,cancelable:!0}))},b=function(r,s){return new Promise(function(e,i){var n;return(n=r.data).cache&&n.store?e():new Promise(function(t,e){return"function"==typeof n.src?n.src(s).then(t,e):t(n.src)}).then(function(t){try{return r.feedback=n.store=t,y("response",r),e()}catch(t){return i(t)}},i)})},w=function(s,a){var o=a.data,h=a.searchEngine,l=[],t=(o.store.forEach(function(i,t){function e(t){var e=t?i[t]:i;(e="function"==typeof h?h(s,e):c(s,e,{mode:h,diacritics:a.diacritics,highlight:a.resultItem.highlight}))&&(e={match:e,value:i},t&&(e.key=t),l.push(e))}if(o.keys){var n,r=function(t){var e,i,n,r,s,a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(a)return n=!(i=!0),{s:function(){a=a.call(t)},n:function(){var t=a.next();return i=t.done,t},e:function(t){n=!0,e=t},f:function(){try{i||null==a.return||a.return()}finally{if(n)throw e}}};if(Array.isArray(t)||(a=u(t)))return a&&(t=a),r=0,{s:s=function(){},n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(o.keys);try{for(r.s();!(n=r.n()).done;)e(n.value)}catch(t){r.e(t)}finally{r.f()}}else e()}),(l=o.filter?o.filter(l):l).slice(0,a.resultsList.maxResults));a.feedback={query:s,matches:l,results:t},y("results",a)},i="aria-expanded",a="aria-activedescendant",o="aria-selected",x=function(t,e){t.feedback.selection=g({index:e},t.feedback.results[e])},S=function(t){t.isOpen||((t.wrapper||t.input).setAttribute(i,!0),t.list.removeAttribute("hidden"),t.isOpen=!0,y("open",t))},C=function(t){t.isOpen&&((t.wrapper||t.input).setAttribute(i,!1),t.input.setAttribute(a,""),t.list.setAttribute("hidden",""),t.isOpen=!1,y("close",t))},k=function(t,e){var i,n=e.resultItem,r=e.list.getElementsByTagName(n.tag),n=!!n.selected&&n.selected.split(" ");e.isOpen&&r.length&&(i=e.cursor,(t=t>=r.length?0:t)<0&&(t=r.length-1),e.cursor=t,-1<i&&(r[i].removeAttribute(o),n)&&(i=r[i].classList).remove.apply(i,s(n)),r[t].setAttribute(o,!0),n&&(i=r[t].classList).add.apply(i,s(n)),e.input.setAttribute(a,r[e.cursor].id),e.list.scrollTop=r[t].offsetTop-e.list.clientHeight+r[t].clientHeight+5,e.feedback.cursor=e.cursor,x(e,t),y("navigate",e))};function E(f,n){var p=this;return new Promise(function(l,u){var t,e,i,c=n||((t=f.input)instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t.value:t.innerHTML);return t=c=f.query?f.query(c):c,e=f.trigger,i=f.threshold,(e?e(t):t.length>=i)?b(f,c).then(function(t){try{return f.feedback instanceof Error?l():(w(c,f),f.resultsList&&(n=(e=f).resultsList,r=e.list,s=e.resultItem,a=e.feedback,o=a.matches,h=a.results,e.cursor=-1,r.innerHTML="",(o.length||n.noResults?(i=new DocumentFragment,h.forEach(function(t,e){e=m(s.tag,g({id:"".concat(s.id,"_").concat(e),role:"option",innerHTML:t.match,inside:i},s.class&&{class:s.class}));s.element&&s.element(e,t)}),r.append(i),n.element&&n.element(r,a),S):C)(e)),d.call(p))}catch(t){return u(t)}var e,i,n,r,s,a,o,h},u):(C(f),d.call(p));function d(){return l()}})}function A(t,e){for(var i in t)for(var n in t[i])e(i,n)}var T=function(s){var t,e,i,n=s.events,r=(t=function(){return E(s)},e=s.debounce,s.events=g({input:g({},n&&n.input)},s.resultsList&&{list:n?g({},n.list):{}})),a={input:{input:function(){clearTimeout(i),i=setTimeout(t,e)},keydown:function(t){var e=t,i=s;switch(e.keyCode){case 40:case 38:e.preventDefault(),(40===e.keyCode?d:f)(i);break;case 13:i.submit||e.preventDefault(),0<=i.cursor&&p(i,e);break;case 9:i.resultsList.tabSelect&&0<=i.cursor&&p(i,e);break;case 27:i.input.value="",C(i)}},blur:function(){C(s)}},list:{mousedown:function(t){t.preventDefault()},click:function(t){var e,i,n,r;t=t,i=(e=s).resultItem.tag.toUpperCase(),n=Array.from(e.list.querySelectorAll(i)),(r=t.target.closest(i))&&r.nodeName===i&&p(e,t,n.indexOf(r))}}};A(a,function(t,e){!s.resultsList&&"input"!==e||r[t][e]||(r[t][e]=a[t][e])}),A(r,function(t,e){s[t].addEventListener(e,r[t][e])})};function I(a){var o=this;new Promise(function(t,e){var i,n,r;return i=a.placeHolder,r={role:"combobox","aria-owns":(n=a.resultsList).id,"aria-haspopup":!0,"aria-expanded":!1},m(a.input,g(g({"aria-controls":n.id,"aria-autocomplete":"both"},i&&{placeholder:i}),!a.wrapper&&g({},r))),a.wrapper&&(a.wrapper=m("div",g({around:a.input,class:a.name+"_wrapper"},r))),n&&(a.list=m(n.tag,g({dest:[n.destination,n.position],id:n.id,role:"listbox",hidden:"hidden"},n.class&&{class:n.class}))),T(a),a.data.cache?b(a).then(function(t){try{return s.call(o)}catch(t){return e(t)}},e):s.call(o);function s(){return y("init",a),t()}})}return function t(e){this.options=e,this.id=t.instances=(t.instances||0)+1,this.name="autoComplete",this.wrapper=1,this.threshold=1,this.debounce=0,this.resultsList={position:"afterend",tag:"ul",maxResults:5},this.resultItem={tag:"li"};var i,n=this,e=n.name,r=n.options,s=n.resultsList,a=n.resultItem;for(i in r)if("object"===h(r[i]))for(var o in n[i]||(n[i]={}),r[i])n[i][o]=r[i][o];else n[i]=r[i];n.selector=n.selector||"#"+e,s.destination=s.destination||n.selector,s.id=s.id||e+"_list_"+n.id,a.id=a.id||e+"_result",n.input=l(n.selector),function(t){(t=t.prototype).init=function(){I(this)},t.start=function(t){E(this,t)},t.unInit=function(){var t,i;this.wrapper&&((t=this.wrapper.parentNode).insertBefore(this.input,this.wrapper),t.removeChild(this.wrapper)),A((i=this).events,function(t,e){i[t].removeEventListener(e,i.events[t][e])})},t.open=function(){S(this)},t.close=function(){C(this)},t.goTo=function(t){k(t,this)},t.next=function(){d(this)},t.previous=function(){f(this)},t.select=function(t){p(this,null,t)},t.search=c}.call(this,t),I(this)}};"object"==typeof i&&void 0!==e?e.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).autoComplete=r()},{}],5:[function(t,e,i){var n,r;n=this,r=function(t){"use strict";var a={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},e="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",D={5:e,"5module":e+" export import",6:e+" const class extends export import super"},B=/^in(stanceof)?$/,e="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",j=new RegExp("["+e+"]"),z=new RegExp("["+e+"·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_]"),F=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],V=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function i(t,e){for(var i=65536,n=0;n<e.length;n+=2){if(t<(i+=e[n]))return!1;if(t<=(i+=e[n+1]))return!0}}function o(t,e){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?170<=t&&j.test(String.fromCharCode(t)):!1!==e&&i(t,F)))}function h(t,e){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?170<=t&&z.test(String.fromCharCode(t)):!1!==e&&(i(t,F)||i(t,V)))))}function n(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null}function r(t,e){return new n(t,{beforeExpr:!0,binop:e})}var e={beforeExpr:!0},s={startsExpr:!0},l={};function u(t,e){return(e=void 0===e?{}:e).keyword=t,l[t]=new n(t,e)}var m={num:new n("num",s),regexp:new n("regexp",s),string:new n("string",s),name:new n("name",s),eof:new n("eof"),bracketL:new n("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new n("]"),braceL:new n("{",{beforeExpr:!0,startsExpr:!0}),braceR:new n("}"),parenL:new n("(",{beforeExpr:!0,startsExpr:!0}),parenR:new n(")"),comma:new n(",",e),semi:new n(";",e),colon:new n(":",e),dot:new n("."),question:new n("?",e),questionDot:new n("?."),arrow:new n("=>",e),template:new n("template"),invalidTemplate:new n("invalidTemplate"),ellipsis:new n("...",e),backQuote:new n("`",s),dollarBraceL:new n("${",{beforeExpr:!0,startsExpr:!0}),eq:new n("=",{beforeExpr:!0,isAssign:!0}),assign:new n("_=",{beforeExpr:!0,isAssign:!0}),incDec:new n("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new n("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:r("||",1),logicalAND:r("&&",2),bitwiseOR:r("|",3),bitwiseXOR:r("^",4),bitwiseAND:r("&",5),equality:r("==/!=/===/!==",6),relational:r("</>/<=/>=",7),bitShift:r("<</>>/>>>",8),plusMin:new n("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:r("%",10),star:r("*",10),slash:r("/",10),starstar:new n("**",{beforeExpr:!0}),coalesce:r("??",1),_break:u("break"),_case:u("case",e),_catch:u("catch"),_continue:u("continue"),_debugger:u("debugger"),_default:u("default",e),_do:u("do",{isLoop:!0,beforeExpr:!0}),_else:u("else",e),_finally:u("finally"),_for:u("for",{isLoop:!0}),_function:u("function",s),_if:u("if"),_return:u("return",e),_switch:u("switch"),_throw:u("throw",e),_try:u("try"),_var:u("var"),_const:u("const"),_while:u("while",{isLoop:!0}),_with:u("with"),_new:u("new",{beforeExpr:!0,startsExpr:!0}),_this:u("this",s),_super:u("super",s),_class:u("class",s),_extends:u("extends",e),_export:u("export"),_import:u("import",s),_null:u("null",s),_true:u("true",s),_false:u("false",s),_in:u("in",{beforeExpr:!0,binop:7}),_instanceof:u("instanceof",{beforeExpr:!0,binop:7}),_typeof:u("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:u("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:u("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},c=/\r\n?|\n|\u2028|\u2029/,d=new RegExp(c.source,"g");function f(t,e){return 10===t||13===t||!e&&(8232===t||8233===t)}var p=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,g=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,e=Object.prototype,q=e.hasOwnProperty,U=e.toString;function _(t,e){return q.call(t,e)}var H=Array.isArray||function(t){return"[object Array]"===U.call(t)};function v(t){return new RegExp("^(?:"+t.replace(/ /g,"|")+")$")}function y(t,e){this.line=t,this.column=e}function b(t,e,i){this.start=e,this.end=i,null!==t.sourceFile&&(this.source=t.sourceFile)}function w(t,e){for(var i=1,n=0;;){d.lastIndex=n;var r=d.exec(t);if(!(r&&r.index<e))return new y(i,e-n);++i,n=r.index+r[0].length}}var x={ecmaVersion:10,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!(y.prototype.offset=function(t){return new y(this.line,this.column+t)}),allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function W(t){var e,i,a,o,n={};for(e in x)n[e]=(t&&_(t,e)?t:x)[e];return 2015<=n.ecmaVersion&&(n.ecmaVersion-=2009),null==n.allowReserved&&(n.allowReserved=n.ecmaVersion<5),H(n.onToken)&&(i=n.onToken,n.onToken=function(t){return i.push(t)}),H(n.onComment)&&(n.onComment=(o=(a=n).onComment,function(t,e,i,n,r,s){t={type:t?"Block":"Line",value:e,start:i,end:n};a.locations&&(t.loc=new b(this,r,s)),a.ranges&&(t.range=[i,n]),o.push(t)})),n}function S(t,e){return 2|(t?4:0)|(e?8:0)}function C(t,e,i){this.options=t=W(t),this.sourceFile=t.sourceFile,this.keywords=v(D[6<=t.ecmaVersion?6:"module"===t.sourceType?"5module":5]);var n="";if(!0!==t.allowReserved){for(var r=t.ecmaVersion;!(n=a[r]);r--);"module"===t.sourceType&&(n+=" await")}this.reservedWords=v(n);var s=(n?n+" ":"")+a.strict;this.reservedWordsStrict=v(s),this.reservedWordsStrictBind=v(s+" "+a.strictBind),this.input=String(e),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(c).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=m.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===t.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null}var s={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}},e=(C.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)},s.inFunction.get=function(){return 0<(2&this.currentVarScope().flags)},s.inGenerator.get=function(){return 0<(8&this.currentVarScope().flags)},s.inAsync.get=function(){return 0<(4&this.currentVarScope().flags)},s.allowSuper.get=function(){return 0<(64&this.currentThisScope().flags)},s.allowDirectSuper.get=function(){return 0<(128&this.currentThisScope().flags)},s.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},C.prototype.inNonArrowFunction=function(){return 0<(2&this.currentThisScope().flags)},C.extend=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var i=this,n=0;n<t.length;n++)i=t[n](i);return i},C.parse=function(t,e){return new this(e,t).parse()},C.parseExpressionAt=function(t,e,i){i=new this(i,t,e);return i.nextToken(),i.parseExpression()},C.tokenizer=function(t,e){return new this(e,t)},Object.defineProperties(C.prototype,s),C.prototype),G=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;function k(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}e.strictDirective=function(t){for(;;){g.lastIndex=t,t+=g.exec(this.input)[0].length;var e,i,n,r=G.exec(this.input.slice(t));if(!r)return!1;if("use strict"===(r[1]||r[2]))return g.lastIndex=t+r[0].length,i=(e=g.exec(this.input)).index+e[0].length,";"===(n=this.input.charAt(i))||"}"===n||c.test(e[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(n)||"!"===n&&"="===this.input.charAt(i+1));t+=r[0].length,g.lastIndex=t,t+=g.exec(this.input)[0].length,";"===this.input[t]&&t++}},e.eat=function(t){return this.type===t&&(this.next(),!0)},e.isContextual=function(t){return this.type===m.name&&this.value===t&&!this.containsEsc},e.eatContextual=function(t){return!!this.isContextual(t)&&(this.next(),!0)},e.expectContextual=function(t){this.eatContextual(t)||this.unexpected()},e.canInsertSemicolon=function(){return this.type===m.eof||this.type===m.braceR||c.test(this.input.slice(this.lastTokEnd,this.start))},e.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},e.semicolon=function(){this.eat(m.semi)||this.insertSemicolon()||this.unexpected()},e.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0},e.expect=function(t){this.eat(t)||this.unexpected()},e.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")},e.checkPatternErrors=function(t,e){t&&(-1<t.trailingComma&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element"),-1<(e=e?t.parenthesizedAssign:t.parenthesizedBind))&&this.raiseRecoverable(e,"Parenthesized pattern")},e.checkExpressionErrors=function(t,e){var i;return!!t&&(i=t.shorthandAssign,t=t.doubleProto,e?(0<=i&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),void(0<=t&&this.raiseRecoverable(t,"Redefinition of __proto__ property"))):0<=i||0<=t)},e.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},e.isSimpleAssignTarget=function(t){return"ParenthesizedExpression"===t.type?this.isSimpleAssignTarget(t.expression):"Identifier"===t.type||"MemberExpression"===t.type};function K(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]}function E(t,e,i){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new b(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])}var s=C.prototype,A=(s.parseTopLevel=function(t){var e={};for(t.body||(t.body=[]);this.type!==m.eof;){var i=this.parseStatement(null,!0,e);t.body.push(i)}if(this.inModule)for(var n=0,r=Object.keys(this.undefinedExports);n<r.length;n+=1){var s=r[n];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType,this.finishNode(t,"Program")},{kind:"loop"}),Z={kind:"switch"},$=(s.isLet=function(t){if(!(this.options.ecmaVersion<6)&&this.isContextual("let")){g.lastIndex=this.pos;var e=g.exec(this.input),e=this.pos+e[0].length,i=this.input.charCodeAt(e);if(91===i)return!0;if(!t){if(123===i)return!0;if(o(i,!0)){for(var n=e+1;h(this.input.charCodeAt(n),!0);)++n;t=this.input.slice(e,n);if(!B.test(t))return!0}}}return!1},s.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;g.lastIndex=this.pos;var t=g.exec(this.input),t=this.pos+t[0].length;return!(c.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!==this.input.length&&h(this.input.charAt(t+8)))},s.parseStatement=function(t,e,i){var n,r,s=this.type,a=this.startNode();switch(this.isLet(t)&&(s=m._var,n="let"),s){case m._break:case m._continue:return this.parseBreakContinueStatement(a,s.keyword);case m._debugger:return this.parseDebuggerStatement(a);case m._do:return this.parseDoStatement(a);case m._for:return this.parseForStatement(a);case m._function:return t&&(this.strict||"if"!==t&&"label"!==t)&&6<=this.options.ecmaVersion&&this.unexpected(),this.parseFunctionStatement(a,!1,!t);case m._class:return t&&this.unexpected(),this.parseClass(a,!0);case m._if:return this.parseIfStatement(a);case m._return:return this.parseReturnStatement(a);case m._switch:return this.parseSwitchStatement(a);case m._throw:return this.parseThrowStatement(a);case m._try:return this.parseTryStatement(a);case m._const:case m._var:return n=n||this.value,t&&"var"!==n&&this.unexpected(),this.parseVarStatement(a,n);case m._while:return this.parseWhileStatement(a);case m._with:return this.parseWithStatement(a);case m.braceL:return this.parseBlock(!0,a);case m.semi:return this.parseEmptyStatement(a);case m._export:case m._import:if(10<this.options.ecmaVersion&&s===m._import){g.lastIndex=this.pos;var o=g.exec(this.input),o=this.pos+o[0].length,o=this.input.charCodeAt(o);if(40===o||46===o)return this.parseExpressionStatement(a,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule)||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'"),s===m._import?this.parseImport(a):this.parseExport(a,i);default:return this.isAsyncFunction()?(t&&this.unexpected(),this.next(),this.parseFunctionStatement(a,!0,!t)):(o=this.value,r=this.parseExpression(),s===m.name&&"Identifier"===r.type&&this.eat(m.colon)?this.parseLabeledStatement(a,o,r,t):this.parseExpressionStatement(a,r))}},s.parseBreakContinueStatement=function(t,e){for(var i="break"===e,n=(this.next(),this.eat(m.semi)||this.insertSemicolon()?t.label=null:this.type!==m.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon()),0);n<this.labels.length;++n){var r=this.labels[n];if(null==t.label||r.name===t.label.name){if(null!=r.kind&&(i||"loop"===r.kind))break;if(t.label&&i)break}}return n===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,i?"BreakStatement":"ContinueStatement")},s.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")},s.parseDoStatement=function(t){return this.next(),this.labels.push(A),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(m._while),t.test=this.parseParenExpression(),6<=this.options.ecmaVersion?this.eat(m.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},s.parseForStatement=function(t){this.next();var e,i,n=9<=this.options.ecmaVersion&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;return this.labels.push(A),this.enterScope(0),this.expect(m.parenL),this.type===m.semi?(-1<n&&this.unexpected(n),this.parseFor(t,null)):(e=this.isLet(),this.type===m._var||this.type===m._const||e?(i=this.startNode(),e=e?"let":this.value,this.next(),this.parseVar(i,!0,e),this.finishNode(i,"VariableDeclaration"),(this.type===m._in||6<=this.options.ecmaVersion&&this.isContextual("of"))&&1===i.declarations.length?(9<=this.options.ecmaVersion&&(this.type===m._in?-1<n&&this.unexpected(n):t.await=-1<n),this.parseForIn(t,i)):(-1<n&&this.unexpected(n),this.parseFor(t,i))):(e=new k,i=this.parseExpression(!0,e),this.type===m._in||6<=this.options.ecmaVersion&&this.isContextual("of")?(9<=this.options.ecmaVersion&&(this.type===m._in?-1<n&&this.unexpected(n):t.await=-1<n),this.toAssignable(i,!1,e),this.checkLVal(i),this.parseForIn(t,i)):(this.checkExpressionErrors(e,!0),-1<n&&this.unexpected(n),this.parseFor(t,i))))},s.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,T|(i?0:I),!1,e)},s.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(m._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")},s.parseReturnStatement=function(t){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(m.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},s.parseSwitchStatement=function(t){var e;this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(m.braceL),this.labels.push(Z),this.enterScope(0);for(var i,n=!1;this.type!==m.braceR;)this.type===m._case||this.type===m._default?(i=this.type===m._case,e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),i?e.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,e.test=null),this.expect(m.colon)):(e||this.unexpected(),e.consequent.push(this.parseStatement(null)));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},s.parseThrowStatement=function(t){return this.next(),c.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")},[]),T=(s.parseTryStatement=function(t){var e,i;return this.next(),t.block=this.parseBlock(),t.handler=null,this.type===m._catch&&(e=this.startNode(),this.next(),this.eat(m.parenL)?(e.param=this.parseBindingAtom(),i="Identifier"===e.param.type,this.enterScope(i?32:0),this.checkLVal(e.param,i?4:2),this.expect(m.parenR)):(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0)),e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")),t.finalizer=this.eat(m._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},s.parseVarStatement=function(t,e){return this.next(),this.parseVar(t,!1,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")},s.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(A),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")},s.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")},s.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},s.parseLabeledStatement=function(t,e,i,n){for(var r=0,s=this.labels;r<s.length;r+=1)s[r].name===e&&this.raise(i.start,"Label '"+e+"' is already declared");for(var a=this.type.isLoop?"loop":this.type===m._switch?"switch":null,o=this.labels.length-1;0<=o;o--){var h=this.labels[o];if(h.statementStart!==t.start)break;h.statementStart=this.start,h.kind=a}return this.labels.push({name:e,kind:a,statementStart:this.start}),t.body=this.parseStatement(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")},s.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},s.parseBlock=function(t,e,i){for(void 0===t&&(t=!0),(e=void 0===e?this.startNode():e).body=[],this.expect(m.braceL),t&&this.enterScope(0);this.type!==m.braceR;){var n=this.parseStatement(null);e.body.push(n)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")},s.parseFor=function(t,e){return t.init=e,this.expect(m.semi),t.test=this.type===m.semi?null:this.parseExpression(),this.expect(m.semi),t.update=this.type===m.parenR?null:this.parseExpression(),this.expect(m.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")},s.parseForIn=function(t,e){var i=this.type===m._in;return this.next(),"VariableDeclaration"===e.type&&null!=e.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==e.kind||"Identifier"!==e.declarations[0].id.type)?this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===e.type&&this.raise(e.start,"Invalid left-hand side in for-loop"),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(m.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")},s.parseVar=function(t,e,i){for(t.declarations=[],t.kind=i;;){var n=this.startNode();if(this.parseVarId(n,i),this.eat(m.eq)?n.init=this.parseMaybeAssign(e):"const"!==i||this.type===m._in||6<=this.options.ecmaVersion&&this.isContextual("of")?"Identifier"===n.id.type||e&&(this.type===m._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),t.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(m.comma))break}return t},s.parseVarId=function(t,e){t.id=this.parseBindingAtom(),this.checkLVal(t.id,"var"===e?1:2,!1)},1),I=2,e=(s.parseFunction=function(t,e,i,n){this.initFunction(t),(9<=this.options.ecmaVersion||6<=this.options.ecmaVersion&&!n)&&(this.type===m.star&&e&I&&this.unexpected(),t.generator=this.eat(m.star)),8<=this.options.ecmaVersion&&(t.async=!!n),e&T&&(t.id=4&e&&this.type!==m.name?null:this.parseIdent(),!t.id||e&I||this.checkLVal(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?1:2:3));var n=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(S(t.async,t.generator)),e&T||(t.id=this.type===m.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=s,this.finishNode(t,e&T?"FunctionDeclaration":"FunctionExpression")},s.parseFunctionParams=function(t){this.expect(m.parenL),t.params=this.parseBindingList(m.parenR,!1,8<=this.options.ecmaVersion),this.checkYieldAwaitInDefaultParams()},s.parseClass=function(t,e){this.next();var i=this.strict,n=(this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t),this.startNode()),r=!1;for(n.body=[],this.expect(m.braceL);this.type!==m.braceR;){var s=this.parseClassElement(null!==t.superClass);s&&(n.body.push(s),"MethodDefinition"===s.type)&&"constructor"===s.kind&&(r&&this.raise(s.start,"Duplicate constructor in the same class"),r=!0)}return this.strict=i,this.next(),t.body=this.finishNode(n,"ClassBody"),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},s.parseClassElement=function(t){var r,e,i,n,s,a=this;return this.eat(m.semi)?null:(n=function(t,e){void 0===e&&(e=!1);var i=a.start,n=a.startLoc;if(a.eatContextual(t)){if(!(a.type===m.parenL||e&&a.canInsertSemicolon()))return!0;r.key&&a.unexpected(),r.computed=!1,r.key=a.startNodeAt(i,n),r.key.name=t,a.finishNode(r.key,"Identifier")}return!1},(r=this.startNode()).kind="method",r.static=n("static"),i=!1,(e=this.eat(m.star))||(8<=this.options.ecmaVersion&&n("async",!0)?(i=!0,e=9<=this.options.ecmaVersion&&this.eat(m.star)):n("get")?r.kind="get":n("set")&&(r.kind="set")),r.key||this.parsePropertyName(r),n=r.key,s=!1,r.computed||r.static||!("Identifier"===n.type&&"constructor"===n.name||"Literal"===n.type&&"constructor"===n.value)?r.static&&"Identifier"===n.type&&"prototype"===n.name&&this.raise(n.start,"Classes may not have a static property named prototype"):("method"!==r.kind&&this.raise(n.start,"Constructor can't have get/set modifier"),e&&this.raise(n.start,"Constructor can't be a generator"),i&&this.raise(n.start,"Constructor can't be an async method"),r.kind="constructor",s=t),this.parseClassMethod(r,e,i,s),"get"===r.kind&&0!==r.value.params.length&&this.raiseRecoverable(r.value.start,"getter should have no params"),"set"===r.kind&&1!==r.value.params.length&&this.raiseRecoverable(r.value.start,"setter should have exactly one param"),"set"===r.kind&&"RestElement"===r.value.params[0].type&&this.raiseRecoverable(r.value.params[0].start,"Setter cannot use rest params"),r)},s.parseClassMethod=function(t,e,i,n){return t.value=this.parseMethod(e,i,n),this.finishNode(t,"MethodDefinition")},s.parseClassId=function(t,e){this.type===m.name?(t.id=this.parseIdent(),e&&this.checkLVal(t.id,2,!1)):(!0===e&&this.unexpected(),t.id=null)},s.parseClassSuper=function(t){t.superClass=this.eat(m._extends)?this.parseExprSubscripts():null},s.parseExport=function(t,e){if(this.next(),this.eat(m.star))return 11<=this.options.ecmaVersion&&(this.eatContextual("as")?(t.exported=this.parseIdent(!0),this.checkExport(e,t.exported.name,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==m.string&&this.unexpected(),t.source=this.parseExprAtom(),this.semicolon(),this.finishNode(t,"ExportAllDeclaration");var i,n;if(this.eat(m._default))return this.checkExport(e,"default",this.lastTokStart),this.type===m._function||(i=this.isAsyncFunction())?(n=this.startNode(),this.next(),i&&this.next(),t.declaration=this.parseFunction(n,4|T,!1,i)):this.type===m._class?(n=this.startNode(),t.declaration=this.parseClass(n,"nullableID")):(t.declaration=this.parseMaybeAssign(),this.semicolon()),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseStatement(null),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id.name,t.declaration.id.start),t.specifiers=[],t.source=null;else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==m.string&&this.unexpected(),t.source=this.parseExprAtom();else{for(var r=0,s=t.specifiers;r<s.length;r+=1){var a=s[r];this.checkUnreserved(a.local),this.checkLocalExport(a.local)}t.source=null}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")},s.checkExport=function(t,e,i){t&&(_(t,e)&&this.raiseRecoverable(i,"Duplicate export '"+e+"'"),t[e]=!0)},s.checkPatternExport=function(t,e){var i=e.type;if("Identifier"===i)this.checkExport(t,e.name,e.start);else if("ObjectPattern"===i)for(var n=0,r=e.properties;n<r.length;n+=1){var s=r[n];this.checkPatternExport(t,s)}else if("ArrayPattern"===i)for(var a=0,o=e.elements;a<o.length;a+=1){var h=o[a];h&&this.checkPatternExport(t,h)}else"Property"===i?this.checkPatternExport(t,e.value):"AssignmentPattern"===i?this.checkPatternExport(t,e.left):"RestElement"===i?this.checkPatternExport(t,e.argument):"ParenthesizedExpression"===i&&this.checkPatternExport(t,e.expression)},s.checkVariableExport=function(t,e){if(t)for(var i=0,n=e;i<n.length;i+=1){var r=n[i];this.checkPatternExport(t,r.id)}},s.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},s.parseExportSpecifiers=function(t){var e=[],i=!0;for(this.expect(m.braceL);!this.eat(m.braceR);){if(i)i=!1;else if(this.expect(m.comma),this.afterTrailingComma(m.braceR))break;var n=this.startNode();n.local=this.parseIdent(!0),n.exported=this.eatContextual("as")?this.parseIdent(!0):n.local,this.checkExport(t,n.exported.name,n.exported.start),e.push(this.finishNode(n,"ExportSpecifier"))}return e},s.parseImport=function(t){return this.next(),this.type===m.string?(t.specifiers=$,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===m.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(t,"ImportDeclaration")},s.parseImportSpecifiers=function(){var t=[],e=!0;if(this.type===m.name){var i=this.startNode();if(i.local=this.parseIdent(),this.checkLVal(i.local,2),t.push(this.finishNode(i,"ImportDefaultSpecifier")),!this.eat(m.comma))return t}if(this.type===m.star)i=this.startNode(),this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLVal(i.local,2),t.push(this.finishNode(i,"ImportNamespaceSpecifier"));else for(this.expect(m.braceL);!this.eat(m.braceR);){if(e)e=!1;else if(this.expect(m.comma),this.afterTrailingComma(m.braceR))break;var n=this.startNode();n.imported=this.parseIdent(!0),this.eatContextual("as")?n.local=this.parseIdent():(this.checkUnreserved(n.imported),n.local=n.imported),this.checkLVal(n.local,2),t.push(this.finishNode(n,"ImportSpecifier"))}return t},s.adaptDirectivePrologue=function(t){for(var e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)},s.isDirectiveCandidate=function(t){return"ExpressionStatement"===t.type&&"Literal"===t.expression.type&&"string"==typeof t.expression.value&&('"'===this.input[t.start]||"'"===this.input[t.start])},C.prototype),s=(e.toAssignable=function(t,e,i){if(6<=this.options.ecmaVersion&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var n=0,r=t.properties;n<r.length;n+=1){var s=r[n];this.toAssignable(s,e),"RestElement"!==s.type||"ArrayPattern"!==s.argument.type&&"ObjectPattern"!==s.argument.type||this.raise(s.argument.start,"Unexpected token")}break;case"Property":"init"!==t.kind&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),"AssignmentPattern"===t.argument.type&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==t.operator&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,i);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return t},e.toAssignableList=function(t,e){for(var i,n=t.length,r=0;r<n;r++){var s=t[r];s&&this.toAssignable(s,e)}return n&&(i=t[n-1],6===this.options.ecmaVersion)&&e&&i&&"RestElement"===i.type&&"Identifier"!==i.argument.type&&this.unexpected(i.argument.start),t},e.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")},e.parseRestBinding=function(){var t=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==m.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")},e.parseBindingAtom=function(){if(6<=this.options.ecmaVersion)switch(this.type){case m.bracketL:var t=this.startNode();return this.next(),t.elements=this.parseBindingList(m.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case m.braceL:return this.parseObj(!0)}return this.parseIdent()},e.parseBindingList=function(t,e,i){for(var n=[],r=!0;!this.eat(t);)if(r?r=!1:this.expect(m.comma),e&&this.type===m.comma)n.push(null);else{if(i&&this.afterTrailingComma(t))break;if(this.type===m.ellipsis){var s=this.parseRestBinding();this.parseBindingListItem(s),n.push(s),this.type===m.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(t);break}s=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(s),n.push(s)}return n},e.parseBindingListItem=function(t){return t},e.parseMaybeDefault=function(t,e,i){return i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(m.eq)?i:((t=this.startNodeAt(t,e)).left=i,t.right=this.parseMaybeAssign(),this.finishNode(t,"AssignmentPattern"))},e.checkLVal=function(t,e,i){switch(void 0===e&&(e=0),t.type){case"Identifier":2===e&&"let"===t.name&&this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name"),this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(e?"Binding ":"Assigning to ")+t.name+" in strict mode"),i&&(_(i,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),i[t.name]=!0),0!==e&&5!==e&&this.declareName(t.name,e,t.start);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":e&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ObjectPattern":for(var n=0,r=t.properties;n<r.length;n+=1){var s=r[n];this.checkLVal(s,e,i)}break;case"Property":this.checkLVal(t.value,e,i);break;case"ArrayPattern":for(var a=0,o=t.elements;a<o.length;a+=1){var h=o[a];h&&this.checkLVal(h,e,i)}break;case"AssignmentPattern":this.checkLVal(t.left,e,i);break;case"RestElement":this.checkLVal(t.argument,e,i);break;case"ParenthesizedExpression":this.checkLVal(t.expression,e,i);break;default:this.raise(t.start,(e?"Binding":"Assigning to")+" rvalue")}},C.prototype),Y=(s.checkPropClash=function(t,e,i){if(!(9<=this.options.ecmaVersion&&"SpreadElement"===t.type||6<=this.options.ecmaVersion&&(t.computed||t.method||t.shorthand))){var n=t.key;switch(n.type){case"Identifier":r=n.name;break;case"Literal":r=String(n.value);break;default:return}var r,t=t.kind;6<=this.options.ecmaVersion?"__proto__"===r&&"init"===t&&(e.proto&&(i?i.doubleProto<0&&(i.doubleProto=n.start):this.raiseRecoverable(n.start,"Redefinition of __proto__ property")),e.proto=!0):((i=e[r="$"+r])?("init"===t?this.strict&&i.init||i.get||i.set:i.init||i[t])&&this.raiseRecoverable(n.start,"Redefinition of property"):i=e[r]={init:!1,get:!1,set:!1},i[t]=!0)}},s.parseExpression=function(t,e){var i=this.start,n=this.startLoc,r=this.parseMaybeAssign(t,e);if(this.type!==m.comma)return r;var s=this.startNodeAt(i,n);for(s.expressions=[r];this.eat(m.comma);)s.expressions.push(this.parseMaybeAssign(t,e));return this.finishNode(s,"SequenceExpression")},s.parseMaybeAssign=function(t,e,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}var n=!1,r=-1,s=-1,a=(e?(r=e.parenthesizedAssign,s=e.trailingComma,e.parenthesizedAssign=e.trailingComma=-1):(e=new k,n=!0),this.start),o=this.startLoc,h=(this.type!==m.parenL&&this.type!==m.name||(this.potentialArrowAt=this.start),this.parseMaybeConditional(t,e));return i&&(h=i.call(this,h,a,o)),this.type.isAssign?((i=this.startNodeAt(a,o)).operator=this.value,i.left=this.type===m.eq?this.toAssignable(h,!1,e):h,n||(e.parenthesizedAssign=e.trailingComma=e.doubleProto=-1),e.shorthandAssign>=i.left.start&&(e.shorthandAssign=-1),this.checkLVal(h),this.next(),i.right=this.parseMaybeAssign(t),this.finishNode(i,"AssignmentExpression")):(n&&this.checkExpressionErrors(e,!0),-1<r&&(e.parenthesizedAssign=r),-1<s&&(e.trailingComma=s),h)},s.parseMaybeConditional=function(t,e){var i=this.start,n=this.startLoc,r=this.parseExprOps(t,e);return!this.checkExpressionErrors(e)&&this.eat(m.question)?((e=this.startNodeAt(i,n)).test=r,e.consequent=this.parseMaybeAssign(),this.expect(m.colon),e.alternate=this.parseMaybeAssign(t),this.finishNode(e,"ConditionalExpression")):r},s.parseExprOps=function(t,e){var i=this.start,n=this.startLoc,r=this.parseMaybeUnary(e,!1);return this.checkExpressionErrors(e)||r.start===i&&"ArrowFunctionExpression"===r.type?r:this.parseExprOp(r,i,n,-1,t)},s.parseExprOp=function(t,e,i,n,r){var s,a,o,h,l,u=this.type.binop;if(null!=u&&(!r||this.type!==m._in)&&n<u)return s=this.type===m.logicalOR||this.type===m.logicalAND,(a=this.type===m.coalesce)&&(u=m.logicalAND.binop),o=this.value,this.next(),h=this.start,l=this.startLoc,h=this.parseExprOp(this.parseMaybeUnary(null,!1),h,l,u,r),l=this.buildBinary(e,i,t,h,o,s||a),(s&&this.type===m.coalesce||a&&(this.type===m.logicalOR||this.type===m.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(l,e,i,n,r);return t},s.buildBinary=function(t,e,i,n,r,s){t=this.startNodeAt(t,e);return t.left=i,t.operator=r,t.right=n,this.finishNode(t,s?"LogicalExpression":"BinaryExpression")},s.parseMaybeUnary=function(t,e){var i,n=this.start,r=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))i=this.parseAwait(),e=!0;else if(this.type.prefix){var s=this.startNode(),a=this.type===m.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),a?this.checkLVal(s.argument):this.strict&&"delete"===s.operator&&"Identifier"===s.argument.type?this.raiseRecoverable(s.start,"Deleting local variable in strict mode"):e=!0,i=this.finishNode(s,a?"UpdateExpression":"UnaryExpression")}else{if(i=this.parseExprSubscripts(t),this.checkExpressionErrors(t))return i;for(;this.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(n,r);o.operator=this.value,o.prefix=!1,o.argument=i,this.checkLVal(i),this.next(),i=this.finishNode(o,"UpdateExpression")}}return!e&&this.eat(m.starstar)?this.buildBinary(n,r,i,this.parseMaybeUnary(null,!1),"**",!1):i},s.parseExprSubscripts=function(t){var e=this.start,i=this.startLoc,n=this.parseExprAtom(t);return"ArrowFunctionExpression"===n.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd)||(n=this.parseSubscripts(n,e,i),t&&"MemberExpression"===n.type&&(t.parenthesizedAssign>=n.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=n.start)&&(t.parenthesizedBind=-1)),n},s.parseSubscripts=function(t,e,i,n){for(var r=8<=this.options.ecmaVersion&&"Identifier"===t.type&&"async"===t.name&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start==5&&this.potentialArrowAt===t.start,s=!1;;){var a,o=this.parseSubscript(t,e,i,n,r,s);if(o.optional&&(s=!0),o===t||"ArrowFunctionExpression"===o.type)return s&&((a=this.startNodeAt(e,i)).expression=o,o=this.finishNode(a,"ChainExpression")),o;t=o}},s.parseSubscript=function(t,e,i,n,r,s){var a=11<=this.options.ecmaVersion,o=a&&this.eat(m.questionDot),h=(n&&o&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions"),this.eat(m.bracketL));if(h||o&&this.type!==m.parenL&&this.type!==m.backQuote||this.eat(m.dot)){var l=this.startNodeAt(e,i);l.object=t,l.property=h?this.parseExpression():this.parseIdent("never"!==this.options.allowReserved),l.computed=!!h,h&&this.expect(m.bracketR),a&&(l.optional=o),t=this.finishNode(l,"MemberExpression")}else if(!n&&this.eat(m.parenL)){var h=new k,l=this.yieldPos,n=this.awaitPos,u=this.awaitIdentPos,c=(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.parseExprList(m.parenR,8<=this.options.ecmaVersion,!1,h));if(r&&!o&&!this.canInsertSemicolon()&&this.eat(m.arrow))return this.checkPatternErrors(h,!1),this.checkYieldAwaitInDefaultParams(),0<this.awaitIdentPos&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=l,this.awaitPos=n,this.awaitIdentPos=u,this.parseArrowExpression(this.startNodeAt(e,i),c,!0);this.checkExpressionErrors(h,!0),this.yieldPos=l||this.yieldPos,this.awaitPos=n||this.awaitPos,this.awaitIdentPos=u||this.awaitIdentPos;r=this.startNodeAt(e,i);r.callee=t,r.arguments=c,a&&(r.optional=o),t=this.finishNode(r,"CallExpression")}else this.type===m.backQuote&&((o||s)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions"),(h=this.startNodeAt(e,i)).tag=t,h.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(h,"TaggedTemplateExpression"));return t},s.parseExprAtom=function(t){this.type===m.slash&&this.readRegexp();var e=this.potentialArrowAt===this.start;switch(this.type){case m._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),a=this.startNode(),this.next(),this.type!==m.parenL||this.allowDirectSuper||this.raise(a.start,"super() call outside constructor of a subclass"),this.type!==m.dot&&this.type!==m.bracketL&&this.type!==m.parenL&&this.unexpected(),this.finishNode(a,"Super");case m._this:return a=this.startNode(),this.next(),this.finishNode(a,"ThisExpression");case m.name:var i=this.start,n=this.startLoc,r=this.containsEsc,s=this.parseIdent(!1);if(8<=this.options.ecmaVersion&&!r&&"async"===s.name&&!this.canInsertSemicolon()&&this.eat(m._function))return this.parseFunction(this.startNodeAt(i,n),0,!1,!0);if(e&&!this.canInsertSemicolon()){if(this.eat(m.arrow))return this.parseArrowExpression(this.startNodeAt(i,n),[s],!1);if(8<=this.options.ecmaVersion&&"async"===s.name&&this.type===m.name&&!r)return s=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(m.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,n),[s],!0)}return s;case m.regexp:var a,r=this.value;return(a=this.parseLiteral(r.value)).regex={pattern:r.pattern,flags:r.flags},a;case m.num:case m.string:return this.parseLiteral(this.value);case m._null:case m._true:case m._false:return(a=this.startNode()).value=this.type===m._null?null:this.type===m._true,a.raw=this.type.keyword,this.next(),this.finishNode(a,"Literal");case m.parenL:i=this.start,n=this.parseParenAndDistinguishExpression(e);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(n)&&(t.parenthesizedAssign=i),t.parenthesizedBind<0)&&(t.parenthesizedBind=i),n;case m.bracketL:return a=this.startNode(),this.next(),a.elements=this.parseExprList(m.bracketR,!0,!0,t),this.finishNode(a,"ArrayExpression");case m.braceL:return this.parseObj(!1,t);case m._function:return a=this.startNode(),this.next(),this.parseFunction(a,0);case m._class:return this.parseClass(this.startNode(),!1);case m._new:return this.parseNew();case m.backQuote:return this.parseTemplate();case m._import:return 11<=this.options.ecmaVersion?this.parseExprImport():this.unexpected();default:this.unexpected()}},s.parseExprImport=function(){var t=this.startNode(),e=(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.parseIdent(!0));switch(this.type){case m.parenL:return this.parseDynamicImport(t);case m.dot:return t.meta=e,this.parseImportMeta(t);default:this.unexpected()}},s.parseDynamicImport=function(t){var e;return this.next(),t.source=this.parseMaybeAssign(),this.eat(m.parenR)||(e=this.start,this.eat(m.comma)&&this.eat(m.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)),this.finishNode(t,"ImportExpression")},s.parseImportMeta=function(t){this.next();var e=this.containsEsc;return t.property=this.parseIdent(!0),"meta"!==t.property.name&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")},s.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),110===e.raw.charCodeAt(e.raw.length-1)&&(e.bigint=e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")},s.parseParenExpression=function(){this.expect(m.parenL);var t=this.parseExpression();return this.expect(m.parenR),t},s.parseParenAndDistinguishExpression=function(t){var e,i=this.start,n=this.startLoc,r=8<=this.options.ecmaVersion;if(6<=this.options.ecmaVersion){this.next();var s,a=this.start,o=this.startLoc,h=[],l=!0,u=!1,c=new k,d=this.yieldPos,f=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==m.parenR;){if(l?l=!1:this.expect(m.comma),r&&this.afterTrailingComma(m.parenR,!0)){u=!0;break}if(this.type===m.ellipsis){s=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===m.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}h.push(this.parseMaybeAssign(!1,c,this.parseParenItem))}var p=this.start,g=this.startLoc;if(this.expect(m.parenR),t&&!this.canInsertSemicolon()&&this.eat(m.arrow))return this.checkPatternErrors(c,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=f,this.parseParenArrowList(i,n,h);h.length&&!u||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(c,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=f||this.awaitPos,1<h.length?((e=this.startNodeAt(a,o)).expressions=h,this.finishNodeAt(e,"SequenceExpression",p,g)):e=h[0]}else e=this.parseParenExpression();return this.options.preserveParens?((t=this.startNodeAt(i,n)).expression=e,this.finishNode(t,"ParenthesizedExpression")):e},s.parseParenItem=function(t){return t},s.parseParenArrowList=function(t,e,i){return this.parseArrowExpression(this.startNodeAt(t,e),i)},[]),e=(s.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t,e,i=this.startNode(),n=this.parseIdent(!0);return 6<=this.options.ecmaVersion&&this.eat(m.dot)?(i.meta=n,n=this.containsEsc,i.property=this.parseIdent(!0),"target"!==i.property.name&&this.raiseRecoverable(i.property.start,"The only valid meta property for new is 'new.target'"),n&&this.raiseRecoverable(i.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(i.start,"'new.target' can only be used in functions"),this.finishNode(i,"MetaProperty")):(n=this.start,t=this.startLoc,e=this.type===m._import,i.callee=this.parseSubscripts(this.parseExprAtom(),n,t,!0),e&&"ImportExpression"===i.callee.type&&this.raise(n,"Cannot use new with import()"),this.eat(m.parenL)?i.arguments=this.parseExprList(m.parenR,8<=this.options.ecmaVersion,!1):i.arguments=Y,this.finishNode(i,"NewExpression"))},s.parseTemplateElement=function(t){var t=t.isTagged,e=this.startNode();return this.type===m.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),e.value={raw:this.value,cooked:null}):e.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),e.tail=this.type===m.backQuote,this.finishNode(e,"TemplateElement")},s.parseTemplate=function(t){var e=(t=void 0===t?{}:t).isTagged,i=(void 0===e&&(e=!1),this.startNode()),n=(this.next(),i.expressions=[],this.parseTemplateElement({isTagged:e}));for(i.quasis=[n];!n.tail;)this.type===m.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(m.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(m.braceR),i.quasis.push(n=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(i,"TemplateLiteral")},s.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.key.name&&(this.type===m.name||this.type===m.num||this.type===m.string||this.type===m.bracketL||this.type.keyword||9<=this.options.ecmaVersion&&this.type===m.star)&&!c.test(this.input.slice(this.lastTokEnd,this.start))},s.parseObj=function(t,e){var i=this.startNode(),n=!0,r={};for(i.properties=[],this.next();!this.eat(m.braceR);){if(n)n=!1;else if(this.expect(m.comma),5<=this.options.ecmaVersion&&this.afterTrailingComma(m.braceR))break;var s=this.parseProperty(t,e);t||this.checkPropClash(s,r,e),i.properties.push(s)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")},s.parseProperty=function(t,e){var i,n,r,s,a=this.startNode();if(9<=this.options.ecmaVersion&&this.eat(m.ellipsis))return t?(a.argument=this.parseIdent(!1),this.type===m.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(this.type===m.parenL&&e&&(e.parenthesizedAssign<0&&(e.parenthesizedAssign=this.start),e.parenthesizedBind<0)&&(e.parenthesizedBind=this.start),a.argument=this.parseMaybeAssign(!1,e),this.type===m.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(a,"SpreadElement"));6<=this.options.ecmaVersion&&(a.method=!1,a.shorthand=!1,(t||e)&&(r=this.start,s=this.startLoc),t||(i=this.eat(m.star)));var o=this.containsEsc;return this.parsePropertyName(a),!t&&!o&&8<=this.options.ecmaVersion&&!i&&this.isAsyncProp(a)?(n=!0,i=9<=this.options.ecmaVersion&&this.eat(m.star),this.parsePropertyName(a,e)):n=!1,this.parsePropertyValue(a,t,i,n,r,s,e,o),this.finishNode(a,"Property")},s.parsePropertyValue=function(t,e,i,n,r,s,a,o){(i||n)&&this.type===m.colon&&this.unexpected(),this.eat(m.colon)?(t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),t.kind="init"):6<=this.options.ecmaVersion&&this.type===m.parenL?(e&&this.unexpected(),t.kind="init",t.method=!0,t.value=this.parseMethod(i,n)):e||o||!(5<=this.options.ecmaVersion)||t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||this.type===m.comma||this.type===m.braceR||this.type===m.eq?6<=this.options.ecmaVersion&&!t.computed&&"Identifier"===t.key.type?((i||n)&&this.unexpected(),this.checkUnreserved(t.key),"await"!==t.key.name||this.awaitIdentPos||(this.awaitIdentPos=r),t.kind="init",e?t.value=this.parseMaybeDefault(r,s,t.key):this.type===m.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),t.value=this.parseMaybeDefault(r,s,t.key)):t.value=t.key,t.shorthand=!0):this.unexpected():((i||n)&&this.unexpected(),t.kind=t.key.name,this.parsePropertyName(t),t.value=this.parseMethod(!1),o="get"===t.kind?0:1,t.value.params.length!==o?(e=t.value.start,"get"===t.kind?this.raiseRecoverable(e,"getter should have no params"):this.raiseRecoverable(e,"setter should have exactly one param")):"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params"))},s.parsePropertyName=function(t){if(6<=this.options.ecmaVersion){if(this.eat(m.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(m.bracketR),t.key;t.computed=!1}return t.key=this.type===m.num||this.type===m.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},s.initFunction=function(t){t.id=null,6<=this.options.ecmaVersion&&(t.generator=t.expression=!1),8<=this.options.ecmaVersion&&(t.async=!1)},s.parseMethod=function(t,e,i){var n=this.startNode(),r=this.yieldPos,s=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(n),6<=this.options.ecmaVersion&&(n.generator=t),8<=this.options.ecmaVersion&&(n.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|S(e,n.generator)|(i?128:0)),this.expect(m.parenL),n.params=this.parseBindingList(m.parenR,!1,8<=this.options.ecmaVersion),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0),this.yieldPos=r,this.awaitPos=s,this.awaitIdentPos=a,this.finishNode(n,"FunctionExpression")},s.parseArrowExpression=function(t,e,i){var n=this.yieldPos,r=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|S(i,!1)),this.initFunction(t),8<=this.options.ecmaVersion&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=s,this.finishNode(t,"ArrowFunctionExpression")},s.parseFunctionBody=function(t,e,i){var n=e&&this.type!==m.braceL,r=this.strict,s=!1;n?(t.body=this.parseMaybeAssign(),t.expression=!0,this.checkParams(t,!1)):(n=7<=this.options.ecmaVersion&&!this.isSimpleParamList(t.params),r&&!n||(s=this.strictDirective(this.end))&&n&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list"),n=this.labels,this.labels=[],s&&(this.strict=!0),this.checkParams(t,!r&&!s&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLVal(t.id,5),t.body=this.parseBlock(!1,void 0,s&&!r),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=n),this.exitScope()},s.isSimpleParamList=function(t){for(var e=0,i=t;e<i.length;e+=1)if("Identifier"!==i[e].type)return!1;return!0},s.checkParams=function(t,e){for(var i={},n=0,r=t.params;n<r.length;n+=1){var s=r[n];this.checkLVal(s,1,e?null:i)}},s.parseExprList=function(t,e,i,n){for(var r=[],s=!0;!this.eat(t);){if(s)s=!1;else if(this.expect(m.comma),e&&this.afterTrailingComma(t))break;var a=void 0;i&&this.type===m.comma?a=null:this.type===m.ellipsis?(a=this.parseSpread(n),n&&this.type===m.comma&&n.trailingComma<0&&(n.trailingComma=this.start)):a=this.parseMaybeAssign(!1,n),r.push(a)}return r},s.checkUnreserved=function(t){var e=t.start,i=t.end,t=t.name;this.inGenerator&&"yield"===t&&this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===t&&this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(t)&&this.raise(e,"Unexpected keyword '"+t+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(e,i).indexOf("\\")||(this.strict?this.reservedWordsStrict:this.reservedWords).test(t)&&(this.inAsync||"await"!==t||this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(e,"The keyword '"+t+"' is reserved"))},s.parseIdent=function(t,e){var i=this.startNode();return this.type===m.name?i.name=this.value:this.type.keyword?(i.name=this.type.keyword,"class"!==i.name&&"function"!==i.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(!!t),this.finishNode(i,"Identifier"),t||(this.checkUnreserved(i),"await"!==i.name)||this.awaitIdentPos||(this.awaitIdentPos=i.start),i},s.parseYield=function(t){this.yieldPos||(this.yieldPos=this.start);var e=this.startNode();return this.next(),this.type===m.semi||this.canInsertSemicolon()||this.type!==m.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(m.star),e.argument=this.parseMaybeAssign(t)),this.finishNode(e,"YieldExpression")},s.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!1),this.finishNode(t,"AwaitExpression")},C.prototype),s=(e.raise=function(t,e){var i=w(this.input,t),e=(e+=" ("+i.line+":"+i.column+")",new SyntaxError(e));throw e.pos=t,e.loc=i,e.raisedAt=this.pos,e},e.raiseRecoverable=e.raise,e.curPosition=function(){if(this.options.locations)return new y(this.curLine,this.pos-this.lineStart)},C.prototype),e=(s.enterScope=function(t){this.scopeStack.push(new K(t))},s.exitScope=function(){this.scopeStack.pop()},s.treatFunctionsAsVarInScope=function(t){return 2&t.flags||!this.inModule&&1&t.flags},s.declareName=function(t,e,i){var n=!1;if(2===e){var r=this.currentScope(),n=-1<r.lexical.indexOf(t)||-1<r.functions.indexOf(t)||-1<r.var.indexOf(t);r.lexical.push(t),this.inModule&&1&r.flags&&delete this.undefinedExports[t]}else if(4===e)this.currentScope().lexical.push(t);else if(3===e){r=this.currentScope();n=this.treatFunctionsAsVar?-1<r.lexical.indexOf(t):-1<r.lexical.indexOf(t)||-1<r.var.indexOf(t),r.functions.push(t)}else for(var s=this.scopeStack.length-1;0<=s;--s){var a=this.scopeStack[s];if(-1<a.lexical.indexOf(t)&&!(32&a.flags&&a.lexical[0]===t)||!this.treatFunctionsAsVarInScope(a)&&-1<a.functions.indexOf(t)){n=!0;break}if(a.var.push(t),this.inModule&&1&a.flags&&delete this.undefinedExports[t],3&a.flags)break}n&&this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")},s.checkLocalExport=function(t){-1===this.scopeStack[0].lexical.indexOf(t.name)&&-1===this.scopeStack[0].var.indexOf(t.name)&&(this.undefinedExports[t.name]=t)},s.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},s.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(3&e.flags)return e}},s.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(3&e.flags&&!(16&e.flags))return e}},C.prototype);function X(t,e,i,n){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=n),this.options.ranges&&(t.range[1]=i),t}e.startNode=function(){return new E(this,this.start,this.startLoc)},e.startNodeAt=function(t,e){return new E(this,t,e)},e.finishNode=function(t,e){return X.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};function L(t,e,i,n,r){this.token=t,this.isExpr=!!e,this.preserveSpace=!!i,this.override=n,this.generator=!!r}var P={b_stat:new L("{",!(e.finishNodeAt=function(t,e,i,n){return X.call(this,t,e,i,n)})),b_expr:new L("{",!0),b_tmpl:new L("${",!1),p_stat:new L("(",!1),p_expr:new L("(",!0),q_tmpl:new L("`",!0,!0,function(t){return t.tryReadTemplateToken()}),f_stat:new L("function",!1),f_expr:new L("function",!0),f_expr_gen:new L("function",!0,!1,null,!0),f_gen:new L("function",!1,!1,null,!0)},s=C.prototype,e=(s.initialContext=function(){return[P.b_stat]},s.braceIsBlock=function(t){var e=this.curContext();return e===P.f_expr||e===P.f_stat||(t!==m.colon||e!==P.b_stat&&e!==P.b_expr?t===m._return||t===m.name&&this.exprAllowed?c.test(this.input.slice(this.lastTokEnd,this.start)):t===m._else||t===m.semi||t===m.eof||t===m.parenR||t===m.arrow||(t===m.braceL?e===P.b_stat:t!==m._var&&t!==m._const&&t!==m.name&&!this.exprAllowed):!e.isExpr)},s.inGeneratorContext=function(){for(var t=this.context.length-1;1<=t;t--){var e=this.context[t];if("function"===e.token)return e.generator}return!1},s.updateContext=function(t){var e,i=this.type;i.keyword&&t===m.dot?this.exprAllowed=!1:(e=i.updateContext)?e.call(this,t):this.exprAllowed=i.beforeExpr},m.parenR.updateContext=m.braceR.updateContext=function(){var t;1===this.context.length?this.exprAllowed=!0:((t=this.context.pop())===P.b_stat&&"function"===this.curContext().token&&(t=this.context.pop()),this.exprAllowed=!t.isExpr)},m.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?P.b_stat:P.b_expr),this.exprAllowed=!0},m.dollarBraceL.updateContext=function(){this.context.push(P.b_tmpl),this.exprAllowed=!0},m.parenL.updateContext=function(t){t=t===m._if||t===m._for||t===m._with||t===m._while;this.context.push(t?P.p_stat:P.p_expr),this.exprAllowed=!0},m.incDec.updateContext=function(){},m._function.updateContext=m._class.updateContext=function(t){!t.beforeExpr||t===m.semi||t===m._else||t===m._return&&c.test(this.input.slice(this.lastTokEnd,this.start))||(t===m.colon||t===m.braceL)&&this.curContext()===P.b_stat?this.context.push(P.f_stat):this.context.push(P.f_expr),this.exprAllowed=!1},m.backQuote.updateContext=function(){this.curContext()===P.q_tmpl?this.context.pop():this.context.push(P.q_tmpl),this.exprAllowed=!1},m.star.updateContext=function(t){t===m._function&&(t=this.context.length-1,this.context[t]===P.f_expr?this.context[t]=P.f_expr_gen:this.context[t]=P.f_gen),this.exprAllowed=!0},m.name.updateContext=function(t){var e=!1;6<=this.options.ecmaVersion&&t!==m.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e},"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"),s=e+" Extended_Pictographic",Q={9:e,10:s,11:"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS Extended_Pictographic"},J="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",e="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",s=e+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",tt={9:e,10:s,11:"Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},et={};function it(t){t=et[t]={binary:v(Q[t]+" "+J),nonBinary:{General_Category:v(J),Script:v(tt[t])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}it(9),it(10),it(11);function O(t){this.parser=t,this.validFlags="gim"+(6<=t.options.ecmaVersion?"uy":"")+(9<=t.options.ecmaVersion?"s":""),this.unicodeProperties=et[11<=t.options.ecmaVersion?11:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]}e=C.prototype;function M(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function nt(t){return 36===t||40<=t&&t<=43||46===t||63===t||91<=t&&t<=94||123<=t&&t<=125}function rt(t){return 65<=t&&t<=90||97<=t&&t<=122}function st(t){return rt(t)||95===t}function N(t){return 48<=t&&t<=57}function at(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function ot(t){return 65<=t&&t<=70?t-65+10:97<=t&&t<=102?t-97+10:t-48}function ht(t){return 48<=t&&t<=55}O.prototype.reset=function(t,e,i){var n=-1!==i.indexOf("u");this.start=0|t,this.source=e+"",this.flags=i,this.switchU=n&&6<=this.parser.options.ecmaVersion,this.switchN=n&&9<=this.parser.options.ecmaVersion},O.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},O.prototype.at=function(t,e){void 0===e&&(e=!1);var i,n=this.source,r=n.length;return r<=t?-1:(i=n.charCodeAt(t),!(!e&&!this.switchU||i<=55295||57344<=i||r<=t+1)&&56320<=(e=n.charCodeAt(t+1))&&e<=57343?(i<<10)+e-56613888:i)},O.prototype.nextIndex=function(t,e){void 0===e&&(e=!1);var i,n=this.source,r=n.length;return r<=t?r:(i=n.charCodeAt(t),!e&&!this.switchU||i<=55295||57344<=i||r<=t+1||(e=n.charCodeAt(t+1))<56320||57343<e?t+1:t+2)},O.prototype.current=function(t){return this.at(this.pos,t=void 0===t?!1:t)},O.prototype.lookahead=function(t){return this.at(this.nextIndex(this.pos,t=void 0===t?!1:t),t)},O.prototype.advance=function(t){this.pos=this.nextIndex(this.pos,t=void 0===t?!1:t)},O.prototype.eat=function(t,e){return this.current(e=void 0===e?!1:e)===t&&(this.advance(e),!0)},e.validateRegExpFlags=function(t){for(var e=t.validFlags,i=t.flags,n=0;n<i.length;n++){var r=i.charAt(n);-1===e.indexOf(r)&&this.raise(t.start,"Invalid regular expression flag"),-1<i.indexOf(r,n+1)&&this.raise(t.start,"Duplicate regular expression flag")}},e.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&9<=this.options.ecmaVersion&&0<t.groupNames.length&&(t.switchN=!0,this.regexp_pattern(t))},e.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames.length=0,t.backReferenceNames.length=0,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets"),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,i=t.backReferenceNames;e<i.length;e+=1){var n=i[e];-1===t.groupNames.indexOf(n)&&t.raise("Invalid named capture referenced")}},e.regexp_disjunction=function(t){for(this.regexp_alternative(t);t.eat(124);)this.regexp_alternative(t);this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")},e.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););},e.regexp_eatTerm=function(t){return this.regexp_eatAssertion(t)?(t.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(t)&&t.switchU&&t.raise("Invalid quantifier"),!0):!(t.switchU?!this.regexp_eatAtom(t):!this.regexp_eatExtendedAtom(t))&&(this.regexp_eatQuantifier(t),!0)},e.regexp_eatAssertion=function(t){var e=t.pos;if(t.lastAssertionIsQuantifiable=!1,t.eat(94)||t.eat(36))return!0;if(t.eat(92)){if(t.eat(66)||t.eat(98))return!0;t.pos=e}if(t.eat(40)&&t.eat(63)){var i=!1;if(9<=this.options.ecmaVersion&&(i=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!i,!0}return t.pos=e,!1},e.regexp_eatQuantifier=function(t,e){return!!this.regexp_eatQuantifierPrefix(t,e=void 0===e?!1:e)&&(t.eat(63),!0)},e.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)},e.regexp_eatBracedQuantifier=function(t,e){var i=t.pos;if(t.eat(123)){var n,r=-1;if(this.regexp_eatDecimalDigits(t)&&(n=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(r=t.lastIntValue),t.eat(125)))return-1!==r&&r<n&&!e&&t.raise("numbers out of order in {} quantifier"),!0;t.switchU&&!e&&t.raise("Incomplete quantifier"),t.pos=i}return!1},e.regexp_eatAtom=function(t){return this.regexp_eatPatternCharacters(t)||t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)},e.regexp_eatReverseSolidusAtomEscape=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1},e.regexp_eatUncapturingGroup=function(t){var e=t.pos;if(t.eat(40)){if(t.eat(63)&&t.eat(58)){if(this.regexp_disjunction(t),t.eat(41))return!0;t.raise("Unterminated group")}t.pos=e}return!1},e.regexp_eatCapturingGroup=function(t){if(t.eat(40)){if(9<=this.options.ecmaVersion?this.regexp_groupSpecifier(t):63===t.current()&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1},e.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)},e.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1},e.regexp_eatSyntaxCharacter=function(t){var e=t.current();return!!nt(e)&&(t.lastIntValue=e,t.advance(),!0)},e.regexp_eatPatternCharacters=function(t){for(var e,i=t.pos;-1!==(e=t.current())&&!nt(e);)t.advance();return t.pos!==i},e.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return!(-1===e||36===e||40<=e&&e<=43||46===e||63===e||91===e||94===e||124===e||(t.advance(),0))},e.regexp_groupSpecifier=function(t){t.eat(63)&&(this.regexp_eatGroupName(t)?(-1!==t.groupNames.indexOf(t.lastStringValue)&&t.raise("Duplicate capture group name"),t.groupNames.push(t.lastStringValue)):t.raise("Invalid group"))},e.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1},e.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=M(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=M(t.lastIntValue);return!0}return!1},e.regexp_eatRegExpIdentifierStart=function(t){var e=t.pos,i=11<=this.options.ecmaVersion,n=t.current(i);return t.advance(i),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(n=t.lastIntValue),o(i=n,!0)||36===i||95===i?(t.lastIntValue=n,!0):(t.pos=e,!1)},e.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,i=11<=this.options.ecmaVersion,n=t.current(i);return t.advance(i),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(n=t.lastIntValue),h(i=n,!0)||36===i||95===i||8204===i||8205===i?(t.lastIntValue=n,!0):(t.pos=e,!1)},e.regexp_eatAtomEscape=function(t){return!!(this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t))||(t.switchU&&(99===t.current()&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)},e.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1},e.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1},e.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)},e.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1},e.regexp_eatZero=function(t){return 48===t.current()&&!N(t.lookahead())&&(t.lastIntValue=0,t.advance(),!0)},e.regexp_eatControlEscape=function(t){var e=t.current();return 116===e?(t.lastIntValue=9,t.advance(),!0):110===e?(t.lastIntValue=10,t.advance(),!0):118===e?(t.lastIntValue=11,t.advance(),!0):102===e?(t.lastIntValue=12,t.advance(),!0):114===e&&(t.lastIntValue=13,t.advance(),!0)},e.regexp_eatControlLetter=function(t){var e=t.current();return!!rt(e)&&(t.lastIntValue=e%32,t.advance(),!0)},e.regexp_eatRegExpUnicodeEscapeSequence=function(t,e){var i=t.pos,e=(e=void 0===e?!1:e)||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var n=t.lastIntValue;if(e&&55296<=n&&n<=56319){var r=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var s=t.lastIntValue;if(56320<=s&&s<=57343)return t.lastIntValue=1024*(n-55296)+(s-56320)+65536,!0}t.pos=r,t.lastIntValue=n}return!0}if(e&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&0<=(s=t.lastIntValue)&&s<=1114111)return!0;e&&t.raise("Invalid unicode escape"),t.pos=i}return!1},e.regexp_eatIdentityEscape=function(t){var e;return t.switchU?!!this.regexp_eatSyntaxCharacter(t)||!!t.eat(47)&&(t.lastIntValue=47,!0):!(99===(e=t.current())||t.switchN&&107===e||(t.lastIntValue=e,t.advance(),0))},e.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(49<=e&&e<=57){for(;t.lastIntValue=10*t.lastIntValue+(e-48),t.advance(),48<=(e=t.current())&&e<=57;);return!0}return!1},e.regexp_eatCharacterClassEscape=function(t){var e,i=t.current();if(100===(e=i)||68===e||115===e||83===e||119===e||87===e)return t.lastIntValue=-1,t.advance(),!0;if(t.switchU&&9<=this.options.ecmaVersion&&(80===i||112===i)){if(t.lastIntValue=-1,t.advance(),t.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(t)&&t.eat(125))return!0;t.raise("Invalid property name")}return!1},e.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var i,n=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t))return i=t.lastStringValue,this.regexp_validateUnicodePropertyNameAndValue(t,n,i),!0}return t.pos=e,!!this.regexp_eatLoneUnicodePropertyNameOrValue(t)&&(n=t.lastStringValue,this.regexp_validateUnicodePropertyNameOrValue(t,n),!0)},e.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){_(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")},e.regexp_validateUnicodePropertyNameOrValue=function(t,e){t.unicodeProperties.binary.test(e)||t.raise("Invalid property name")},e.regexp_eatUnicodePropertyName=function(t){var e;for(t.lastStringValue="";st(e=t.current());)t.lastStringValue+=M(e),t.advance();return""!==t.lastStringValue},e.regexp_eatUnicodePropertyValue=function(t){var e,i;for(t.lastStringValue="";st(i=e=t.current())||N(i);)t.lastStringValue+=M(e),t.advance();return""!==t.lastStringValue},e.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)},e.regexp_eatCharacterClass=function(t){if(t.eat(91)){if(t.eat(94),this.regexp_classRanges(t),t.eat(93))return!0;t.raise("Unterminated character class")}return!1},e.regexp_classRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e,i=t.lastIntValue;t.eat(45)&&this.regexp_eatClassAtom(t)&&(e=t.lastIntValue,!t.switchU||-1!==i&&-1!==e||t.raise("Invalid character class"),-1!==i)&&-1!==e&&e<i&&t.raise("Range out of order in character class")}},e.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;t.switchU&&(99!==(i=t.current())&&!ht(i)||t.raise("Invalid class escape"),t.raise("Invalid escape")),t.pos=e}var i=t.current();return 93!==i&&(t.lastIntValue=i,t.advance(),!0)},e.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)},e.regexp_eatClassControlLetter=function(t){var e=t.current();return!(!N(e)&&95!==e||(t.lastIntValue=e%32,t.advance(),0))},e.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1},e.regexp_eatDecimalDigits=function(t){var e,i=t.pos;for(t.lastIntValue=0;N(e=t.current());)t.lastIntValue=10*t.lastIntValue+(e-48),t.advance();return t.pos!==i},e.regexp_eatHexDigits=function(t){var e,i=t.pos;for(t.lastIntValue=0;at(e=t.current());)t.lastIntValue=16*t.lastIntValue+ot(e),t.advance();return t.pos!==i},e.regexp_eatLegacyOctalEscapeSequence=function(t){var e,i;return!!this.regexp_eatOctalDigit(t)&&(e=t.lastIntValue,this.regexp_eatOctalDigit(t)?(i=t.lastIntValue,e<=3&&this.regexp_eatOctalDigit(t)?t.lastIntValue=64*e+8*i+t.lastIntValue:t.lastIntValue=8*e+i):t.lastIntValue=e,!0)},e.regexp_eatOctalDigit=function(t){var e=t.current();return ht(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)},e.regexp_eatFixedHexDigits=function(t,e){for(var i=t.pos,n=t.lastIntValue=0;n<e;++n){var r=t.current();if(!at(r))return t.pos=i,!1;t.lastIntValue=16*t.lastIntValue+ot(r),t.advance()}return!0};function R(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new b(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])}s=C.prototype;function lt(t){return"function"!=typeof BigInt?null:BigInt(t.replace(/_/g,""))}function ut(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}s.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new R(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},s.getToken=function(){return this.next(),new R(this)},"undefined"!=typeof Symbol&&(s[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===m.eof,value:t}}}}),s.curContext=function(){return this.context[this.context.length-1]},s.nextToken=function(){var t=this.curContext();return t&&t.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(m.eof):t.override?t.override(this):void this.readToken(this.fullCharCodeAtPos())},s.readToken=function(t){return o(t,6<=this.options.ecmaVersion)||92===t?this.readWord():this.getTokenFromCode(t)},s.fullCharCodeAtPos=function(){var t=this.input.charCodeAt(this.pos);return t<=55295||57344<=t?t:(t<<10)+this.input.charCodeAt(this.pos+1)-56613888},s.skipBlockComment=function(){var t,e=this.options.onComment&&this.curPosition(),i=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(d.lastIndex=i;(t=d.exec(this.input))&&t.index<this.pos;)++this.curLine,this.lineStart=t.index+t[0].length;this.options.onComment&&this.options.onComment(!0,this.input.slice(i+2,n),i,this.pos,e,this.curPosition())},s.skipLineComment=function(t){for(var e=this.pos,i=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&!f(n);)n=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,i,this.curPosition())},s.skipSpace=function(){t:for(;this.pos<this.input.length;){var t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(!(8<t&&t<14||5760<=t&&p.test(String.fromCharCode(t))))break t;++this.pos}}},s.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=t,this.value=e,this.updateContext(i)},s.readToken_dot=function(){var t,e=this.input.charCodeAt(this.pos+1);return 48<=e&&e<=57?this.readNumber(!0):(t=this.input.charCodeAt(this.pos+2),6<=this.options.ecmaVersion&&46===e&&46===t?(this.pos+=3,this.finishToken(m.ellipsis)):(++this.pos,this.finishToken(m.dot)))},s.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===t?this.finishOp(m.assign,2):this.finishOp(m.slash,1)},s.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,n=42===t?m.star:m.modulo;return 7<=this.options.ecmaVersion&&42===t&&42===e&&(++i,n=m.starstar,e=this.input.charCodeAt(this.pos+2)),61===e?this.finishOp(m.assign,i+1):this.finishOp(n,i)},s.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);if(e!==t)return 61===e?this.finishOp(m.assign,2):this.finishOp(124===t?m.bitwiseOR:m.bitwiseAND,1);if(12<=this.options.ecmaVersion&&61===this.input.charCodeAt(this.pos+2))return this.finishOp(m.assign,3);return this.finishOp(124===t?m.logicalOR:m.logicalAND,2)},s.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(m.assign,2):this.finishOp(m.bitwiseXOR,1)},s.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?45!==e||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!c.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(m.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===e?this.finishOp(m.assign,2):this.finishOp(m.plusMin,1)},s.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=62===t&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(m.assign,i+1):this.finishOp(m.bitShift,i)):33!==e||60!==t||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?this.finishOp(m.relational,i=61===e?2:i):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},s.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(m.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===t&&62===e&&6<=this.options.ecmaVersion?(this.pos+=2,this.finishToken(m.arrow)):this.finishOp(61===t?m.eq:m.prefix,1)},s.readToken_question=function(){var t=this.options.ecmaVersion;if(11<=t){var e=this.input.charCodeAt(this.pos+1);if(46===e){var i=this.input.charCodeAt(this.pos+2);if(i<48||57<i)return this.finishOp(m.questionDot,2)}if(63===e){if(12<=t)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(m.assign,3);return this.finishOp(m.coalesce,2)}}return this.finishOp(m.question,1)},s.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(m.parenL);case 41:return++this.pos,this.finishToken(m.parenR);case 59:return++this.pos,this.finishToken(m.semi);case 44:return++this.pos,this.finishToken(m.comma);case 91:return++this.pos,this.finishToken(m.bracketL);case 93:return++this.pos,this.finishToken(m.bracketR);case 123:return++this.pos,this.finishToken(m.braceL);case 125:return++this.pos,this.finishToken(m.braceR);case 58:return++this.pos,this.finishToken(m.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(m.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(120===e||88===e)return this.readRadixNumber(16);if(6<=this.options.ecmaVersion){if(111===e||79===e)return this.readRadixNumber(8);if(98===e||66===e)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(m.prefix,1)}this.raise(this.pos,"Unexpected character '"+ut(t)+"'")},s.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)},s.readRegexp=function(){for(var t,e,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(c.test(n)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if("["===n)e=!0;else if("]"===n&&e)e=!1;else if("/"===n&&!e)break;t="\\"===n}++this.pos}var r=this.input.slice(i,this.pos),s=(++this.pos,this.pos),a=this.readWord1(),s=(this.containsEsc&&this.unexpected(s),this.regexpState||(this.regexpState=new O(this))),s=(s.reset(i,r,a),this.validateRegExpFlags(s),this.validateRegExpPattern(s),null);try{s=new RegExp(r,a)}catch(t){}return this.finishToken(m.regexp,{pattern:r,flags:a,value:s})},s.readInt=function(t,e,i){for(var n=12<=this.options.ecmaVersion&&void 0===e,r=i&&48===this.input.charCodeAt(this.pos),i=this.pos,s=0,a=0,o=0,h=null==e?1/0:e;o<h;++o,++this.pos){var l=this.input.charCodeAt(this.pos),u=void 0;if(n&&95===l)r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===a&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===o&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),a=l;else{if(t<=(u=97<=l?l-97+10:65<=l?l-65+10:48<=l&&l<=57?l-48:1/0))break;a=l,s=s*t+u}}return n&&95===a&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===i||null!=e&&this.pos-i!==e?null:s},s.readRadixNumber=function(t){var e=this.pos,i=(this.pos+=2,this.readInt(t));return null==i&&this.raise(this.start+2,"Expected number in radix "+t),11<=this.options.ecmaVersion&&110===this.input.charCodeAt(this.pos)?(i=lt(this.input.slice(e,this.pos)),++this.pos):o(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(m.num,i)},s.readNumber=function(t){var e=this.pos,i=(t||null!==this.readInt(10,void 0,!0)||this.raise(e,"Invalid number"),2<=this.pos-e&&48===this.input.charCodeAt(e)),n=(i&&this.strict&&this.raise(e,"Invalid number"),this.input.charCodeAt(this.pos));if(!i&&!t&&11<=this.options.ecmaVersion&&110===n)return t=lt(this.input.slice(e,this.pos)),++this.pos,o(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(m.num,t);i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),46!==n||i||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||i||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(e,"Invalid number")),o(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");t=this.input.slice(e,this.pos);n=i?parseInt(t,8):parseFloat(t.replace(/_/g,""));return this.finishToken(m.num,n)},s.readCodePoint=function(){var t,e;return 123===this.input.charCodeAt(this.pos)?(this.options.ecmaVersion<6&&this.unexpected(),t=++this.pos,e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,1114111<e&&this.invalidStringToken(t,"Code point out of bounds")):e=this.readHexChar(4),e},s.readString=function(t){for(var e="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===t)break;92===n?(e=(e+=this.input.slice(i,this.pos))+this.readEscapedChar(!1),i=this.pos):(f(n,10<=this.options.ecmaVersion)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(m.string,e)};var ct={};s.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t!==ct)throw t;this.readInvalidTemplateToken()}this.inTemplateElement=!1},s.invalidStringToken=function(t,e){if(this.inTemplateElement&&9<=this.options.ecmaVersion)throw ct;this.raise(t,e)},s.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==m.template&&this.type!==m.invalidTemplate?(t+=this.input.slice(e,this.pos),this.finishToken(m.template,t)):36===i?(this.pos+=2,this.finishToken(m.dollarBraceL)):(++this.pos,this.finishToken(m.backQuote));if(92===i)t=(t+=this.input.slice(e,this.pos))+this.readEscapedChar(!0),e=this.pos;else if(f(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}},s.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(m.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")},s.readEscapedChar=function(t){var e,i,n=this.input.charCodeAt(++this.pos);switch(++this.pos,n){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ut(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(t)return e=this.pos-1,this.invalidStringToken(e,"Invalid escape sequence in template string"),null;default:return 48<=n&&n<=55?(e=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],255<(i=parseInt(e,8))&&(e=e.slice(0,-1),i=parseInt(e,8)),this.pos+=e.length-1,n=this.input.charCodeAt(this.pos),"0"===e&&56!==n&&57!==n||!this.strict&&!t||this.invalidStringToken(this.pos-1-e.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)):f(n)?"":String.fromCharCode(n)}},s.readHexChar=function(t){var e=this.pos,t=this.readInt(16,t);return null===t&&this.invalidStringToken(e,"Bad character escape sequence"),t},s.readWord1=function(){for(var t="",e=!(this.containsEsc=!1),i=this.pos,n=6<=this.options.ecmaVersion;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(h(r,n))this.pos+=r<=65535?1:2;else{if(92!==r)break;this.containsEsc=!0,t+=this.input.slice(i,this.pos);var r=this.pos,s=(117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos,this.readCodePoint());(e?o:h)(s,n)||this.invalidStringToken(r,"Invalid Unicode escape"),t+=ut(s),i=this.pos}e=!1}return t+this.input.slice(i,this.pos)},s.readWord=function(){var t=this.readWord1(),e=m.name;return this.keywords.test(t)&&(e=l[t]),this.finishToken(e,t)};C.acorn={Parser:C,version:"7.4.1",defaultOptions:x,Position:y,SourceLocation:b,getLineInfo:w,Node:E,TokenType:n,tokTypes:m,keywordTypes:l,TokContext:L,tokContexts:P,isIdentifierChar:h,isIdentifierStart:o,Token:R,isNewLine:f,lineBreak:c,lineBreakG:d,nonASCIIwhitespace:p},t.Node=E,t.Parser=C,t.Position=y,t.SourceLocation=b,t.TokContext=L,t.Token=R,t.TokenType=n,t.defaultOptions=x,t.getLineInfo=w,t.isIdentifierChar=h,t.isIdentifierStart=o,t.isNewLine=f,t.keywordTypes=l,t.lineBreak=c,t.lineBreakG=d,t.nonASCIIwhitespace=p,t.parse=function(t,e){return C.parse(t,e)},t.parseExpressionAt=function(t,e,i){return C.parseExpressionAt(t,e,i)},t.tokContexts=P,t.tokTypes=m,t.tokenizer=function(t,e){return C.tokenizer(t,e)},t.version="7.4.1",Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof i&&void 0!==e?r(i):"function"==typeof define&&define.amd?define(["exports"],r):r((n=n||self).acorn={})},{}],6:[function(t,e,i){"use strict";i.byteLength=function(t){var t=u(t),e=t[0],t=t[1];return 3*(e+t)/4-t},i.toByteArray=function(t){var e,i,n=u(t),r=n[0],n=n[1],s=new l(function(t,e){return 3*(t+e)/4-e}(r,n)),a=0,o=0<n?r-4:r;for(i=0;i<o;i+=4)e=h[t.charCodeAt(i)]<<18|h[t.charCodeAt(i+1)]<<12|h[t.charCodeAt(i+2)]<<6|h[t.charCodeAt(i+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;2===n&&(e=h[t.charCodeAt(i)]<<2|h[t.charCodeAt(i+1)]>>4,s[a++]=255&e);1===n&&(e=h[t.charCodeAt(i)]<<10|h[t.charCodeAt(i+1)]<<4|h[t.charCodeAt(i+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e);return s},i.fromByteArray=function(t){for(var e,i=t.length,n=i%3,r=[],s=0,a=i-n;s<a;s+=16383)r.push(function(t,e,i){for(var n,r=[],s=e;s<i;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),r.push(function(t){return o[t>>18&63]+o[t>>12&63]+o[t>>6&63]+o[63&t]}(n));return r.join("")}(t,s,a<s+16383?a:s+16383));1==n?(e=t[i-1],r.push(o[e>>2]+o[e<<4&63]+"==")):2==n&&(e=(t[i-2]<<8)+t[i-1],r.push(o[e>>10]+o[e>>4&63]+o[e<<2&63]+"="));return r.join("")};for(var o=[],h=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,s=n.length;r<s;++r)o[r]=n[r],h[n.charCodeAt(r)]=r;function u(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("="),e=(t=-1===t?e:t)===e?0:4-t%4;return[t,e]}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},{}],7:[function(t,e,i){var n,r;n=this,r=function(t){"use strict";function D(t){if(t&&t.__esModule)return t;var e,i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const n in t)"default"!==n&&(e=Object.getOwnPropertyDescriptor(t,n),Object.defineProperty(i,n,e.get?e:{enumerable:!0,get:()=>t[n]}));return i.default=t,Object.freeze(i)}const i=D(t),B=1e3,j="transitionend",z=e=>{let i=e.getAttribute("data-bs-target");if(!i||"#"===i){let t=e.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t="#"+t.split("#")[1]),i=t&&"#"!==t?t.trim():null}return i},F=t=>{t=z(t);return t&&document.querySelector(t)?t:null},r=t=>{t=z(t);return t?document.querySelector(t):null},V=t=>{t.dispatchEvent(new Event(j))},s=t=>!(!t||"object"!=typeof t)&&void 0!==(t=void 0!==t.jquery?t[0]:t).nodeType,n=t=>s(t)?t.jquery?t[0]:t:"string"==typeof t&&0<t.length?document.querySelector(t):null,a=t=>{if(!s(t)||0===t.getClientRects().length)return!1;var e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(i&&i!==t){t=t.closest("summary");if(t&&t.parentNode!==i)return!1;if(null===t)return!1}return e},o=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),q=t=>{var e;return document.documentElement.attachShadow?"function"==typeof t.getRootNode?(e=t.getRootNode())instanceof ShadowRoot?e:null:t instanceof ShadowRoot?t:t.parentNode?q(t.parentNode):null:null},U=()=>{},l=t=>{t.offsetHeight},H=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,W=[],h=()=>"rtl"===document.documentElement.dir;t=n=>{var t;t=()=>{const t=H();if(t){const e=n.NAME,i=t.fn[e];t.fn[e]=n.jQueryInterface,t.fn[e].Constructor=n,t.fn[e].noConflict=()=>(t.fn[e]=i,n.jQueryInterface)}},"loading"===document.readyState?(W.length||document.addEventListener("DOMContentLoaded",()=>{for(const t of W)t()}),W.push(t)):t()};const u=t=>{"function"==typeof t&&t()},G=(i,n,t=!0)=>{if(t){t=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);var t=Number.parseFloat(e),n=Number.parseFloat(i);return t||n?(e=e.split(",")[0],i=i.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(i))*B):0})(n)+5;let e=!1;const r=({target:t})=>{t===n&&(e=!0,n.removeEventListener(j,r),u(i))};n.addEventListener(j,r),setTimeout(()=>{e||V(n)},t)}else u(i)},K=(t,e,i,n)=>{var r=t.length;let s=t.indexOf(e);return-1===s?!i&&n?t[r-1]:t[0]:(s+=i?1:-1,n&&(s=(s+r)%r),t[Math.max(0,Math.min(s,r-1))])},Z=/[^.]*(?=\..*)\.|.*/,$=/\..*/,Y=/::\d+$/,X={};let Q=1;const J={mouseenter:"mouseover",mouseleave:"mouseout"},tt=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function et(t,e){return e&&e+"::"+Q++||t.uidEvent||Q++}function it(t){var e=et(t);return t.uidEvent=e,X[e]=X[e]||{},X[e]}function nt(t,e,i=null){return Object.values(t).find(t=>t.callable===e&&t.delegationSelector===i)}function rt(t,e,i){var n="string"==typeof e,e=!n&&e||i;let r=ot(t);return[n,e,r=tt.has(r)?r:t]}function st(n,r,s,a,o){if("string"==typeof r&&n){let[t,e,i]=rt(r,s,a);r in J&&(e=(h=e,function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return h.call(this,t)}));var h,l,u,c,d,f,a=it(n),a=a[i]||(a[i]={}),p=nt(a,e,t?s:null);p?p.oneOff=p.oneOff&&o:(p=et(e,r.replace(Z,"")),(r=t?(c=n,d=s,f=e,function e(i){var n=c.querySelectorAll(d);for(let t=i["target"];t&&t!==this;t=t.parentNode)for(const r of n)if(r===t)return ht(i,{delegateTarget:t}),e.oneOff&&g.off(c,i.type,d,f),f.apply(t,[i])}):(l=n,u=e,function t(e){return ht(e,{delegateTarget:l}),t.oneOff&&g.off(l,e.type,u),u.apply(l,[e])})).delegationSelector=t?s:null,r.callable=e,r.oneOff=o,a[r.uidEvent=p]=r,n.addEventListener(i,r,t))}}function at(t,e,i,n,r){n=nt(e[i],n,r);n&&(t.removeEventListener(i,n,Boolean(r)),delete e[i][n.uidEvent])}function ot(t){return t=t.replace($,""),J[t]||t}const g={on(t,e,i,n){st(t,e,i,n,!1)},one(t,e,i,n){st(t,e,i,n,!0)},off(t,e,i,n){if("string"==typeof e&&t){var[n,r,s]=rt(e,i,n),a=s!==e,o=it(t),h=o[s]||{},l=e.startsWith(".");if(void 0!==r)return Object.keys(h).length?void at(t,o,s,r,n?i:null):void 0;if(l)for(const _ of Object.keys(o)){u=g=p=f=d=c=void 0;var u,c=t,d=o,f=_,p=e.slice(1),g=d[f]||{};for(const v of Object.keys(g))v.includes(p)&&at(c,d,f,(u=g[v]).callable,u.delegationSelector)}for(const y of Object.keys(h)){var m=y.replace(Y,"");a&&!e.includes(m)||at(t,o,s,(m=h[y]).callable,m.delegationSelector)}}},trigger(t,e,i){if("string"!=typeof e||!t)return null;var n=H();let r=null,s=!0,a=!0,o=!1;e!==ot(e)&&n&&(r=n.Event(e,i),n(t).trigger(r),s=!r.isPropagationStopped(),a=!r.isImmediatePropagationStopped(),o=r.isDefaultPrevented());n=ht(n=new Event(e,{bubbles:s,cancelable:!0}),i);return o&&n.preventDefault(),a&&t.dispatchEvent(n),n.defaultPrevented&&r&&r.preventDefault(),n}};function ht(e,t){for(const[i,n]of Object.entries(t||{}))try{e[i]=n}catch(t){Object.defineProperty(e,i,{configurable:!0,get(){return n}})}return e}const c=new Map,lt={set(t,e,i){c.has(t)||c.set(t,new Map);t=c.get(t);t.has(e)||0===t.size?t.set(e,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(t.keys())[0]}.`)},get(t,e){return c.has(t)&&c.get(t).get(e)||null},remove(t,e){var i;c.has(t)&&((i=c.get(t)).delete(e),0===i.size)&&c.delete(t)}};function ut(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function ct(t){return t.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}const d={setDataAttribute(t,e,i){t.setAttribute("data-bs-"+ct(e),i)},removeDataAttribute(t,e){t.removeAttribute("data-bs-"+ct(e))},getDataAttributes(e){if(!e)return{};var i={};for(const n of Object.keys(e.dataset).filter(t=>t.startsWith("bs")&&!t.startsWith("bsConfig"))){let t=n.replace(/^bs/,"");i[t=t.charAt(0).toLowerCase()+t.slice(1,t.length)]=ut(e.dataset[n])}return i},getDataAttribute(t,e){return ut(t.getAttribute("data-bs-"+ct(e)))}};class e{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){var i=s(e)?d.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...s(e)?d.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const r of Object.keys(e)){var i=e[r],n=t[r],n=s(n)?"element":null==(n=n)?""+n:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(i).test(n))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${r}" provided type "${n}" but expected type "${i}".`)}}}class f extends e{constructor(t,e){super(),(t=n(t))&&(this._element=t,this._config=this._getConfig(e),lt.set(this._element,this.constructor.DATA_KEY,this))}dispose(){lt.remove(this._element,this.constructor.DATA_KEY),g.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){G(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return lt.get(n(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.2.3"}static get DATA_KEY(){return"bs."+this.NAME}static get EVENT_KEY(){return"."+this.DATA_KEY}static eventName(t){return""+t+this.EVENT_KEY}}var dt=(e,i="hide")=>{var t="click.dismiss"+e.EVENT_KEY;const n=e.NAME;g.on(document,t,`[data-bs-dismiss="${n}"]`,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),o(this)||(t=r(this)||this.closest("."+n),e.getOrCreateInstance(t)[i]())})};class ft extends f{static get NAME(){return"alert"}close(){var t;g.trigger(this._element,"close.bs.alert").defaultPrevented||(this._element.classList.remove("show"),t=this._element.classList.contains("fade"),this._queueCallback(()=>this._destroyElement(),this._element,t))}_destroyElement(){this._element.remove(),g.trigger(this._element,"closed.bs.alert"),this.dispose()}static jQueryInterface(e){return this.each(function(){var t=ft.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}dt(ft,"close"),t(ft);const pt='[data-bs-toggle="button"]';class gt extends f{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){var t=gt.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}g.on(document,"click.bs.button.data-api",pt,t=>{t.preventDefault();t=t.target.closest(pt);gt.getOrCreateInstance(t).toggle()}),t(gt);const p={find(t,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,t))},findOne(t,e=document.documentElement){return Element.prototype.querySelector.call(e,t)},children(t,e){return[].concat(...t.children).filter(t=>t.matches(e))},parents(t,e){var i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){var e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>t+':not([tabindex^="-"])').join(",");return this.find(e,t).filter(t=>!o(t)&&a(t))}},m=".bs.swipe",mt=(m,m,m,m,m,{endCallback:null,leftCallback:null,rightCallback:null}),_t={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class vt extends e{constructor(t,e){super(),(this._element=t)&&vt.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return mt}static get DefaultType(){return _t}static get NAME(){return"swipe"}dispose(){g.off(this._element,m)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),u(this._config.endCallback)}_move(t){this._deltaX=t.touches&&1<t.touches.length?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){var t=Math.abs(this._deltaX);t<=40||(t=t/this._deltaX,this._deltaX=0,t&&u(0<t?this._config.rightCallback:this._config.leftCallback))}_initEvents(){this._supportPointerEvents?(g.on(this._element,"pointerdown.bs.swipe",t=>this._start(t)),g.on(this._element,"pointerup.bs.swipe",t=>this._end(t)),this._element.classList.add("pointer-event")):(g.on(this._element,"touchstart.bs.swipe",t=>this._start(t)),g.on(this._element,"touchmove.bs.swipe",t=>this._move(t)),g.on(this._element,"touchend.bs.swipe",t=>this._end(t)))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||0<navigator.maxTouchPoints}}var _=".bs.carousel";const v="next",y="prev",b="left",yt="right",bt="slid"+_;const wt="carousel",xt="active",St=".active",Ct=".carousel-item";St,Ct;const kt={ArrowLeft:yt,ArrowRight:b},Et={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},At={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class w extends f{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=p.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===wt&&this.cycle()}static get Default(){return Et}static get DefaultType(){return At}static get NAME(){return"carousel"}next(){this._slide(v)}nextWhenVisible(){!document.hidden&&a(this._element)&&this.next()}prev(){this._slide(y)}pause(){this._isSliding&&V(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?g.one(this._element,bt,()=>this.cycle()):this.cycle())}to(t){var e,i=this._getItems();t>i.length-1||t<0||(this._isSliding?g.one(this._element,bt,()=>this.to(t)):(e=this._getItemIndex(this._getActive()))!==t&&(e=e<t?v:y,this._slide(e,i[t])))}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&g.on(this._element,"keydown.bs.carousel",t=>this._keydown(t)),"hover"===this._config.pause&&(g.on(this._element,"mouseenter.bs.carousel",()=>this.pause()),g.on(this._element,"mouseleave.bs.carousel",()=>this._maybeEnableCycle())),this._config.touch&&vt.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of p.find(".carousel-item img",this._element))g.on(e,"dragstart.bs.carousel",t=>t.preventDefault());var t={leftCallback:()=>this._slide(this._directionToOrder(b)),rightCallback:()=>this._slide(this._directionToOrder(yt)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new vt(this._element,t)}_keydown(t){var e;/input|textarea/i.test(t.target.tagName)||(e=kt[t.key])&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){var e;this._indicatorsElement&&((e=p.findOne(St,this._indicatorsElement)).classList.remove(xt),e.removeAttribute("aria-current"),e=p.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement))&&(e.classList.add(xt),e.setAttribute("aria-current","true"))}_updateInterval(){var t=this._activeElement||this._getActive();t&&(t=Number.parseInt(t.getAttribute("data-bs-interval"),10),this._config.interval=t||this._config.defaultInterval)}_slide(e,t=null){if(!this._isSliding){const n=this._getActive();var i=e===v;const r=t||K(this._getItems(),n,i,this._config.wrap);if(r!==n){const s=this._getItemIndex(r),a=t=>g.trigger(this._element,t,{relatedTarget:r,direction:this._orderToDirection(e),from:this._getItemIndex(n),to:s});t=a("slide.bs.carousel");if(!t.defaultPrevented&&n&&r){t=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=r;const o=i?"carousel-item-start":"carousel-item-end",h=i?"carousel-item-next":"carousel-item-prev";r.classList.add(h),l(r),n.classList.add(o),r.classList.add(o);this._queueCallback(()=>{r.classList.remove(o,h),r.classList.add(xt),n.classList.remove(xt,h,o),this._isSliding=!1,a(bt)},n,this._isAnimated()),t&&this.cycle()}}}}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return p.findOne(".active.carousel-item",this._element)}_getItems(){return p.find(Ct,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return h()?t===b?y:v:t===b?v:y}_orderToDirection(t){return h()?t===y?b:yt:t===y?yt:b}static jQueryInterface(e){return this.each(function(){var t=w.getOrCreateInstance(this,e);if("number"==typeof e)t.to(e);else if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}g.on(document,"click.bs.carousel.data-api","[data-bs-slide], [data-bs-slide-to]",function(t){var e=r(this);e&&e.classList.contains(wt)&&(t.preventDefault(),t=w.getOrCreateInstance(e),(e=this.getAttribute("data-bs-slide-to"))?t.to(e):"next"===d.getDataAttribute(this,"slide")?t.next():t.prev(),t._maybeEnableCycle())}),g.on(window,"load.bs.carousel.data-api",()=>{for(const t of p.find('[data-bs-ride="carousel"]'))w.getOrCreateInstance(t)}),t(w);const Tt="show",x="collapse",It="collapsing",Lt=(x,x,'[data-bs-toggle="collapse"]'),Pt={parent:null,toggle:!0},Ot={parent:"(null|element)",toggle:"boolean"};class S extends f{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];for(const r of p.find(Lt)){var i=F(r),n=p.find(i).filter(t=>t===this._element);null!==i&&n.length&&this._triggerArray.push(r)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Pt}static get DefaultType(){return Ot}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(!this._isTransitioning&&!this._isShown()){let t=[];if(!(t=this._config.parent?this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(t=>t!==this._element).map(t=>S.getOrCreateInstance(t,{toggle:!1})):t).length||!t[0]._isTransitioning){var e=g.trigger(this._element,"show.bs.collapse");if(!e.defaultPrevented){for(const n of t)n.hide();const i=this._getDimension();this._element.classList.remove(x),this._element.classList.add(It),this._element.style[i]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;e="scroll"+(i[0].toUpperCase()+i.slice(1));this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(It),this._element.classList.add(x,Tt),this._element.style[i]="",g.trigger(this._element,"shown.bs.collapse")},this._element,!0),this._element.style[i]=this._element[e]+"px"}}}}hide(){if(!this._isTransitioning&&this._isShown()){var t=g.trigger(this._element,"hide.bs.collapse");if(!t.defaultPrevented){t=this._getDimension();this._element.style[t]=this._element.getBoundingClientRect()[t]+"px",l(this._element),this._element.classList.add(It),this._element.classList.remove(x,Tt);for(const i of this._triggerArray){var e=r(i);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([i],!1)}this._isTransitioning=!0;this._element.style[t]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(It),this._element.classList.add(x),g.trigger(this._element,"hidden.bs.collapse")},this._element,!0)}}}_isShown(t=this._element){return t.classList.contains(Tt)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=n(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(this._config.parent)for(const e of this._getFirstLevelChildren(Lt)){var t=r(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=p.find(":scope .collapse .collapse",this._config.parent);return p.find(t,this._config.parent).filter(t=>!e.includes(t))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle("collapsed",!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(e){const i={};return"string"==typeof e&&/show|hide/.test(e)&&(i.toggle=!1),this.each(function(){var t=S.getOrCreateInstance(this,i);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}g.on(document,"click.bs.collapse.data-api",Lt,function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();t=F(this);for(const e of p.find(t))S.getOrCreateInstance(e,{toggle:!1}).toggle()}),t(S);const Mt="dropdown";var _=".bs.dropdown",C=".data-api";const Nt="ArrowDown";var Rt="click"+_+C,_="keydown"+_+C;const k="show",E='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',Dt=(E,".dropdown-menu"),Bt=h()?"top-end":"top-start",jt=h()?"top-start":"top-end",zt=h()?"bottom-end":"bottom-start",Ft=h()?"bottom-start":"bottom-end",Vt=h()?"left-start":"right-start",qt=h()?"right-start":"left-start",Ut={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Ht={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class A extends f{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=p.next(this._element,Dt)[0]||p.prev(this._element,Dt)[0]||p.findOne(Dt,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Ut}static get DefaultType(){return Ht}static get NAME(){return Mt}toggle(){return this._isShown()?this.hide():this.show()}show(){if(!o(this._element)&&!this._isShown()){var t={relatedTarget:this._element},e=g.trigger(this._element,"show.bs.dropdown",t);if(!e.defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const i of[].concat(...document.body.children))g.on(i,"mouseover",U);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(k),this._element.classList.add(k),g.trigger(this._element,"shown.bs.dropdown",t)}}}hide(){var t;!o(this._element)&&this._isShown()&&(t={relatedTarget:this._element},this._completeHide(t))}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){var e=g.trigger(this._element,"hide.bs.dropdown",t);if(!e.defaultPrevented){if("ontouchstart"in document.documentElement)for(const i of[].concat(...document.body.children))g.off(i,"mouseover",U);this._popper&&this._popper.destroy(),this._menu.classList.remove(k),this._element.classList.remove(k),this._element.setAttribute("aria-expanded","false"),d.removeDataAttribute(this._menu,"popper"),g.trigger(this._element,"hidden.bs.dropdown",t)}}_getConfig(t){if("object"!=typeof(t=super._getConfig(t)).reference||s(t.reference)||"function"==typeof t.reference.getBoundingClientRect)return t;throw new TypeError(Mt.toUpperCase()+': Option "reference" provided type "object" without a required "getBoundingClientRect" method.')}_createPopper(){if(void 0===i)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let t=this._element;"parent"===this._config.reference?t=this._parent:s(this._config.reference)?t=n(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);var e=this._getPopperConfig();this._popper=i.createPopper(t,this._menu,e)}_isShown(){return this._menu.classList.contains(k)}_getPlacement(){var t,e=this._parent;return e.classList.contains("dropend")?Vt:e.classList.contains("dropstart")?qt:e.classList.contains("dropup-center")?"top":e.classList.contains("dropdown-center")?"bottom":(t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim(),e.classList.contains("dropup")?t?jt:Bt:t?Ft:zt)}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const e=this._config["offset"];return"string"==typeof e?e.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){var t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return!this._inNavbar&&"static"!==this._config.display||(d.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,..."function"==typeof this._config.popperConfig?this._config.popperConfig(t):this._config.popperConfig}}_selectMenuItem({key:t,target:e}){var i=p.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(t=>a(t));i.length&&K(i,e,t===Nt,!i.includes(e)).focus()}static jQueryInterface(e){return this.each(function(){var t=A.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(t){if(2!==t.button&&("keyup"!==t.type||"Tab"===t.key))for(const r of p.find('[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled).show')){var e,i,n=A.getInstance(r);n&&!1!==n._config.autoClose&&(e=(i=t.composedPath()).includes(n._menu),i.includes(n._element)||"inside"===n._config.autoClose&&!e||"outside"===n._config.autoClose&&e||n._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName))||(i={relatedTarget:n._element},"click"===t.type&&(i.clickEvent=t),n._completeHide(i)))}}static dataApiKeydownHandler(t){var e=/input|textarea/i.test(t.target.tagName),i="Escape"===t.key,n=["ArrowUp",Nt].includes(t.key);!n&&!i||e&&!i||(t.preventDefault(),e=this.matches(E)?this:p.prev(this,E)[0]||p.next(this,E)[0]||p.findOne(E,t.delegateTarget.parentNode),i=A.getOrCreateInstance(e),n?(t.stopPropagation(),i.show(),i._selectMenuItem(t)):i._isShown()&&(t.stopPropagation(),i.hide(),e.focus()))}}g.on(document,_,E,A.dataApiKeydownHandler),g.on(document,_,Dt,A.dataApiKeydownHandler),g.on(document,Rt,A.clearMenus),g.on(document,"keyup.bs.dropdown.data-api",A.clearMenus),g.on(document,Rt,E,function(t){t.preventDefault(),A.getOrCreateInstance(this).toggle()}),t(A);const Wt=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Gt=".sticky-top",Kt="padding-right",Zt="margin-right";class $t{constructor(){this._element=document.body}getWidth(){var t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Kt,t=>t+e),this._setElementAttributes(Wt,Kt,t=>t+e),this._setElementAttributes(Gt,Zt,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Kt),this._resetElementAttributes(Wt,Kt),this._resetElementAttributes(Gt,Zt)}isOverflowing(){return 0<this.getWidth()}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,i,n){const r=this.getWidth();this._applyManipulationCallback(t,t=>{var e;t!==this._element&&window.innerWidth>t.clientWidth+r||(this._saveInitialAttribute(t,i),e=window.getComputedStyle(t).getPropertyValue(i),t.style.setProperty(i,n(Number.parseFloat(e))+"px"))})}_saveInitialAttribute(t,e){var i=t.style.getPropertyValue(e);i&&d.setDataAttribute(t,e,i)}_resetElementAttributes(t,i){this._applyManipulationCallback(t,t=>{var e=d.getDataAttribute(t,i);null===e?t.style.removeProperty(i):(d.removeDataAttribute(t,i),t.style.setProperty(i,e))})}_applyManipulationCallback(t,e){if(s(t))e(t);else for(const i of p.find(t,this._element))e(i)}}const Yt="backdrop",Xt="mousedown.bs."+Yt,Qt={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Jt={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class te extends e{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return Qt}static get DefaultType(){return Jt}static get NAME(){return Yt}show(t){var e;this._config.isVisible?(this._append(),e=this._getElement(),this._config.isAnimated&&l(e),e.classList.add("show"),this._emulateAnimation(()=>{u(t)})):u(t)}hide(t){this._config.isVisible?(this._getElement().classList.remove("show"),this._emulateAnimation(()=>{this.dispose(),u(t)})):u(t)}dispose(){this._isAppended&&(g.off(this._element,Xt),this._element.remove(),this._isAppended=!1)}_getElement(){var t;return this._element||((t=document.createElement("div")).className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t),this._element}_configAfterMerge(t){return t.rootElement=n(t.rootElement),t}_append(){var t;this._isAppended||(t=this._getElement(),this._config.rootElement.append(t),g.on(t,Xt,()=>{u(this._config.clickCallback)}),this._isAppended=!0)}_emulateAnimation(t){G(t,this._getElement(),this._config.isAnimated)}}const ee=".bs.focustrap",ie=(ee,ee,"backward"),ne={autofocus:!0,trapElement:null},re={autofocus:"boolean",trapElement:"element"};class se extends e{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return ne}static get DefaultType(){return re}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),g.off(document,ee),g.on(document,"focusin.bs.focustrap",t=>this._handleFocusin(t)),g.on(document,"keydown.tab.bs.focustrap",t=>this._handleKeydown(t)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,g.off(document,ee))}_handleFocusin(t){var e=this._config["trapElement"];t.target===document||t.target===e||e.contains(t.target)||(0===(t=p.focusableChildren(e)).length?e:this._lastTabNavDirection===ie?t[t.length-1]:t[0]).focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?ie:"forward")}}const T=".bs.modal";T,T;const ae="hidden"+T,oe="show"+T;T,T,T,T,T;T;const he="modal-open",le="modal-static";const ue={backdrop:!0,focus:!0,keyboard:!0},ce={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class I extends f{constructor(t,e){super(t,e),this._dialog=p.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new $t,this._addEventListeners()}static get Default(){return ue}static get DefaultType(){return ce}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||g.trigger(this._element,oe,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(he),this._adjustDialog(),this._backdrop.show(()=>this._showElement(t)))}hide(){!this._isShown||this._isTransitioning||g.trigger(this._element,"hide.bs.modal").defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove("show"),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){for(const t of[window,this._dialog])g.off(t,T);this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new te({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new se({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;var e=p.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),l(this._element),this._element.classList.add("show");this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,g.trigger(this._element,"shown.bs.modal",{relatedTarget:t})},this._dialog,this._isAnimated())}_addEventListeners(){g.on(this._element,"keydown.dismiss.bs.modal",t=>{"Escape"===t.key&&(this._config.keyboard?(t.preventDefault(),this.hide()):this._triggerBackdropTransition())}),g.on(window,"resize.bs.modal",()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),g.on(this._element,"mousedown.dismiss.bs.modal",e=>{g.one(this._element,"click.dismiss.bs.modal",t=>{this._element===e.target&&this._element===t.target&&("static"===this._config.backdrop?this._triggerBackdropTransition():this._config.backdrop&&this.hide())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(he),this._resetAdjustments(),this._scrollBar.reset(),g.trigger(this._element,ae)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){var t=g.trigger(this._element,"hidePrevented.bs.modal");if(!t.defaultPrevented){t=this._element.scrollHeight>document.documentElement.clientHeight;const e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(le)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(le),this._queueCallback(()=>{this._element.classList.remove(le),this._queueCallback(()=>{this._element.style.overflowY=e},this._dialog)},this._dialog),this._element.focus())}}_adjustDialog(){var t,e=this._element.scrollHeight>document.documentElement.clientHeight,i=this._scrollBar.getWidth(),n=0<i;n&&!e&&(t=h()?"paddingLeft":"paddingRight",this._element.style[t]=i+"px"),!n&&e&&(t=h()?"paddingRight":"paddingLeft",this._element.style[t]=i+"px")}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,i){return this.each(function(){var t=I.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](i)}})}}g.on(document,"click.bs.modal.data-api",'[data-bs-toggle="modal"]',function(t){const e=r(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),g.one(e,oe,t=>{t.defaultPrevented||g.one(e,ae,()=>{a(this)&&this.focus()})});t=p.findOne(".modal.show");t&&I.getInstance(t).hide(),I.getOrCreateInstance(e).toggle(this)}),dt(I),t(I);C=".bs.offcanvas";const de="showing",fe=".offcanvas.show",pe="hidePrevented"+C,ge="hidden"+C;const me={backdrop:!0,keyboard:!0,scroll:!1},_e={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class L extends f{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return me}static get DefaultType(){return _e}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||g.trigger(this._element,"show.bs.offcanvas",{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new $t).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(de),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add("show"),this._element.classList.remove(de),g.trigger(this._element,"shown.bs.offcanvas",{relatedTarget:t})},this._element,!0))}hide(){this._isShown&&!g.trigger(this._element,"hide.bs.offcanvas").defaultPrevented&&(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add("hiding"),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove("show","hiding"),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new $t).reset(),g.trigger(this._element,ge)},this._element,!0))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){var t=Boolean(this._config.backdrop);return new te({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"===this._config.backdrop?g.trigger(this._element,pe):this.hide()}:null})}_initializeFocusTrap(){return new se({trapElement:this._element})}_addEventListeners(){g.on(this._element,"keydown.dismiss.bs.offcanvas",t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():g.trigger(this._element,pe))})}static jQueryInterface(e){return this.each(function(){var t=L.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}g.on(document,"click.bs.offcanvas.data-api",'[data-bs-toggle="offcanvas"]',function(t){var e=r(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),o(this)||(g.one(e,ge,()=>{a(this)&&this.focus()}),(t=p.findOne(fe))&&t!==e&&L.getInstance(t).hide(),L.getOrCreateInstance(e).toggle(this))}),g.on(window,"load.bs.offcanvas.data-api",()=>{for(const t of p.find(fe))L.getOrCreateInstance(t).show()}),g.on(window,"resize.bs.offcanvas",()=>{for(const t of p.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&L.getOrCreateInstance(t).hide()}),dt(L),t(L);const ve=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]);const ye=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i,be=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;_={"*":["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:[]};function we(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);i=(new window.DOMParser).parseFromString(t,"text/html");for(const a of[].concat(...i.body.querySelectorAll("*"))){var n=a.nodeName.toLowerCase();if(Object.keys(e).includes(n)){var r=[].concat(...a.attributes),s=[].concat(e["*"]||[],e[n]||[]);for(const o of r)((t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!ve.has(i)||Boolean(ye.test(t.nodeValue)||be.test(t.nodeValue)):e.filter(t=>t instanceof RegExp).some(t=>t.test(i))})(o,s)||a.removeAttribute(o.nodeName)}else a.remove()}return i.body.innerHTML}const xe={allowList:_,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},Se={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Ce={entry:"(string|element|function|null)",selector:"(string|element)"};class ke extends e{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return xe}static get DefaultType(){return Se}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(t=>this._resolvePossibleFunction(t)).filter(Boolean)}hasContent(){return 0<this.getContent().length}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){var t,e,i=document.createElement("div");i.innerHTML=this._maybeSanitize(this._config.template);for([t,e]of Object.entries(this._config.content))this._setContent(i,e,t);var n=i.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&n.classList.add(...r.split(" ")),n}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(var[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},Ce)}_setContent(t,e,i){i=p.findOne(i,t);i&&((e=this._resolvePossibleFunction(e))?s(e)?this._putElementInTemplate(n(e),i):this._config.html?i.innerHTML=this._maybeSanitize(e):i.textContent=e:i.remove())}_maybeSanitize(t){return this._config.sanitize?we(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return"function"==typeof t?t(this):t}_putElementInTemplate(t,e){this._config.html?(e.innerHTML="",e.append(t)):e.textContent=t.textContent}}const Ee=new Set(["sanitize","allowList","sanitizeFn"]),Ae="fade";const Te="show",Ie="hide.bs.modal",P="hover",Le="focus",Pe={AUTO:"auto",TOP:"top",RIGHT:h()?"left":"right",BOTTOM:"bottom",LEFT:h()?"right":"left"},Oe={allowList:_,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,0],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},Me={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class O extends f{constructor(t,e){if(void 0===i)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Oe}static get DefaultType(){return Me}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),g.off(this._element.closest(".modal"),Ie,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(this._isWithContent()&&this._isEnabled){var t=g.trigger(this._element,this.constructor.eventName("show")),e=(q(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(!t.defaultPrevented&&e){this._disposePopper();t=this._getTipElement(),e=(this._element.setAttribute("aria-describedby",t.getAttribute("id")),this._config)["container"];if(this._element.ownerDocument.documentElement.contains(this.tip)||(e.append(t),g.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(t),t.classList.add(Te),"ontouchstart"in document.documentElement)for(const i of[].concat(...document.body.children))g.on(i,"mouseover",U);this._queueCallback(()=>{g.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}}}hide(){if(this._isShown()){var t=g.trigger(this._element,this.constructor.eventName("hide"));if(!t.defaultPrevented){if(this._getTipElement().classList.remove(Te),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))g.off(e,"mouseover",U);this._activeTrigger.click=!1,this._activeTrigger[Le]=!1,this._activeTrigger[P]=!1,this._isHovered=null;this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),g.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){t=this._getTemplateFactory(t).toHtml();if(!t)return null;t.classList.remove(Ae,Te),t.classList.add(`bs-${this.constructor.NAME}-auto`);var e=(t=>{for(;t+=Math.floor(1e6*Math.random()),document.getElementById(t););return t})(this.constructor.NAME).toString();return t.setAttribute("id",e),this._isAnimated()&&t.classList.add(Ae),t}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new ke({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Ae)}_isShown(){return this.tip&&this.tip.classList.contains(Te)}_createPopper(t){var e="function"==typeof this._config.placement?this._config.placement.call(this,t,this._element):this._config.placement,e=Pe[e.toUpperCase()];return i.createPopper(this._element,t,this._getPopperConfig(e))}_getOffset(){const e=this._config["offset"];return"string"==typeof e?e.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof e?t=>e(t,this._element):e}_resolvePossibleFunction(t){return"function"==typeof t?t.call(this._element):t}_getPopperConfig(t){t={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...t,..."function"==typeof this._config.popperConfig?this._config.popperConfig(t):this._config.popperConfig}}_setListeners(){var t,e;for(const i of this._config.trigger.split(" "))"click"===i?g.on(this._element,this.constructor.eventName("click"),this._config.selector,t=>{this._initializeOnDelegatedTarget(t).toggle()}):"manual"!==i&&(t=i===P?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),e=i===P?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout"),g.on(this._element,t,this._config.selector,t=>{var e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?Le:P]=!0,e._enter()}),g.on(this._element,e,this._config.selector,t=>{var e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?Le:P]=e._element.contains(t.relatedTarget),e._leave()}));this._hideModalHandler=()=>{this._element&&this.hide()},g.on(this._element.closest(".modal"),Ie,this._hideModalHandler)}_fixTitle(){var t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){var e=d.getDataAttributes(this._element);for(const i of Object.keys(e))Ee.has(i)&&delete e[i];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:n(t.container),"number"==typeof 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()),t}_getDelegateConfig(){var t={};for(const e in this._config)this.constructor.Default[e]!==this._config[e]&&(t[e]=this._config[e]);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){var t=O.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}t(O);const Ne={...O.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},Re={...O.DefaultType,content:"(null|string|element|function)"};class De extends O{static get Default(){return Ne}static get DefaultType(){return Re}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){var t=De.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}t(De);Rt=".bs.scrollspy";const Be="click"+Rt;const M="active",je="[href]";const ze={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Fe={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Ve extends f{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return ze}static get DefaultType(){return Fe}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=n(t.target)||document.body,t.rootMargin=t.offset?t.offset+"px 0px -30%":t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map(t=>Number.parseFloat(t))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(g.off(this._config.target,Be),g.on(this._config.target,Be,je,t=>{var e=this._observableSections.get(t.target.hash);e&&(t.preventDefault(),t=this._rootElement||window,e=e.offsetTop-this._element.offsetTop,t.scrollTo?t.scrollTo({top:e,behavior:"smooth"}):t.scrollTop=e)}))}_getNewObserver(){var t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),t)}_observerCallback(t){const e=t=>this._targetLinks.get("#"+t.target.id);var i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,r=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const a of t)if(a.isIntersecting){var s=a.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&s){if(i(a),n)continue;return}r||s||i(a)}else this._activeTarget=null,this._clearActiveClass(e(a))}_initializeTargetsAndObservables(){var t;this._targetLinks=new Map,this._observableSections=new Map;for(const e of p.find(je,this._config.target))e.hash&&!o(e)&&(t=p.findOne(e.hash,this._element),a(t))&&(this._targetLinks.set(e.hash,e),this._observableSections.set(e.hash,t))}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),(this._activeTarget=t).classList.add(M),this._activateParents(t),g.trigger(this._element,"activate.bs.scrollspy",{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))p.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(M);else for(const e of p.parents(t,".nav, .list-group"))for(const i of p.prev(e,".nav-link, .nav-item > .nav-link, .list-group-item"))i.classList.add(M)}_clearActiveClass(t){t.classList.remove(M);for(const e of p.find(je+"."+M,t))e.classList.remove(M)}static jQueryInterface(e){return this.each(function(){var t=Ve.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}g.on(window,"load.bs.scrollspy.data-api",()=>{for(const t of p.find('[data-bs-spy="scroll"]'))Ve.getOrCreateInstance(t)}),t(Ve);const qe="ArrowRight",Ue="ArrowDown",N="active",He="show";C='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';const We='.nav-link:not(.dropdown-toggle), .list-group-item:not(.dropdown-toggle), [role="tab"]:not(.dropdown-toggle), '+C;N,N,N;class R extends f{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),g.on(this._element,"keydown.bs.tab",t=>this._keydown(t)))}static get NAME(){return"tab"}show(){var t,e,i=this._element;this._elemIsActive(i)||(e=(t=this._getActiveElem())?g.trigger(t,"hide.bs.tab",{relatedTarget:i}):null,g.trigger(i,"show.bs.tab",{relatedTarget:t}).defaultPrevented)||e&&e.defaultPrevented||(this._deactivate(t,i),this._activate(i,t))}_activate(t,e){t&&(t.classList.add(N),this._activate(r(t)),this._queueCallback(()=>{"tab"!==t.getAttribute("role")?t.classList.add(He):(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),g.trigger(t,"shown.bs.tab",{relatedTarget:e}))},t,t.classList.contains("fade")))}_deactivate(t,e){t&&(t.classList.remove(N),t.blur(),this._deactivate(r(t)),this._queueCallback(()=>{"tab"!==t.getAttribute("role")?t.classList.remove(He):(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),g.trigger(t,"hidden.bs.tab",{relatedTarget:e}))},t,t.classList.contains("fade")))}_keydown(t){var e;["ArrowLeft",qe,"ArrowUp",Ue].includes(t.key)&&(t.stopPropagation(),t.preventDefault(),e=[qe,Ue].includes(t.key),t=K(this._getChildren().filter(t=>!o(t)),t.target,e,!0))&&(t.focus({preventScroll:!0}),R.getOrCreateInstance(t).show())}_getChildren(){return p.find(We,this._parent)}_getActiveElem(){return this._getChildren().find(t=>this._elemIsActive(t))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const i of e)this._setInitialAttributesOnChild(i)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);var e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){var e=r(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id)&&this._setAttributeIfNotExists(e,"aria-labelledby","#"+t.id)}_toggleDropDown(t,i){const n=this._getOuterElement(t);n.classList.contains("dropdown")&&((t=(t,e)=>{t=p.findOne(t,n);t&&t.classList.toggle(e,i)})(".dropdown-toggle",N),t(".dropdown-menu",He),n.setAttribute("aria-expanded",i))}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(N)}_getInnerElement(t){return t.matches(We)?t:p.findOne(We,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(e){return this.each(function(){var t=R.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}g.on(document,"click.bs.tab",C,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),o(this)||R.getOrCreateInstance(this).show()}),g.on(window,"load.bs.tab",()=>{for(const t of p.find('.active[data-bs-toggle="tab"], .active[data-bs-toggle="pill"], .active[data-bs-toggle="list"]'))R.getOrCreateInstance(t)}),t(R);const Ge="show",Ke="showing",Ze={animation:"boolean",autohide:"boolean",delay:"number"},$e={animation:!0,autohide:!0,delay:5e3};class Ye extends f{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return $e}static get DefaultType(){return Ze}static get NAME(){return"toast"}show(){g.trigger(this._element,"show.bs.toast").defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove("hide"),l(this._element),this._element.classList.add(Ge,Ke),this._queueCallback(()=>{this._element.classList.remove(Ke),g.trigger(this._element,"shown.bs.toast"),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&!g.trigger(this._element,"hide.bs.toast").defaultPrevented&&(this._element.classList.add(Ke),this._queueCallback(()=>{this._element.classList.add("hide"),this._element.classList.remove(Ke,Ge),g.trigger(this._element,"hidden.bs.toast")},this._element,this._config.animation))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Ge),super.dispose()}isShown(){return this._element.classList.contains(Ge)}_maybeScheduleHide(){!this._config.autohide||this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}e?this._clearTimeout():(t=t.relatedTarget,this._element===t||this._element.contains(t)||this._maybeScheduleHide())}_setListeners(){g.on(this._element,"mouseover.bs.toast",t=>this._onInteraction(t,!0)),g.on(this._element,"mouseout.bs.toast",t=>this._onInteraction(t,!1)),g.on(this._element,"focusin.bs.toast",t=>this._onInteraction(t,!0)),g.on(this._element,"focusout.bs.toast",t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){var t=Ye.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}})}}return dt(Ye),t(Ye),{Alert:ft,Button:gt,Carousel:w,Collapse:S,Dropdown:A,Modal:I,Offcanvas:L,Popover:De,ScrollSpy:Ve,Tab:R,Toast:Ye,Tooltip:O}},"object"==typeof i&&void 0!==e?e.exports=r(t("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],r):(n="undefined"!=typeof globalThis?globalThis:n||self).bootstrap=r(n.Popper)},{"@popperjs/core":3}],8:[function(t,e,i){},{}],9:[function(t,e,i){arguments[4][8][0].apply(i,arguments)},{dup:8}],10:[function(t,T,I){!function(A){!function(){var t=this,e="object"==typeof I&&I&&!I.nodeType&&I,i="object"==typeof T&&T&&!T.nodeType&&T,n="object"==typeof A&&A;n.global!==n&&n.window!==n&&n.self!==n||(t=n);var r,s,m=2147483647,_=36,v=26,a=38,o=700,h=/^xn--/,l=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=_-1,y=Math.floor,b=String.fromCharCode;function w(t){throw new RangeError(c[t])}function f(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function p(t,e){var i=t.split("@"),n="",i=(1<i.length&&(n=i[0]+"@",t=i[1]),(t=t.replace(u,".")).split("."));return n+f(i,e).join(".")}function x(t){for(var e,i,n=[],r=0,s=t.length;r<s;)55296<=(e=t.charCodeAt(r++))&&e<=56319&&r<s?56320==(64512&(i=t.charCodeAt(r++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),r--):n.push(e);return n}function g(t){return f(t,function(t){var e="";return 65535<t&&(e+=b((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=b(t)}).join("")}function S(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function C(t,e,i){var n=0;for(t=i?y(t/o):t>>1,t+=y(t/e);d*v>>1<t;n+=_)t=y(t/d);return y(n+(d+1)*t/(t+a))}function k(t){var e,i,n,r,s,a,o,h=[],l=t.length,u=0,c=128,d=72,f=t.lastIndexOf("-");for(f<0&&(f=0),i=0;i<f;++i)128<=t.charCodeAt(i)&&w("not-basic"),h.push(t.charCodeAt(i));for(n=0<f?f+1:0;n<l;){for(r=u,s=1,a=_;l<=n&&w("invalid-input"),o=t.charCodeAt(n++),(_<=(o=o-48<10?o-22:o-65<26?o-65:o-97<26?o-97:_)||o>y((m-u)/s))&&w("overflow"),u+=o*s,!(o<(o=a<=d?1:d+v<=a?v:a-d));a+=_)s>y(m/(o=_-o))&&w("overflow"),s*=o;d=C(u-r,e=h.length+1,0==r),y(u/e)>m-c&&w("overflow"),c+=y(u/e),u%=e,h.splice(u++,0,c)}return g(h)}function E(t){for(var e,i,n,r,s,a,o,h,l,u,c=[],d=(t=x(t)).length,f=128,p=72,g=e=0;g<d;++g)(o=t[g])<128&&c.push(b(o));for(i=n=c.length,n&&c.push("-");i<d;){for(r=m,g=0;g<d;++g)f<=(o=t[g])&&o<r&&(r=o);for(r-f>y((m-e)/(h=i+1))&&w("overflow"),e+=(r-f)*h,f=r,g=0;g<d;++g)if((o=t[g])<f&&++e>m&&w("overflow"),o==f){for(s=e,a=_;!(s<(l=a<=p?1:p+v<=a?v:a-p));a+=_)c.push(b(S(l+(u=s-l)%(l=_-l),0))),s=y(u/l);c.push(b(S(s,0))),p=C(e,h,i==n),e=0,++i}++e,++f}return c.join("")}if(r={version:"1.4.1",ucs2:{decode:x,encode:g},decode:k,encode:E,toASCII:function(t){return p(t,function(t){return l.test(t)?"xn--"+E(t):t})},toUnicode:function(t){return p(t,function(t){return h.test(t)?k(t.slice(4).toLowerCase()):t})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return r});else if(e&&i)if(T.exports==e)i.exports=r;else for(s in r)r.hasOwnProperty(s)&&(e[s]=r[s]);else t.punycode=r}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(P,t,O){!function(t){!function(){"use strict";var C=P("base64-js"),s=P("ieee754"),e=(O.Buffer=c,O.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},O.INSPECT_MAX_BYTES=50,2147483647);function h(t){if(e<t)throw new RangeError('The value "'+t+'" is invalid for option "size"');t=new Uint8Array(t);return t.__proto__=c.prototype,t}function c(t,e,i){if("number"!=typeof t)return n(t,e,i);if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}function n(t,e,i){if("string"==typeof t){var n=t,r=e;if(c.isEncoding(r="string"==typeof r&&""!==r?r:"utf8"))return s=0|d(n,r),a=h(s),a=(n=a.write(n,r))!==s?a.slice(0,n):a;throw new TypeError("Unknown encoding: "+r)}if(ArrayBuffer.isView(t))return l(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(I(t,ArrayBuffer)||t&&I(t.buffer,ArrayBuffer)){var s=t,n=e,a=i;if(n<0||s.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<n+(a||0))throw new RangeError('"length" is outside of buffer bounds');return(s=void 0===n&&void 0===a?new Uint8Array(s):void 0===a?new Uint8Array(s,n):new Uint8Array(s,n,a)).__proto__=c.prototype,s}if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return c.from(r,e,i);var o=function(t){{var e,i;if(c.isBuffer(t))return e=0|u(t.length),0!==(i=h(e)).length&&t.copy(i,0,0,e),i}if(void 0!==t.length)return"number"!=typeof t.length||L(t.length)?h(0):l(t);if("Buffer"===t.type&&Array.isArray(t.data))return l(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function r(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return r(t),h(t<0?0:0|u(t))}function l(t){for(var e=t.length<0?0:0|u(t.length),i=h(e),n=0;n<e;n+=1)i[n]=255&t[n];return i}function u(t){if(e<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+e.toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||I(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var i=t.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===i)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return E(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return A(t).length;default:if(r)return n?-1:E(t).length;e=(""+e).toLowerCase(),r=!0}}function i(t,e,i){var n,r=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((i=void 0===i||i>this.length?this.length:i)<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":var s=this,a=e,o=i,h=s.length;(!o||o<0||h<o)&&(o=h);for(var l="",u=a=!a||a<0?0:a;u<o;++u)l+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(s[u]);return l;case"utf8":case"utf-8":return k(this,e,i);case"ascii":var c=this,h=e,d=i,f="";d=Math.min(c.length,d);for(var p=h;p<d;++p)f+=String.fromCharCode(127&c[p]);return f;case"latin1":case"binary":var g=this,a=e,m=i,_="";m=Math.min(g.length,m);for(var v=a;v<m;++v)_+=String.fromCharCode(g[v]);return _;case"base64":return y=this,n=i,0===(b=e)&&n===y.length?C.fromByteArray(y):C.fromByteArray(y.slice(b,n));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var y=e,b=i,w=this.slice(y,b),x="",S=0;S<w.length;S+=2)x+=String.fromCharCode(w[S]+256*w[S+1]);return x;default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function o(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function f(t,e,i,n,r){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):2147483647<i?i=2147483647:i<-2147483648&&(i=-2147483648),(i=(i=L(i=+i)?r?0:t.length-1:i)<0?t.length+i:i)>=t.length){if(r)return-1;i=t.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:p(t,e,i,n,r);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?(r?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,i):p(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}function p(t,e,i,n,r){var s=1,a=t.length,o=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a/=s=2,o/=2,i/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(r)for(var l=-1,u=i;u<a;u++)if(h(t,u)===h(e,-1===l?0:u-l)){if(u-(l=-1===l?u:l)+1===o)return l*s}else-1!==l&&(u-=u-l),l=-1;else for(u=i=a<i+o?a-o:i;0<=u;u--){for(var c=!0,d=0;d<o;d++)if(h(t,u+d)!==h(e,d)){c=!1;break}if(c)return u}return-1}function m(t,e,i,n){return T(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,n)}function _(t,e,i,n){return T(function(t,e){for(var i,n,r=[],s=0;s<t.length&&!((e-=2)<0);++s)i=t.charCodeAt(s),n=i>>8,r.push(i%256),r.push(n);return r}(e,t.length-i),t,i,n)}function k(t,e,i){i=Math.min(t.length,i);for(var n=[],r=e;r<i;){var s,a,o,h,l=t[r],u=null,c=239<l?4:223<l?3:191<l?2:1;if(r+c<=i)switch(c){case 1:l<128&&(u=l);break;case 2:128==(192&(s=t[r+1]))&&127<(h=(31&l)<<6|63&s)&&(u=h);break;case 3:s=t[r+1],a=t[r+2],128==(192&s)&&128==(192&a)&&2047<(h=(15&l)<<12|(63&s)<<6|63&a)&&(h<55296||57343<h)&&(u=h);break;case 4:s=t[r+1],a=t[r+2],o=t[r+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&65535<(h=(15&l)<<18|(63&s)<<12|(63&a)<<6|63&o)&&h<1114112&&(u=h)}null===u?(u=65533,c=1):65535<u&&(n.push((u-=65536)>>>10&1023|55296),u=56320|1023&u),n.push(u),r+=c}var d=n,f=d.length;if(f<=v)return String.fromCharCode.apply(String,d);for(var p="",g=0;g<f;)p+=String.fromCharCode.apply(String,d.slice(g,g+=v));return p}O.kMaxLength=e,(c.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),c.poolSize=8192,c.from=n,c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,c.alloc=function(t,e,i){return e=e,i=i,r(t=t),!(t<=0)&&void 0!==e?"string"==typeof i?h(t).fill(e,i):h(t).fill(e):h(t)},c.allocUnsafe=a,c.allocUnsafeSlow=a,c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(I(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),I(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var i=t.length,n=e.length,r=0,s=Math.min(i,n);r<s;++r)if(t[r]!==e[r]){i=t[r],n=e[r];break}return i<n?-1:n<i?1:0},c.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}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;for(var i=c.allocUnsafe(e),n=0,r=0;r<t.length;++r){var s=t[r];if(I(s,Uint8Array)&&(s=c.from(s)),!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n),n+=s.length}return i},c.byteLength=d,c.prototype._isBuffer=!0,c.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 e=0;e<t;e+=2)o(this,e,e+1);return this},c.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 e=0;e<t;e+=4)o(this,e,e+3),o(this,e+1,e+2);return this},c.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 e=0;e<t;e+=8)o(this,e,e+7),o(this,e+1,e+6),o(this,e+2,e+5),o(this,e+3,e+4);return this},c.prototype.toLocaleString=c.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?k(this,0,t):i.apply(this,arguments)},c.prototype.equals=function(t){if(c.isBuffer(t))return this===t||0===c.compare(this,t);throw new TypeError("Argument must be a Buffer")},c.prototype.inspect=function(){var t="",e=O.INSPECT_MAX_BYTES,t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim();return this.length>e&&(t+=" ... "),"<Buffer "+t+">"},c.prototype.compare=function(t,e,i,n,r){if(I(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),(e=void 0===e?0:e)<0||i>t.length||n<0||r>this.length)throw new RangeError("out of range index");if(r<=n&&i<=e)return 0;if(r<=n)return-1;if(i<=e)return 1;if(this===t)return 0;for(var s=(r>>>=0)-(n>>>=0),a=(i>>>=0)-(e>>>=0),o=Math.min(s,a),h=this.slice(n,r),l=t.slice(e,i),u=0;u<o;++u)if(h[u]!==l[u]){s=h[u],a=l[u];break}return s<a?-1:a<s?1:0},c.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},c.prototype.indexOf=function(t,e,i){return f(this,t,e,i,!0)},c.prototype.lastIndexOf=function(t,e,i){return f(this,t,e,i,!1)},c.prototype.write=function(t,e,i,n){if(void 0===e)n="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)n=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-e;if((void 0===i||r<i)&&(i=r),0<t.length&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var s,a,o,h=!1;;)switch(n){case"hex":var l=this,u=t,c=e,d=i,f=(c=Number(c)||0,l.length-c);(!d||f<(d=Number(d)))&&(d=f),(f=u.length)/2<d&&(d=f/2);for(var p=0;p<d;++p){var g=parseInt(u.substr(2*p,2),16);if(L(g))return p;l[c+p]=g}return p;case"utf8":case"utf-8":return f=e,o=i,T(E(t,(a=this).length-f),a,f,o);case"ascii":return m(this,t,e,i);case"latin1":case"binary":return m(this,t,e,i);case"base64":return a=this,o=e,s=i,T(A(t),a,o,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,i);default:if(h)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var v=4096;function g(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(i<t+e)throw new RangeError("Trying to access beyond buffer length")}function y(t,e,i,n,r,s){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r<e||e<s)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}function b(t,e,i,n){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function w(t,e,i,n,r){return e=+e,i>>>=0,r||b(t,0,i,4),s.write(t,e,i,n,23,4),i+4}function x(t,e,i,n,r){return e=+e,i>>>=0,r||b(t,0,i,8),s.write(t,e,i,n,52,8),i+8}c.prototype.slice=function(t,e){var i=this.length,i=((t=~~t)<0?(t+=i)<0&&(t=0):i<t&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):i<e&&(e=i),e<t&&(e=t),this.subarray(t,e));return i.__proto__=c.prototype,i},c.prototype.readUIntLE=function(t,e,i){t>>>=0,e>>>=0,i||g(t,e,this.length);for(var n=this[t],r=1,s=0;++s<e&&(r*=256);)n+=this[t+s]*r;return n},c.prototype.readUIntBE=function(t,e,i){t>>>=0,e>>>=0,i||g(t,e,this.length);for(var n=this[t+--e],r=1;0<e&&(r*=256);)n+=this[t+--e]*r;return n},c.prototype.readUInt8=function(t,e){return t>>>=0,e||g(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||g(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||g(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||g(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||g(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,i){t>>>=0,e>>>=0,i||g(t,e,this.length);for(var n=this[t],r=1,s=0;++s<e&&(r*=256);)n+=this[t+s]*r;return(r*=128)<=n&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,i){t>>>=0,e>>>=0,i||g(t,e,this.length);for(var n=e,r=1,s=this[t+--n];0<n&&(r*=256);)s+=this[t+--n]*r;return(r*=128)<=s&&(s-=Math.pow(2,8*e)),s},c.prototype.readInt8=function(t,e){return t>>>=0,e||g(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||g(t,2,this.length);e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},c.prototype.readInt16BE=function(t,e){t>>>=0,e||g(t,2,this.length);e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||g(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||g(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return t>>>=0,e||g(t,4,this.length),s.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||g(t,4,this.length),s.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||g(t,8,this.length),s.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||g(t,8,this.length),s.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,i,n){t=+t,e>>>=0,i>>>=0,n||y(this,t,e,i,Math.pow(2,8*i)-1,0);var r=1,s=0;for(this[e]=255&t;++s<i&&(r*=256);)this[e+s]=t/r&255;return e+i},c.prototype.writeUIntBE=function(t,e,i,n){t=+t,e>>>=0,i>>>=0,n||y(this,t,e,i,Math.pow(2,8*i)-1,0);var r=i-1,s=1;for(this[e+r]=255&t;0<=--r&&(s*=256);)this[e+r]=t/s&255;return e+i},c.prototype.writeUInt8=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUInt16BE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUInt32LE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUInt32BE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeIntLE=function(t,e,i,n){t=+t,e>>>=0,n||y(this,t,e,i,(n=Math.pow(2,8*i-1))-1,-n);var r=0,s=1,a=0;for(this[e]=255&t;++r<i&&(s*=256);)t<0&&0===a&&0!==this[e+r-1]&&(a=1),this[e+r]=(t/s>>0)-a&255;return e+i},c.prototype.writeIntBE=function(t,e,i,n){t=+t,e>>>=0,n||y(this,t,e,i,(n=Math.pow(2,8*i-1))-1,-n);var r=i-1,s=1,a=0;for(this[e+r]=255&t;0<=--r&&(s*=256);)t<0&&0===a&&0!==this[e+r+1]&&(a=1),this[e+r]=(t/s>>0)-a&255;return e+i},c.prototype.writeInt8=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,1,127,-128),this[e]=255&(t=t<0?255+t+1:t),e+1},c.prototype.writeInt16LE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,i){return t=+t,e>>>=0,i||y(this,t,e,4,2147483647,-2147483648),this[e]=(t=t<0?4294967295+t+1:t)>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeFloatLE=function(t,e,i){return w(this,t,e,!0,i)},c.prototype.writeFloatBE=function(t,e,i){return w(this,t,e,!1,i)},c.prototype.writeDoubleLE=function(t,e,i){return x(this,t,e,!0,i)},c.prototype.writeDoubleBE=function(t,e,i){return x(this,t,e,!1,i)},c.prototype.copy=function(t,e,i,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i=i||0,n||0===n||(n=this.length),e>=t.length&&(e=t.length),(n=0<n&&n<i?i:n)===i)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var r=(n=t.length-e<n-i?t.length-e+i:n)-i;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,i,n);else if(this===t&&i<e&&e<n)for(var s=r-1;0<=s;--s)t[s+e]=this[s+i];else Uint8Array.prototype.set.call(t,this.subarray(i,n),e);return r},c.prototype.fill=function(t,e,i,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var r;1===t.length&&(r=t.charCodeAt(0),"utf8"===n&&r<128||"latin1"===n)&&(t=r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");var s;if(!(i<=e))if(e>>>=0,i=void 0===i?this.length:i>>>0,"number"==typeof(t=t||0))for(s=e;s<i;++s)this[s]=t;else{var a=c.isBuffer(t)?t:c.from(t,n),o=a.length;if(0===o)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<i-e;++s)this[s+e]=a[s%o]}return this};var S=/[^+/0-9A-Za-z-_]/g;function E(t,e){e=e||1/0;for(var i,n=t.length,r=null,s=[],a=0;a<n;++a){if(55295<(i=t.charCodeAt(a))&&i<57344){if(!r){if(56319<i){-1<(e-=3)&&s.push(239,191,189);continue}if(a+1===n){-1<(e-=3)&&s.push(239,191,189);continue}r=i;continue}if(i<56320){-1<(e-=3)&&s.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&-1<(e-=3)&&s.push(239,191,189);if(r=null,i<128){if(--e<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function A(t){return C.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(S,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function T(t,e,i,n){for(var r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}function I(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function L(t){return t!=t}}.call(this)}.call(this,P("buffer").Buffer)},{"base64-js":6,buffer:11,ieee754:19}],12:[function(t,e,i){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],13:[function(t,e,i){const a=t("color-name"),o={};for(const s of Object.keys(a))o[a[s]]=s;const h={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"]}};e.exports=h;for(const l of Object.keys(h)){if(!("channels"in h[l]))throw new Error("missing channels property: "+l);if(!("labels"in h[l]))throw new Error("missing channel labels property: "+l);if(h[l].labels.length!==h[l].channels)throw new Error("channel and label counts mismatch: "+l);var{channels:n,labels:r}=h[l];delete h[l].channels,delete h[l].labels,Object.defineProperty(h[l],"channels",{value:n}),Object.defineProperty(h[l],"labels",{value:r})}h.rgb.hsl=function(t){var e=t[0]/255,i=t[1]/255,t=t[2]/255,n=Math.min(e,i,t),r=Math.max(e,i,t),s=r-n;let a,o;r===n?a=0:e===r?a=(i-t)/s:i===r?a=2+(t-e)/s:t===r&&(a=4+(e-i)/s),(a=Math.min(60*a,360))<0&&(a+=360);t=(n+r)/2;return o=r===n?0:t<=.5?s/(r+n):s/(2-r-n),[a,100*o,100*t]},h.rgb.hsv=function(t){var e,i,n;let r,s;var a=t[0]/255,o=t[1]/255,t=t[2]/255;const h=Math.max(a,o,t),l=h-Math.min(a,o,t);function u(t){return(h-t)/6/l+.5}return 0==l?(r=0,s=0):(s=l/h,e=u(a),i=u(o),n=u(t),a===h?r=n-i:o===h?r=1/3+e-n:t===h&&(r=2/3+i-e),r<0?r+=1:1<r&&--r),[360*r,100*s,100*h]},h.rgb.hwb=function(t){var e=t[0],i=t[1],n=t[2];return[h.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(i,n))),100*(1-1/255*Math.max(e,Math.max(i,n)))]},h.rgb.cmyk=function(t){var e=t[0]/255,i=t[1]/255,t=t[2]/255,n=Math.min(1-e,1-i,1-t);return[100*((1-e-n)/(1-n)||0),100*((1-i-n)/(1-n)||0),100*((1-t-n)/(1-n)||0),100*n]},h.rgb.keyword=function(t){var e=o[t];if(e)return e;let i=1/0,n;for(const s of Object.keys(a)){var r=a[s],r=(t[0]-r[0])**2+(t[1]-r[1])**2+(t[2]-r[2])**2;r<i&&(i=r,n=s)}return n},h.keyword.rgb=function(t){return a[t]},h.rgb.xyz=function(t){var e=t[0]/255,i=t[1]/255,t=t[2]/255;return[100*(.4124*(e=.04045<e?((.055+e)/1.055)**2.4:e/12.92)+.3576*(i=.04045<i?((.055+i)/1.055)**2.4:i/12.92)+.1805*(t=.04045<t?((.055+t)/1.055)**2.4:t/12.92)),100*(.2126*e+.7152*i+.0722*t),100*(.0193*e+.1192*i+.9505*t)]},h.rgb.lab=function(t){var t=h.rgb.xyz(t),e=t[0],i=t[1],t=t[2];return[116*(i=.008856<(i/=100)?i**(1/3):7.787*i+16/116)-16,500*((.008856<(e/=95.047)?e**(1/3):7.787*e+16/116)-i),200*(i-(.008856<(t/=108.883)?t**(1/3):7.787*t+16/116))]},h.hsl.rgb=function(t){var e=t[0]/360,i=t[1]/100,t=t[2]/100;let n,r,s;if(0==i)return[s=255*t,s,s];var a=2*t-(n=t<.5?t*(1+i):t+i-t*i),o=[0,0,0];for(let t=0;t<3;t++)(r=e+1/3*-(t-1))<0&&r++,1<r&&r--,s=6*r<1?a+6*(n-a)*r:2*r<1?n:3*r<2?a+(n-a)*(2/3-r)*6:a,o[t]=255*s;return o},h.hsl.hsv=function(t){var e=t[0],i=t[1]/100,t=t[2]/100,n=i,r=Math.max(t,.01),s=(n*=r<=1?r:2-r,((t*=2)+(i*=t<=1?t:2-t))/2);return[e,100*(0==t?2*n/(r+n):2*i/(t+i)),100*s]},h.hsv.rgb=function(t){var e=t[0]/60,i=t[1]/100,n=t[2]/100,t=Math.floor(e)%6,e=e-Math.floor(e),r=255*n*(1-i),s=255*n*(1-i*e),a=255*n*(1-i*(1-e));switch(n*=255,t){case 0:return[n,a,r];case 1:return[s,n,r];case 2:return[r,n,a];case 3:return[r,s,n];case 4:return[a,r,n];case 5:return[n,r,s]}},h.hsv.hsl=function(t){var e=t[0],i=t[1]/100,t=t[2]/100,n=Math.max(t,.01),t=(2-i)*t,r=(2-i)*n,i=i*n;return[e,100*((i/=r<=1?r:2-r)||0),100*(t/=2)]},h.hwb.rgb=function(t){var e=t[0]/360;let i=t[1]/100,n=t[2]/100;t=i+n;let r;1<t&&(i/=t,n/=t);var t=Math.floor(6*e),s=1-n,a=(r=6*e-t,0!=(1&t)&&(r=1-r),i+r*(s-i));let o,h,l;switch(t){default:case 6:case 0:o=s,h=a,l=i;break;case 1:o=a,h=s,l=i;break;case 2:o=i,h=s,l=a;break;case 3:o=i,h=a,l=s;break;case 4:o=a,h=i,l=s;break;case 5:o=s,h=i,l=a}return[255*o,255*h,255*l]},h.cmyk.rgb=function(t){var e=t[0]/100,i=t[1]/100,n=t[2]/100,t=t[3]/100;return[255*(1-Math.min(1,e*(1-t)+t)),255*(1-Math.min(1,i*(1-t)+t)),255*(1-Math.min(1,n*(1-t)+t))]},h.xyz.rgb=function(t){var e=t[0]/100,i=t[1]/100,t=t[2]/100,n=3.2406*e+-1.5372*i+-.4986*t,r=-.9689*e+1.8758*i+.0415*t,e=.0557*e+-.204*i+1.057*t;return r=.0031308<r?1.055*r**(1/2.4)-.055:12.92*r,e=.0031308<e?1.055*e**(1/2.4)-.055:12.92*e,[255*Math.min(Math.max(0,.0031308<n?1.055*n**(1/2.4)-.055:12.92*n),1),255*Math.min(Math.max(0,r),1),255*Math.min(Math.max(0,e),1)]},h.xyz.lab=function(t){var e=t[0],i=t[1],t=t[2];return[116*(i=.008856<(i/=100)?i**(1/3):7.787*i+16/116)-16,500*((.008856<(e/=95.047)?e**(1/3):7.787*e+16/116)-i),200*(i-(.008856<(t/=108.883)?t**(1/3):7.787*t+16/116))]},h.lab.xyz=function(t){var e=(t[0]+16)/116,i=t[1]/500+e,t=e-t[2]/200,n=e**3,r=i**3,s=t**3;return e=.008856<n?n:(e-16/116)/7.787,i=.008856<r?r:(i-16/116)/7.787,t=.008856<s?s:(t-16/116)/7.787,[i*=95.047,e*=100,t*=108.883]},h.lab.lch=function(t){var e=t[0],i=t[1],t=t[2];let n;var r=Math.atan2(t,i),r=((n=360*r/2/Math.PI)<0&&(n+=360),Math.sqrt(i*i+t*t));return[e,r,n]},h.lch.lab=function(t){var e=t[0],i=t[1],t=t[2]/360*2*Math.PI;return[e,i*Math.cos(t),i*Math.sin(t)]},h.rgb.ansi16=function(t,e=null){var[i,n,r]=t,t=null===e?h.rgb.hsv(t)[2]:e;if(0===(t=Math.round(t/50)))return 30;let s=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(i/255));return 2===t&&(s+=60),s},h.hsv.ansi16=function(t){return h.rgb.ansi16(h.hsv.rgb(t),t[2])},h.rgb.ansi256=function(t){var e=t[0],i=t[1],t=t[2];return e===i&&i===t?e<8?16:248<e?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(i/255*5)+Math.round(t/255*5)},h.ansi16.rgb=function(t){let e=t%10;return 0===e||7===e?(50<t&&(e+=3.5),[e=e/10.5*255,e,e]):(t=.5*(1+~~(50<t)),[(1&e)*t*255,(e>>1&1)*t*255,(e>>2&1)*t*255])},h.ansi256.rgb=function(t){var e;return 232<=t?[e=10*(t-232)+8,e,e]:(t-=16,[Math.floor(t/36)/5*255,Math.floor((e=t%36)/6)/5*255,e%6/5*255])},h.rgb.hex=function(t){t=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},h.hex.rgb=function(t){t=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let e=t[0];3===t[0].length&&(e=e.split("").map(t=>t+t).join(""));t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t]},h.rgb.hcg=function(t){var e=t[0]/255,i=t[1]/255,t=t[2]/255,n=Math.max(Math.max(e,i),t),r=Math.min(Math.min(e,i),t),s=n-r;let a,o;return a=s<1?r/(1-s):0,[360*(o=(o=s<=0?0:n===e?(i-t)/s%6:n===i?2+(t-e)/s:4+(e-i)/s)/6%1),100*s,100*a]},h.hsl.hcg=function(t){var e=t[1]/100,i=t[2]/100,e=i<.5?2*e*i:2*e*(1-i);let n=e<1?(i-.5*e)/(1-e):0;return[t[0],100*e,100*n]},h.hsv.hcg=function(t){var e=t[1]/100,i=t[2]/100,e=e*i;let n=e<1?(i-e)/(1-e):0;return[t[0],100*e,100*n]},h.hcg.rgb=function(t){var e=t[0]/360,i=t[1]/100,t=t[2]/100;if(0==i)return[255*t,255*t,255*t];var n=[0,0,0],e=e%1*6,r=e%1,s=1-r;switch(Math.floor(e)){case 0:n[0]=1,n[1]=r,n[2]=0;break;case 1:n[0]=s,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=r;break;case 3:n[0]=0,n[1]=s,n[2]=1;break;case 4:n[0]=r,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=s}return[255*(i*n[0]+(e=(1-i)*t)),255*(i*n[1]+e),255*(i*n[2]+e)]},h.hcg.hsv=function(t){var e=t[1]/100,i=e+t[2]/100*(1-e);let n=0<i?e/i:0;return[t[0],100*n,100*i]},h.hcg.hsl=function(t){var e=t[1]/100,i=t[2]/100*(1-e)+.5*e;let n=0;return 0<i&&i<.5?n=e/(2*i):.5<=i&&i<1&&(n=e/(2*(1-i))),[t[0],100*n,100*i]},h.hcg.hwb=function(t){var e=t[1]/100,i=e+t[2]/100*(1-e);return[t[0],100*(i-e),100*(1-i)]},h.hwb.hcg=function(t){var e=t[1]/100,i=1-t[2]/100,e=i-e;let n=e<1?(i-e)/(1-e):0;return[t[0],100*e,100*n]},h.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},h.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},h.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},h.gray.hsl=function(t){return[0,0,t[0]]},h.gray.hsv=h.gray.hsl,h.gray.hwb=function(t){return[0,100,t[0]]},h.gray.cmyk=function(t){return[0,0,0,t[0]]},h.gray.lab=function(t){return[t[0],0,0]},h.gray.hex=function(t){t=255&Math.round(t[0]/100*255),t=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(t.length)+t},h.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},{"color-name":16}],14:[function(t,e,i){const r=t("./conversions"),s=t("./route"),a={};function o(i){function t(...t){var e=t[0];return null==e?e:(1<e.length&&(t=e),i(t))}return"conversion"in i&&(t.conversion=i.conversion),t}function h(n){function t(...t){var e=t[0];if(null==e)return e;1<e.length&&(t=e);var i=n(t);if("object"==typeof i)for(let t=i.length,e=0;e<t;e++)i[e]=Math.round(i[e]);return i}return"conversion"in n&&(t.conversion=n.conversion),t}Object.keys(r).forEach(i=>{a[i]={},Object.defineProperty(a[i],"channels",{value:r[i].channels}),Object.defineProperty(a[i],"labels",{value:r[i].labels});const n=s(i);Object.keys(n).forEach(t=>{var e=n[t];a[i][t]=h(e),a[i][t].raw=o(e)})}),e.exports=a},{"./conversions":13,"./route":15}],15:[function(t,e,i){const h=t("./conversions");function a(t){var i=function(){var i={},n=Object.keys(h);for(let t=n.length,e=0;e<t;e++)i[n[e]]={distance:-1,parent:null};return i}(),n=[t];for(i[t].distance=0;n.length;){var r=n.pop(),s=Object.keys(h[r]);for(let t=s.length,e=0;e<t;e++){var a=s[e],o=i[a];-1===o.distance&&(o.distance=i[r].distance+1,o.parent=r,n.unshift(a))}}return i}function o(t,e){var i=[e[t].parent,t];let n=h[e[t].parent][t],r=e[t].parent;for(;e[r].parent;)i.unshift(e[r].parent),n=function(e,i){return function(t){return i(e(t))}}(h[e[r].parent][r],n),r=e[r].parent;return n.conversion=i,n}e.exports=function(t){var i=a(t),n={},r=Object.keys(i);for(let t=r.length,e=0;e<t;e++){var s=r[e];null!==i[s].parent&&(n[s]=o(s,i))}return n}},{"./conversions":13}],16:[function(t,e,i){"use strict";e.exports={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]}},{}],17:[function(t,e,i){"use strict";var n="object"==typeof Reflect?Reflect:null,h=n&&"function"==typeof n.apply?n.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};var r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)},s=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(o,h){return new Promise(function(t,e){function i(t){o.removeListener(h,n),e(t)}function n(){"function"==typeof o.removeListener&&o.removeListener("error",i),t([].slice.call(arguments))}var r,s,a;m(o,h,n,{once:!0}),"error"!==h&&(s=i,a={once:!0},"function"==typeof(r=o).on)&&m(r,"error",s,a)})},(a.EventEmitter=a).prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function c(t,e,i,n){var r,s;return l(i),void 0===(r=t._events)?(r=t._events=Object.create(null),t._eventsCount=0):(void 0!==r.newListener&&(t.emit("newListener",e,i.listener||i),r=t._events),s=r[e]),void 0===s?(s=r[e]=i,++t._eventsCount):("function"==typeof s?s=r[e]=n?[i,s]:[s,i]:n?s.unshift(i):s.push(i),0<(r=u(t))&&s.length>r&&!s.warned&&(s.warned=!0,(n=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",n.emitter=t,n.type=e,n.count=s.length,i=n,console)&&console.warn&&console.warn(i)),t}function d(t,e,i){t={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},e=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(t);return e.listener=i,t.wrapFn=e}function f(t,e,i){t=t._events;if(void 0===t)return[];t=t[e];if(void 0===t)return[];if("function"==typeof t)return i?[t.listener||t]:[t];if(i){for(var n=t,r=new Array(n.length),s=0;s<r.length;++s)r[s]=n[s].listener||n[s];return r}return g(t,t.length)}function p(t){var e=this._events;if(void 0!==e){e=e[t];if("function"==typeof e)return 1;if(void 0!==e)return e.length}return 0}function g(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}function m(i,n,r,s){if("function"==typeof i.on)s.once?i.once(n,r):i.on(n,r);else{if("function"!=typeof i.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof i);i.addEventListener(n,function t(e){s.once&&i.removeEventListener(n,t),r(e)})}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");o=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return u(this)},a.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var n="error"===t,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){if((s=0<e.length?e[0]:s)instanceof Error)throw s;n=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw n.context=s,n}var s=r[t];if(void 0===s)return!1;if("function"==typeof s)h(s,this,e);else for(var a=s.length,o=g(s,a),i=0;i<a;++i)h(o[i],this,e);return!0},a.prototype.on=a.prototype.addListener=function(t,e){return c(this,t,e,!1)},a.prototype.prependListener=function(t,e){return c(this,t,e,!0)},a.prototype.once=function(t,e){return l(e),this.on(t,d(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return l(e),this.prependListener(t,d(this,t,e)),this},a.prototype.off=a.prototype.removeListener=function(t,e){var i,n,r,s,a;if(l(e),void 0!==(n=this._events)&&void 0!==(i=n[t]))if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(r=-1,s=i.length-1;0<=s;s--)if(i[s]===e||i[s].listener===e){a=i[s].listener,r=s;break}if(r<0)return this;if(0===r)i.shift();else{for(var o=i,h=r;h+1<o.length;h++)o[h]=o[h+1];o.pop()}1===i.length&&(n[t]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",t,a||e)}return this},a.prototype.removeAllListeners=function(t){var e,i=this._events;if(void 0!==i)if(void 0===i.removeListener)0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]);else if(0===arguments.length){for(var n,r=Object.keys(i),s=0;s<r.length;++s)"removeListener"!==(n=r[s])&&this.removeAllListeners(n);this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0}else if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(s=e.length-1;0<=s;s--)this.removeListener(t,e[s]);return this},a.prototype.listeners=function(t){return f(this,t,!0)},a.prototype.rawListeners=function(t){return f(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return 0<this._eventsCount?r(this._events):[]}},{}],18:[function(t,e,i){var n,r=t("http"),s=t("url"),a=e.exports;for(n in r)r.hasOwnProperty(n)&&(a[n]=r[n]);function o(t){if((t="string"==typeof t?s.parse(t):t).protocol||(t.protocol="https:"),"https:"!==t.protocol)throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}a.request=function(t,e){return t=o(t),r.request.call(this,t,e)},a.get=function(t,e){return t=o(t),r.get.call(this,t,e)}},{http:38,url:58}],19:[function(t,e,i){i.read=function(t,e,i,n,r){var s,a,o=8*r-n-1,h=(1<<o)-1,l=h>>1,u=-7,c=i?r-1:0,d=i?-1:1,r=t[e+c];for(c+=d,s=r&(1<<-u)-1,r>>=-u,u+=o;0<u;s=256*s+t[e+c],c+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=n;0<u;a=256*a+t[e+c],c+=d,u-=8);if(0===s)s=1-l;else{if(s===h)return a?NaN:1/0*(r?-1:1);a+=Math.pow(2,n),s-=l}return(r?-1:1)*a*Math.pow(2,s-n)},i.write=function(t,e,i,n,r,s){var a,o,h=8*s-r-1,l=(1<<h)-1,u=l>>1,c=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,f=n?1:-1,s=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(n=Math.pow(2,-a))<1&&(a--,n*=2),2<=(e+=1<=a+u?c/n:c*Math.pow(2,1-u))*n&&(a++,n/=2),l<=a+u?(o=0,a=l):1<=a+u?(o=(e*n-1)*Math.pow(2,r),a+=u):(o=e*Math.pow(2,u-1)*Math.pow(2,r),a=0));8<=r;t[i+d]=255&o,d+=f,o/=256,r-=8);for(a=a<<r|o,h+=r;0<h;t[i+d]=255&a,d+=f,a/=256,h-=8);t[i+d-f]|=128*s}},{}],20:[function(t,e,i){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){var i;e&&(t.super_=e,(i=function(){}).prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t)}},{}],21:[function(t,e,i){e.exports={Renderer:t("./map-fragment/draw/renderer").Renderer,Settings:t("./map-fragment/draw/renderer").Settings,MapReader:t("./map-fragment/reader/MapReader").MapReader}},{"./map-fragment/draw/renderer":23,"./map-fragment/reader/MapReader":25}],22:[function(t,e,i){const n=t("paper"),r=t("../reader/PathFinder")["PathFinder"];function s(t){var e={strokeColor:new n.Color(180/255,93/255,60/255,.9)};return t.closed&&(e.fillColor=new n.Color(new n.Gradient([[t.fillColor,.38],new n.Color(1,1,1)],!1),t.bounds.topCenter,t.bounds.bottomCenter)),e}n.Item.prototype.select=function(t){if(this.mapSelected=!this.mapSelected,this.mapSelected&&void 0!==t){t=t(this);this.orgStyle={};for(const e in t)this.orgStyle[e]=this[e];this.style=t}else this.style=this.orgStyle};e.exports={Controls:class{constructor(t,e,i,n){this.renderer=t,this.reader=e,this.element=i,this.scope=n,this.view=n.view,this.element.onwheel=t=>this.zoom(t),this.activateDrag(),this.renderer.emitter.addEventListener("roomClick",t=>this.selectRoom(t.detail)),this.renderer.emitter.addEventListener("backgroundClick",()=>this.deselectRoom()),this.renderer.emitter.addEventListener("areaArrowClick",t=>this.goToRoomArea(t.detail));t=this.renderer.getBounds();this.view.center=t.center,this.view.zoom=Math.min(this.view.size.width/t.width,this.view.size.height/t.height),this.view.minZoom=this.view.zoom,this.pathFinder=new r(e)}zoom(t){t.preventDefault();var e=this.view.zoom,t=(this.deltaZoom(0<t.deltaY?.9:1.1),this.view.viewToProject(new n.Point(t.offsetX,t.offsetY))),e=e/this.view.zoom,i=t.subtract(this.view.center),t=t.subtract(i.multiply(e)).subtract(this.view.center);this.view.center=this.view.center.add(t)}setZoom(t){this.view.zoom=t,this.view.zoom=Math.min(Math.max(this.view.zoom,this.view.minZoom),50),this.element.dispatchEvent(new CustomEvent("zoom",{detail:this.view}))}deltaZoom(t){this.setZoom(this.view.zoom*t)}activateDrag(){var t=new n.Tool;t.activate(),t.onMouseDrag=t=>{this.toggleOptimizedDrag(!0),this.element.style.cursor="all-scroll";t=t.downPoint.subtract(t.point);this.view.translate(t.negate()),this.isDrag=!0,this.element.dispatchEvent(new CustomEvent("drag",{detail:this.view}))},t.onMouseDown=()=>{this.isDrag=!1,this.element.dispatchEvent(new CustomEvent("drag",{detail:this.view}))},t.onMouseUp=()=>{this.isDrag=!1,this.element.style.cursor="default",this.toggleOptimizedDrag(!1)}}toggleOptimizedDrag(t){this.renderer.settings.optimizeDrag&&(t?this.isDrag||(this.renderer.linkLayer.visible=!1,this.renderer.roomLayer.visible=!1,this.renderer.rasterLayer.visible=!0):(this.renderer.linkLayer.visible=!0,this.renderer.roomLayer.visible=!0,this.renderer.rasterLayer.visible=!1))}selectRoom(t){if(this.isDrag)return!1;this.deselectRoom(),this.renderer.renderPosition(t.id),t.render.select(s),t.exitsRenders.forEach(t=>t.select(s)),this.selected=t,this.element.dispatchEvent(new CustomEvent("roomSelected",{detail:t}))}deselectRoom(){if(this.isDrag)return!1;this.renderer.clearPosition(),this.renderer.clearHighlight(),void 0!==this.selected&&(this.selected.render.select(),this.selected.exitsRenders.forEach(t=>t.select()),delete this.selected,this.element.dispatchEvent(new CustomEvent("roomDeselected")))}centerRoom(t){t=this.renderer.area.getRoomById(t);void 0!==t&&(this.centerOnItem(t.render),this.selectRoom(t))}centerOnItem(t){this.view.center=t.localToGlobal(t.position)}goToRoomArea(t){t=this.reader.getRoomById(t);this.element.dispatchEvent(new CustomEvent("goToArea",{detail:t}))}move(t,e){this.view.translate(new n.Point(50*t,50*e).negate())}renderPath(t,e,i){t=this.pathFinder.path(t,e)?.map(t=>parseInt(t));if(t)return this.renderer.renderPath(t,i)}}}},{"../reader/PathFinder":26,paper:32}],23:[function(t,e,i){const u=t("paper");t("../reader/MapReader").MapReader;const n=t("./controls").Controls,s={OPEN_DOOR:new u.Color(10/255,155/255,10/255),CLOSED_DOOR:new u.Color(226/255,205/255,59/255),LOCKED_DOOR:new u.Color(155/255,10/255,10/255),DEFAULT_BACKGROUND:new u.Color(0,0,0),DEFAULT:new u.Color(1,1,1)};class a{constructor(){this.isRound=!1,this.scale=55,this.roomSize=10,this.exitsSize=2,this.borders=!1,this.frameMode=!1,this.areaName=!0,this.showLabels=!0,this.uniformLevelSize=!1,this.fontFamily="sans-serif",this.mapBackground=s.DEFAULT_BACKGROUND,this.linesColor=s.DEFAULT,this.transparentLabels=!1,this.emboss=!1}}u.Item.prototype.registerClick=function(t){"undefined"!=typeof document&&(this.onClick=t)},u.Item.prototype.pointerReactor=function(t){"undefined"!=typeof document&&(this.onMouseEnter=()=>t.style.cursor="pointer",this.onMouseLeave=()=>t.style.cursor="default")};function c(t,e){for(var i in t)if(t.hasOwnProperty(i)&&t[i]===e)return i}e.exports={Renderer:class{constructor(t,e,i,n,r){this.settings=new a,Object.assign(this.settings,r),this.reader=e,this.area=i,this.colors=n,this.scale=this.settings.scale,this.grideSize=this.settings.gridSize,this.roomSize=this.settings.roomSize,this.roomFactor=this.roomSize/20,this.exitFactor=.01*this.settings.exitsSize,this.roomDiagonal=this.roomFactor*Math.sqrt(2),this.innerExits=["up","down","u","d","in","out","i","u"],this.paper=new u.PaperScope,this.bounds=this.area.getAreaBounds(this.settings.uniformLevelSize),null==t?(t=new u.Size((this.bounds.width+14)*this.scale,(this.bounds.height+14)*this.scale),this.isVisual=!1):(this.isVisual=!0,this.emitter=new EventTarget),this.paper.setup(t),this.element=t,this.backgroundLayer=new u.Layer,this.bgLabels=new u.Layer,this.linkLayer=new u.Layer,this.roomLayer=new u.Layer,this.rasterLayer=new u.Layer,this.labelsLayer=new u.Layer,this.specialLinkLayer=new u.Layer,this.charsLayer=new u.Layer,this.overlayLayer=new u.Layer,this.exitsRendered={},this.defualtColor=new u.Color(this.colors.default[0]/255,this.colors.default[1]/255,this.colors.default[2]/255),this.highlights=new u.Group,this.highlights.locked=!0,this.path=[],this.render()}render(t=!1){this.pngRender=t,this.renderBackground(this.bounds.minX-7,this.bounds.minY-7,this.bounds.maxX+7,this.bounds.maxY+7),this.renderHeader(this.bounds.minX-3.5,this.bounds.maxY+3.5),this.area.rooms.filter(t=>t.z==this.area.zIndex).forEach(t=>{this.renderRoom(t)}),void 0!==this.area.labels&&this.settings.showLabels&&(this.bgLabels.activate(),this.area.labels.filter(t=>t.Z==this.area.zIndex).forEach(t=>this.renderLabel(t),this)),this.matrix=new u.Matrix(1,0,0,-1,7-this.bounds.minX,this.bounds.maxY+7).scale(this.scale,new u.Point(this.bounds.minX,this.bounds.maxY)),this.settings.optimizeDrag&&(this.rasterLayer.activate(),this.linkRaster=this.linkLayer.rasterize({resolution:2e3}),this.roomRaster=this.roomLayer.rasterize({resolution:2e3}),this.rasterLayer.visible=!1),this.transform(),this.isVisual&&(this.controls=new n(this,this.reader,this.element,this.paper),this.element.dispatchEvent(new CustomEvent("renderComplete",{detail:this})))}transform(){let e=+this.scale;this.paper.project.layers.forEach(t=>{t.applyMatrix=!1,t.matrix=new u.Matrix(1,0,0,-1,-this.bounds.minX+e,this.bounds.maxY+e).scale(this.scale,new u.Point(this.bounds.minX,this.bounds.maxY))})}renderBackground(t,e,i,n){this.backgroundLayer.activate();t=new u.Path.Rectangle(new u.Point(t,e),new u.Point(i,n));t.fillColor=new u.Color(this.settings.mapBackground),t.registerClick(()=>{this.emitter.dispatchEvent(new CustomEvent("backgroundClick"))})}renderHeader(t,e){this.settings.areaName&&(this.backgroundLayer.activate(),(t=new u.PointText(t,e)).fillColor=new u.Color(1,1,1,1),t.fontSize=2.5,t.fontFamily=this.settings.fontFamily,t.content=this.area.areaName,t.scale(1,-1))}renderRoom(e){this.roomLayer.activate();let t,i=(t=this.settings.isRound?new u.Path.Circle(new u.Point(e.x+this.roomFactor/2,e.y+this.roomFactor/2),this.roomFactor/2):new u.Path.Rectangle(new u.Point(e.x,e.y),new u.Size(this.roomFactor,this.roomFactor)),this.colors[e.env]);void 0===i&&(i=[114,1,0]);var n,r,s,a,o=new u.Color(i[0]/255,i[1]/255,i[2]/255,1);for(n in t.fillColor=this.settings.frameMode?new u.Color(this.settings.mapBackground):o,t.strokeWidth=this.exitFactor,t.strokeColor=!this.settings.borders||this.settings.frameMode?o:this.settings.linesColor,e.render=t,e.exitsRenders=null!=e.exitsRenders?e.exitsRenders:[],e.exits)this.innerExits.indexOf(n)<=-1?e.exits.hasOwnProperty(n)&&!e.customLines.hasOwnProperty(d(n))&&this.renderLink(e,e.exits[n],n):this.renderInnerExit(e,n);for(r in e.specialExits)e.specialExits.hasOwnProperty(r)&&!e.customLines.hasOwnProperty(r)&&this.renderSpecialLink(e,e.specialExits[r],r);for(s in e.customLines)this.renderCustomLine(e,s,e.exits[l(s)]??e.specialExits[l(s)]);for(a in e.stubs)this.renderStub(e,h[e.stubs[a]]);if(this.settings.emboss){this.overlayLayer.activate();let t;.41<new u.Color(this.settings.linesColor).lightness?(t=new u.Path([e.render.bounds.topLeft,e.render.bounds.topRight,e.render.bounds.bottomRight])).strokeColor="#000000":(t=t=new u.Path([e.render.bounds.topLeft,e.render.bounds.bottomLeft,e.render.bounds.bottomRight])).strokeColor="#ffffff",t.strokeWidth=this.exitFactor}this.renderChar(e),t.pointerReactor(this.element),t.registerClick(()=>{this.emitter.dispatchEvent(new CustomEvent("roomClick",{detail:e}))})}renderLink(n,r,t){var s=new Array(n.id,r).sort().join("#");if(!this.exitsRendered[s]||void 0!==n.doors[d(t)]){this.linkLayer.activate();var a=this.area.getRoomById(r),o=new u.Point(this.getExitX(n.x,t),this.getExitY(n.y,t));let e=new u.Path,i;if(a){var h=c(a.exits,n.id),l=null==h;i=new u.Point(this.getExitX(a.x,h),this.getExitY(a.y,h)),l?this.renderArrow(o,i,this.settings.linesColor,[],this.exitFactor,this.settings.linesColor,!0):(e.moveTo(o),e.lineTo(i),e.strokeWidth=this.exitFactor,e.strokeColor=this.settings.linesColor)}else{i=new u.Point(n.x+this.roomFactor/2,n.y+this.roomFactor/2);let t=this.colors[this.reader.getRoomById(r).env];void 0===t&&(t=[114,1,0]),(e=this.renderArrow(o,i,new u.Color(t[0]/255,t[1]/255,t[2]/255),[],this.exitFactor)).rotate(180,o),e.scale(2),e.pointerReactor(this.element),e.registerClick(()=>this.emitter.dispatchEvent(new CustomEvent("areaArrowClick",{detail:r})))}return void 0!==n.doors[d(t)]&&this.renderDoors(o,i,n.doors[d(t)]),this.exitsRendered[s]=!0,n.exitsRenders.push(e),a&&(a.exitsRenders=null!=a.exitsRenders?a.exitsRenders:[],a.exitsRenders.push(e)),e}}renderSpecialLink(e,t,i){this.linkLayer.activate();let n;var r,s=new u.Point(e.x+this.roomFactor/2,e.y+this.roomFactor/2);let a=this.area.getRoomById(t),o;return a&&0==Object.entries(a.specialExits).filter(t=>t[1]==e.id).filter(t=>Object.keys(a.specialExits).indexOf(-1!=t[0])).length?((n=new u.Path).moveTo(s),r=c(a.exits,e.id),o=new u.Point(this.getExitX(a.x,r),this.getExitY(a.y,r)),n.lineTo(o),n.strokeColor=this.settings.linesColor,n.strokeWidth=this.exitFactor):(o=new u.Point(e.x+this.roomFactor/2,e.y+this.roomFactor/2),(n=this.renderArrow(s,o,this.defualtColor,[],this.exitFactor)).strokeColor=this.settings.linesColor,n.scale(1,s),n.rotate(180,s),n.registerClick(()=>this.emitter.dispatchEvent(new CustomEvent("areaArrowClick",{detail:t})))),e.exitsRenders.push(n),a&&(a.exitsRenders=a.exitsRenders??[],a.exitsRenders.push(n)),n}renderCustomLine(t,i,e){if(void 0===t.customLines[i].points||0!==t.customLines[i].points.length){this.linkLayer.activate();var n=new u.Group,r=new u.Path,s=t.customLines[i].attributes.style,a=("dot line"===s?(r.dashArray=[.05,.05],r.dashOffset=.1):"dash line"===s?r.dashArray=[.4,.2]:"solid line"!==s&&console.log("Brak opisu stylu: "+s),void 0!==t.customLines[i].attributes.color?(s=t.customLines[i].attributes.color,r.strokeColor=new u.Color(s.r/255,s.g/255,s.b/255)):r.strokeColor=this.defualtColor,new u.Point(t.x+this.roomFactor/2,t.y+this.roomFactor/2));if(r.moveTo(a),void 0!==t.customLines[i].points){let e=[];for(var o in t.customLines[i].points.forEach(t=>e.push(t)),e){o=e[o],o=new u.Point(o.x+this.roomFactor/2,o.y+this.roomFactor/2),a=new u.Point(o);r.lineTo(a)}}return n.addChild(r),t.customLines[i].attributes.arrow&&1<r.segments.length&&(s=this.renderArrow(r.segments[r.segments.length-2].point,r.segments[r.segments.length-1].point,r.strokeColor,r.dashArray,this.exitFactor),n.addChild(s)),r.strokeWidth=this.exitFactor,r.orgStrokeColor=r.strokeColor,this.area.getRoomById(e)||(n.registerClick(()=>this.emitter.dispatchEvent(new CustomEvent("areaArrowClick",{detail:e}))),n.pointerReactor(this.element)),t.exitsRenders.push(n),n}}renderArrow(t,e,i,n,r,s,a){var o=e,o=new u.Path.RegularPolygon(o,3,this.roomDiagonal/6),h=(o.position=o.position.add(o.bounds.topCenter.subtract(o.bounds.center)),o.rotate(e.subtract(t).getAngle()+90,e),new u.Path.Line(t,o.bounds.center)),l=new u.Group([h,o]);return l.closed=!0,o.fillColor=i,o.strokeColor=i,o.strokeWidth=this.exitFactor,h.fillColor=s||i,h.strokeColor=s||i,h.dashArray=n,h.strokeWidth=this.exitFactor,a?(o.position=new u.Point(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2),h.dashArray=[.1,.1],l.fillColor=new u.Color(1,0,0),o.scale(1.5)):h.strokeWidth=r,l}renderStub(t,e){this.linkLayer.activate();let i;var n;return-1<this.innerExits.indexOf(e)?i=this.renderInnerExit(t,e,!0):(n=new u.Point(t.x+.5*this.roomFactor,t.y+.5*this.roomFactor),t=new u.Point(this.getExitX(t.x,e),this.getExitY(t.y,e)),(i=new u.Path).moveTo(n),i.lineTo(t),i.pivot=n,i.scale(2),i.position=t,i.strokeWidth=this.exitFactor,i.strokeColor=this.settings.linesColor),i}renderInnerExit(t,e,i=!1){this.labelsLayer.activate();var n,r,s=new u.Group;return"down"!==e&&"d"!=e||s.addChild(this.renderInnerTriangle(t,e,i)),"up"!==e&&"u"!==e||(s.addChild(this.renderInnerTriangle(t,e,i)),s.rotate(180,t.render.bounds.center)),"in"!==e&&"i"!==e||((n=this.renderInnerTriangle(t,e,i)).rotate(90,t.render.bounds.center),n.scale(.4,t.render.bounds.center),n.position.x-=.01,(r=this.renderInnerTriangle(t,e,i)).scale(.4,t.render.bounds.center),r.rotate(270,t.render.bounds.center),r.position.x+=.01,s.addChild(n),s.addChild(r)),"out"!==e&&"o"!==e||((n=this.renderInnerTriangle(t,e,i)).rotate(270,t.render.bounds.center),n.scale(.5,t.render.bounds.rightCenter),n.rotate(180),n.position.x-=.01,(r=this.renderInnerTriangle(t,e,i)).rotate(90,t.render.bounds.center),r.scale(.5,t.render.bounds.leftCenter),r.rotate(180),r.position.x+=.01,s.addChild(n),s.addChild(r)),this.settings.isRound&&s.scale(.8,.8,new u.Point(t.render.bounds.center)),s.locked=!0,s}renderInnerTriangle(t,e,i){var n=new u.Path.RegularPolygon(new u.Point(t.render.bounds.bottomCenter).subtract(new u.Point(0,.2*this.roomFactor)),3,.3*this.roomFactor),r=(n.scale(1.2,.75),this.lightnessDependantColor(t)),i=(n.strokeWidth=this.exitFactor,i||(n.fillColor=new u.Color(r,r,r,.75)),n.strokeColor=new u.Color(r,r,r),t.doors[l(e)]);if(void 0!==i)switch(i){case 1:n.strokeColor=s.OPEN_DOOR;break;case 2:n.strokeColor=s.CLOSED_DOOR;break;default:n.strokeColor=s.LOCKED_DOOR}return n.bringToFront(),n}renderChar(t){var e,i;this.charsLayer.activate(),t.roomChar&&(e=.85*this.roomFactor/t.roomChar.length,i=this.pngRender?t.render.position.x-.1:t.render.position.x,i=new u.PointText(i,t.render.position.y+e/4),t.userData&&void 0!==t.userData["system.fallback_symbol_color"]?i.fillColor=t.userData["system.fallback_symbol_color"]:i.fillColor=this.lightnessDependantColor(t),i.fontSize=e,i.content=t.roomChar,i.justification="center",i.locked=!0,i.scale(1,-1))}renderDoors(t,e,i){this.specialLinkLayer.activate();var n=(t.x+e.x)/2,t=(t.y+e.y)/2,r=new u.Path.Rectangle(n-.5,t-.5,1,1);switch(r.scale(.5*this.roomFactor,r.center),i){case 1:r.strokeColor=s.OPEN_DOOR;break;case 2:r.strokeColor=s.CLOSED_DOOR;break;default:r.strokeColor=s.LOCKED_DOOR}r.strokeWidth=this.exitFactor}renderLabel(t){var e=new u.Path.Rectangle(new u.Point(t.X,t.Y-t.Height),new u.Size(t.Width,t.Height)),e=(this.settings.transparentLabels||(e.fillColor=new u.Color(t.BgColor.r/255,t.BgColor.g/255,t.BgColor.b/255)),new u.PointText(e.bounds.center.add(0,1.2))),i=(e.fillColor=new u.Color(t.FgColor.r/255,t.FgColor.g/255,t.FgColor.b/255),Math.min(.75,t.Width/(t.Text.length/2)));e.fontSize=4,e.content=t.Text,e.fontFamily=this.settings.fontFamily,e.justification="center",e.locked=!0,e.scale(i/4,-i/4)}lightnessDependantColor(t){return.41<t.render.fillColor.lightness?.1:.9}getXMid(t){return t+this.roomFactor/2}getYMid(t){return t+this.roomFactor/2}getExitX(t,e){if(this.settings.isRound)return t+.5*this.roomFactor;switch(e){case"west":case"w":case"northwest":case"nw":case"southwest":case"sw":return t;case"east":case"e":case"northeast":case"ne":case"southeast":case"se":return t+this.roomFactor;default:return t+.5*this.roomFactor}}getExitY(t,e){if(this.settings.isRound)return t+.5*this.roomFactor;switch(e){case"north":case"n":case"northwest":case"nw":case"northeast":case"ne":return t+this.roomFactor;case"south":case"s":case"southwest":case"sw":case"southeast":case"se":return t;default:return t+.5*this.roomFactor}}getRealPoint(t,e){return this.matrix.transform(new u.Point(t,e))}getBounds(){return this.backgroundLayer.getBounds()}renderPosition(t,e){this.clearPosition(),this.overlayLayer.activate();t=this.area.getRoomById(t),t=new u.Shape.Circle(new u.Point(t.x+.5*this.roomFactor,t.y+.5*this.roomFactor),.6*this.roomDiagonal);t.fillColor=new u.Color(.5,.1,.1,.2),t.strokeWidth=5*this.exitFactor,t.shadowColor=new u.Color(1,1,1),t.shadowBlur=12,void 0===e&&(e=[0,.9,.7]),t.strokeColor=new u.Color(e[0],e[1],e[2]),t.dashArray=[.05,.05],this.position=t}clearPosition(){void 0!==this.position&&this.position.remove()}renderSelection(t,e){this.clearSelection(),this.overlayLayer.activate();t=this.area.getRoomById(t),t=new u.Path.Rectangle(new u.Point(t.x-.05,t.y-.05),new u.Size(this.roomFactor+.1,this.roomFactor+.1));t.fillColor=new u.Color(1,1,1,0),t.strokeWidth=this.exitFactor,void 0===e&&(e=[0,.9,.7]),t.strokeColor=new u.Color(e[0],e[1],e[2]),this.selection=t}clearSelection(){void 0!==this.selection&&this.selection.remove()}renderHighlight(t,e){this.overlayLayer.activate();var t=this.area.getRoomById(t),i=new u.Shape.Circle(new u.Point(t.x+.5*this.roomFactor,t.y+.5*this.roomFactor),.6*this.roomDiagonal);i.fillColor=new u.Color(.5,.1,.1,.2),i.strokeWidth=4*this.exitFactor,i.shadowColor=t.render.fillColor,i.shadowBlur=12,void 0===e&&(e=[.4,.9,.3]),i.strokeColor=new u.Color(e[0],e[1],e[2]),i.dashArray=[.1,.1],i.locked=!0,this.highlights.addChild(i)}clearHighlight(){this.highlights.removeChildren()}renderPath(i,n){this.overlayLayer.activate();let r=new u.Group;return i.forEach(t=>{t=this.area.getRoomById(t);if(t&&t.z===this.area.zIndex){let e=new u.Point(t.x+.5*this.roomFactor,t.y+.5*this.roomFactor);Object.values(t.exits).concat(Object.values(t.specialExits)).forEach(t=>{-1<i.indexOf(t)&&(t=this.area.getRoomById(t))&&t.z===this.area.zIndex&&(t=new u.Point(t.x+.5*this.roomFactor,t.y+.5*this.roomFactor),(t=new u.Path.Line(e,t)).strokeWidth=4*this.exitFactor,void 0===n&&(n=[.4,.9,.3]),this.path.push(t),r.addChild(t))})}}),r.strokeColor=new u.Color(n[0],n[1],n[2]),r.locked=!0,r}clearPath(){this.path.forEach(t=>t.remove()),this.path=[]}clear(){this.paper.clear()}exportSvg(t,e){let i="content";if(void 0!==t){var n=this.reader.roomIndex[t];if(void 0===n)throw new Error(`Room ${t} not found.`);i=new u.Rectangle(this.getRealPoint(new u.Point(n.x,n.y)).subtract(e*this.scale),2*e*this.scale,2*e*this.scale)}return this.paper.project.exportSVG({asString:!0,bounds:i})}},Settings:a};let r={north:"n",south:"s",east:"e",west:"w",northeast:"ne",northwest:"nw",southeast:"se",southwest:"sw",up:"u",down:"d",in:"i",out:"o"},h={1:"n",2:"ne",3:"nw",4:"e",5:"w",6:"s",7:"se",8:"sw",9:"u",10:"d",11:"i",12:"o"};function l(t){var e=c(r,t);return void 0!==e?e:t}function d(t){return void 0!==r[t]?r[t]:t}},{"../reader/MapReader":25,"./controls":22,paper:32}],24:[function(t,e,i){e.exports={Area:class r{constructor(t,e,i,n,r,s){this.areaId=parseInt(t),this.areaName=e,this.rooms=[],this.labels=n,i.forEach(t=>this.rooms[t.id]=t),this.levels=s,this.zIndex=r}getAreaBounds(s=!1){if(void 0===this.bounds){let e=9999999999,i=9999999999,n=-9999999999,r=-9999999999;this.rooms.forEach(t=>{!s&&t.z!==this.zIndex||(e=Math.min(e,t.x),i=Math.min(i,t.y),n=Math.max(n,t.x),r=Math.max(r,t.y))}),this.labels.forEach(t=>{!s&&t.Z!==this.zIndex||(e=Math.min(e,t.X),i=Math.min(i,t.Y),n=Math.max(n,t.X+t.Width),r=Math.max(r,t.Y+t.Height))}),this.bounds={minX:e,minY:i,maxX:n,maxY:r}}return this.bounds}getRoomById(t){return this.rooms[t]}getLevels(){return this.levels}getZIndex(){return this.zIndex}limit(t,e){let i={xMin:(t=this.rooms[t]).x-e,xMax:t.x+e,yMin:t.y-e,yMax:t.y+e},n=this.rooms.filter(t=>i.xMin<t.x&&i.xMax>t.x&&i.yMin<t.y&&i.yMax>t.y).map(t=>t.id);return new r(this.areaId,this.areaName,this.rooms.filter(t=>n.includes(t.id)||0<Object.values(t.exits).filter(t=>n.includes(t)).length),this.labels.filter(t=>i.xMin<t.X&&i.xMax>t.X&&i.yMin<t.Y&&i.yMax>t.Y),this.zIndex,this.levels)}}}},{}],25:[function(t,e,i){let a=t("./Area").Area;e.exports={MapReader:class{constructor(t,e){this.mapDataIndex={},this.roomIndex={},this.data=t,this.data.sort(function(t,e){return t.areaName<e.areaName?-1:t.areaName>e.areaName?1:0}),t.forEach((e,t)=>{this.mapDataIndex[e.areaId]=t,e.rooms.forEach(t=>{t.areaId=e.areaId,this.roomIndex[t.id]=t})}),this.colors={},e.forEach(t=>{this.colors[parseInt(t.envId)]=t.colors}),this.colors.default=[255,255,255]}getAreas(){return this.data}getArea(t,e,i){var n=this.data[this.mapDataIndex[t]];let r=new Set,s=new a(t,n.areaName,n.rooms.filter(t=>{r.add(parseInt(t.z));let e=!0;return e=i?i.xMin<t.x&&i.xMax>t.x&&i.yMin<t.y&&i.yMax>t.y:e}),n.labels.filter(t=>{let e=!0;return e=i?i.xMin<t.X&&i.xMax>t.X&&i.yMin<t.Y&&i.yMax>t.Y:e}),e,r);return s=0<n.rooms.length&&!r.has(e)?this.getArea(t,r.values().next().value):s}getAreaProperties(t){return this.data[this.mapDataIndex[t]]}getAreaByRoomId(t,e){t=this.getRoomById(t);if(void 0!==t)return this.getArea(t.areaId,t.z,e)}getColors(){return this.colors}getRoomById(t){return this.roomIndex[t]}}}},{"./Area":24}],26:[function(t,e,i){var{}=t("./MapReader");const n=t("node-dijkstra");e.exports={PathFinder:class{constructor(t){this.route=new n,t.getAreas().forEach(t=>t.rooms.forEach(t=>{var e=Object.values(t.exits).concat(Object.values(t.specialExits)).map(t=>[t,1]);this.route.addNode(t.id.toString(),Object.fromEntries(e))}))}path(t,e){return this.route.path(t.toString(),e.toString())}}}},{"./MapReader":25,"node-dijkstra":27}],27:[function(t,e,i){const u=t("./PriorityQueue"),n=t("./removeDeepFromMap"),r=t("./toDeepMap"),s=t("./validateDeep");e.exports=class{constructor(t){t instanceof Map?(s(t),this.graph=t):this.graph=t?r(t):new Map}addNode(t,e){let i;return i=e instanceof Map?(s(e),e):r(e),this.graph.set(t,i),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=n(this.graph,t),this}path(t,e,i={}){if(!this.graph.size)return i.cost?{path:null,cost:0}:null;const r=new Set,s=new u,a=new Map;let n=[],o=0,h=[];if((h=i.avoid?[].concat(i.avoid):h).includes(t))throw new Error(`Starting node (${t}) cannot be avoided`);if(h.includes(e))throw new Error(`Ending node (${e}) cannot be avoided`);for(s.set(t,0);!s.isEmpty();){const l=s.next();if(l.key===e){o=l.priority;let t=l.key;for(;a.has(t);)n.push(t),t=a.get(t);break}r.add(l.key),(this.graph.get(l.key)||new Map).forEach((t,e)=>{var i,n;return r.has(e)||h.includes(e)?null:s.has(e)?(i=s.get(e).priority,(n=l.priority+t)<i?(a.set(e,l.key),s.set(e,n)):null):(a.set(e,l.key),s.set(e,l.priority+t))})}return n.length?(i.trim?n.shift():n=n.concat([t]),i.reverse||(n=n.reverse()),i.cost?{path:n,cost:o}:n):i.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}}},{"./PriorityQueue":28,"./removeDeepFromMap":29,"./toDeepMap":30,"./validateDeep":31}],28:[function(t,e,i){e.exports=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(e,t){const i=Number(t);if(isNaN(i))throw new TypeError('"priority" must be a number');return this.keys.has(e)?this.queue.map(t=>(t.key===e&&Object.assign(t,{priority:i}),t)):(this.keys.add(e),this.queue.push({key:e,priority:i})),this.sort(),this.queue.length}next(){var t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return Boolean(0===this.queue.length)}has(t){return this.keys.has(t)}get(e){return this.queue.find(t=>t.key===e)}}},{}],29:[function(t,e,i){e.exports=function t(e,i){var n,r,s=new Map;for([n,r]of e)n!==i&&r instanceof Map?s.set(n,t(r,i)):n!==i&&s.set(n,r);return s}},{}],30:[function(t,e,i){e.exports=function n(r){const s=new Map;return Object.keys(r).forEach(t=>{var e,i=r[t];if(null!==i&&"object"==typeof i&&!Array.isArray(i))return s.set(t,n(i));if(e=i,e=Number(e),isNaN(e)||e<=0)throw new Error(`Could not add node at key "${t}", make sure it's a valid node`,i);return s.set(t,Number(i))}),s}},{}],31:[function(t,e,i){e.exports=function i(t){if(!(t instanceof Map))throw new Error("Invalid graph: Expected Map instead found "+typeof t);t.forEach((t,e)=>{if("object"==typeof t&&t instanceof Map)i(t);else if("number"!=typeof t||t<=0)throw new Error(`Values must be numbers greater than 0. Found value ${t} at `+e)})}},{}],32:[function(Bt,jt,t){(function(b,j){var p,s,a,C,k,E,i,T=(b=b||Bt("./node/self.js")).window,I=b.document,z=new function(){function r(t,e){for(var i in this)this.hasOwnProperty(i)&&t.call(e,this[i],i,this)}function i(t,e,i){var n;return t&&((n=d(t,"length"))&&"number"==typeof n.value?o:r).call(t,e,i=i||t),i}var s=/^(statics|enumerable|beans|preserve)$/,t=[],n=t.slice,a=Object.create,d=Object.getOwnPropertyDescriptor,f=Object.defineProperty,o=t.forEach||function(t,e){for(var i=0,n=this.length;i<n;i++)t.call(e,this[i],i,this)},h=Object.assign||function(t){for(var e=1,i=arguments.length;e<i;e++){var n,r=arguments[e];for(n in r)r.hasOwnProperty(n)&&(t[n]=r[n])}return t};function l(a,o,h,l,u){var c={};function t(t,e){var i,n="function"==typeof(e="string"==typeof(e=e||(e=d(o,t))&&(e.get?e:e.value))&&"#"===e[0]?a[e.substring(1)]||e:e),r=e,s=u||n&&!e.base?e&&e.get?t in a:a[t]:null;u&&s||(n&&s&&(e.base=s),n&&!1!==l&&(i=t.match(/^([gs]et|is)(([A-Z])(.*))$/))&&(c[i[3].toLowerCase()+i[4]]=i[2]),r&&!n&&r.get&&"function"==typeof r.get&&p.isPlainObject(r)||(r={value:r,writable:!0}),(d(a,t)||{configurable:!0}).configurable&&(r.configurable=!0,r.enumerable=null!=h?h:!i),f(a,t,r))}if(o){for(var e in o)o.hasOwnProperty(e)&&!s.test(e)&&t(e);for(var e in c){var i=c[e],n=a["set"+i],i=a["get"+i]||n&&a["is"+i];!i||!0!==l&&0!==i.length||t(e,{get:i,set:n})}}return a}function p(){for(var t=0,e=arguments.length;t<e;t++){var i=arguments[t];i&&h(this,i)}return this}return l(p,{inject:function(t){var e,i,n;t&&(e=!0===t.statics?t:t.statics,i=t.beans,n=t.preserve,e!==t&&l(this.prototype,t,t.enumerable,i,n),l(this,e,null,i,n));for(var r=1,s=arguments.length;r<s;r++)this.inject(arguments[r]);return this},extend:function(){for(var t,e,i,n=this,r=0,s=arguments.length;r<s&&(!t||!e);r++)i=arguments[r],t=t||i.initialize,e=e||i.prototype;return e=(t=t||function(){n.apply(this,arguments)}).prototype=e||a(this.prototype),f(e,"constructor",{value:t,writable:!0,configurable:!0}),l(t,this),arguments.length&&this.inject.apply(t,arguments),t.base=n,t}}).inject({enumerable:!1,initialize:p,set:p,inject:function(){for(var t=0,e=arguments.length;t<e;t++){var i=arguments[t];i&&l(this,i,i.enumerable,i.beans,i.preserve)}return this},extend:function(){var t=a(this);return t.inject.apply(t,arguments)},each:function(t,e){return i(this,t,e)},clone:function(){return new this.constructor(this)},statics:{set:h,each:i,create:a,define:f,describe:d,clone:function(t){return h(new t.constructor,t)},isPlainObject:function(t){t=null!=t&&t.constructor;return t&&(t===Object||t===p||"Object"===t.name)},pick:function(t,e){return t!==j?t:e},slice:function(t,e,i){return n.call(t,e,i)}}})},t=(void 0!==jt&&(jt.exports=z),z.inject({enumerable:!1,toString:function(){return null!=this._id?(this._class||"Object")+(this._name?" '"+this._name+"'":" @"+this._id):"{ "+z.each(this,function(t,e){/^_/.test(e)||this.push(e+": "+("number"==(e=typeof t)?w.instance.number(t):"string"==e?"'"+t+"'":t))},[]).join(", ")+" }"},getClassName:function(){return this._class||""},importJSON:function(t){return z.importJSON(t,this)},exportJSON:function(t){return z.exportJSON(this,t)},toJSON:function(){return z.serialize(this)},set:function(t,e){return t&&z.filter(this,t,e,this._prioritize),this}},{beans:!1,statics:{exports:{},extend:function t(){var e=t.base.apply(this,arguments),i=e.prototype._class;return i&&!z.exports[i]&&(z.exports[i]=e),e},equals:function(t,e){if(t===e)return!0;if(t&&t.equals)return t.equals(e);if(e&&e.equals)return e.equals(t);if(t&&e&&"object"==typeof t&&"object"==typeof e){if(Array.isArray(t)&&Array.isArray(e)){if((i=t.length)!==e.length)return!1;for(;i--;)if(!z.equals(t[i],e[i]))return!1}else{var i,n=Object.keys(t);if((i=n.length)!==Object.keys(e).length)return!1;for(;i--;){var r=n[i];if(!e.hasOwnProperty(r)||!z.equals(t[r],e[r]))return!1}}return!0}return!1},read:function(t,e,i,n){var r,s,a,o;return this===z?(r=this.peek(t,e),t.__index++,r):(s=(r=this.prototype)._readIndex,e=e||s&&t.__index||0,a=t.length,n=n||a-e,(o=t[e])instanceof this||i&&i.readNull&&null==o&&n<=1?(s&&(t.__index=e+1),o&&i&&i.clone?o.clone():o):(o=z.create(r),s&&(o.__read=!0),o=o.initialize.apply(o,0<e||e+n<a?z.slice(t,e,e+n):t)||o,s&&(t.__index=e+o.__read,(i=o.__filtered)&&(t.__filtered=i,o.__filtered=j),o.__read=j),o))},peek:function(t,e){return t[t.__index=e||t.__index||0]},remain:function(t){return t.length-(t.__index||0)},readList:function(t,e,i,n){for(var r,s=[],e=e||0,a=n?e+n:t.length,o=e;o<a;o++)s.push(Array.isArray(r=t[o])?this.read(r,0,i):this.read(t,o,i,1));return s},readNamed:function(t,e,i,n,r){var s,a,o=this.getNamed(t,e),h=o!==j;return h&&((a=t.__filtered)||(s=this.getSource(t),(a=t.__filtered=z.create(s)).__unfiltered=s),a[e]=j),this.read(h?[o]:t,i,n,r)},readSupported:function(i,n){var t=this.getSource(i),r=this,s=!1;return t&&Object.keys(t).forEach(function(t){var e;t in n&&((e=r.readNamed(i,t))!==j&&(n[t]=e),s=!0)}),s},getSource:function(t){var e,i=t.__source;return i===j&&(e=1===t.length&&t[0],i=t.__source=e&&z.isPlainObject(e)?e:null),i},getNamed:function(t,e){var i=this.getSource(t);if(i)return e?i[e]:t.__filtered||i},hasNamed:function(t,e){return!!this.getNamed(t,e)},filter:function(i,n,r,t){var s;function e(t){var e;r&&t in r||s&&t in s||(e=n[t])!==j&&(i[t]=e)}if(t){for(var a,o={},h=0,l=t.length;h<l;h++)(a=t[h])in n&&(e(a),o[a]=!0);s=o}return Object.keys(n.__unfiltered||n).forEach(e),i},isPlainValue:function(t,e){return z.isPlainObject(t)||Array.isArray(t)||e&&"string"==typeof t},serialize:function(t,e,i,n){e=e||{};var r=!n;if(r&&(e.formatter=new w(e.precision),n={length:0,definitions:{},references:{},add:function(t,e){var i="#"+t._id,n=this.references[i];return n||(this.length++,e=e.call(t),(t=t._class)&&e[0]!==t&&e.unshift(t),this.definitions[i]=e,n=this.references[i]=[i]),n}}),t&&t._serialize){var s=t._serialize(e,n),a=t._class;!a||t._compactSerialize||!r&&i||s[0]===a||s.unshift(a)}else if(Array.isArray(t)){s=[];for(var o=0,h=t.length;o<h;o++)s[o]=z.serialize(t[o],e,i,n)}else if(z.isPlainObject(t)){s={};for(var l=Object.keys(t),o=0,h=l.length;o<h;o++){var u=l[o];s[u]=z.serialize(t[u],e,i,n)}}else s="number"==typeof t?e.formatter.number(t,e.precision):t;return r&&0<n.length?[["dictionary",n.definitions],s]:s},deserialize:function(t,e,i,n,r){var s=t,a=!i,o=a&&t&&t.length&&"dictionary"===t[0][0];if(i=i||{},Array.isArray(t)){var h=t[0],l="dictionary"===h;if(1==t.length&&/^#/.test(h))return i.dictionary[h];s=[];for(var u,c=(h=z.exports[h])?1:0,d=t.length;c<d;c++)s.push(z.deserialize(t[c],e,i,l,o));h&&(u=s,s=e?e(h,u,a||r):new h(u))}else if(z.isPlainObject(t))for(var f in s={},n&&(i.dictionary=s),t)s[f]=z.deserialize(t[f],e,i);return o?s[1]:s},exportJSON:function(t,e){t=z.serialize(t,e);return e&&0==e.asString?t:JSON.stringify(t)},importJSON:function(t,s){return z.deserialize("string"==typeof t?JSON.parse(t):t,function(t,e,i){var n,i=i&&s&&s.constructor===t,r=i?s:z.create(t.prototype);return!(1===e.length&&r instanceof V)||!i&&r instanceof Z||(n=e[0],z.isPlainObject(n)&&(n.insert=!1,i)&&(e=e.concat([V.INSERT]))),(i?r.set:t).apply(r,e),i&&(s=null),r})},push:function(t,e){var i=e.length;if(i<4096)t.push.apply(t,e);else{var n=t.length;t.length+=i;for(var r=0;r<i;r++)t[n+r]=e[r]}return t},splice:function(t,e,i,n){var r=e&&e.length,s=i===j;(i=s?t.length:i)>t.length&&(i=t.length);for(var a=0;a<r;a++)e[a]._index=i+a;if(s)return z.push(t,e),[];for(var s=[i,n],o=(e&&z.push(s,e),t.splice.apply(t,s)),a=0,h=o.length;a<h;a++)o[a]._index=j;for(a=i+r,h=t.length;a<h;a++)t[a]._index=a;return o},capitalize:function(t){return t.replace(/\b[a-z]/g,function(t){return t.toUpperCase()})},camelize:function(t){return t.replace(/-(.)/g,function(t,e){return e.toUpperCase()})},hyphenate:function(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}}}),{on:function(t,e){var i,n;return"string"!=typeof t?z.each(t,function(t,e){this.on(e,t)},this):(i=(i=this._eventTypes)&&i[t],-1===(n=(n=this._callbacks=this._callbacks||{})[t]=n[t]||[]).indexOf(e)&&(n.push(e),i)&&i.install&&1===n.length&&i.install.call(this,t)),this},off:function(t,e){var i,n;if("string"==typeof t)return i=(i=this._eventTypes)&&i[t],(n=this._callbacks&&this._callbacks[t])&&(!e||-1!==(e=n.indexOf(e))&&1===n.length?(i&&i.uninstall&&i.uninstall.call(this,t),delete this._callbacks[t]):-1!==e&&n.splice(e,1)),this;z.each(t,function(t,e){this.off(e,t)},this)},once:function(e,i){return this.on(e,function t(){i.apply(this,arguments),this.off(e,t)})},emit:function(t,e){if(!(r=this._callbacks&&this._callbacks[t]))return!1;var i=z.slice(arguments,1),n=e&&e.target&&!e.currentTarget,r=r.slice();n&&(e.currentTarget=this);for(var s=0,a=r.length;s<a;s++)if(0==r[s].apply(this,i)){e&&e.stop&&e.stop();break}return n&&delete e.currentTarget,!0},responds:function(t){return!(!this._callbacks||!this._callbacks[t])},attach:"#on",detach:"#off",fire:"#emit",_installEvents:function(t){var e,i=this._eventTypes,n=this._callbacks,r=t?"install":"uninstall";if(i)for(var s in n)0<n[s].length&&(e=(e=i[s])&&e[r])&&e.call(this,s)},statics:{inject:function t(s){var a,e=s._events;return e&&(a={},z.each(e,function(t,e){var i="string"==typeof t,n=i?t:e,e=z.capitalize(n),r=n.substring(2).toLowerCase();a[r]=i?{}:t,n="_"+n,s["get"+e]=function(){return this[n]},s["set"+e]=function(t){var e=this[n];e&&this.off(r,e),t&&this.on(r,t),this[n]=t}}),s._eventTypes=a),t.base.apply(this,arguments)}}}),u=z.extend({_class:"PaperScope",initialize:function t(){(B=this).settings=new z({applyMatrix:!0,insertItems:!0,handleSize:4,hitTolerance:0}),this.project=null,this.projects=[],this.tools=[],this._id=t._id++,t._scopes[this._id]=this;var e,i,s,n=t.prototype;this.support||(e=A.getContext(1,1)||{},n.support={nativeDash:"setLineDash"in e||"mozDash"in e,nativeBlendModes:gt.nativeModes},A.release(e)),this.agent||(e=b.navigator.userAgent.toLowerCase(),i=(/(darwin|win|mac|linux|freebsd|sunos)/.exec(e)||[])[0],s=n.agent=n.browser={platform:n="darwin"===i?"mac":i},n&&(s[n]=!0),e.replace(/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node|jsdom)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g,function(t,e,i,n,r){s.chrome||(n="opera"===e?n:/^(node|trident)$/.test(e)?r:i,s.version=n,s.versionNumber=parseFloat(n),s.name=e={trident:"msie",jsdom:"node"}[e]||e,s[e]=!0)}),s.chrome&&delete s.webkit,s.atom&&delete s.chrome)},version:"0.12.17",getView:function(){var t=this.project;return t&&t._view},getPaper:function(){return this},execute:function(t,e){t=B.PaperScript.execute(t,this,e);return D.updateFocus(),t},install:function(e){var t,i=this;for(t in z.each(["project","view","tool"],function(t){z.define(e,t,{configurable:!0,get:function(){return i[t]}})}),this)!/^_/.test(t)&&this[t]&&(e[t]=this[t])},setup:function(t){return(B=this).project=new h(t),this},createCanvas:function(t,e){return A.getCanvas(t,e)},activate:function(){B=this},clear:function(){for(var t=this.projects,e=this.tools,i=t.length-1;0<=i;i--)t[i].remove();for(i=e.length-1;0<=i;i--)e[i].remove()},remove:function(){this.clear(),delete u._scopes[this._id]},statics:new function(){function t(i){return i+="Attribute",function(t,e){return t[i](e)||t[i]("data-paper-"+e)}}return{_scopes:{},_id:0,get:function(t){return this._scopes[t]||null},getAttribute:t("get"),hasAttribute:t("has")}}}),e=z.extend(t,{initialize:function(t){this._scope=B,this._index=this._scope[this._list].push(this)-1,!t&&this._scope[this._reference]||this.activate()},activate:function(){var t;return!!this._scope&&((t=this._scope[this._reference])&&t!==this&&t.emit("deactivate"),(this._scope[this._reference]=this).emit("activate",t),!0)},isActive:function(){return this._scope[this._reference]===this},remove:function(){return null!=this._index&&(z.splice(this._scope[this._list],null,this._index,1),this._scope[this._reference]==this&&(this._scope[this._reference]=null),!(this._scope=null))},getView:function(){return this._scope.getView()}}),K={findItemBoundsCollisions:function(t,e,i){function n(t){for(var e=new Array(t.length),i=0;i<t.length;i++){var n=t[i].getBounds();e[i]=[n.left,n.top,n.right,n.bottom]}return e}var r=n(t),t=e&&e!==t?n(e):r;return this.findBoundsCollisions(r,t,i||0)},findCurveBoundsCollisions:function(t,e,i,n){function r(t){for(var e=Math.min,i=Math.max,n=new Array(t.length),r=0;r<t.length;r++){var s=t[r];n[r]=[e(s[0],s[2],s[4],s[6]),e(s[1],s[3],s[5],s[7]),i(s[0],s[2],s[4],s[6]),i(s[1],s[3],s[5],s[7])]}return n}var s=r(t),t=e&&e!==t?r(e):s;if(n){for(var a=this.findBoundsCollisions(s,t,i||0,!1,!0),o=this.findBoundsCollisions(s,t,i||0,!0,!0),h=[],l=0,u=a.length;l<u;l++)h[l]={hor:a[l],ver:o[l]};return h}return this.findBoundsCollisions(s,t,i||0)},findBoundsCollisions:function(t,e,i,n,r){var s=!e||t===e,a=s?t:t.concat(e),o=t.length,h=a.length;function l(t,e,i){for(var n=0,r=t.length;n<r;){var s=r+n>>>1;a[t[s]][e]<i?n=1+s:r=s}return n-1}for(var u=n?1:0,c=2+u,d=n?0:1,f=2+d,p=new Array(h),g=0;g<h;g++)p[g]=g;p.sort(function(t,e){return a[t][u]-a[e][u]});for(var m=[],_=new Array(o),g=0;g<h;g++){var v=p[g],y=a[v],b=s?v:v-o,w=v<o,x=s||!w,S=w?[]:null;if(m.length){var C=l(m,c,y[u]-i)+1;if(m.splice(0,C),s&&r)for(var S=S.concat(m),k=0;k<m.length;k++)_[T=m[k]].push(b);else for(var E=y[f],A=y[d],k=0;k<m.length;k++){var T=m[k],I=a[T],L=T<o,P=s||o<=T;(r||(w&&P||x&&L)&&E>=I[d]-i&&A<=I[f]+i)&&(w&&P&&S.push(s?T:T-o),x)&&L&&_[T].push(b)}}w&&(t===e&&S.push(v),_[v]=S),m.length?(C=l(m,c,y[c]),m.splice(C+1,0,v)):m.push(v)}for(g=0;g<_.length;g++){var O=_[g];O&&O.sort(function(t,e){return t-e})}return _}},w=z.extend({initialize:function(t){this.precision=z.pick(t,5),this.multiplier=Math.pow(10,this.precision)},number:function(t){return this.precision<16?Math.round(t*this.multiplier)/this.multiplier:t},pair:function(t,e,i){return this.number(t)+(i||",")+this.number(e)},point:function(t,e){return this.number(t.x)+(e||",")+this.number(t.y)},size:function(t,e){return this.number(t.width)+(e||",")+this.number(t.height)},rectangle:function(t,e){return this.point(t,e)+(e||",")+this.size(t,e)}}),F=(w.instance=new w,new function(){var d=[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],f=[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]],_=Math.abs,v=Math.sqrt,y=Math.pow,e=Math.log2||function(t){return Math.log(t)*Math.LOG2E},b=1e-12,w=112e-18;function x(t,e,i){return t<e?e:i<t?i:t}function u(t,e,i){function n(t){var e=134217729*t,e=t-e+e;return[e,t-e]}var r,s,a=e*e-t*i,o=e*e+t*i;return 3*_(a)<o&&(o=n(t),r=n(e),s=n(i),a=(e=e*e)-(t=t*i)+(r[0]*r[0]-e+2*r[0]*r[1]+r[1]*r[1]-(o[0]*s[0]-t+o[0]*s[1]+o[1]*s[0]+o[1]*s[1]))),a}function S(){var t=Math.max.apply(Math,arguments);return t&&(t<1e-8||1e8<t)?y(2,-Math.round(e(t))):0}return{EPSILON:b,MACHINE_EPSILON:w,CURVETIME_EPSILON:1e-8,GEOMETRIC_EPSILON:1e-7,TRIGONOMETRIC_EPSILON:1e-8,ANGULAR_EPSILON:1e-5,KAPPA:4*(v(2)-1)/3,isZero:function(t){return-b<=t&&t<=b},isMachineZero:function(t){return-w<=t&&t<=w},clamp:x,integrate:function(t,e,i,n){for(var r=d[n-2],s=f[n-2],a=.5*(i-e),o=a+e,h=0,l=n+1>>1,u=1&n?s[h++]*t(o):0;h<l;){var c=a*r[h];u+=s[h++]*(t(o+c)+t(o-c))}return a*u},findRoot:function(t,e,i,n,r,s,a){for(var o=0;o<s;o++){var h=t(i),l=h/e(i),u=i-l;if(_(l)<a){i=u;break}i=0<h?(r=i,u<=n?.5*(n+r):u):(n=i,r<=u?.5*(n+r):u)}return x(i,n,r)},solveQuadratic:function(t,e,i,n,r,s){var a,o=1/0;if(_(t)<b){if(_(e)<b)return _(i)<b?-1:0;a=-i/e}else{var h=u(t,e*=-.5,i);h&&_(h)<w&&(l=S(_(t),_(e),_(i)))&&(h=u(t*=l,e*=l,i*=l)),-w<=h&&(l=h<0?0:v(h),o=0===(h=e+(e<0?-l:l))?-(a=i/t):(a=h/t,i/h))}var e=0,l=null==r,t=r-b,i=s+b;return isFinite(a)&&(l||t<a&&a<i)&&(n[e++]=l?a:x(a,r,s)),o!==a&&isFinite(o)&&(l||t<o&&o<i)&&(n[e++]=l?o:x(o,r,s)),e},solveCubic:function(e,i,n,r,t,s,a){var o,h,l,u,c,d=S(_(e),_(i),_(n),_(r));function f(t){t=e*(o=t);u=(t+(h=t+i))*o+(l=h*o+n),c=l*o+r}if(d&&(e*=d,i*=d,n*=d,r*=d),_(e)<b)e=i,h=n,l=r,o=1/0;else if(_(r)<b)h=i,l=n,o=0;else{f(-i/e/3);var d=c/e,p=y(_(d),1/3),g=d<0?-1:1,d=-u/e,d=0<d?1.324717957244746*Math.max(p,v(d)):p,m=o-g*d;if(m!==o){for(;f(m),g*o<g*(m=0===u?o:o-c/u/(1+w)););_(e)*o*o>_(r/o)&&(h=((l=-r/o)-n)/o)}}p=F.solveQuadratic(e,h,l,t,s,a),d=null==s;return isFinite(o)&&(0===p||0<p&&o!==t[0]&&o!==t[1])&&(d||s-b<o&&o<a+b)&&(t[p++]=d?o:x(o,s,a)),p}}}),o={_id:1,_pools:{},get:function(t){return t?(this._pools[t]||(this._pools[t]={_id:1}))._id++:this._id++}},P=z.extend({_class:"Point",_readIndex:!0,initialize:function(t,e){var i,n=typeof t,r=this.__read,s=0;return"number"==n?(this._set(t,(i="number"==typeof e)?e:t),r&&(s=i?2:1)):"undefined"==n||null===t?(this._set(0,0),r&&(s=null===t?1:0)):(e="string"==n?t.split(/[\s,]+/)||[]:t,s=1,Array.isArray(e)?this._set(+e[0],+(1<e.length?e[1]:e[0])):"x"in e?this._set(e.x||0,e.y||0):"width"in e?this._set(e.width||0,e.height||0):"angle"in e?(this._set(e.length||0,0),this.setAngle(e.angle||0)):(this._set(0,0),s=0)),r&&(this.__read=s),this},set:"#initialize",_set:function(t,e){return this.x=t,this.y=e,this},equals:function(t){return this===t||t&&(this.x===t.x&&this.y===t.y||Array.isArray(t)&&this.x===t[0]&&this.y===t[1])||!1},clone:function(){return new P(this.x,this.y)},toString:function(){var t=w.instance;return"{ x: "+t.number(this.x)+", y: "+t.number(this.y)+" }"},_serialize:function(t){t=t.formatter;return[t.number(this.x),t.number(this.y)]},getLength:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},setLength:function(t){var e;this.isZero()?(e=this._angle||0,this._set(Math.cos(e)*t,Math.sin(e)*t)):(e=t/this.getLength(),F.isZero(e)&&this.getAngle(),this._set(this.x*e,this.y*e))},getAngle:function(){return 180*this.getAngleInRadians.apply(this,arguments)/Math.PI},setAngle:function(t){this.setAngleInRadians.call(this,t*Math.PI/180)},getAngleInDegrees:"#getAngle",setAngleInDegrees:"#setAngle",getAngleInRadians:function(){var t,e;return arguments.length?(e=P.read(arguments),t=this.getLength()*e.getLength(),F.isZero(t)?NaN:(e=this.dot(e)/t,Math.acos(e<-1?-1:1<e?1:e))):this.isZero()?this._angle||0:this._angle=Math.atan2(this.y,this.x)},setAngleInRadians:function(t){var e;this._angle=t,this.isZero()||(e=this.getLength(),this._set(Math.cos(t)*e,Math.sin(t)*e))},getQuadrant:function(){return 0<=this.x?0<=this.y?1:4:0<=this.y?2:3}},{beans:!1,getDirectedAngle:function(){var t=P.read(arguments);return 180*Math.atan2(this.cross(t),this.dot(t))/Math.PI},getDistance:function(){var t=arguments,e=P.read(t),i=e.x-this.x,e=e.y-this.y,i=i*i+e*e;return z.read(t)?i:Math.sqrt(i)},normalize:function(t){t===j&&(t=1);var e=this.getLength(),t=0!==e?t/e:0,e=new P(this.x*t,this.y*t);return 0<=t&&(e._angle=this._angle),e},rotate:function(t,e){if(0===t)return this.clone();t=t*Math.PI/180;var i=e?this.subtract(e):this,n=Math.sin(t),t=Math.cos(t),i=new P(i.x*t-i.y*n,i.x*n+i.y*t);return e?i.add(e):i},transform:function(t){return t?t._transformPoint(this):this},add:function(){var t=P.read(arguments);return new P(this.x+t.x,this.y+t.y)},subtract:function(){var t=P.read(arguments);return new P(this.x-t.x,this.y-t.y)},multiply:function(){var t=P.read(arguments);return new P(this.x*t.x,this.y*t.y)},divide:function(){var t=P.read(arguments);return new P(this.x/t.x,this.y/t.y)},modulo:function(){var t=P.read(arguments);return new P(this.x%t.x,this.y%t.y)},negate:function(){return new P(-this.x,-this.y)},isInside:function(){return x.read(arguments).contains(this)},isClose:function(){var t=arguments,e=P.read(t),t=z.read(t);return this.getDistance(e)<=t},isCollinear:function(){var t=P.read(arguments);return P.isCollinear(this.x,this.y,t.x,t.y)},isColinear:"#isCollinear",isOrthogonal:function(){var t=P.read(arguments);return P.isOrthogonal(this.x,this.y,t.x,t.y)},isZero:function(){var t=F.isZero;return t(this.x)&&t(this.y)},isNaN:function(){return isNaN(this.x)||isNaN(this.y)},isInQuadrant:function(t){return 0<=this.x*(1<t&&t<4?-1:1)&&0<=this.y*(2<t?-1:1)},dot:function(){var t=P.read(arguments);return this.x*t.x+this.y*t.y},cross:function(){var t=P.read(arguments);return this.x*t.y-this.y*t.x},project:function(){var t=P.read(arguments),e=t.isZero()?0:this.dot(t)/t.dot(t);return new P(t.x*e,t.y*e)},statics:{min:function(){var t=arguments,e=P.read(t),t=P.read(t);return new P(Math.min(e.x,t.x),Math.min(e.y,t.y))},max:function(){var t=arguments,e=P.read(t),t=P.read(t);return new P(Math.max(e.x,t.x),Math.max(e.y,t.y))},random:function(){return new P(Math.random(),Math.random())},isCollinear:function(t,e,i,n){return Math.abs(t*n-e*i)<=1e-8*Math.sqrt((t*t+e*e)*(i*i+n*n))},isOrthogonal:function(t,e,i,n){return Math.abs(t*i+e*n)<=1e-8*Math.sqrt((t*t+e*e)*(i*i+n*n))}}},z.each(["round","ceil","floor","abs"],function(t){var e=Math[t];this[t]=function(){return new P(e(this.x),e(this.y))}},{})),l=P.extend({initialize:function(t,e,i,n){this._x=t,this._y=e,this._owner=i,this._setter=n},_set:function(t,e,i){return this._x=t,this._y=e,i||this._owner[this._setter](this),this},getX:function(){return this._x},setX:function(t){this._x=t,this._owner[this._setter](this)},getY:function(){return this._y},setY:function(t){this._y=t,this._owner[this._setter](this)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(t){this._owner._changeSelection(this._getSelection(),t)},_getSelection:function(){return"setPosition"===this._setter?4:0}}),O=z.extend({_class:"Size",_readIndex:!0,initialize:function(t,e){var i,n=typeof t,r=this.__read,s=0;return"number"==n?(this._set(t,(i="number"==typeof e)?e:t),r&&(s=i?2:1)):"undefined"==n||null===t?(this._set(0,0),r&&(s=null===t?1:0)):(e="string"==n?t.split(/[\s,]+/)||[]:t,s=1,Array.isArray(e)?this._set(+e[0],+(1<e.length?e[1]:e[0])):"width"in e?this._set(e.width||0,e.height||0):"x"in e?this._set(e.x||0,e.y||0):(this._set(0,0),s=0)),r&&(this.__read=s),this},set:"#initialize",_set:function(t,e){return this.width=t,this.height=e,this},equals:function(t){return t===this||t&&(this.width===t.width&&this.height===t.height||Array.isArray(t)&&this.width===t[0]&&this.height===t[1])||!1},clone:function(){return new O(this.width,this.height)},toString:function(){var t=w.instance;return"{ width: "+t.number(this.width)+", height: "+t.number(this.height)+" }"},_serialize:function(t){t=t.formatter;return[t.number(this.width),t.number(this.height)]},add:function(){var t=O.read(arguments);return new O(this.width+t.width,this.height+t.height)},subtract:function(){var t=O.read(arguments);return new O(this.width-t.width,this.height-t.height)},multiply:function(){var t=O.read(arguments);return new O(this.width*t.width,this.height*t.height)},divide:function(){var t=O.read(arguments);return new O(this.width/t.width,this.height/t.height)},modulo:function(){var t=O.read(arguments);return new O(this.width%t.width,this.height%t.height)},negate:function(){return new O(-this.width,-this.height)},isZero:function(){var t=F.isZero;return t(this.width)&&t(this.height)},isNaN:function(){return isNaN(this.width)||isNaN(this.height)},statics:{min:function(t,e){return new O(Math.min(t.width,e.width),Math.min(t.height,e.height))},max:function(t,e){return new O(Math.max(t.width,e.width),Math.max(t.height,e.height))},random:function(){return new O(Math.random(),Math.random())}}},z.each(["round","ceil","floor","abs"],function(t){var e=Math[t];this[t]=function(){return new O(e(this.width),e(this.height))}},{})),n=O.extend({initialize:function(t,e,i,n){this._width=t,this._height=e,this._owner=i,this._setter=n},_set:function(t,e,i){return this._width=t,this._height=e,i||this._owner[this._setter](this),this},getWidth:function(){return this._width},setWidth:function(t){this._width=t,this._owner[this._setter](this)},getHeight:function(){return this._height},setHeight:function(t){this._height=t,this._owner[this._setter](this)}}),x=z.extend({_class:"Rectangle",_readIndex:!0,beans:!0,initialize:function(t,e,i,n){var r,s,a,o,h=arguments,l=typeof t,u=("number"==l?(this._set(t,e,i,n),r=4):"undefined"==l||null===t?(this._set(0,0,0,0),r=null===t?1:0):1===h.length&&(Array.isArray(t)?(this._set.apply(this,t),r=1):t.x!==j||t.width!==j?(this._set(t.x||0,t.y||0,t.width||0,t.height||0),r=1):t.from===j&&t.to===j&&(this._set(0,0,0,0),z.readSupported(h,this))&&(r=1)),r===j&&(l=P.readNamed(h,"from"),u=z.peek(h),s=l.x,l=l.y,u&&u.x!==j||z.hasNamed(h,"to")?(a=(u=P.readNamed(h,"to")).x-s,o=u.y-l,a<0&&(s=u.x,a=-a),o<0&&(l=u.y,o=-o)):(a=(u=O.read(h)).width,o=u.height),this._set(s,l,a,o),r=h.__index),h.__filtered);return u&&(this.__filtered=u),this.__read&&(this.__read=r),this},set:"#initialize",_set:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},clone:function(){return new x(this.x,this.y,this.width,this.height)},equals:function(t){var e=z.isPlainValue(t)?x.read(arguments):t;return e===this||e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height||!1},toString:function(){var t=w.instance;return"{ x: "+t.number(this.x)+", y: "+t.number(this.y)+", width: "+t.number(this.width)+", height: "+t.number(this.height)+" }"},_serialize:function(t){t=t.formatter;return[t.number(this.x),t.number(this.y),t.number(this.width),t.number(this.height)]},getPoint:function(t){return new(t?P:l)(this.x,this.y,this,"setPoint")},setPoint:function(){var t=P.read(arguments);this.x=t.x,this.y=t.y},getSize:function(t){return new(t?O:n)(this.width,this.height,this,"setSize")},_fw:1,_fh:1,setSize:function(){var t=O.read(arguments),e=this._sx,i=this._sy,n=t.width,t=t.height;e&&(this.x+=(this.width-n)*e),i&&(this.y+=(this.height-t)*i),this.width=n,this.height=t,this._fw=this._fh=1},getLeft:function(){return this.x},setLeft:function(t){var e;this._fw||(e=t-this.x,this.width-=.5===this._sx?2*e:e),this.x=t,this._sx=this._fw=0},getTop:function(){return this.y},setTop:function(t){var e;this._fh||(e=t-this.y,this.height-=.5===this._sy?2*e:e),this.y=t,this._sy=this._fh=0},getRight:function(){return this.x+this.width},setRight:function(t){var e;this._fw||(e=t-this.x,this.width=.5===this._sx?2*e:e),this.x=t-this.width,this._sx=1,this._fw=0},getBottom:function(){return this.y+this.height},setBottom:function(t){var e;this._fh||(e=t-this.y,this.height=.5===this._sy?2*e:e),this.y=t-this.height,this._sy=1,this._fh=0},getCenterX:function(){return this.x+this.width/2},setCenterX:function(t){this._fw||.5===this._sx?this.x=t-this.width/2:(this._sx&&(this.x+=2*(t-this.x)*this._sx),this.width=2*(t-this.x)),this._sx=.5,this._fw=0},getCenterY:function(){return this.y+this.height/2},setCenterY:function(t){this._fh||.5===this._sy?this.y=t-this.height/2:(this._sy&&(this.y+=2*(t-this.y)*this._sy),this.height=2*(t-this.y)),this._sy=.5,this._fh=0},getCenter:function(t){return new(t?P:l)(this.getCenterX(),this.getCenterY(),this,"setCenter")},setCenter:function(){var t=P.read(arguments);return this.setCenterX(t.x),this.setCenterY(t.y),this},getArea:function(){return this.width*this.height},isEmpty:function(){return 0===this.width||0===this.height},contains:function(t){return t&&t.width!==j||4===(Array.isArray(t)?t:arguments).length?this._containsRectangle(x.read(arguments)):this._containsPoint(P.read(arguments))},_containsPoint:function(t){var e=t.x,t=t.y;return e>=this.x&&t>=this.y&&e<=this.x+this.width&&t<=this.y+this.height},_containsRectangle:function(t){var e=t.x,i=t.y;return e>=this.x&&i>=this.y&&e+t.width<=this.x+this.width&&i+t.height<=this.y+this.height},intersects:function(){var t=x.read(arguments),e=z.read(arguments)||0;return t.x+t.width>this.x-e&&t.y+t.height>this.y-e&&t.x<this.x+this.width+e&&t.y<this.y+this.height+e},intersect:function(){var t=x.read(arguments),e=Math.max(this.x,t.x),i=Math.max(this.y,t.y),n=Math.min(this.x+this.width,t.x+t.width),t=Math.min(this.y+this.height,t.y+t.height);return new x(e,i,n-e,t-i)},unite:function(){var t=x.read(arguments),e=Math.min(this.x,t.x),i=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width),t=Math.max(this.y+this.height,t.y+t.height);return new x(e,i,n-e,t-i)},include:function(){var t=P.read(arguments),e=Math.min(this.x,t.x),i=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x),t=Math.max(this.y+this.height,t.y);return new x(e,i,n-e,t-i)},expand:function(){var t=O.read(arguments),e=t.width,t=t.height;return new x(this.x-e/2,this.y-t/2,this.width+e,this.height+t)},scale:function(t,e){return this.expand(this.width*t-this.width,this.height*(e===j?t:e)-this.height)}},z.each([["Top","Left"],["Top","Right"],["Bottom","Left"],["Bottom","Right"],["Left","Center"],["Top","Center"],["Right","Center"],["Bottom","Center"]],function(t,e){var i=t.join(""),n=/^[RL]/.test(i),e=(4<=e&&(t[1]+=n?"Y":"X"),t[n?0:1]),t=t[n?1:0],r="get"+e,s="get"+t,a="set"+e,o="set"+t,h="set"+i;this["get"+i]=function(t){return new(t?P:l)(this[r](),this[s](),this,h)},this[h]=function(){var t=P.read(arguments);this[a](t.x),this[o](t.y)}},{beans:!0})),r=x.extend({initialize:function(t,e,i,n,r,s){this._set(t,e,i,n,!0),this._owner=r,this._setter=s},_set:function(t,e,i,n,r){return this._x=t,this._y=e,this._width=i,this._height=n,r||this._owner[this._setter](this),this}},new function(){var i=x.prototype;return z.each(["x","y","width","height"],function(t){var e=z.capitalize(t),i="_"+t;this["get"+e]=function(){return this[i]},this["set"+e]=function(t){this[i]=t,this._dontNotify||this._owner[this._setter](this)}},z.each(["Point","Size","Center","Left","Top","Right","Bottom","CenterX","CenterY","TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],function(t){var e="set"+t;this[e]=function(){this._dontNotify=!0,i[e].apply(this,arguments),this._dontNotify=!1,this._owner[this._setter](this)}},{isSelected:function(){return!!(2&this._owner._selection)},setSelected:function(t){var e=this._owner;e._changeSelection&&e._changeSelection(2,t)}}))}),M=z.extend({_class:"Matrix",initialize:function t(e,i){var n=arguments,r=n.length,s=!0;if(6<=r?this._set.apply(this,n):1===r||2===r?e instanceof t?this._set(e._a,e._b,e._c,e._d,e._tx,e._ty,i):Array.isArray(e)?this._set.apply(this,i?e.concat([i]):e):s=!1:r?s=!1:this.reset(),s)return this;throw new Error("Unsupported matrix parameters")},set:"#initialize",_set:function(t,e,i,n,r,s,a){return this._a=t,this._b=e,this._c=i,this._d=n,this._tx=r,this._ty=s,a||this._changed(),this},_serialize:function(t,e){return z.serialize(this.getValues(),t,!0,e)},_changed:function(){var t=this._owner;t&&(t._applyMatrix?t.transform(null,!0):t._changed(25))},clone:function(){return new M(this._a,this._b,this._c,this._d,this._tx,this._ty)},equals:function(t){return t===this||t&&this._a===t._a&&this._b===t._b&&this._c===t._c&&this._d===t._d&&this._tx===t._tx&&this._ty===t._ty},toString:function(){var t=w.instance;return"[["+[t.number(this._a),t.number(this._c),t.number(this._tx)].join(", ")+"], ["+[t.number(this._b),t.number(this._d),t.number(this._ty)].join(", ")+"]]"},reset:function(t){return this._a=this._d=1,this._b=this._c=this._tx=this._ty=0,t||this._changed(),this},apply:function(t,e){var i=this._owner;return!!i&&(i.transform(null,z.pick(t,!0),e),this.isIdentity())},translate:function(){var t=P.read(arguments),e=t.x,t=t.y;return this._tx+=e*this._a+t*this._c,this._ty+=e*this._b+t*this._d,this._changed(),this},scale:function(){var t=arguments,e=P.read(t),t=P.read(t,0,{readNull:!0});return t&&this.translate(t),this._a*=e.x,this._b*=e.x,this._c*=e.y,this._d*=e.y,t&&this.translate(t.negate()),this._changed(),this},rotate:function(t){t*=Math.PI/180;var e=P.read(arguments,1),i=e.x,e=e.y,n=Math.cos(t),r=Math.sin(t),s=i-i*n+e*r,i=e-i*r-e*n,e=this._a,a=this._b,o=this._c,h=this._d;return this._a=n*e+r*o,this._b=n*a+r*h,this._c=-r*e+n*o,this._d=-r*a+n*h,this._tx+=s*e+i*o,this._ty+=s*a+i*h,this._changed(),this},shear:function(){var t=arguments,e=P.read(t),t=P.read(t,0,{readNull:!0}),i=(t&&this.translate(t),this._a),n=this._b;return this._a+=e.y*this._c,this._b+=e.y*this._d,this._c+=e.x*i,this._d+=e.x*n,t&&this.translate(t.negate()),this._changed(),this},skew:function(){var t=arguments,e=P.read(t),t=P.read(t,0,{readNull:!0}),i=Math.PI/180,e=new P(Math.tan(e.x*i),Math.tan(e.y*i));return this.shear(e,t)},append:function(t,e){var i,n,r,s,a,o,h,l,u;return t&&(i=this._a,n=this._b,r=this._c,s=this._d,a=t._a,o=t._c,h=t._b,l=t._d,u=t._tx,t=t._ty,this._a=a*i+h*r,this._c=o*i+l*r,this._b=a*n+h*s,this._d=o*n+l*s,this._tx+=u*i+t*r,this._ty+=u*n+t*s,e||this._changed()),this},prepend:function(t,e){var i,n,r,s,a,o,h,l,u,c,d;return t&&(i=this._a,n=this._b,r=this._c,s=this._d,a=this._tx,o=this._ty,h=t._a,l=t._c,u=t._b,c=t._d,d=t._tx,t=t._ty,this._a=h*i+l*n,this._c=h*r+l*s,this._b=u*i+c*n,this._d=u*r+c*s,this._tx=h*a+l*o+d,this._ty=u*a+c*o+t,e||this._changed()),this},appended:function(t){return this.clone().append(t)},prepended:function(t){return this.clone().prepend(t)},invert:function(){var t=this._a,e=this._b,i=this._c,n=this._d,r=this._tx,s=this._ty,a=t*n-e*i,o=null;return a&&!isNaN(a)&&isFinite(r)&&isFinite(s)&&(this._a=n/a,this._b=-e/a,this._c=-i/a,this._d=t/a,this._tx=(i*s-n*r)/a,this._ty=(e*r-t*s)/a,o=this),o},inverted:function(){return this.clone().invert()},concatenate:"#append",preConcatenate:"#prepend",chain:"#appended",_shiftless:function(){return new M(this._a,this._b,this._c,this._d,0,0)},_orNullIfIdentity:function(){return this.isIdentity()?null:this},isIdentity:function(){return 1===this._a&&0===this._b&&0===this._c&&1===this._d&&0===this._tx&&0===this._ty},isInvertible:function(){var t=this._a*this._d-this._c*this._b;return t&&!isNaN(t)&&isFinite(this._tx)&&isFinite(this._ty)},isSingular:function(){return!this.isInvertible()},transform:function(t,e,i){return arguments.length<3?this._transformPoint(P.read(arguments)):this._transformCoordinates(t,e,i)},_transformPoint:function(t,e,i){var n=t.x,t=t.y;return(e=e||new P)._set(n*this._a+t*this._c+this._tx,n*this._b+t*this._d+this._ty,i)},_transformCoordinates:function(t,e,i){for(var n=0,r=2*i;n<r;n+=2){var s=t[n],a=t[n+1];e[n]=s*this._a+a*this._c+this._tx,e[n+1]=s*this._b+a*this._d+this._ty}return e},_transformCorners:function(t){var e=t.x,i=t.y,n=e+t.width,t=i+t.height,i=[e,i,n,i,n,t,e,t];return this._transformCoordinates(i,i,4)},_transformBounds:function(t,e,i){for(var n=this._transformCorners(t),r=n.slice(0,2),s=r.slice(),a=2;a<8;a++){var o=n[a],h=1&a;o<r[h]?r[h]=o:o>s[h]&&(s[h]=o)}return(e=e||new x)._set(r[0],r[1],s[0]-r[0],s[1]-r[1],i)},inverseTransform:function(){return this._inverseTransform(P.read(arguments))},_inverseTransform:function(t,e,i){var n=this._a,r=this._b,s=this._c,a=this._d,o=this._tx,h=this._ty,l=n*a-r*s,u=null;return l&&!isNaN(l)&&isFinite(o)&&isFinite(h)&&(o=t.x-this._tx,h=t.y-this._ty,u=(e=e||new P)._set((o*a-h*s)/l,(h*n-o*r)/l,i)),u},decompose:function(){var t,e,i,n=this._a,r=this._b,s=this._c,a=this._d,o=n*a-r*s,h=Math.sqrt,l=Math.atan2,u=180/Math.PI;return h=0!==n||0!==r?(i=h(n*n+r*r),t=Math.acos(n/i)*(0<r?1:-1),e=[i,o/i],[l(n*s+r*a,i*i),0]):0!==s||0!==a?(i=h(s*s+a*a),t=Math.asin(s/i)*(0<a?1:-1),e=[o/i,i],[0,l(n*s+r*a,i*i)]):e=[t=0,0],{translation:this.getTranslation(),rotation:t*u,scaling:new P(e),skewing:new P(h[0]*u,h[1]*u)}},getValues:function(){return[this._a,this._b,this._c,this._d,this._tx,this._ty]},getTranslation:function(){return new P(this._tx,this._ty)},getScaling:function(){return this.decompose().scaling},getRotation:function(){return this.decompose().rotation},applyToContext:function(t){this.isIdentity()||t.transform(this._a,this._b,this._c,this._d,this._tx,this._ty)}},z.each(["a","b","c","d","tx","ty"],function(t){var e=z.capitalize(t),i="_"+t;this["get"+e]=function(){return this[i]},this["set"+e]=function(t){this[i]=t,this._changed()}},{})),N=z.extend({_class:"Line",initialize:function(t,e,i,n,r){(4<=arguments.length?(this._px=t,this._py=e,this._vx=i,this._vy=n,r):(this._px=t.x,this._py=t.y,this._vx=e.x,this._vy=e.y,i))||(this._vx-=this._px,this._vy-=this._py)},getPoint:function(){return new P(this._px,this._py)},getVector:function(){return new P(this._vx,this._vy)},getLength:function(){return this.getVector().getLength()},intersect:function(t,e){return N.intersect(this._px,this._py,this._vx,this._vy,t._px,t._py,t._vx,t._vy,!0,e)},getSide:function(t,e){return N.getSide(this._px,this._py,this._vx,this._vy,t.x,t.y,!0,e)},getDistance:function(t){return Math.abs(this.getSignedDistance(t))},getSignedDistance:function(t){return N.getSignedDistance(this._px,this._py,this._vx,this._vy,t.x,t.y,!0)},isCollinear:function(t){return P.isCollinear(this._vx,this._vy,t._vx,t._vy)},isOrthogonal:function(t){return P.isOrthogonal(this._vx,this._vy,t._vx,t._vy)},statics:{intersect:function(t,e,i,n,r,s,a,o,h,l){h||(i-=t,n-=e,a-=r,o-=s);h=i*o-n*a;if(!F.isMachineZero(h)){r=t-r,s=e-s,a=(a*s-o*r)/h,o=(i*s-n*r)/h;if(l||-1e-12<a&&a<1+1e-12&&-1e-12<o&&o<1+1e-12)return new P(t+(a=l?a:a<=0?0:1<=a?1:a)*i,e+a*n)}},getSide:function(t,e,i,n,r,s,a,o){a||(i-=t,n-=e);a=r-t,r=a*n-(s-e)*i;return(r=!o&&F.isMachineZero(r)&&0<=(r=(a*i+a*i)/(i*i+n*n))&&r<=1?0:r)<0?-1:0<r?1:0},getSignedDistance:function(t,e,i,n,r,s,a){return a||(i-=t,n-=e),0===i?0<n?r-t:t-r:0===n?i<0?s-e:e-s:((r-t)*n-(s-e)*i)/(i<n?n*Math.sqrt(1+i*i/(n*n)):i*Math.sqrt(1+n*n/(i*i)))},getDistance:function(t,e,i,n,r,s,a){return Math.abs(N.getSignedDistance(t,e,i,n,r,s,a))}}}),h=e.extend({_class:"Project",_list:"projects",_reference:"project",_compactSerialize:!0,initialize:function(t){e.call(this,!0),this._children=[],this._namedChildren={},this._activeLayer=null,this._currentStyle=new st(null,null,this),this._view=D.create(this,t||A.getCanvas(1,1)),this._selectionItems={},this._selectionCount=0,this._updateVersion=0},_serialize:function(t,e){return z.serialize(this._children,t,!0,e)},_changed:function(t,e){1&t&&(s=this._view)&&(s._needsUpdate=!0,!s._requested)&&s._autoUpdate&&s.requestUpdate();var i,n,r,s=this._changes;s&&e&&((r=(i=this._changesById)[n=e._id])?r.flags|=t:s.push(i[n]={item:e,flags:t}))},clear:function(){for(var t=this._children,e=t.length-1;0<=e;e--)t[e].remove()},isEmpty:function(){return!this._children.length},remove:function t(){return!!t.base.call(this)&&(this._view&&this._view.remove(),!0)},getView:function(){return this._view},getCurrentStyle:function(){return this._currentStyle},setCurrentStyle:function(t){this._currentStyle.set(t)},getIndex:function(){return this._index},getOptions:function(){return this._scope.settings},getLayers:function(){return this._children},getActiveLayer:function(){return this._activeLayer||new Z({project:this,insert:!0})},getSymbolDefinitions:function(){var i=[],n={};return this.getItems({class:Y,match:function(t){var t=t._definition,e=t._id;return n[e]||(n[e]=!0,i.push(t)),!1}}),i},getSymbols:"getSymbolDefinitions",getSelectedItems:function(){var t,e=this._selectionItems,i=[];for(t in e){var n=e[t],r=n._selection;1&r&&n.isInserted()?i.push(n):r||this._updateSelection(n)}return i},_updateSelection:function(t){var e=t._id,i=this._selectionItems;t._selection?i[e]!==t&&(this._selectionCount++,i[e]=t):i[e]===t&&(this._selectionCount--,delete i[e])},selectAll:function(){for(var t=this._children,e=0,i=t.length;e<i;e++)t[e].setFullySelected(!0)},deselectAll:function(){var t,e=this._selectionItems;for(t in e)e[t].setFullySelected(!1)},addLayer:function(t){return this.insertLayer(j,t)},insertLayer:function(t,e){return e instanceof Z?(e._remove(!1,!0),z.splice(this._children,[e],t,0),e._setProject(this,!0),(t=e._name)&&e.setName(t),this._changes&&e._changed(5),this._activeLayer||(this._activeLayer=e)):e=null,e},_insertItem:function(t,e,i){return e=this.insertLayer(t,e)||(this._activeLayer||this._insertItem(j,new Z(V.NO_INSERT),!0)).insertChild(t,e),i&&e.activate&&e.activate(),e},getItems:function(t){return V._getItems(this,t)},getItem:function(t){return V._getItems(this,t,null,null,!0)[0]||null},importJSON:function(t){this.activate();var e=this._activeLayer;return z.importJSON(t,e&&e.isEmpty()&&e)},removeOn:function(t){var e=this._removeSets;if(e){"mouseup"===t&&(e.mousedrag=null);var i=e[t];if(i){for(var n in i){var r,s=i[n];for(r in e){var a=e[r];a&&a!=i&&delete a[s._id]}s.remove()}e[t]=null}}},draw:function(t,e,i){this._updateVersion++,t.save(),e.applyToContext(t);for(var n=this._children,r=new z({offset:new P(0,0),pixelRatio:i,viewMatrix:e.isIdentity()?null:e,matrices:[new M],updateMatrix:!0}),s=0,a=n.length;s<a;s++)n[s].draw(t,r);if(t.restore(),0<this._selectionCount){t.save(),t.strokeWidth=1;var o,h=this._selectionItems,l=this._scope.settings.handleSize,u=this._updateVersion;for(o in h)h[o]._drawSelection(t,e,l,h,u);t.restore()}}}),V=z.extend(t,{statics:{extend:function t(e){return e._serializeFields&&(e._serializeFields=z.set({},this.prototype._serializeFields,e._serializeFields)),t.base.apply(this,arguments)},INSERT:{insert:!0},NO_INSERT:{insert:!1}},_class:"Item",_name:null,_applyMatrix:!0,_canApplyMatrix:!0,_canScaleStroke:!1,_pivot:null,_visible:!0,_blendMode:"normal",_opacity:1,_locked:!1,_guide:!1,_clipMask:!1,_selection:0,_selectBounds:!0,_selectChildren:!1,_serializeFields:{name:null,applyMatrix:null,matrix:new M,pivot:null,visible:!0,blendMode:"normal",opacity:1,locked:!1,guide:!1,clipMask:!1,selected:!1,data:{}},_prioritize:["applyMatrix"]},new function(){var t=["onMouseDown","onMouseUp","onMouseDrag","onClick","onDoubleClick","onMouseMove","onMouseEnter","onMouseLeave"];return z.each(t,function(t){this._events[t]={install:function(t){this.getView()._countItemEvent(t,1)},uninstall:function(t){this.getView()._countItemEvent(t,-1)}}},{_events:{onFrame:{install:function(){this.getView()._animateItem(this,!0)},uninstall:function(){this.getView()._animateItem(this,!1)}},onLoad:{},onError:{}},statics:{_itemHandlers:t}})},{initialize:function(){},_initialize:function(t,e){var i=t&&z.isPlainObject(t),n=i&&!0===t.internal,r=this._matrix=new M,s=i&&t.project||B.project,a=B.settings;return this._id=n?null:o.get(),this._parent=this._index=null,this._applyMatrix=this._canApplyMatrix&&a.applyMatrix,e&&r.translate(e),(r._owner=this)._style=new st(s._currentStyle,this,s),n||i&&0==t.insert||!a.insertItems&&(!i||1!=t.insert)?this._setProject(s):(i&&t.parent||s)._insertItem(j,this,!0),i&&t!==V.NO_INSERT&&t!==V.INSERT&&this.set(t,{internal:!0,insert:!0,project:!0,parent:!0}),i},_serialize:function(n,r){var s={},a=this;function t(t){for(var e in t){var i=a[e];z.equals(i,"leading"===e?1.2*t.fontSize:t[e])||(s[e]=z.serialize(i,n,"data"!==e,r))}}return t(this._serializeFields),this instanceof g||t(this._style._defaults),[this._class,s]},_changed:function(t){var e=this._symbol,i=this._parent||e,n=this._project;8&t&&(this._bounds=this._position=this._decomposed=j),16&t&&(this._globalMatrix=j),i&&72&t&&V._clearBoundsCache(i),2&t&&V._clearBoundsCache(this),n&&n._changed(t,this),e&&e._changed(t)},getId:function(){return this._id},getName:function(){return this._name},setName:function(t){if(this._name&&this._removeNamed(),t===+t+"")throw new Error("Names consisting only of numbers are not supported.");var e,i=this._getOwner();t&&i&&(e=i._children,((i=i._namedChildren)[t]=i[t]||[]).push(this),t in e||(e[t]=this)),this._name=t||j,this._changed(256)},getStyle:function(){return this._style},setStyle:function(t){this.getStyle().set(t)}},z.each(["locked","visible","blendMode","opacity","guide"],function(e){var t=z.capitalize(e),i="_"+e,n={locked:256,visible:265};this["get"+t]=function(){return this[i]},this["set"+t]=function(t){t!=this[i]&&(this[i]=t,this._changed(n[e]||257))}},{}),{beans:!0,getSelection:function(){return this._selection},setSelection:function(t){t!==this._selection&&(this._selection=t,t=this._project)&&(t._updateSelection(this),this._changed(257))},_changeSelection:function(t,e){var i=this._selection;this.setSelection(e?i|t:i&~t)},isSelected:function(){if(this._selectChildren)for(var t=this._children,e=0,i=t.length;e<i;e++)if(t[e].isSelected())return!0;return!!(1&this._selection)},setSelected:function(t){if(this._selectChildren)for(var e=this._children,i=0,n=e.length;i<n;i++)e[i].setSelected(t);this._changeSelection(1,t)},isFullySelected:function(){var t=this._children,e=!!(1&this._selection);if(t&&e){for(var i=0,n=t.length;i<n;i++)if(!t[i].isFullySelected())return!1;return!0}return e},setFullySelected:function(t){var e=this._children;if(e)for(var i=0,n=e.length;i<n;i++)e[i].setFullySelected(t);this._changeSelection(1,t)},isClipMask:function(){return this._clipMask},setClipMask:function(t){this._clipMask!=(t=!!t)&&((this._clipMask=t)&&(this.setFillColor(null),this.setStrokeColor(null)),this._changed(257),this._parent)&&this._parent._changed(2048)},getData:function(){return this._data||(this._data={}),this._data},setData:function(t){this._data=t},getPosition:function(t){var t=t?P:l,e=this._position||(this._position=this._getPositionFromBounds());return new t(e.x,e.y,this,"setPosition")},setPosition:function(){this.translate(P.read(arguments).subtract(this.getPosition(!0)))},_getPositionFromBounds:function(t){return this._pivot?this._matrix._transformPoint(this._pivot):(t||this.getBounds()).getCenter(!0)},getPivot:function(){var t=this._pivot;return t?new l(t.x,t.y,this,"setPivot"):null},setPivot:function(){this._pivot=P.read(arguments,0,{clone:!0,readNull:!0}),this._position=j}},z.each({getStrokeBounds:{stroke:!0},getHandleBounds:{handle:!0},getInternalBounds:{internal:!0}},function(e,t){this[t]=function(t){return this.getBounds(t,e)}},{beans:!0,getBounds:function(t,e){var i=e||t instanceof M,n=z.set({},i?e:t,this._boundsOptions),i=(n.stroke&&!this.getStrokeScaling()||(n.cacheItem=this),this._getCachedBounds(i&&t,n).rect);return arguments.length?i:new r(i.x,i.y,i.width,i.height,this,"setBounds")},setBounds:function(){var t=x.read(arguments),e=this.getBounds(),i=this._matrix,n=new M,r=t.getCenter();n.translate(r),t.width==e.width&&t.height==e.height||(i.isInvertible()||(i.set(i._backup||(new M).translate(i.getTranslation())),e=this.getBounds()),n.scale(0!==e.width?t.width/e.width:0,0!==e.height?t.height/e.height:0)),r=e.getCenter(),n.translate(-r.x,-r.y),this.transform(n)},_getBounds:function(t,e){var i=this._children;return i&&i.length?(V._updateBoundsCache(this,e.cacheItem),V._getBounds(i,t,e)):new x},_getBoundsCacheKey:function(t,e){return[t.stroke?1:0,t.handle?1:0,e?1:0].join("")},_getCachedBounds:function(t,e,i){t=t&&t._orNullIfIdentity();var n,i=e.internal&&!i,r=e.cacheItem,s=i?null:this._matrix._orNullIfIdentity(),a=r&&(!t||t.equals(s))&&this._getBoundsCacheKey(e,i),o=this._bounds;return V._updateBoundsCache(this._parent||this._symbol,r),a&&o&&a in o?{rect:(n=o[a]).rect.clone(),nonscaling:n.nonscaling}:(t=(r=this._getBounds(t||s,e)).rect||r,s=this._style,e=r.nonscaling||s.hasStroke()&&!s.getStrokeScaling(),a&&(o||(this._bounds=o={}),n=o[a]={rect:t.clone(),nonscaling:e,internal:i}),{rect:t,nonscaling:e})},_getStrokeMatrix:function(t,e){e=this.getStrokeScaling()?null:e&&e.internal?this:this._parent||this._symbol&&this._symbol._item,e=e?e.getViewMatrix().invert():t;return e&&e._shiftless()},statics:{_updateBoundsCache:function(t,e){var i;t&&e&&(i=e._id,(t=t._boundsCache=t._boundsCache||{ids:{},list:[]}).ids[i]||(t.list.push(e),t.ids[i]=e))},_clearBoundsCache:function(t){var e=t._boundsCache;if(e){t._bounds=t._position=t._boundsCache=j;for(var i=0,n=e.list,r=n.length;i<r;i++){var s=n[i];s!==t&&(s._bounds=s._position=j,s._boundsCache)&&V._clearBoundsCache(s)}}},_getBounds:function(t,e,i){var n=l=1/0,r=u=-l,s=!1;i=i||{};for(var a=0,o=t.length;a<o;a++){var h,l,u,c=t[a];c._visible&&!c.isEmpty(!0)&&(h=(c=c._getCachedBounds(e&&e.appended(c._matrix),i,!0)).rect,l=Math.min(h.x,l),n=Math.min(h.y,n),u=Math.max(h.x+h.width,u),r=Math.max(h.y+h.height,r),c.nonscaling)&&(s=!0)}return{rect:isFinite(l)?new x(l,n,u-l,r-n):new x,nonscaling:s}}}}),{beans:!0,_decompose:function(){return this._applyMatrix?null:this._decomposed||(this._decomposed=this._matrix.decompose())},getRotation:function(){var t=this._decompose();return t?t.rotation:0},setRotation:function(t){var e,i=this.getRotation();null!=i&&null!=t&&(e=this._decomposed,this.rotate(t-i),e)&&(e.rotation=t,this._decomposed=e)},getScaling:function(){var t=this._decompose(),t=t&&t.scaling;return new l(t?t.x:1,t?t.y:1,this,"setScaling")},setScaling:function(){var t,e,i,n,r=this.getScaling(),s=P.read(arguments,0,{clone:!0,readNull:!0});r&&s&&!r.equals(s)&&(t=this.getRotation(),e=this._decomposed,i=new M,(n=F.isZero)(r.x)||n(r.y)?(i.translate(e.translation),t&&i.rotate(t),i.scale(s.x,s.y),this._matrix.set(i)):(n=this.getPosition(!0),i.translate(n),t&&i.rotate(t),i.scale(s.x/r.x,s.y/r.y),t&&i.rotate(-t),i.translate(n.negate()),this.transform(i)),e)&&(e.scaling=s,this._decomposed=e)},getMatrix:function(){return this._matrix},setMatrix:function(){var t=this._matrix;t.set.apply(t,arguments)},getGlobalMatrix:function(t){if(n=this._globalMatrix)for(var e=this._parent,i=[];e;){if(!e._globalMatrix){for(var n=null,r=0,s=i.length;r<s;r++)i[r]._globalMatrix=null;break}i.push(e),e=e._parent}return!n&&(n=this._globalMatrix=this._matrix.clone(),e=this._parent)&&n.prepend(e.getGlobalMatrix(!0)),t?n:n.clone()},getViewMatrix:function(){return this.getGlobalMatrix().prepend(this.getView()._matrix)},getApplyMatrix:function(){return this._applyMatrix},setApplyMatrix:function(t){(this._applyMatrix=this._canApplyMatrix&&!!t)&&this.transform(null,!0)},getTransformContent:"#getApplyMatrix",setTransformContent:"#setApplyMatrix"},{getProject:function(){return this._project},_setProject:function(t,e){if(this._project!==t){this._project&&this._installEvents(!1),this._project=t;for(var i=this._children,n=0,r=i&&i.length;n<r;n++)i[n]._setProject(t);e=!0}e&&this._installEvents(!0)},getView:function(){return this._project._view},_installEvents:function t(e){t.base.call(this,e);for(var i=this._children,n=0,r=i&&i.length;n<r;n++)i[n]._installEvents(e)},getLayer:function(){for(var t=this;t=t._parent;)if(t instanceof Z)return t;return null},getParent:function(){return this._parent},setParent:function(t){return t.addChild(this)},_getOwner:"#getParent",getChildren:function(){return this._children},setChildren:function(t){this.removeChildren(),this.addChildren(t)},getFirstChild:function(){return this._children&&this._children[0]||null},getLastChild:function(){return this._children&&this._children[this._children.length-1]||null},getNextSibling:function(){var t=this._getOwner();return t&&t._children[this._index+1]||null},getPreviousSibling:function(){var t=this._getOwner();return t&&t._children[this._index-1]||null},getIndex:function(){return this._index},equals:function(t){return t===this||t&&this._class===t._class&&this._style.equals(t._style)&&this._matrix.equals(t._matrix)&&this._locked===t._locked&&this._visible===t._visible&&this._blendMode===t._blendMode&&this._opacity===t._opacity&&this._clipMask===t._clipMask&&this._guide===t._guide&&this._equals(t)||!1},_equals:function(t){return z.equals(this._children,t._children)},clone:function(t){var e=new this.constructor(V.NO_INSERT),i=this._children,n=z.pick(t?t.insert:j,t===j||!0===t),t=z.pick(t?t.deep:j,!0),r=(i&&e.copyAttributes(this),i&&!t||e.copyContent(this),i||e.copyAttributes(this),n&&e.insertAbove(this),this._name),t=this._parent;if(r&&t){for(var i=t._children,s=r,a=1;i[r];)r=s+" "+a++;r!==s&&e.setName(r)}return e},copyContent:function(t){for(var e=t._children,i=0,n=e&&e.length;i<n;i++)this.addChild(e[i].clone(!1),!0)},copyAttributes:function(t,e){this.setStyle(t._style);for(var i=["_locked","_visible","_blendMode","_opacity","_clipMask","_guide"],n=0,r=i.length;n<r;n++){var s=i[n];t.hasOwnProperty(s)&&(this[s]=t[s])}e||this._matrix.set(t._matrix,!0),this.setApplyMatrix(t._applyMatrix),this.setPivot(t._pivot),this.setSelection(t._selection);var e=t._data,a=t._name;this._data=e?z.clone(e):null,a&&this.setName(a)},rasterize:function(t,e){z.isPlainObject(t)?(s=t.resolution,i=t.insert,n=t.raster):(s=t,i=e),n=n||new $(V.NO_INSERT);var i,n,r,t=this.getStrokeBounds(),e=(s||this.getView().getResolution())/72,s=t.getTopLeft().floor(),t=t.getBottomRight().ceil(),t=new O(t.subtract(s)),a=t.multiply(e);return n.setSize(a,!0),a.isZero()||(a=n.getContext(!0),r=(new M).scale(e).translate(s.negate()),a.save(),r.applyToContext(a),this.draw(a,new z({matrices:[r]})),a.restore()),n._matrix.set((new M).translate(s.add(t.divide(2))).scale(1/e)),i!==j&&!i||n.insertAbove(this),n},contains:function(){var t=this._matrix;return t.isInvertible()&&!!this._contains(t._inverseTransform(P.read(arguments)))},_contains:function(t){var e=this._children;if(e){for(var i=e.length-1;0<=i;i--)if(e[i].contains(t))return!0;return!1}return t.isInside(this.getInternalBounds())},isInside:function(){return x.read(arguments).contains(this.getBounds())},_asPathItem:function(){return new W.Rectangle({rectangle:this.getInternalBounds(),matrix:this._matrix,insert:!1})},intersects:function(t,e){return t instanceof V&&0<this._asPathItem().getIntersections(t._asPathItem(),null,e,!0).length}},new function(){function t(){var t=arguments;return this._hitTest(P.read(t),L.getOptions(t))}function e(){var t=arguments,e=P.read(t),t=L.getOptions(t),i=[];return this._hitTest(e,new z({all:i},t)),i}function i(t,e,i,n){var r=this._children;if(r)for(var s=r.length-1;0<=s;s--){var a=r[s],a=a!==n&&a._hitTest(t,e,i);if(a&&!e.all)return a}return null}return h.inject({hitTest:t,hitTestAll:e,_hitTest:i}),{hitTest:t,hitTestAll:e,_hitTestChildren:i}},{_hitTest:function(n,e,t){if(this._locked||!this._visible||this._guide&&!e.guides||this.isEmpty())return null;var i=this._matrix,t=t?t.appended(i):this.getGlobalMatrix().prepend(this.getView()._matrix),r=Math.max(e.tolerance,1e-12),s=e._tolerancePadding=new O(W._getStrokePadding(r,i._shiftless().invert()));if(!(n=i._inverseTransform(n))||!this._children&&!this.getBounds({internal:!0,stroke:!0,handle:!0}).expand(s.multiply(2))._containsPoint(n))return null;var a,o,r=!(e.guides&&!this._guide||e.selected&&!this.isSelected()||e.type&&e.type!==z.hyphenate(this._class)||e.class&&!(this instanceof e.class)),h=e.match,l=this;function u(t){return(t=t&&h&&!h(t)?null:t)&&e.all&&e.all.push(t),t}function c(t,e){var i=e?a["get"+e]():l.getPosition();if(n.subtract(i).divide(s).length<=1)return new L(t,l,{name:e?z.hyphenate(e):t,point:i})}var d=e.position,f=e.center,p=e.bounds;if(r&&this._parent&&(d||f||p)){if((f||p)&&(a=this.getInternalBounds()),!(o=d&&c("position")||f&&c("center","Center"))&&p)for(var g=["TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],m=0;m<8&&!o;m++)o=c("bounds",g[m]);o=u(o)}return(o=o||this._hitTestChildren(n,e,t)||r&&u(this._hitTestSelf(n,e,t,this.getStrokeScaling()?null:t._shiftless().invert()))||null)&&o.point&&(o.point=i.transform(o.point)),o},_hitTestSelf:function(t,e){if(e.fill&&this.hasFill()&&this._contains(t))return new L("fill",this)},matches:function(t,e){var i=typeof t;if("object"==i){for(var n in t)if(t.hasOwnProperty(n)&&!this.matches(n,t[n]))return!1;return!0}if("function"==i)return t(this);if("match"===t)return e(this);i=/^(empty|editable)$/.test(t)?this["is"+z.capitalize(t)]():"type"===t?z.hyphenate(this._class):this[t];if("class"===t){if("function"==typeof e)return this instanceof e;i=this._class}if("function"==typeof e)return!!e(i);if(e){if(e.test)return e.test(i);if(z.isPlainObject(e))return function t(e,i){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n],n=i[n];if(z.isPlainObject(r)&&z.isPlainObject(n)){if(!t(r,n))return!1}else if(!z.equals(r,n))return!1}return!0}(e,i)}return z.equals(i,e)},getItems:function(t){return V._getItems(this,t,this._matrix)},getItem:function(t){return V._getItems(this,t,this._matrix,null,!0)[0]||null},statics:{_getItems:function t(e,i,n,r,s){r||(o=(a="object"==typeof i&&i)&&a.overlapping,h=a&&a.inside,c=(_=o||h)&&x.read([_]),r={items:[],recursive:a&&!1!==a.recursive,inside:!!h,overlapping:!!o,rect:c,path:o&&new W.Rectangle({rectangle:c,insert:!1})},a&&(i=z.filter({},i,{recursive:!0,inside:!0,overlapping:!0})));var a,o,h,l=e._children,u=r.items,c=r.rect;n=c&&(n||new M);for(var d=0,f=l&&l.length;d<f;d++){var p=l[d],g=n&&n.appended(p._matrix),m=!0;if(c){var _=p.getBounds(g);if(!c.intersects(_))continue;c.contains(_)||r.overlapping&&(_.contains(c)||r.path.intersects(p,g))||(m=!1)}if(m&&p.matches(i)&&(u.push(p),s))break;if(!1!==r.recursive&&t(p,i,g,r,s),s&&0<u.length)break}return u}}},{importJSON:function(t){t=z.importJSON(t,this);return t!==this?this.addChild(t):t},addChild:function(t){return this.insertChild(j,t)},insertChild:function(t,e){t=e?this.insertChildren(t,[e]):null;return t&&t[0]},addChildren:function(t){return this.insertChildren(this._children.length,t)},insertChildren:function(t,e){var i=this._children;if(i&&e&&0<e.length){for(var n={},r=(e=z.slice(e)).length-1;0<=r;r--){var s=(l=e[r])&&l._id;!l||n[s]?e.splice(r,1):(l._remove(!1,!0),n[s]=!0)}z.splice(i,e,t,0);for(var a=this._project,o=a._changes,r=0,h=e.length;r<h;r++){var l,u=(l=e[r])._name;l._parent=this,l._setProject(a,!0),u&&l.setName(u),o&&l._changed(5)}this._changed(11)}else e=null;return e},_insertItem:"#insertChild",_insertAt:function(t,e){var i=t&&t._getOwner(),n=t!==this&&i?this:null;return n&&(n._remove(!1,!0),i._insertItem(t._index+e,n)),n},insertAbove:function(t){return this._insertAt(t,1)},insertBelow:function(t){return this._insertAt(t,0)},sendToBack:function(){var t=this._getOwner();return t?t._insertItem(0,this):null},bringToFront:function(){var t=this._getOwner();return t?t._insertItem(j,this):null},appendTop:"#addChild",appendBottom:function(t){return this.insertChild(0,t)},moveAbove:"#insertAbove",moveBelow:"#insertBelow",addTo:function(t){return t._insertItem(j,this)},copyTo:function(t){return this.clone(!1).addTo(t)},reduce:function(t){var e=this._children;return e&&1===e.length?(e=e[0].reduce(t),(this._parent?(e.insertAbove(this),this):e).remove(),e):this},_removeNamed:function(){var t,e,i,n,r=this._getOwner();r&&(t=r._children,-1!==(n=(i=(r=r._namedChildren)[e=this._name])?i.indexOf(this):-1))&&(t[e]==this&&delete t[e],i.splice(n,1),i.length?t[e]=i[0]:delete r[e])},_remove:function(t,e){var i=this._getOwner(),n=this._project,r=this._index;return this._style&&this._style._dispose(),!(!i||(this._name&&this._removeNamed(),null!=r&&(n._activeLayer===this&&(n._activeLayer=this.getNextSibling()||this.getPreviousSibling()),z.splice(i._children,null,r,1)),this._installEvents(!1),t&&n._changes&&this._changed(5),e&&i._changed(11,this),this._parent=null))},remove:function(){return this._remove(!0,!0)},replaceWith:function(t){t=t&&t.insertBelow(this);return t&&this.remove(),t},removeChildren:function(t,e){if(!this._children)return null;t=t||0,e=z.pick(e,this._children.length);for(var i=z.splice(this._children,null,t,e-t),n=i.length-1;0<=n;n--)i[n]._remove(!0,!1);return 0<i.length&&this._changed(11),i},clear:"#removeChildren",reverseChildren:function(){if(this._children){this._children.reverse();for(var t=0,e=this._children.length;t<e;t++)this._children[t]._index=t;this._changed(11)}},isEmpty:function(t){var e=this._children,i=e?e.length:0;if(t){for(var n=0;n<i;n++)if(!e[n].isEmpty(t))return!1;return!0}return!i},isEditable:function(){for(var t=this;t;){if(!t._visible||t._locked)return!1;t=t._parent}return!0},hasFill:function(){return this.getStyle().hasFill()},hasStroke:function(){return this.getStyle().hasStroke()},hasShadow:function(){return this.getStyle().hasShadow()},_getOrder:function(t){function e(t){for(var e=[];e.unshift(t),t=t._parent;);return e}for(var i=e(this),n=e(t),r=0,s=Math.min(i.length,n.length);r<s;r++)if(i[r]!=n[r])return i[r]._index<n[r]._index?1:-1;return 0},hasChildren:function(){return this._children&&0<this._children.length},isInserted:function(){return!!this._parent&&this._parent.isInserted()},isAbove:function(t){return-1===this._getOrder(t)},isBelow:function(t){return 1===this._getOrder(t)},isParent:function(t){return this._parent===t},isChild:function(t){return t&&t._parent===this},isDescendant:function(t){for(var e=this;e=e._parent;)if(e===t)return!0;return!1},isAncestor:function(t){return!!t&&t.isDescendant(this)},isSibling:function(t){return this._parent===t._parent},isGroupedWith:function(t){for(var e=this._parent;e;){if(e._parent&&/^(Group|Layer|CompoundPath)$/.test(e._class)&&t.isDescendant(e))return!0;e=e._parent}return!1}},z.each(["rotate","scale","shear","skew"],function(i){var n="rotate"===i;this[i]=function(){var t=arguments,e=(n?z:P).read(t),t=P.read(t,0,{readNull:!0});return this.transform((new M)[i](e,t||this.getPosition(!0)))}},{translate:function(){var t=new M;return this.transform(t.translate.apply(t,arguments))},transform:function(t,e,i){var n=this._matrix,r=t&&!t.isIdentity(),s=i&&this._canApplyMatrix||this._applyMatrix&&(r||!n.isIdentity()||e&&this._children);if(r||s){r&&(!t.isInvertible()&&n.isInvertible()&&(n._backup=n.getValues()),n.prepend(t,!0),u=(o=this._style).getFillColor(!0),o=o.getStrokeColor(!0),u&&u.transform(t),o)&&o.transform(t),(s=s&&this._transformContent(n,e,i))&&((u=this._pivot)&&n._transformPoint(u,u,!0),n.reset(!0),i)&&this._canApplyMatrix&&(this._applyMatrix=!0);var a=this._bounds,o=this._position,e=((r||s)&&this._changed(25),r&&a&&t.decompose());if(e&&e.skewing.isZero()&&e.rotation%90==0){for(var h in a){var l=a[h];l.nonscaling?delete a[h]:!s&&l.internal||(h=l.rect,t._transformBounds(h,h))}var u=(this._bounds=a)[this._getBoundsCacheKey(this._boundsOptions||{})];u&&(this._position=this._getPositionFromBounds(u.rect))}else r&&o&&this._pivot&&(this._position=t._transformPoint(o,o))}return this},_transformContent:function(t,e,i){var n=this._children;if(n){for(var r=0,s=n.length;r<s;r++)n[r].transform(t,e,i);return!0}},globalToLocal:function(){return this.getGlobalMatrix(!0)._inverseTransform(P.read(arguments))},localToGlobal:function(){return this.getGlobalMatrix(!0)._transformPoint(P.read(arguments))},parentToLocal:function(){return this._matrix._inverseTransform(P.read(arguments))},localToParent:function(){return this._matrix._transformPoint(P.read(arguments))},fitBounds:function(t,e){t=x.read(arguments);var i=this.getBounds(),n=i.height/i.width,r=t.height/t.width,n=(e?r<n:n<r)?t.width/i.width:t.height/i.height,r=new x(new P,new O(i.width*n,i.height*n));r.setCenter(t.getCenter()),this.setBounds(r)}}),{_setStyles:function(t,e,i){var n,r,s=this._style,a=this._matrix;s.hasFill()&&(t.fillStyle=s.getFillColor().toCanvasStyle(t,a)),s.hasStroke()&&(t.strokeStyle=s.getStrokeColor().toCanvasStyle(t,a),t.lineWidth=s.getStrokeWidth(),a=s.getStrokeJoin(),r=s.getStrokeCap(),n=s.getMiterLimit(),a&&(t.lineJoin=a),r&&(t.lineCap=r),n&&(t.miterLimit=n),B.support.nativeDash)&&(a=s.getDashArray(),r=s.getDashOffset(),a)&&a.length&&("setLineDash"in t?(t.setLineDash(a),t.lineDashOffset=r):(t.mozDash=a,t.mozDashOffset=r)),s.hasShadow()&&(n=e.pixelRatio||1,r=(a=i._shiftless().prepend((new M).scale(n,n))).transform(new P(s.getShadowBlur(),0)),e=a.transform(this.getShadowOffset()),t.shadowColor=s.getShadowColor().toCanvasStyle(t),t.shadowBlur=r.getLength(),t.shadowOffsetX=e.x,t.shadowOffsetY=e.y)},draw:function(t,e,i){this._updateVersion=this._project._updateVersion;if(this._visible&&0!==this._opacity){var n=e.matrices,r=e.viewMatrix,s=this._matrix,a=n[n.length-1].appended(s);if(a.isInvertible()){r=r?r.appended(a):a,n.push(a),e.updateMatrix&&(this._globalMatrix=a);var o,h,l,a=this._blendMode,u=F.clamp(this._opacity,0,1),c="normal"===a,d=gt.nativeModes[a],c=c&&1===u||e.dontStart||e.clip||(d||c&&u<1)&&this._canComposite(),f=e.pixelRatio||1;if(!c){var p=this.getStrokeBounds(r);if(!p.width||!p.height)return void n.pop();l=e.offset,h=e.offset=p.getTopLeft().floor(),o=t,t=A.getContext(p.getSize().ceil().add(1).multiply(f)),1!==f&&t.scale(f,f)}t.save();var p=i?i.appended(s):this._canScaleStroke&&!this.getStrokeScaling(!0)&&r,i=!c&&e.clipItem,g=!p||i;c?(t.globalAlpha=u,d&&(t.globalCompositeOperation=a)):g&&t.translate(-h.x,-h.y),g&&(c?s:r).applyToContext(t),i&&e.clipItem.draw(t,e.extend({clip:!0})),p&&(t.setTransform(f,0,0,f,0,0),d=e.offset)&&t.translate(-d.x,-d.y),this._draw(t,e,r,p),t.restore(),n.pop(),e.clip&&!e.dontFinish&&t.clip(this.getFillRule()),c||(gt.process(a,t,o,u,h.subtract(l).multiply(f)),A.release(t),e.offset=l)}}},_isUpdated:function(t){var e,i=this._parent;return i instanceof G?i._isUpdated(t):(!(e=this._updateVersion===t)&&i&&i._visible&&i._isUpdated(t)&&(this._updateVersion=t,e=!0),e)},_drawSelection:function(t,e,i,n,r){var s=this._selection,a=1&s,o=2&s||a&&this._selectBounds,s=4&s;if(((a=this._drawSelected?a:!1)||o||s)&&this._isUpdated(r)){var r=this.getSelectedColor(!0)||(r=this.getLayer())&&r.getSelectedColor(!0),e=e.appended(this.getGlobalMatrix(!0)),h=i/2;if(t.strokeStyle=t.fillStyle=r?r.toCanvasStyle(t):"#009dec",a&&this._drawSelected(t,e,n),s)for(var r=this.getPosition(!0),a=this._parent,n=a?a.localToGlobal(r):r,l=n.x,u=n.y,c=(t.beginPath(),t.arc(l,u,h,0,2*Math.PI,!0),t.stroke(),[[0,-1],[1,0],[0,1],[-1,0]]),d=h,f=i+1,p=0;p<4;p++){var g=c[p],m=g[0],g=g[1];t.moveTo(l+m*d,u+g*d),t.lineTo(l+m*f,u+g*f),t.stroke()}if(o){var _=e._transformCorners(this.getInternalBounds());t.beginPath();for(p=0;p<8;p++)t[p?"lineTo":"moveTo"](_[p],_[++p]);t.closePath(),t.stroke();for(p=0;p<8;p++)t.fillRect(_[p]-h,_[++p]-h,i,i)}}},_canComposite:function(){return!1}},z.each(["down","drag","up","move"],function(e){this["removeOn"+z.capitalize(e)]=function(){var t={};return t[e]=!0,this.removeOn(t)}},{removeOn:function(t){for(var e in t){var i;t[e]&&(e="mouse"+e,(i=(i=this._project)._removeSets=i._removeSets||{})[e]=i[e]||{},i[e][this._id]=this)}return this}}),{tween:function(t,e,i){i||(i=e,e=t,t=null,i)||(i=e,e=null);var n=i&&i.easing,r=i&&i.start,i=null!=i&&("number"==typeof i?i:i.duration),s=new ft(this,t,e,i,n,r);return i&&this.on("frame",function t(e){s._handleFrame(1e3*e.time),s.running||this.off("frame",t)}),s},tweenTo:function(t,e){return this.tween(null,t,e)},tweenFrom:function(t,e){return this.tween(t,null,e)}}),g=V.extend({_class:"Group",_selectBounds:!1,_selectChildren:!0,_serializeFields:{children:[]},initialize:function(t){this._children=[],this._namedChildren={},this._initialize(t)||this.addChildren(Array.isArray(t)?t:arguments)},_changed:function t(e){t.base.call(this,e),2050&e&&(this._clipItem=j)},_getClipItem:function(){if((t=this._clipItem)===j){for(var t=null,e=this._children,i=0,n=e.length;i<n;i++)if(e[i]._clipMask){t=e[i];break}this._clipItem=t}return t},isClipped:function(){return!!this._getClipItem()},setClipped:function(t){var e=this.getFirstChild();e&&e.setClipMask(t)},_getBounds:function t(e,i){var n=this._getClipItem();return n?n._getCachedBounds(n._matrix.prepended(e),z.set({},i,{stroke:!1})):t.base.call(this,e,i)},_hitTestChildren:function t(e,i,n){var r=this._getClipItem();return(!r||r.contains(e))&&t.base.call(this,e,i,n,r)},_draw:function(t,e){for(var i=e.clip,n=!i&&this._getClipItem(),r=(e=e.extend({clipItem:n,clip:!1}),i?(t.beginPath(),e.dontStart=e.dontFinish=!0):n&&n.draw(t,e.extend({clip:!0})),this._children),s=0,a=r.length;s<a;s++){var o=r[s];o!==n&&o.draw(t,e)}}}),Z=g.extend({_class:"Layer",initialize:function(){g.apply(this,arguments)},_getOwner:function(){return this._parent||null!=this._index&&this._project},isInserted:function t(){return this._parent?t.base.call(this):null!=this._index},activate:function(){this._project._activeLayer=this},_hitTestSelf:function(){}}),f=V.extend({_class:"Shape",_applyMatrix:!1,_canApplyMatrix:!1,_canScaleStroke:!0,_serializeFields:{type:null,size:null,radius:null},initialize:function(t,e){this._initialize(t,e)},_equals:function(t){return this._type===t._type&&this._size.equals(t._size)&&z.equals(this._radius,t._radius)},copyContent:function(t){this.setType(t._type),this.setSize(t._size),this.setRadius(t._radius)},getType:function(){return this._type},setType:function(t){this._type=t},getShape:"#getType",setShape:"#setType",getSize:function(){var t=this._size;return new n(t.width,t.height,this,"setSize")},setSize:function(){var t,e,i,n=O.read(arguments);this._size?this._size.equals(n)||(t=this._type,e=n.width,i=n.height,"rectangle"===t?this._radius.set(O.min(this._radius,n.divide(2).abs())):"circle"===t?(e=i=(e+i)/2,this._radius=e/2):"ellipse"===t&&this._radius._set(e/2,i/2),this._size._set(e,i),this._changed(9)):this._size=n.clone()},getRadius:function(){var t=this._radius;return"circle"===this._type?t:new n(t.width,t.height,this,"setRadius")},setRadius:function(t){var e=this._type;if("circle"===e){if(t===this._radius)return;var i=2*t;this._radius=t,this._size._set(i,i)}else if(t=O.read(arguments),this._radius){if(this._radius.equals(t))return;this._radius.set(t),"rectangle"===e?(i=O.max(this._size,t.multiply(2)),this._size.set(i)):"ellipse"===e&&this._size._set(2*t.width,2*t.height)}else this._radius=t.clone();this._changed(9)},isEmpty:function(){return!1},toPath:function(t){var e=new W[z.capitalize(this._type)]({center:new P,size:this._size,radius:this._radius,insert:!1});return e.copyAttributes(this),B.settings.applyMatrix&&e.setApplyMatrix(!0),t!==j&&!t||e.insertAbove(this),e},toShape:"#clone",_asPathItem:function(){return this.toPath(!1)},_draw:function(t,e,i,n){var r,s,a,o,h,l=this._style,u=l.hasFill(),c=l.hasStroke(),d=e.dontFinish||e.clip,f=!n;(u||c||d)&&(a=this._type,o=this._radius,s="circle"===a,e.dontStart||t.beginPath(),f&&s?t.arc(0,0,o,0,2*Math.PI,!0):(r=s?o:o.width,s=s?o:o.height,h=(o=this._size).width,o=o.height,f&&"rectangle"===a&&0===r&&0===s?t.rect(-h/2,-o/2,h,o):(h=[-(f=h/2),-(a=o/2)+s,-f,(o=s*(h=.44771525016920644))-a,(h=r*h)-f,-a,-f+r,-a,f-r,-a,f-h,-a,f,o-a,f,-a+s,f,a-s,f,a-o,f-h,a,f-r,a,-f+r,a,h-f,a,-f,a-o,-f,a-s],n&&n.transform(h,h,32),t.moveTo(h[0],h[1]),t.bezierCurveTo(h[2],h[3],h[4],h[5],h[6],h[7]),f!==r&&t.lineTo(h[8],h[9]),t.bezierCurveTo(h[10],h[11],h[12],h[13],h[14],h[15]),a!==s&&t.lineTo(h[16],h[17]),t.bezierCurveTo(h[18],h[19],h[20],h[21],h[22],h[23]),f!==r&&t.lineTo(h[24],h[25]),t.bezierCurveTo(h[26],h[27],h[28],h[29],h[30],h[31]))),t.closePath()),d||!u&&!c||(this._setStyles(t,e,i),u&&(t.fill(l.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),c&&t.stroke())},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_getBounds:function(t,e){var i=new x(this._size).setCenter(0,0),n=this._style,n=e.stroke&&n.hasStroke()&&n.getStrokeWidth();return t&&(i=t._transformBounds(i)),n?i.expand(W._getStrokePadding(n,this._getStrokeMatrix(t,e))):i}},new function(){function d(t,e,i){var n=t._radius;if(!n.isZero())for(var r=t._size.divide(2),s=1;s<=4;s++){var a=new P(1<s&&s<4?-1:1,2<s?-1:1),o=a.multiply(r),h=o.subtract(a.multiply(n));if(new x(i?o.add(a.multiply(i)):o,h).contains(e))return{point:h,quadrant:s}}}function f(t,e,i,n){t=t.divide(e);return(!n||t.isInQuadrant(n))&&t.subtract(t.normalize()).multiply(e).divide(i).length<=1}return{_contains:function t(e){var i;return"rectangle"===this._type?(i=d(this,e))?e.subtract(i.point).divide(this._radius).getLength()<=1:t.base.call(this,e):e.divide(this.size).getLength()<=.5},_hitTestSelf:function t(e,i,n,r){var s,a,o,h=!1,l=this._style,u=i.stroke&&l.hasStroke(),c=i.fill&&l.hasFill();return(u||c)&&(c=this._type,s=this._radius,a=u?l.getStrokeWidth()/2:0,a=i._tolerancePadding.add(W._getStrokePadding(a,!l.getStrokeScaling()&&r)),h="rectangle"===c?(c=d(this,e,l=a.multiply(2)))?f(e.subtract(c.point),s,a,c.quadrant):(o=(c=new x(this._size).setCenter(0,0)).expand(l),c=c.expand(l.negate()),o._containsPoint(e)&&!c._containsPoint(e)):f(e,s,a)),h?new L(u?"stroke":"fill",this):t.base.apply(this,arguments)}}},{statics:new function(){function n(t,e,i,n,r){var s=z.create(f.prototype);return s._type=t,s._size=i,s._radius=n,s._initialize(z.getNamed(r),e),s}return{Circle:function(){var t=arguments,e=P.readNamed(t,"center"),i=z.readNamed(t,"radius");return n("circle",e,new O(2*i),i,t)},Rectangle:function(){var t=arguments,e=x.readNamed(t,"rectangle"),i=O.min(O.readNamed(t,"radius"),e.getSize(!0).divide(2));return n("rectangle",e.getCenter(!0),e.getSize(!0),i,t)},Ellipse:function(){var t=arguments,e=f._readEllipse(t),i=e.radius;return n("ellipse",e.center,i.multiply(2),i,t)},_readEllipse:function(t){var e;return t=z.hasNamed(t,"radius")?(e=P.readNamed(t,"center"),O.readNamed(t,"radius")):(e=(t=x.readNamed(t,"rectangle")).getCenter(!0),t.getSize(!0).divide(2)),{center:e,radius:t}}}}}),$=V.extend({_class:"Raster",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!1,handle:!1},_serializeFields:{crossOrigin:null,source:null},_prioritize:["crossOrigin"],_smoothing:"low",beans:!0,initialize:function(t,e){var i,n;this._initialize(t,e!==j&&P.read(arguments))||((n="string"==(n=typeof t)?I.getElementById(t):"object"==n?t:null)&&n!==V.NO_INSERT&&(n.getContext||null!=n.naturalHeight?i=n:n&&!(n=O.read(arguments)).isZero()&&(i=A.getCanvas(n))),i?this.setImage(i):this.setSource(t)),this._size||(this._size=new O,this._loaded=!1)},_equals:function(t){return this.getSource()===t.getSource()},copyContent:function(t){var e=t._image,i=t._canvas;e?this._setImage(e):i&&((e=A.getCanvas(t._size)).getContext("2d").drawImage(i,0,0),this._setImage(e)),this._crossOrigin=t._crossOrigin},getSize:function(){var t=this._size;return new n(t?t.width:0,t?t.height:0,this,"setSize")},setSize:function(t,e){var i,n=O.read(arguments);n.equals(this._size)?e&&this.clear():0<n.width&&0<n.height?(i=!e&&this.getElement(),this._setImage(A.getCanvas(n)),i&&this.getContext(!0).drawImage(i,0,0,n.width,n.height)):(this._canvas&&A.release(this._canvas),this._size=n.clone())},getWidth:function(){return this._size?this._size.width:0},setWidth:function(t){this.setSize(t,this.getHeight())},getHeight:function(){return this._size?this._size.height:0},setHeight:function(t){this.setSize(this.getWidth(),t)},getLoaded:function(){return this._loaded},isEmpty:function(){var t=this._size;return!t||0===t.width&&0===t.height},getResolution:function(){var t=this._matrix,e=new P(0,0).transform(t),i=new P(1,0).transform(t).subtract(e),t=new P(0,1).transform(t).subtract(e);return new O(72/i.getLength(),72/t.getLength())},getPpi:"#getResolution",getImage:function(){return this._image},setImage:function(e){var n=this;function i(t){var e=n.getView(),i=t&&t.type||"load";e&&n.responds(i)&&(B=e._scope,n.emit(i,new ot(t)))}this._setImage(e),this._loaded?setTimeout(i,0):e&&R.add(e,{load:function(t){n._setImage(e),i(t)},error:i})},_setImage:function(t){this._canvas&&A.release(this._canvas),t&&t.getContext?(this._image=null,this._canvas=t,this._loaded=!0):(this._image=t,this._canvas=null,this._loaded=!!(t&&t.src&&t.complete)),this._size=new O(t?t.naturalWidth||t.width:0,t?t.naturalHeight||t.height:0),this._context=null,this._changed(1033)},getCanvas:function(){if(!this._canvas){var e=A.getContext(this._size);try{this._image&&e.drawImage(this._image,0,0),this._canvas=e.canvas}catch(t){A.release(e)}}return this._canvas},setCanvas:"#setImage",getContext:function(t){return this._context||(this._context=this.getCanvas().getContext("2d")),t&&(this._image=null,this._changed(1025)),this._context},setContext:function(t){this._context=t},getSource:function(){var t=this._image;return t&&t.src||this.toDataURL()},setSource:function(t){var e=new b.Image,i=this._crossOrigin;i&&(e.crossOrigin=i),t&&(e.src=t),this.setImage(e)},getCrossOrigin:function(){var t=this._image;return t&&t.crossOrigin||this._crossOrigin||""},setCrossOrigin:function(t){this._crossOrigin=t;var e=this._image;e&&(e.crossOrigin=t)},getSmoothing:function(){return this._smoothing},setSmoothing:function(t){this._smoothing="string"==typeof t?t:t?"low":"off",this._changed(257)},getElement:function(){return this._canvas||this._loaded&&this._image}},{beans:!1,getSubCanvas:function(){var t=x.read(arguments),e=A.getContext(t.getSize());return e.drawImage(this.getCanvas(),t.x,t.y,t.width,t.height,0,0,t.width,t.height),e.canvas},getSubRaster:function(){var t=x.read(arguments),e=new $(V.NO_INSERT);return e._setImage(this.getSubCanvas(t)),e.translate(t.getCenter().subtract(this.getSize().divide(2))),e._matrix.prepend(this._matrix),e.insertAbove(this),e},toDataURL:function(){var t=this._image,t=t&&t.src;return/^data:/.test(t)?t:(t=this.getCanvas())?t.toDataURL.apply(t,arguments):null},drawImage:function(t){var e=P.read(arguments,1);this.getContext(!0).drawImage(t,e.x,e.y)},getAverageColor:function(t){if(t?t instanceof Q?n=(r=t).getBounds():"object"==typeof t&&("width"in t?n=new x(t):"x"in t&&(n=new x(t.x-.5,t.y-.5,1,1))):n=this.getBounds(),!n)return null;for(var t=Math.min(n.width,32),e=Math.min(n.height,32),i=$._sampleContext,n=(i?i.clearRect(0,0,33,33):i=$._sampleContext=A.getContext(new O(32)),i.save(),(new M).scale(t/n.width,e/n.height).translate(-n.x,-n.y)),r=(n.applyToContext(i),r&&r.draw(i,new z({clip:!0,matrices:[n]})),this._matrix.applyToContext(i),this.getElement()),n=this._size,s=(r&&i.drawImage(r,-n.width/2,-n.height/2),i.restore(),i.getImageData(.5,.5,Math.ceil(t),Math.ceil(e)).data),a=[0,0,0],o=0,h=0,l=s.length;h<l;h+=4){var u=s[h+3];o+=u,u/=255,a[0]+=s[h]*u,a[1]+=s[h+1]*u,a[2]+=s[h+2]*u}for(h=0;h<3;h++)a[h]/=o;return o?S.read(a):null},getPixel:function(){var t=P.read(arguments),t=this.getContext().getImageData(t.x,t.y,1,1).data;return new S("rgb",[t[0]/255,t[1]/255,t[2]/255],t[3]/255)},setPixel:function(){var t=arguments,e=P.read(t),t=S.read(t),i=t._convert("rgb"),t=t._alpha,n=this.getContext(!0),r=n.createImageData(1,1),s=r.data;s[0]=255*i[0],s[1]=255*i[1],s[2]=255*i[2],s[3]=null!=t?255*t:255,n.putImageData(r,e.x,e.y)},clear:function(){var t=this._size;this.getContext(!0).clearRect(0,0,t.width+1,t.height+1)},createImageData:function(){var t=O.read(arguments);return this.getContext().createImageData(t.width,t.height)},getImageData:function(){var t=x.read(arguments);return t.isEmpty()&&(t=new x(this._size)),this.getContext().getImageData(t.x,t.y,t.width,t.height)},putImageData:function(t){var e=P.read(arguments,1);this.getContext(!0).putImageData(t,e.x,e.y)},setImageData:function(t){this.setSize(t),this.getContext(!0).putImageData(t,0,0)},_getBounds:function(t,e){var i=new x(this._size).setCenter(0,0);return t?t._transformBounds(i):i},_hitTestSelf:function(t){var e;if(this._contains(t))return new L("pixel",e=this,{offset:t.add(e._size.divide(2)).round(),color:{get:function(){return e.getPixel(this.offset)}}})},_draw:function(t,e,i){var n=this.getElement();n&&0<n.width&&0<n.height&&(t.globalAlpha=F.clamp(this._opacity,0,1),this._setStyles(t,e,i),e=this._smoothing,c.setPrefixed(t,(i="off"===e)?"imageSmoothingEnabled":"imageSmoothingQuality",!i&&e),t.drawImage(n,-this._size.width/2,-this._size.height/2))},_canComposite:function(){return!0}}),Y=V.extend({_class:"SymbolItem",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!0},_serializeFields:{symbol:null},initialize:function(t,e){this._initialize(t,e!==j&&P.read(arguments,1))||this.setDefinition(t instanceof m?t:new m(t))},_equals:function(t){return this._definition===t._definition},copyContent:function(t){this.setDefinition(t._definition)},getDefinition:function(){return this._definition},setDefinition:function(t){this._definition=t,this._changed(9)},getSymbol:"#getDefinition",setSymbol:"#setDefinition",isEmpty:function(){return this._definition._item.isEmpty()},_getBounds:function(t,e){var i=this._definition._item;return i._getCachedBounds(i._matrix.prepended(t),e)},_hitTestSelf:function(t,e,i){e=e.extend({all:!1}),t=this._definition._item._hitTest(t,e,i);return t&&(t.item=this),t},_draw:function(t,e){this._definition._item.draw(t,e)}}),m=z.extend({_class:"SymbolDefinition",initialize:function(t,e){this._id=o.get(),this.project=B.project,t&&this.setItem(t,e)},_serialize:function(t,e){return e.add(this,function(){return z.serialize([this._class,this._item],t,!1,e)})},_changed:function(t){8&t&&V._clearBoundsCache(this),1&t&&this.project._changed(t)},getItem:function(){return this._item},setItem:function(t,e){t._symbol&&(t=t.clone()),this._item&&(this._item._symbol=null),(this._item=t).remove(),t.setSelected(!1),e||t.setPosition(new P),(t._symbol=this)._changed(9)},getDefinition:"#getItem",setDefinition:"#setItem",place:function(t){return new Y(this,t)},clone:function(){return new m(this._item.clone(!1))},equals:function(t){return t===this||t&&this._item.equals(t._item)||!1}}),L=z.extend({_class:"HitResult",initialize:function(t,e,i){this.type=t,this.item=e,i&&this.inject(i)},statics:{getOptions:function(t){t=t&&z.read(t);return new z({type:null,tolerance:B.settings.hitTolerance,fill:!t,stroke:!t,segments:!t,handles:!1,ends:!1,position:!1,center:!1,bounds:!1,guides:!1,selected:!1},t)}}}),q=z.extend({_class:"Segment",beans:!0,_selection:0,initialize:function(t,e,i,n,r,s){var a,o,h,l,u=arguments.length;0<u&&(null==t||"object"==typeof t?l=1===u&&t&&"point"in t?(a=t.point,o=t.handleIn,h=t.handleOut,t.selection):(a=t,o=e,h=i,n):(a=[t,e],o=i!==j?[i,n]:null,h=r!==j?[r,s]:null)),new X(a,this,"_point"),new X(o,this,"_handleIn"),new X(h,this,"_handleOut"),l&&this.setSelection(l)},_serialize:function(t,e){var i=this._point,n=this._selection,i=n||this.hasHandles()?[i,this._handleIn,this._handleOut]:i;return n&&i.push(n),z.serialize(i,t,!0,e)},_changed:function(t){var e,i,n,r=this._path;r&&(e=r._curves,i=this._index,e&&(t&&t!==this._point&&t!==this._handleIn||!(n=0<i?e[i-1]:r._closed?e[e.length-1]:null)||n._changed(),t&&t!==this._point&&t!==this._handleOut||!(n=e[i])||n._changed()),r._changed(41))},getPoint:function(){return this._point},setPoint:function(){this._point.set(P.read(arguments))},getHandleIn:function(){return this._handleIn},setHandleIn:function(){this._handleIn.set(P.read(arguments))},getHandleOut:function(){return this._handleOut},setHandleOut:function(){this._handleOut.set(P.read(arguments))},hasHandles:function(){return!this._handleIn.isZero()||!this._handleOut.isZero()},isSmooth:function(){var t=this._handleIn,e=this._handleOut;return!t.isZero()&&!e.isZero()&&t.isCollinear(e)},clearHandles:function(){this._handleIn._set(0,0),this._handleOut._set(0,0)},getSelection:function(){return this._selection},setSelection:function(t){var e=this._selection,i=this._path;this._selection=t=t||0,i&&t!==e&&(i._updateSelection(this,e,t),i._changed(257))},_changeSelection:function(t,e){var i=this._selection;this.setSelection(e?i|t:i&~t)},isSelected:function(){return!!(7&this._selection)},setSelected:function(t){this._changeSelection(7,t)},getIndex:function(){return this._index!==j?this._index:null},getPath:function(){return this._path||null},getCurve:function(){var t=this._path,e=this._index;return t&&(0<e&&!t._closed&&e===t._segments.length-1&&e--,t.getCurves()[e])||null},getLocation:function(){var t=this.getCurve();return t?new H(t,this===t._segment1?0:1):null},getNext:function(){var t=this._path&&this._path._segments;return t&&(t[this._index+1]||this._path._closed&&t[0])||null},smooth:function(t,e,i){var t=t||{},n=t.type,t=t.factor,r=this.getPrevious(),s=this.getNext(),a=(r||this)._point,o=this._point,h=(s||this)._point,l=a.getDistance(o),u=o.getDistance(h);if(n&&"catmull-rom"!==n){if("geometric"!==n)throw new Error("Smoothing method '"+n+"' not supported.");r&&s&&(n=a.subtract(h),f=(p=t===j?.4:t)*l/(l+u),e||this.setHandleIn(n.multiply(f)),i||this.setHandleOut(n.multiply(f-p)))}else{var c,d,n=t===j?.5:t,f=Math.pow(l,n),p=f*f,t=Math.pow(u,n),l=t*t;!e&&r&&(c=2*l+3*t*f+p,this.setHandleIn(0!==(d=3*t*(t+f))?new P((l*a._x+c*o._x-p*h._x)/d-o._x,(l*a._y+c*o._y-p*h._y)/d-o._y):new P)),!i&&s&&(c=2*p+3*f*t+l,this.setHandleOut(0!==(d=3*f*(f+t))?new P((p*h._x+c*o._x-l*a._x)/d-o._x,(p*h._y+c*o._y-l*a._y)/d-o._y):new P))}},getPrevious:function(){var t=this._path&&this._path._segments;return t&&(t[this._index-1]||this._path._closed&&t[t.length-1])||null},isFirst:function(){return!this._index},isLast:function(){var t=this._path;return t&&this._index===t._segments.length-1||!1},reverse:function(){var t=this._handleIn,e=this._handleOut,i=t.clone();t.set(e),e.set(i)},reversed:function(){return new q(this._point,this._handleOut,this._handleIn)},remove:function(){return!!this._path&&!!this._path.removeSegment(this._index)},clone:function(){return new q(this._point,this._handleIn,this._handleOut)},equals:function(t){return t===this||t&&this._class===t._class&&this._point.equals(t._point)&&this._handleIn.equals(t._handleIn)&&this._handleOut.equals(t._handleOut)||!1},toString:function(){var t=["point: "+this._point];return this._handleIn.isZero()||t.push("handleIn: "+this._handleIn),this._handleOut.isZero()||t.push("handleOut: "+this._handleOut),"{ "+t.join(", ")+" }"},transform:function(t){this._transformCoordinates(t,new Array(6),!0),this._changed()},interpolate:function(t,e,i){var n=1-i,r=t._point,s=e._point,a=t._handleIn,o=e._handleIn,e=e._handleOut,t=t._handleOut;this._point._set(n*r._x+i*s._x,n*r._y+i*s._y,!0),this._handleIn._set(n*a._x+i*o._x,n*a._y+i*o._y,!0),this._handleOut._set(n*t._x+i*e._x,n*t._y+i*e._y,!0),this._changed()},_transformCoordinates:function(t,e,i){var n=this._point,r=i&&this._handleIn.isZero()?null:this._handleIn,s=i&&this._handleOut.isZero()?null:this._handleOut,a=n._x,o=n._y,h=2;return e[0]=a,e[1]=o,r&&(e[h++]=r._x+a,e[h++]=r._y+o),s&&(e[h++]=s._x+a,e[h++]=s._y+o),t&&(t._transformCoordinates(e,e,h/2),a=e[0],o=e[1],i?(n._x=a,n._y=o,h=2,r&&(r._x=e[h++]-a,r._y=e[h++]-o),s&&(s._x=e[h++]-a,s._y=e[h++]-o)):(r||(e[h++]=a,e[h++]=o),s||(e[h++]=a,e[h++]=o))),e}}),X=P.extend({initialize:function(t,e,i){var n,r,s;t?(n=t[0])!==j?r=t[1]:((n=(s=t).x)===j&&(n=(s=P.read(arguments)).x),r=s.y,s=s.selected):n=r=0,this._x=n,this._y=r,(this._owner=e)[i]=this,s&&this.setSelected(!0)},_set:function(t,e){return this._x=t,this._y=e,this._owner._changed(this),this},getX:function(){return this._x},setX:function(t){this._x=t,this._owner._changed(this)},getY:function(){return this._y},setY:function(t){this._y=t,this._owner._changed(this)},isZero:function(){var t=F.isZero;return t(this._x)&&t(this._y)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(t){this._owner._changeSelection(this._getSelection(),t)},_getSelection:function(){var t=this._owner;return this===t._point?1:this===t._handleIn?2:this===t._handleOut?4:0}}),U=z.extend({_class:"Curve",beans:!0,initialize:function(t,e,i,n,r,s,a,o){var h,l,u,c,d,f,p=arguments.length;3===p?(this._path=t,h=e,l=i):p?1===p?"segment1"in t?(h=new q(t.segment1),l=new q(t.segment2)):"point1"in t?(u=t.point1,d=t.handle1,f=t.handle2,c=t.point2):Array.isArray(t)&&(u=[t[0],t[1]],c=[t[6],t[7]],d=[t[2]-t[0],t[3]-t[1]],f=[t[4]-t[6],t[5]-t[7]]):2===p?(h=new q(t),l=new q(e)):4===p?(u=t,d=e,f=i,c=n):8===p&&(u=[t,e],c=[a,o],d=[i-t,n-e],f=[r-a,s-o]):(h=new q,l=new q),this._segment1=h||new q(u,null,d),this._segment2=l||new q(c,f,null)},_serialize:function(t,e){return z.serialize(this.hasHandles()?[this.getPoint1(),this.getHandle1(),this.getHandle2(),this.getPoint2()]:[this.getPoint1(),this.getPoint2()],t,!0,e)},_changed:function(){this._length=this._bounds=j},clone:function(){return new U(this._segment1,this._segment2)},toString:function(){var t=["point1: "+this._segment1._point];return this._segment1._handleOut.isZero()||t.push("handle1: "+this._segment1._handleOut),this._segment2._handleIn.isZero()||t.push("handle2: "+this._segment2._handleIn),t.push("point2: "+this._segment2._point),"{ "+t.join(", ")+" }"},classify:function(){return U.classify(this.getValues())},remove:function(){var t,e,i=!1;return this._path&&(e=(t=this._segment2)._handleOut,i=t.remove())&&this._segment1._handleOut.set(e),i},getPoint1:function(){return this._segment1._point},setPoint1:function(){this._segment1._point.set(P.read(arguments))},getPoint2:function(){return this._segment2._point},setPoint2:function(){this._segment2._point.set(P.read(arguments))},getHandle1:function(){return this._segment1._handleOut},setHandle1:function(){this._segment1._handleOut.set(P.read(arguments))},getHandle2:function(){return this._segment2._handleIn},setHandle2:function(){this._segment2._handleIn.set(P.read(arguments))},getSegment1:function(){return this._segment1},getSegment2:function(){return this._segment2},getPath:function(){return this._path},getIndex:function(){return this._segment1._index},getNext:function(){var t=this._path&&this._path._curves;return t&&(t[this._segment1._index+1]||this._path._closed&&t[0])||null},getPrevious:function(){var t=this._path&&this._path._curves;return t&&(t[this._segment1._index-1]||this._path._closed&&t[t.length-1])||null},isFirst:function(){return!this._segment1._index},isLast:function(){var t=this._path;return t&&this._segment1._index===t._curves.length-1||!1},isSelected:function(){return this.getPoint1().isSelected()&&this.getHandle1().isSelected()&&this.getHandle2().isSelected()&&this.getPoint2().isSelected()},setSelected:function(t){this.getPoint1().setSelected(t),this.getHandle1().setSelected(t),this.getHandle2().setSelected(t),this.getPoint2().setSelected(t)},getValues:function(t){return U.getValues(this._segment1,this._segment2,t)},getPoints:function(){for(var t=this.getValues(),e=[],i=0;i<8;i+=2)e.push(new P(t[i],t[i+1]));return e}},{getLength:function(){return null==this._length&&(this._length=U.getLength(this.getValues(),0,1)),this._length},getArea:function(){return U.getArea(this.getValues())},getLine:function(){return new N(this._segment1._point,this._segment2._point)},getPart:function(t,e){return new U(U.getPart(this.getValues(),t,e))},getPartLength:function(t,e){return U.getLength(this.getValues(),t,e)},divideAt:function(t){return this.divideAtTime(t&&t.curve===this?t.time:this.getTimeAt(t))},divideAtTime:function(t,e){var i,n,r,s,a,o,h=null;return 1e-8<=t&&t<=1-1e-8&&(o=(t=U.subdivide(this.getValues(),t))[0],t=t[1],e=e||this.hasHandles(),i=this._segment1,n=this._segment2,r=this._path,e&&(i._handleOut._set(o[2]-o[0],o[3]-o[1]),n._handleIn._set(t[4]-t[6],t[5]-t[7])),s=o[6],a=o[7],o=new q(new P(s,a),e&&new P(o[4]-s,o[5]-a),e&&new P(t[2]-s,t[3]-a)),h=r?(r.insert(i._index+1,o),this.getNext()):(this._segment2=o,this._changed(),new U(o,n))),h},splitAt:function(t){var e=this._path;return e?e.splitAt(t):null},splitAtTime:function(t){return this.splitAt(this.getLocationAtTime(t))},divide:function(t,e){return this.divideAtTime(t===j?.5:e?t:this.getTimeAt(t))},split:function(t,e){return this.splitAtTime(t===j?.5:e?t:this.getTimeAt(t))},reversed:function(){return new U(this._segment2.reversed(),this._segment1.reversed())},clearHandles:function(){this._segment1._handleOut._set(0,0),this._segment2._handleIn._set(0,0)},statics:{getValues:function(t,e,i,n){var r=t._point,t=t._handleOut,s=e._handleIn,e=e._point,a=r.x,r=r.y,o=e.x,e=e.y,n=n?[a,r,a,r,o,e,o,e]:[a,r,a+t._x,r+t._y,o+s._x,e+s._y,o,e];return i&&i._transformCoordinates(n,n,4),n},subdivide:function(t,e){var i=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],t=t[7],l=1-(e=e===j?.5:e),u=l*i+e*r,c=l*n+e*s,r=l*r+e*a,s=l*s+e*o,a=l*a+e*h,o=l*o+e*t,d=l*u+e*r,f=l*c+e*s,r=l*r+e*a,s=l*s+e*o,p=l*d+e*r,l=l*f+e*s;return[[i,n,u,c,d,f,p,l],[p,l,r,s,a,o,h,t]]},getMonoCurves:function(t,e){var i=[],e=e?0:1,n=t[0+e],r=t[2+e],s=t[4+e],e=t[6+e];return!(r<=n==s<=r&&s<=r==e<=s||U.isStraight(t))&&(s=F.solveQuadratic(3*(r-s)-n+e,2*(n+s)-4*r,r-n,e=[],1e-8,1-1e-8))?(e.sort(),r=e[0],n=U.subdivide(t,r),i.push(n[0]),1<s&&(r=(e[1]-r)/(1-r),n=U.subdivide(n[1],r),i.push(n[0])),i.push(n[1])):i.push(t),i},solveCubic:function(t,e,i,n,r,s){var a=t[e],o=t[e+2],h=t[e+4],t=t[e+6],e=0;return e=a<i&&t<i&&o<i&&h<i||i<a&&i<t&&i<o&&i<h?e:F.solveCubic(t-a-(t=3*(o-a))-(h=3*(h-o)-t),h,t,a-i,n,r,s)},getTimeOf:function(t,e){var i=new P(t[0],t[1]),n=new P(t[6],t[7]);if(null===(e.isClose(i,1e-12)?0:e.isClose(n,1e-12)?1:null))for(var r=[e.x,e.y],s=[],a=0;a<2;a++)for(var o=U.solveCubic(t,a,r[a],s,0,1),h=0;h<o;h++){var l=s[h];if(e.isClose(U.getPoint(t,l),1e-7))return l}return e.isClose(i,1e-7)?0:e.isClose(n,1e-7)?1:null},getNearestTime:function(i,n){var t,e,r,s,a;if(U.isStraight(i))return t=i[0],e=i[1],0==(a=(r=i[6]-t)*r+(s=i[7]-e)*s)||(a=((n.x-t)*r+(n.y-e)*s)/a)<1e-12?0:.999999999999<a?1:U.getTimeOf(i,new P(t+a*r,e+a*s));var o=1/0,h=0;function l(t){var e;return 0<=t&&t<=1&&(e=n.getDistance(U.getPoint(i,t),!0))<o?(o=e,h=t,1):void 0}for(var u=0;u<=100;u++)l(u/100);for(var c=.005;1e-8<c;)l(h-c)||l(h+c)||(c/=2);return h},getPart:function(t,e,i){var n,r=i<e;return r&&(n=e,e=i,i=n),0<e&&(t=U.subdivide(t,e)[1]),i<1&&(t=U.subdivide(t,(i-e)/(1-e))[0]),r?[t[6],t[7],t[4],t[5],t[2],t[3],t[0],t[1]]:t},isFlatEnough:function(t,e){var i=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],t=t[7],r=3*r-2*i-h,s=3*s-2*n-t,a=3*a-2*h-i,h=3*o-2*t-n;return Math.max(r*r,a*a)+Math.max(s*s,h*h)<=16*e*e},getArea:function(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],t=t[7];return 3*((t-i)*(n+s)-(o-e)*(r+a)+r*(e-s)-n*(i-a)+t*(s+e/3)-o*(a+i/3))/20},getBounds:function(t){for(var e=t.slice(0,2),i=e.slice(),n=[0,0],r=0;r<2;r++)U._addBounds(t[r],t[r+2],t[r+4],t[r+6],r,0,e,i,n);return new x(e[0],e[1],i[0]-e[0],i[1]-e[1])},_addBounds:function(t,e,i,n,r,s,a,o,h){function l(t,e){var i=t-e,t=t+e;i<a[r]&&(a[r]=i),t>o[r]&&(o[r]=t)}var u=a[r]+(s/=2),c=o[r]-s;if(t<u||e<u||i<u||n<u||c<t||c<e||c<i||c<n)if(e<t!=e<n&&i<t!=i<n)l(t,0),l(n,0);else{var d=F.solveQuadratic(3*(e-i)-t+n,2*(t+i)-4*e,e-t,h);l(n,0);for(var f=0;f<d;f++){var p=h[f],g=1-p;1e-8<=p&&p<=1-1e-8&&l(g*g*g*t+3*g*g*p*e+3*g*p*p*i+p*p*p*n,s)}}}}},z.each(["getBounds","getStrokeBounds","getHandleBounds"],function(t){this[t]=function(){return this._bounds||(this._bounds={}),(this._bounds[t]||(this._bounds[t]=W[t]([this._segment1,this._segment2],!1,this._path))).clone()}},{}),z.each({isStraight:function(t,e,i,n){if(e.isZero()&&i.isZero())return!0;var r=n.subtract(t);if(!r.isZero()&&r.isCollinear(e)&&r.isCollinear(i)){var s=new N(t,n);if(s.getDistance(t.add(e))<1e-7&&s.getDistance(n.add(i))<1e-7)return t=r.dot(r),s=r.dot(e)/t,n=r.dot(i)/t,0<=s&&s<=1&&n<=0&&-1<=n}return!1},isLinear:function(t,e,i,n){n=n.subtract(t).divide(3);return e.equals(n)&&i.negate().equals(n)}},function(a,t){this[t]=function(t){var e=this._segment1,i=this._segment2;return a(e._point,e._handleOut,i._handleIn,i._point,t)},this.statics[t]=function(t,e){var i=t[0],n=t[1],r=t[6],s=t[7];return a(new P(i,n),new P(t[2]-i,t[3]-n),new P(t[4]-r,t[5]-s),new P(r,s),e)}},{statics:{},hasHandles:function(){return!this._segment1._handleOut.isZero()||!this._segment2._handleIn.isZero()},hasLength:function(t){return(!this.getPoint1().equals(this.getPoint2())||this.hasHandles())&&this.getLength()>(t||0)},isCollinear:function(t){return t&&this.isStraight()&&t.isStraight()&&this.getLine().isCollinear(t.getLine())},isHorizontal:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).y)<1e-8},isVertical:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).x)<1e-8}}),{beans:!1,getLocationAt:function(t,e){return this.getLocationAtTime(e?t:this.getTimeAt(t))},getLocationAtTime:function(t){return null!=t&&0<=t&&t<=1?new H(this,t):null},getTimeAt:function(t,e){return U.getTimeAt(this.getValues(),t,e)},getParameterAt:"#getTimeAt",getTimesWithTangent:function(){var t=P.read(arguments);return t.isZero()?[]:U.getTimesWithTangent(this.getValues(),t)},getOffsetAtTime:function(t){return this.getPartLength(0,t)},getLocationOf:function(){return this.getLocationAtTime(this.getTimeOf(P.read(arguments)))},getOffsetOf:function(){var t=this.getLocationOf.apply(this,arguments);return t?t.getOffset():null},getTimeOf:function(){return U.getTimeOf(this.getValues(),P.read(arguments))},getParameterOf:"#getTimeOf",getNearestLocation:function(){var t=P.read(arguments),e=this.getValues(),i=U.getNearestTime(e,t),e=U.getPoint(e,i);return new H(this,i,e,null,t.getDistance(e))},getNearestPoint:function(){var t=this.getNearestLocation.apply(this,arguments);return t&&t.getPoint()}},new function(){var t=["getPoint","getTangent","getNormal","getWeightedTangent","getWeightedNormal","getCurvature"];return z.each(t,function(n){this[n+"At"]=function(t,e){var i=this.getValues();return U[n](i,e?t:U.getTimeAt(i,t))},this[n+"AtTime"]=function(t){return U[n](this.getValues(),t)}},{statics:{_evaluateMethods:t}})},new function(){function u(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],t=t[7],h=9*(n-s)+3*(o-e),l=6*(e+s)-12*n,u=3*(n-e),c=9*(r-a)+3*(t-i),d=6*(i+a)-12*r,f=3*(r-i);return function(t){var e=(h*t+l)*t+u,t=(c*t+d)*t+f;return Math.sqrt(e*e+t*t)}}function c(t,e){return Math.max(2,Math.min(16,Math.ceil(32*Math.abs(e-t))))}function i(t,e,i,n){var r,s,a,o,h,l,u,c,d,f,p,g,m,_,v;return null==e||e<0||1<e?null:(f=t[0],m=t[1],r=t[2],s=t[3],p=t[4],g=t[5],a=t[6],t=t[7],(o=F.isZero)(r-f)&&o(s-m)&&(r=f,s=m),o(p-a)&&o(g-t)&&(p=a,g=t),l=a-f-(o=3*(r-f))-(h=3*(p-r)-o),d=t-m-(u=3*(s-m))-(c=3*(g-s)-u),0===i?(_=0===e?f:1===e?a:((l*e+h)*e+o)*e+f,v=0===e?m:1===e?t:((d*e+c)*e+u)*e+m):(0,v=e<1e-8?(_=o,u):1-1e-8<e?(_=3*(a-p),3*(t-g)):(_=(3*l*e+2*h)*e+o,(3*d*e+2*c)*e+u),n&&(0===_&&0===v&&(e<1e-8||1-1e-8<e)&&(_=p-r,v=g-s),f=Math.sqrt(_*_+v*v))&&(_/=f,v/=f),3===i&&(p=6*l*e+2*h,g=6*d*e+2*c,_=0!==(m=Math.pow(_*_+v*v,1.5))?(_*g-v*p)/m:0,v=0)),2===i?new P(v,-_):new P(_,v))}return{statics:{classify:function(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],t=t[7],h=n*(i-t)+r*(o-e)+e*t-i*o,n=3*(s*(r-i)+a*(e-n)+n*i-r*e),r=n-h,h=r-h+(e*(t-a)+i*(s-o)+o*a-t*s),e=Math.sqrt(h*h+r*r+n*n),i=0!==e?1/e:0,o=F.isZero,a="serpentine";function l(t,e,i){var n=e!==j,r=n&&0<e&&e<1,s=n&&0<i&&i<1;return!n||(r||s)&&("loop"!==t||r&&s)||(r=s=!(t="arch")),{type:t,roots:r||s?r&&s?e<i?[e,i]:[i,e]:[r?e:i]:null}}return r*=i,n*=i,o(h*=i)?o(r)?l(o(n)?"line":"quadratic"):l(a,n/(3*r)):o(t=3*r*r-4*h*n)?l("cusp",r/(2*h)):l(0<t?a:"loop",(r+(s=0<t?Math.sqrt(t/3):Math.sqrt(-t)))/(e=2*h),(r-s)/e)},getLength:function(t,e,i,n){var r,s;return e===j&&(e=0),i===j&&(i=1),U.isStraight(t)?(s=t,i<1&&(s=U.subdivide(s,i)[0],e/=i),r=(s=0<e?U.subdivide(s,e)[1]:s)[6]-s[0],s=s[7]-s[1],Math.sqrt(r*r+s*s)):F.integrate(n||u(t),e,i,c(e,i))},getTimeAt:function(t,e,i){var n,r,s,a,o,h,l;return i===j&&(i=e<0?1:0),0===e?i:(n=Math.abs,s=(r=0<e)?i:0,a=r?1:i,o=u(t),t=U.getLength(t,s,a,o),h=n(e)-t,n(h)<1e-12?r?a:s:1e-12<h?null:(l=0,F.findRoot(function(t){return l+=F.integrate(o,i,t,c(i,t)),i=t,l-e},o,i+e/t,s,a,32,1e-12)))},getPoint:function(t,e){return i(t,e,0,!1)},getTangent:function(t,e){return i(t,e,1,!0)},getWeightedTangent:function(t,e){return i(t,e,1,!1)},getNormal:function(t,e){return i(t,e,2,!0)},getWeightedNormal:function(t,e){return i(t,e,2,!1)},getCurvature:function(t,e){return i(t,e,3,!1).x},getPeaks:function(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=3*n-e-3*s+t[6],s=3*e-6*n+3*s,e=-3*e+3*n,n=3*r-i-3*a+t[7],t=3*i-6*r+3*a,a=-3*i+3*r,i=[];return F.solveCubic(9*(o*o+n*n),9*(o*s+t*n),2*(s*s+t*t)+3*(e*o+a*n),e*s+t*a,i,1e-8,1-1e-8),i.sort()}}}},new function(){function T(t,e,i,n,r,s,a){var o=!a&&i.getPrevious()===r,h=!a&&i!==r&&i.getNext()===r;null!==n&&(o?1e-8:0)<=n&&n<=(h?1-1e-8:1)&&null!==s&&(h?1e-8:0)<=s&&s<=(o?1-1e-8:1)&&(h=new H(i,n,null,a),o=new H(r,s,null,a),(h._intersection=o)._intersection=h,e&&!e(h)||H.insert(t,h,!0))}function I(t,e,i,n,r,s,a,o,h,l,u,c,d){var f,p,g,m,_,v,y,b,w,x,S,C,k,E,A;return 4096<=++h||40<=++o||(w=e[0],v=e[1],y=e[6],b=e[7],f=(p=0<(x=(_=N.getSignedDistance)(w,v,y,b,e[2],e[3]))*(S=_(w,v,y,b,e[4],e[5]))?.75:4/9)*Math.min(0,x,S),p=p*Math.max(0,x,S),v=(w=function(t,e,i,n){var r=[0,t],s=[1/3,e],a=[2/3,i],o=[1,n],e=e-(2*t+n)/3,i=i-(t+2*n)/3;n=e*i<0?[[r,s,o],[r,a,o]]:[2<=(t=e/i)?[r,s,o]:t<=.5?[r,a,o]:[r,s,a,o],[r,o]];return(e||i)<0?n.reverse():n}(C=_(w,v,y,b,t[0],t[1]),g=_(w,v,y,b,t[2],t[3]),m=_(w,v,y,b,t[4],t[5]),_=_(w,v,y,b,t[6],t[7])))[0],y=w[1],0===x&&0===S&&0===C&&0===g&&0===m&&0===_)||null==(b=L(v,y,f,p))||null==(w=L(v.reverse(),y.reverse(),f,p))||(x=l+(u-l)*b,S=l+(u-l)*w,Math.max(d-c,S-x)<1e-9?(k=(x+S)/2,A=(c+d)/2,T(r,s,a?n:i,a?A:k,a?i:n,a?k:A)):(t=U.getPart(t,b,w),C=d-c,h=.8<w-b?C<S-x?(k=(x+S)/2,h=I(e,(E=U.subdivide(t,.5))[0],n,i,r,s,!a,o,h,c,d,x,k),I(e,E[1],n,i,r,s,!a,o,h,c,d,k,S)):(A=(c+d)/2,h=I((E=U.subdivide(e,.5))[0],t,n,i,r,s,!a,o,h,c,A,x,S),I(E[1],t,n,i,r,s,!a,o,h,A,d,x,S)):0==C||1e-9<=C?I(e,t,n,i,r,s,!a,o,h,c,d,x,S):I(t,e,i,n,r,s,a,o,h,x,S,c,d))),h}function L(t,e,i,n){return t[0][1]<i?r(t,!0,i):e[0][1]>n?r(e,!1,n):t[0][0]}function r(t,e,i){for(var n=t[0][0],r=t[0][1],s=1,a=t.length;s<a;s++){var o=t[s][0],h=t[s][1];if(e?i<=h:h<=i)return h===i?o:n+(i-r)*(o-n)/(h-r);n=o,r=h}return null}function p(t,e,i,n,r){var s=F.isZero;if(s(n)&&s(r))return null===(s=U.getTimeOf(t,new P(e,i)))?[]:[s];for(var s=Math.atan2(-r,n),a=Math.sin(s),o=Math.cos(s),h=[],r=[],l=0;l<8;l+=2){var u=t[l]-e,c=t[l+1]-i;h.push(u*o-c*a,u*a+c*o)}return U.solveCubic(h,1,0,r,0,1),r}function v(t,e,i,n,r,s,a){for(var o=e[0],h=e[1],l=p(t,o,h,e[6]-o,e[7]-h),u=0,c=l.length;u<c;u++){var d=l[u],f=U.getPoint(t,d),f=U.getTimeOf(e,f);null!==f&&T(r,s,a?n:i,a?f:d,a?i:n,a?d:f)}}function y(t,e,i,n,r,s){var a=N.intersect(t[0],t[1],t[6],t[7],e[0],e[1],e[6],e[7]);a&&T(r,s,i,U.getTimeOf(t,a),n,U.getTimeOf(e,a))}function w(t,e,i,n,r,s){var a=Math.min,o=Math.max;if(o(t[0],t[2],t[4],t[6])+1e-12>a(e[0],e[2],e[4],e[6])&&a(t[0],t[2],t[4],t[6])-1e-12<o(e[0],e[2],e[4],e[6])&&o(t[1],t[3],t[5],t[7])+1e-12>a(e[1],e[3],e[5],e[7])&&a(t[1],t[3],t[5],t[7])-1e-12<o(e[1],e[3],e[5],e[7])){var h=b(t,e);if(h)for(var l=0;l<2;l++){var u=h[l];T(r,s,i,u[0],n,u[1],!0)}else{var a=U.isStraight(t),o=U.isStraight(e),c=a&&o,d=a&&!o,f=r.length;if((c?y:a||o?v:I)(d?e:t,d?t:e,d?n:i,d?i:n,r,s,d,0,0,0,1,0,1),!c||r.length===f)for(l=0;l<4;l++){var p=l>>1,g=1&l,m=6*p,_=6*g,m=new P(t[m],t[1+m]),_=new P(e[_],e[1+_]);m.isClose(_,1e-12)&&T(r,s,i,p,n,g)}}}return r}function x(t,e,i,n){t=U.classify(t);return"loop"===t.type&&T(i,n,e,(n=t.roots)[0],e,n[1]),i}function b(t,e){function i(t){var e=t[6]-t[0],t=t[7]-t[1];return e*e+t*t}var n=Math.abs,r=N.getDistance,s=1e-7,a=U.isStraight(t),o=U.isStraight(e),h=a&&o,l=i(t)<i(e),u=l?e:t,l=l?t:e,c=u[0],d=u[1],f=u[6]-c,p=u[7]-d;if(r(c,d,f,p,l[0],l[1],!0)<s&&r(c,d,f,p,l[6],l[7],!0)<s)!h&&r(c,d,f,p,u[2],u[3],!0)<s&&r(c,d,f,p,u[4],u[5],!0)<s&&r(c,d,f,p,l[2],l[3],!0)<s&&r(c,d,f,p,l[4],l[5],!0)<s&&(a=o=h=!0);else if(h)return null;if(a^o)return null;for(var g=[t,e],m=[],_=0;_<4&&m.length<2;_++){var v=1&_,y=1^v,b=_>>1,y=U.getTimeOf(g[v],new P(g[y][b?6:0],g[y][b?7:1]));if(null!=y&&(v=v?[b,y]:[y,b],!m.length||1e-8<n(v[0]-m[0][0])&&1e-8<n(v[1]-m[0][1]))&&m.push(v),2<_&&!m.length)break}return m=2!==m.length||!h&&(u=U.getPart(t,m[0][0],m[1][0]),n((r=U.getPart(e,m[0][1],m[1][1]))[2]-u[2])>s||n(r[3]-u[3])>s||n(r[4]-u[4])>s||n(r[5]-u[5])>s)?null:m}return{getIntersections:function(t){var e=this.getValues(),i=t&&t!==this&&t.getValues();return i?w(e,i,this,t,[]):x(e,this,[])},statics:{getOverlaps:b,getIntersections:function(t,e,i,n,r,s){for(var a=!e,o=t.length,h=(e=a?t:e).length,l=new Array(o),u=a?l:new Array(h),c=[],d=0;d<o;d++)l[d]=t[d].getValues(n);if(!a)for(d=0;d<h;d++)u[d]=e[d].getValues(r);for(var f=K.findCurveBoundsCollisions(l,u,1e-7),p=0;p<o;p++){var g=t[p],m=l[p],_=(a&&x(m,g,c,i),f[p]);if(_)for(var v=0;v<_.length;v++){if(s&&c.length)return c;var y,b=_[v];(!a||p<b)&&(y=e[b],w(m,u[b],g,y,c,i))}}return c},getCurveLineIntersections:p,getTimesWithTangent:function(t,e){var i,n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],t=t[7],u=(e=e.normalize()).x,e=e.y,l=3*l-9*o+9*s-3*n,t=3*t-9*h+9*a-3*r,o=6*o-12*s+6*n,h=6*h-12*a+6*r,s=3*s-3*n,n=3*a-3*r,a=2*l*e-2*t*u,r=[];return Math.abs(a)<F.CURVETIME_EPSILON?0!=(a=l*h-t*o)&&0<=(i=-(l*n-t*s)/a)&&i<=1&&r.push(i):(i=o*e-h*u,0<=(o=(o*o-4*l*s)*e*e+(-2*o*h+4*t*s+4*l*n)*u*e+(h*h-4*t*n)*u*u)&&0!=a&&(l=(-i+(s=Math.sqrt(o)))/a,0<=(e=-(i+s)/a)&&e<=1&&r.push(e),0<=l)&&l<=1&&r.push(l)),r}}}}),H=z.extend({_class:"CurveLocation",initialize:function(t,e,i,n,r){var s;.99999999<=e&&(s=t.getNext())&&(e=0,t=s),this._setCurve(t),this._time=e,this._point=i||t.getPointAtTime(e),this._overlap=n,this._distance=r,this._intersection=this._next=this._previous=null},_setPath:function(t){this._path=t,this._version=t?t._version:0},_setCurve:function(t){this._setPath(t._path),this._curve=t,this._segment=null,this._segment1=t._segment1,this._segment2=t._segment2},_setSegment:function(t){var e=t.getCurve();e?this._setCurve(e):(this._setPath(t._path),this._segment1=t,this._segment2=null),this._segment=t,this._time=t===this._segment1?0:1,this._point=t._point.clone()},getSegment:function(){var t,e,i=this._segment;return i||(t=this.getCurve(),0===(e=this.getTime())?i=t._segment1:1===e?i=t._segment2:null!=e&&(i=t.getPartLength(0,e)<t.getPartLength(e,1)?t._segment1:t._segment2),this._segment=i),i},getCurve:function(){var t=this._path,e=this;function i(t){t=t&&t.getCurve();if(t&&null!=(e._time=t.getTimeOf(e._point)))return e._setCurve(t),t}return t&&t._version!==this._version&&(this._time=this._offset=this._curveOffset=this._curve=null),this._curve||i(this._segment)||i(this._segment1)||i(this._segment2.getPrevious())},getPath:function(){var t=this.getCurve();return t&&t._path},getIndex:function(){var t=this.getCurve();return t&&t.getIndex()},getTime:function(){var t=this.getCurve(),e=this._time;return t&&null==e?this._time=t.getTimeOf(this._point):e},getParameter:"#getTime",getPoint:function(){return this._point},getOffset:function(){if(null==(t=this._offset)){var t=0,e=this.getPath(),i=this.getIndex();if(e&&null!=i)for(var n=e.getCurves(),r=0;r<i;r++)t+=n[r].getLength();this._offset=t+=this.getCurveOffset()}return t},getCurveOffset:function(){var t,e,i=this._curveOffset;return null==i&&(t=this.getCurve(),e=this.getTime(),this._curveOffset=i=null!=e&&t&&t.getPartLength(0,e)),i},getIntersection:function(){return this._intersection},getDistance:function(){return this._distance},divide:function(){var t=this.getCurve(),t=t&&t.divideAtTime(this.getTime());return t&&this._setSegment(t._segment1),t},split:function(){var t=this.getCurve(),e=t._path,t=t&&t.splitAtTime(this.getTime());return t&&this._setSegment(e.getLastSegment()),t},equals:function(t,e){var i,n,r,s,a=this===t;return!a&&t instanceof H&&(i=this.getCurve(),n=t.getCurve(),(i=i._path)===n._path)&&(r=(n=Math.abs)(this.getOffset()-t.getOffset()),s=!e&&this._intersection,e=!e&&t._intersection,a=(r<1e-7||i&&n(i.getLength()-r)<1e-7)&&(!s&&!e||s&&e&&s.equals(e,!0))),a},toString:function(){var t=[],e=this.getPoint(),i=w.instance,e=(e&&t.push("point: "+e),this.getIndex()),e=(null!=e&&t.push("index: "+e),this.getTime());return null!=e&&t.push("time: "+i.number(e)),null!=this._distance&&t.push("distance: "+i.number(this._distance)),"{ "+t.join(", ")+" }"},isTouching:function(){var t,e=this._intersection;return!(!e||!this.getTangent().isCollinear(e.getTangent())||(t=this.getCurve(),e=e.getCurve(),t.isStraight()&&e.isStraight()&&t.getLine().intersect(e.getLine())))},isCrossing:function(){var t=this._intersection;if(!t)return!1;var e=this.getTime(),i=t.getTime(),n=1-1e-8,r=1e-8<=e&&e<=n,s=1e-8<=i&&i<=n;if(r&&s)return!this.isTouching();var a=this.getCurve(),o=a&&e<1e-8?a.getPrevious():a,t=t.getCurve(),h=t&&i<1e-8?t.getPrevious():t;if(n<e&&(a=a.getNext()),n<i&&(t=t.getNext()),!(o&&a&&h&&t))return!1;var l=[];function u(t,e){var t=t.getValues(),i=U.classify(t).roots||U.getPeaks(t),n=i.length,t=U.getLength(t,e&&n?i[n-1]:0,!e&&n?i[0]:1);l.push(n?t:t/32)}function c(t,e,i){return e<i?e<t&&t<i:e<t||t<i}r||(u(o,!0),u(a,!1)),s||(u(h,!0),u(t,!1));var n=this.getPoint(),d=Math.min.apply(Math,l),e=r?a.getTangentAtTime(e):a.getPointAt(d).subtract(n),a=r?e.negate():o.getPointAt(-d).subtract(n),o=s?t.getTangentAtTime(i):t.getPointAt(d).subtract(n),i=s?o.negate():h.getPointAt(-d).subtract(n),t=a.getAngle(),s=e.getAngle(),h=i.getAngle(),d=o.getAngle();return!!(r?c(t,h,d)^c(s,h,d)&&c(t,d,h)^c(s,d,h):c(h,t,s)^c(d,t,s)&&c(h,s,t)^c(d,s,t))},hasOverlap:function(){return!!this._overlap}},z.each(U._evaluateMethods,function(t){var i=t+"At";this[t]=function(){var t=this.getCurve(),e=this.getTime();return null!=e&&t&&t[i](e,!0)}},{preserve:!0}),new function(){function n(r,s,t){var a=r.length,e=0,i=a-1;function n(t,e){for(var i=t+e;-1<=i&&i<=a;i+=e){var n=r[(i%a+a)%a];if(!s.getPoint().isClose(n.getPoint(),1e-7))break;if(s.equals(n))return n}return null}for(;e<=i;){var o=e+i>>>1,h=r[o];if(t&&(l=s.equals(h)?h:n(o,-1)||n(o,1)))return s._overlap&&(l._overlap=l._intersection._overlap=!0),l;var l=s.getPath(),u=h.getPath();(l!==u?l._id-u._id:s.getIndex()+s.getTime()-(h.getIndex()+h.getTime()))<0?i=o-1:e=1+o}return r.splice(e,0,s),s}return{statics:{insert:n,expand:function(t){for(var e=t.slice(),i=t.length-1;0<=i;i--)n(e,t[i]._intersection,!1);return e}}}}),Q=V.extend({_class:"PathItem",_selectBounds:!1,_canScaleStroke:!0,beans:!0,initialize:function(){},statics:{create:function(t){var e,i,n;return z.isPlainObject(t)?(i=t.segments,e=t.pathData):Array.isArray(t)?i=t:"string"==typeof t&&(e=t),i?n=(i=i[0])&&Array.isArray(i[0]):e&&(n=1<(e.match(/m/gi)||[]).length||/z\s*\S+/i.test(e)),new(n?G:W)(t)}},_asPathItem:function(){return this},isClockwise:function(){return 0<=this.getArea()},setClockwise:function(t){this.isClockwise()!=(t=!!t)&&this.reverse()},setPathData:function(t){var e,i,n=t&&t.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/gi),r=!1,s=new P,a=new P;function o(t,e){t=+c[t];return r&&(t+=s[e]),t}function h(t){return new P(o(t,"x"),o(t+1,"y"))}this.clear();for(var l=0,u=n&&n.length;l<u;l++){var c,d=n[l],f=d[0],p=f.toLowerCase(),g=(c=d.match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g))&&c.length,r=f===p;switch("z"!==e||/[mz]/.test(p)||this.moveTo(s),p){case"m":case"l":for(var m="m"===p,_=0;_<g;_+=2)this[m?"moveTo":"lineTo"](s=h(_)),m&&(a=s,m=!1);i=s;break;case"h":case"v":for(var v="h"===p?"x":"y",s=s.clone(),_=0;_<g;_++)s[v]=o(_,v),this.lineTo(s);i=s;break;case"c":for(_=0;_<g;_+=6)this.cubicCurveTo(h(_),i=h(_+2),s=h(_+4));break;case"s":for(_=0;_<g;_+=4)this.cubicCurveTo(/[cs]/.test(e)?s.multiply(2).subtract(i):s,i=h(_),s=h(_+2)),e=p;break;case"q":for(_=0;_<g;_+=4)this.quadraticCurveTo(i=h(_),s=h(_+2));break;case"t":for(_=0;_<g;_+=2)this.quadraticCurveTo(i=/[qt]/.test(e)?s.multiply(2).subtract(i):s,s=h(_)),e=p;break;case"a":for(_=0;_<g;_+=7)this.arcTo(s=h(_+5),new O(+c[_],+c[_+1]),+c[_+2],+c[_+4],+c[_+3]);break;case"z":this.closePath(1e-12),s=a}e=p}},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_contains:function(t){t=t.isInside(this.getBounds({internal:!0,handle:!0}))?this._getWinding(t):{};return t.onPath||!!("evenodd"===this.getFillRule()?1&t.windingL||1&t.windingR:t.winding)},getIntersections:function(t,e,i,n){var r=this===t||!t,s=this._matrix._orNullIfIdentity(),i=r?s:(i||t._matrix)._orNullIfIdentity();return r||this.getBounds(s).intersects(t.getBounds(i),1e-12)?U.getIntersections(this.getCurves(),!r&&t.getCurves(),e,s,i,n):[]},getCrossings:function(t){return this.getIntersections(t,function(t){return t.isCrossing()})},getNearestLocation:function(){for(var t=P.read(arguments),e=this.getCurves(),i=1/0,n=null,r=0,s=e.length;r<s;r++){var a=e[r].getNearestLocation(t);a._distance<i&&(i=a._distance,n=a)}return n},getNearestPoint:function(){var t=this.getNearestLocation.apply(this,arguments);return t&&t.getPoint()},interpolate:function(t,e,i){var n=!this._children,r=n?"_segments":"_children",s=t[r],a=e[r],o=this[r];if(!s||!a||s.length!==a.length)throw new Error("Invalid operands in interpolate() call: "+t+", "+e);var r=o.length,h=a.length;if(r<h)for(var l=n?q:W,u=r;u<h;u++)this.add(new l);else h<r&&this[n?"removeSegments":"removeChildren"](h,r);for(u=0;u<h;u++)o[u].interpolate(s[u],a[u],i);n&&(this.setClosed(t._closed),this._changed(9))},compare:function(t){var e=!1;if(t){for(var i=this._children||[this],n=t._children?t._children.slice():[t],t=i.length,r=n.length,s=[],a=0,o=(e=!0,K.findItemBoundsCollisions(i,n,F.GEOMETRIC_EPSILON)),h=t-1;0<=h&&e;h--){var l=i[h],e=!1,u=o[h];if(u)for(var c=u.length-1;0<=c&&!e;c--)l.compare(n[u[c]])&&(s[u[c]]||(s[u[c]]=!0,a++),e=!0)}e=e&&a===r}return e}}),W=Q.extend({_class:"Path",_serializeFields:{segments:[],closed:!1},initialize:function(t){this._closed=!1,this._segments=[],this._version=0;var e=arguments,e=Array.isArray(t)?"object"==typeof t[0]?t:e:!t||t.size!==j||t.x===j&&t.point===j?null:e;e&&0<e.length?this.setSegments(e):(this._curves=j,this._segmentSelection=0,e||"string"!=typeof t||(this.setPathData(t),t=null)),this._initialize(!e&&t)},_equals:function(t){return this._closed===t._closed&&z.equals(this._segments,t._segments)},copyContent:function(t){this.setSegments(t._segments),this._closed=t._closed},_changed:function t(e){if(t.base.call(this,e),8&e){if(this._length=this._area=j,32&e)this._version++;else if(this._curves)for(var i=0,n=this._curves.length;i<n;i++)this._curves[i]._changed()}else 64&e&&(this._bounds=j)},getStyle:function(){var t=this._parent;return(t instanceof G?t:this)._style},getSegments:function(){return this._segments},setSegments:function(t){var e,i=this.isFullySelected(),n=t&&t.length;this._segments.length=0,this._segmentSelection=0,this._curves=j,n&&("boolean"==typeof(e=t[n-1])&&(this.setClosed(e),n--),this._add(q.readList(t,0,{},n))),i&&this.setFullySelected(!0)},getFirstSegment:function(){return this._segments[0]},getLastSegment:function(){return this._segments[this._segments.length-1]},getCurves:function(){var t=this._curves,e=this._segments;if(!t)for(var i=this._countCurves(),t=this._curves=new Array(i),n=0;n<i;n++)t[n]=new U(this,e[n],e[n+1]||e[0]);return t},getFirstCurve:function(){return this.getCurves()[0]},getLastCurve:function(){var t=this.getCurves();return t[t.length-1]},isClosed:function(){return this._closed},setClosed:function(t){var e;this._closed!=(t=!!t)&&(this._closed=t,this._curves&&(e=this._curves.length=this._countCurves(),t)&&(this._curves[e-1]=new U(this,this._segments[e-1],this._segments[0])),this._changed(41))}},{beans:!0,getPathData:function(i,t){var n,r,s,a,o,h,l,u,e=this._segments,c=e.length,d=new w(t),f=new Array(6),p=!0,g=[];function m(t,e){t._transformCoordinates(i,f),n=f[0],r=f[1],p?(g.push("M"+d.pair(n,r)),p=!1):(o=f[2],h=f[3],o===n&&h===r&&l===s&&u===a?e||(t=n-s,e=r-a,g.push(0==t?"v"+d.number(e):0==e?"h"+d.number(t):"l"+d.pair(t,e))):g.push("c"+d.pair(l-s,u-a)+" "+d.pair(o-s,h-a)+" "+d.pair(n-s,r-a))),s=n,a=r,l=f[4],u=f[5]}if(!c)return"";for(var _=0;_<c;_++)m(e[_]);return this._closed&&0<c&&(m(e[0],!0),g.push("z")),g.join("")},isEmpty:function(){return!this._segments.length},_transformContent:function(t){for(var e=this._segments,i=new Array(6),n=0,r=e.length;n<r;n++)e[n]._transformCoordinates(t,i,!0);return!0},_add:function(t,e){for(var i=this._segments,n=this._curves,r=t.length,s=null==e,e=s?i.length:e,a=0;a<r;a++){var o=t[a];(o=o._path?t[a]=o.clone():o)._path=this,o._index=e+a,o._selection&&this._updateSelection(o,0,o._selection)}if(s)z.push(i,t);else{i.splice.apply(i,[e,0].concat(t));for(var a=e+r,h=i.length;a<h;a++)i[a]._index=a}if(n){var s=this._countCurves(),l=0<e&&e+r-1===s?e-1:e,u=l,c=Math.min(l+r,s);t._curves&&(n.splice.apply(n,[l,0].concat(t._curves)),u+=t._curves.length);for(a=u;a<c;a++)n.splice(a,0,new U(this,null,null));this._adjustCurves(l,c)}return this._changed(41),t},_adjustCurves:function(t,e){for(var i,n=this._segments,r=this._curves,s=t;s<e;s++)(i=r[s])._path=this,i._segment1=n[s],i._segment2=n[s+1]||n[0],i._changed();(i=r[this._closed&&!t?n.length-1:t-1])&&(i._segment2=n[t]||n[0],i._changed()),(i=r[e])&&(i._segment1=n[e],i._changed())},_countCurves:function(){var t=this._segments.length;return!this._closed&&0<t?t-1:t},add:function(t){var e=arguments;return 1<e.length&&"number"!=typeof t?this._add(q.readList(e)):this._add([q.read(e)])[0]},insert:function(t,e){var i=arguments;return 2<i.length&&"number"!=typeof e?this._add(q.readList(i,1),t):this._add([q.read(i,1)],t)[0]},addSegment:function(){return this._add([q.read(arguments)])[0]},insertSegment:function(t){return this._add([q.read(arguments,1)],t)[0]},addSegments:function(t){return this._add(q.readList(t))},insertSegments:function(t,e){return this._add(q.readList(e),t)},removeSegment:function(t){return this.removeSegments(t,t+1)[0]||null},removeSegments:function(t,e,i){t=t||0,e=z.pick(e,this._segments.length);var n=this._segments,r=this._curves,s=n.length,a=n.splice(t,e-t),o=a.length;if(o){for(var h=0;h<o;h++){var l=a[h];l._selection&&this._updateSelection(l,l._selection,0),l._index=l._path=null}for(var h=t,u=n.length;h<u;h++)n[h]._index=h;if(r){for(e=0<t&&e===s+(this._closed?1:0)?t-1:t,h=(r=r.splice(e,o)).length-1;0<=h;h--)r[h]._path=null;i&&(a._curves=r.slice(1)),this._adjustCurves(e,e)}this._changed(41)}return a},clear:"#removeSegments",hasHandles:function(){for(var t=this._segments,e=0,i=t.length;e<i;e++)if(t[e].hasHandles())return!0;return!1},clearHandles:function(){for(var t=this._segments,e=0,i=t.length;e<i;e++)t[e].clearHandles()},getLength:function(){if(null==this._length){for(var t=this.getCurves(),e=0,i=0,n=t.length;i<n;i++)e+=t[i].getLength();this._length=e}return this._length},getArea:function(){if(null==(i=this._area)){for(var t=this._segments,e=this._closed,i=0,n=0,r=t.length;n<r;n++){var s=n+1===r;i+=U.getArea(U.getValues(t[n],t[s?0:n+1],null,s&&!e))}this._area=i}return i},isFullySelected:function(){var t=this._segments.length;return this.isSelected()&&0<t&&this._segmentSelection===7*t},setFullySelected:function(t){t&&this._selectSegments(!0),this.setSelected(t)},setSelection:function t(e){1&e||this._selectSegments(!1),t.base.call(this,e)},_selectSegments:function(t){var e=this._segments,i=e.length,n=t?7:0;this._segmentSelection=n*i;for(var r=0;r<i;r++)e[r]._selection=n},_updateSelection:function(t,e,i){t._selection=i,0<(this._segmentSelection+=i-e)&&this.setSelected(!0)},divideAt:function(t){var t=this.getLocationAt(t);return t&&(t=t.getCurve().divideAt(t.getCurveOffset()))?t._segment1:null},splitAt:function(t){var e,t=this.getLocationAt(t),i=t&&t.index,t=t&&t.time,n=(1-1e-8<t&&(i++,t=0),this.getCurves());return 0<=i&&i<n.length?(1e-8<=t&&n[i++].divideAtTime(t),n=this.removeSegments(i,this._segments.length,!0),this._closed?(this.setClosed(!1),e=this):((e=new W(V.NO_INSERT)).insertAbove(this),e.copyAttributes(this)),e._add(n,0),this.addSegment(n[0]),e):null},split:function(t,e){t=e===j?t:(t=this.getCurves()[t])&&t.getLocationAtTime(e);return null!=t?this.splitAt(t):null},join:function(t,e){e=e||0;if(t&&t!==this){var i=t._segments,n=this.getLastSegment(),r=t.getLastSegment();if(!r)return this;n&&n._point.isClose(r._point,e)&&t.reverse();var s=t.getFirstSegment();n&&n._point.isClose(s._point,e)?(n.setHandleOut(s._handleOut),this._add(i.slice(1))):((n=this.getFirstSegment())&&n._point.isClose(s._point,e)&&t.reverse(),r=t.getLastSegment(),n&&n._point.isClose(r._point,e)?(n.setHandleIn(r._handleIn),this._add(i.slice(0,i.length-1),0)):this._add(i.slice())),t._closed&&this._add([i[0]]),t.remove()}s=this.getFirstSegment(),n=this.getLastSegment();return s!==n&&s._point.isClose(n._point,e)&&(s.setHandleIn(n._handleIn),n.remove(),this.setClosed(!0)),this},reduce:function(t){for(var e=this.getCurves(),i=t&&t.simplify,n=i?1e-7:0,r=e.length-1;0<=r;r--){var s=e[r];!s.hasHandles()&&(!s.hasLength(n)||i&&s.isCollinear(s.getNext()))&&s.remove()}return this},reverse:function(){this._segments.reverse();for(var t=0,e=this._segments.length;t<e;t++){var i=this._segments[t],n=i._handleIn;i._handleIn=i._handleOut,i._handleOut=n,i._index=t}this._curves=null,this._changed(9)},flatten:function(t){for(var e=new J(this,t||.25,256,!0).parts,i=e.length,n=[],r=0;r<i;r++)n.push(new q(e[r].curve.slice(0,2)));!this._closed&&0<i&&n.push(new q(e[i-1].curve.slice(6))),this.setSegments(n)},simplify:function(t){t=new tt(this).fit(t||2.5);return t&&this.setSegments(t),!!t},smooth:function(t){var r=this,e=t||{},t=e.type||"asymmetric",i=this._segments,s=i.length,a=this._closed;function n(t,e){var i=t&&t.index;if(null!=i){var n=t.path;if(n&&n!==r)throw new Error(t._class+" "+i+" of "+n+" is not part of "+r);e&&t instanceof U&&i++}else i="number"==typeof t?t:e;return Math.min(i<0&&a?i%s:i<0?i+s:i,s-1)}var o=a&&e.from===j&&e.to===j,h=n(e.from,0),l=n(e.to,s-1);if(l<h&&(a?h-=s:(c=h,h=l,l=c)),/^(?:asymmetric|continuous)$/.test(t)){var u="asymmetric"===t,c=Math.min,t=l-h+1,d=t-1,t=o?c(t,4):1,f=t,p=[];if(a||(f=c(1,h),t=c(1,s-l-1)),!((d+=f+t)<=1)){for(var g=0,m=h-f;g<=d;g++,m++)p[g]=i[(m<0?m+s:m)%s]._point;for(var _=d-1,v=[T=p[0]._x+2*p[1]._x],y=[I=p[0]._y+2*p[1]._y],b=[A=2],w=[],x=[],g=1;g<d;g++)var S=g<_,C=S?4:u?3:8,k=S?2:u?0:1,E=(S||u?1:2)/A,A=b[g]=(S?4:u?2:7)-E,T=v[g]=C*p[g]._x+k*p[g+1]._x-E*T,I=y[g]=C*p[g]._y+k*p[g+1]._y-E*I;w[_]=v[_]/b[_],x[_]=y[_]/b[_];for(g=d-2;0<=g;g--)w[g]=(v[g]-w[g+1])/b[g],x[g]=(y[g]-x[g+1])/b[g];w[d]=(3*p[d]._x-w[_])/2,x[d]=(3*p[d]._y-x[_])/2;for(var g=f,L=d-t,m=h;g<=L;g++,m++){var P=i[m<0?m+s:m],O=P._point,M=w[g]-O._x,O=x[g]-O._y;(o||g<L)&&P.setHandleOut(M,O),(o||f<g)&&P.setHandleIn(-M,-O)}}}else for(g=h;g<=l;g++)i[g<0?g+s:g].smooth(e,!o&&g===h,!o&&g===l)},toShape:function(t){var a,e,i,n,r,s,o,h;return this._closed&&(a=this._segments,!this.hasHandles()&&4===a.length&&l(0,2)&&l(1,3)&&(o=(s=a[s=1]).getPrevious(),h=s.getNext(),o._handleOut.isZero())&&s._handleIn.isZero()&&s._handleOut.isZero()&&h._handleIn.isZero()&&s._point.subtract(o._point).isOrthogonal(h._point.subtract(s._point))?(e=f.Rectangle,i=new O(c(0,3),c(0,1)),r=a[1]._point.add(a[2]._point).divide(2)):8===a.length&&u(0)&&u(2)&&u(4)&&u(6)&&l(1,5)&&l(3,7)?(e=f.Rectangle,n=(i=new O(c(1,6),c(0,3))).subtract(new O(c(0,7),c(1,2))).divide(2),r=a[3]._point.add(a[4]._point).divide(2)):4===a.length&&u(0)&&u(1)&&u(2)&&u(3)&&(n=F.isZero(c(0,2)-c(1,3))?(e=f.Circle,c(0,2)/2):(e=f.Ellipse,new O(c(2,0)/2,c(3,1)/2)),r=a[1]._point),e)?((h=new e({center:o=this.getPosition(!0),size:i,radius:n,insert:!1})).copyAttributes(this,!0),h._matrix.prepend(this._matrix),h.rotate(r.subtract(o).getAngle()+90),t!==j&&!t||h.insertAbove(this),h):null;function l(t,e){var t=a[t],i=t.getNext(),e=a[e],n=e.getNext();return t._handleOut.isZero()&&i._handleIn.isZero()&&e._handleOut.isZero()&&n._handleIn.isZero()&&i._point.subtract(t._point).isCollinear(n._point.subtract(e._point))}function u(t){var e,t=a[t],i=t.getNext(),n=t._handleOut,r=i._handleIn,s=.5522847498307936;if(n.isOrthogonal(r))return t=t._point,i=i._point,(e=new N(t,n,!0).intersect(new N(i,r,!0),!0))&&F.isZero(n.getLength()/e.subtract(t).getLength()-s)&&F.isZero(r.getLength()/e.subtract(i).getLength()-s)}function c(t,e){return a[t]._point.getDistance(a[e]._point)}},toPath:"#clone",compare:function t(e){if(!e||e instanceof G)return t.base.call(this,e);var i=this.getCurves(),n=e.getCurves(),r=i.length,s=n.length;if(!r||!s)return r==s;for(var a,o,h=i[0].getValues(),l=[],u=0,c=0,d=0;d<s;d++){var f=n[d].getValues();if(l.push(f),m=U.getOverlaps(h,f)){a=!d&&0<m[0][0]?s-1:d,o=m[0][1];break}}for(var p,g=Math.abs,f=l[a];h&&f;){var m=U.getOverlaps(h,f);if(m)if(g(m[0][0]-c)<1e-8){1===(c=m[1][0])&&(h=++u<r?i[u].getValues():null,c=0);var _=m[0][1];if(g(_-o)<1e-8){if(p=p||[a,_],1===(o=m[1][1])&&(f=l[a=++a>=s?0:a]||n[a].getValues(),o=0),h)continue;return p[0]===a&&p[1]===o}}break}return!1},_hitTestSelf:function(i,r,t,n){var s,a,o,h,e,l,u=this,c=this.getStyle(),d=this._segments,f=d.length,p=this._closed,g=r._tolerancePadding,m=g,_=r.stroke&&c.hasStroke(),v=r.fill&&c.hasFill(),y=r.curves,b=_?c.getStrokeWidth()/2:v&&0<r.tolerance||y?0:null;function w(t,e){return i.subtract(t).divide(e).length<=1}function x(t,e,i){if(!r.selected||e.isSelected()){var n=t._point;if(w(e=e!==n?e.add(n):e,m))return new L(i,u,{segment:t,point:e})}}function S(t,e){return(e||r.segments)&&x(t,t._point,"segment")||!e&&r.handles&&(x(t,t._handleIn,"handle-in")||x(t,t._handleOut,"handle-out"))}function C(t){h.add(t)}function k(t){var e=p||0<t._index&&t._index<f-1;return"round"===(e?s:a)?w(t._point,m):(h=new W({internal:!0,closed:!0}),e?t.isSmooth()||W._addBevelJoin(t,s,b,o,null,n,C,!0):"square"===a&&W._addSquareCap(t,a,b,null,n,C,!0),!h.isEmpty()&&(h.contains(i)||(e=h.getNearestLocation(i))&&w(e.getPoint(),g)))}if(null!==b&&(0<b?(s=c.getStrokeJoin(),a=c.getStrokeCap(),o=c.getMiterLimit(),m=m.add(W._getStrokePadding(b,n))):s=a="round"),!r.ends||r.segments||p){if(r.segments||r.handles)for(var E=0;E<f;E++)if(e=S(d[E]))return e}else if(e=S(d[0],!0)||S(d[f-1],!0))return e;if(null!==b&&((l=this.getNearestLocation(i))&&(0===(c=l.getTime())||1===c&&1<f?k(l.getSegment())||(l=null):w(l.getPoint(),m)||(l=null)),!l&&"miter"===s&&1<f))for(E=0;E<f;E++){var A=d[E];if(i.getDistance(A._point)<=o*b&&k(A)){l=A.getLocation();break}}return!l&&v&&this._contains(i)||l&&!_&&!y?new L("fill",this):l?new L(_?"stroke":"curve",this,{location:l,point:l.getPoint()}):null}},z.each(U._evaluateMethods,function(e){this[e+"At"]=function(t){t=this.getLocationAt(t);return t&&t[e]()}},{beans:!1,getLocationOf:function(){for(var t=P.read(arguments),e=this.getCurves(),i=0,n=e.length;i<n;i++){var r=e[i].getLocationOf(t);if(r)return r}return null},getOffsetOf:function(){var t=this.getLocationOf.apply(this,arguments);return t?t.getOffset():null},getLocationAt:function(t){if("number"==typeof t){for(var e=this.getCurves(),i=0,n=0,r=e.length;n<r;n++){var s=i,a=e[n];if(t<(i+=a.getLength()))return a.getLocationAt(t-s)}if(0<e.length&&t<=this.getLength())return new H(e[e.length-1],1)}else if(t&&t.getPath&&t.getPath()===this)return t;return null},getOffsetsWithTangent:function(){var t=P.read(arguments);if(t.isZero())return[];for(var e=[],i=0,n=this.getCurves(),r=0,s=n.length;r<s;r++){for(var a=n[r],o=a.getTimesWithTangent(t),h=0,l=o.length;h<l;h++){var u=i+a.getOffsetAtTime(o[h]);e.indexOf(u)<0&&e.push(u)}i+=a.length}return e}}),new function(){function _(n,t,r){var s,a,o,h,l,u,c,d,e=t._segments,i=e.length,f=new Array(6),p=!0;function g(t){var e,i;a=r?(t._transformCoordinates(r,f),s=f[0],f[1]):(e=t._point,s=e._x,e._y),p?(n.moveTo(s,a),p=!1):(u=r?(l=f[2],f[3]):(i=t._handleIn,l=s+i._x,a+i._y),l===s&&u===a&&c===o&&d===h?n.lineTo(s,a):n.bezierCurveTo(c,d,l,u,s,a)),o=s,h=a,d=r?(c=f[4],f[5]):(i=t._handleOut,c=o+i._x,h+i._y)}for(var m=0;m<i;m++)g(e[m]);t._closed&&0<i&&g(e[0])}return{_draw:function(t,e,i,n){var r=e.dontStart,s=e.dontFinish||e.clip,a=this.getStyle(),o=a.hasFill(),h=a.hasStroke(),l=a.getDashArray(),u=!B.support.nativeDash&&h&&l&&l.length;function c(t){return l[(t%u+u)%u]}if(r||t.beginPath(),(o||h&&!u||s)&&(_(t,this,n),this._closed)&&t.closePath(),!s&&(o||h)&&(this._setStyles(t,e,i),o&&(t.fill(a.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),h)){if(u){r||t.beginPath();for(var d,f=new J(this,.25,32,!1,n),p=f.length,g=-a.getDashOffset(),m=0;0<g;)g-=c(m--)+c(m--);for(;g<p;)d=g+c(m++),(0<g||0<d)&&f.drawPart(t,Math.max(g,0),Math.max(d,0)),g=d+c(m++)}t.stroke()}},_drawSelected:function(t,e){t.beginPath(),_(t,this,e),t.stroke();var i=t,n=this._segments,r=e,s=B.settings.handleSize;if(!(s<=0))for(var a,o,h=s/2,l=s-2,u=h-1,c=new Array(6),d=0,f=n.length;d<f;d++){var p=n[d],g=p._selection;p._transformCoordinates(r,c),a=c[0],o=c[1],2&g&&m(2),4&g&&m(4),i.fillRect(a-h,o-h,s,s),0<l&&!(1&g)&&(p=i.fillStyle,i.fillStyle="#ffffff",i.fillRect(a-u,o-u,l,l),i.fillStyle=p)}function m(t){var e=c[t],t=c[t+1];a==e&&o==t||(i.beginPath(),i.moveTo(a,o),i.lineTo(e,t),i.stroke(),i.beginPath(),i.arc(e,t,h,0,2*Math.PI,!0),i.fill())}}}},new function(){function L(t){t=t._segments;if(t.length)return t[t.length-1];throw new Error("Use a moveTo() command first")}return{moveTo:function(){var t=this._segments;1===t.length&&this.removeSegment(0),t.length||this._add([new q(P.read(arguments))])},moveBy:function(){throw new Error("moveBy() is unsupported on Path items.")},lineTo:function(){this._add([new q(P.read(arguments))])},cubicCurveTo:function(){var t=arguments,e=P.read(t),i=P.read(t),t=P.read(t),n=L(this);n.setHandleOut(e.subtract(n._point)),this._add([new q(t,i.subtract(t))])},quadraticCurveTo:function(){var t=arguments,e=P.read(t),t=P.read(t),i=L(this)._point;this.cubicCurveTo(e.add(i.subtract(e).multiply(1/3)),e.add(t.subtract(e).multiply(1/3)),t)},curveTo:function(){var t=arguments,e=P.read(t),i=P.read(t),t=z.pick(z.read(t),.5),n=1-t,r=L(this)._point,e=e.subtract(r.multiply(n*n)).subtract(i.multiply(t*t)).divide(2*t*n);if(e.isNaN())throw new Error("Cannot put a curve through points with parameter = "+t);this.quadraticCurveTo(e,i)},arcTo:function(){var t,e=arguments,i=Math.abs,n=Math.sqrt,r=L(this),s=r._point,a=P.read(e),o=z.peek(e);if("boolean"==typeof(o=z.pick(o,!0)))var h=(c=s.add(a).divide(2)).add(c.subtract(s).rotate(o?-90:90));else if(z.remain(e)<=2)h=a,a=P.read(e);else if(!s.equals(a)){var l=O.read(e),u=F.isZero;if(u(l.width)||u(l.height))return this.lineTo(a);var u=z.read(e),o=!!z.read(e),e=!!z.read(e),c=s.add(a).divide(2),d=(T=s.subtract(c).rotate(-u)).x,f=T.y,p=i(l.width),l=i(l.height),g=p*p,m=l*l,_=d*d,v=f*f,y=n(_/g+v/m);if(1<y&&(g=(p*=y)*p,m=(l*=y)*l),(y=i(y=(g*m-g*v-m*_)/(g*v+m*_))<1e-12?0:y)<0)throw new Error("Cannot create an arc with the given arguments");b=new P(p*f/l,-l*d/p).multiply((e==o?-1:1)*n(y)).rotate(u).add(c),g=(w=(t=(new M).translate(b).rotate(u).scale(p,l))._inverseTransform(s)).getDirectedAngle(t._inverseTransform(a)),!o&&0<g?g-=360:o&&g<0&&(g+=360)}if(h){var b,v=new N(s.add(h).divide(2),h.subtract(s).rotate(90),!0),m=new N(h.add(a).divide(2),a.subtract(h).rotate(90),!0),_=new N(s,a),f=_.getSide(h);if(!(b=v.intersect(m,!0))){if(f)throw new Error("Cannot create an arc with the given arguments");return this.lineTo(a)}var w,g=(w=s.subtract(b)).getDirectedAngle(a.subtract(b)),d=_.getSide(b,!0);0===d?g=f*i(g):f===d&&(g+=g<0?360:-360)}if(g){for(var e=i(g),x=360<=e?4:Math.ceil((e-1e-5)/90),S=g/x,n=S*Math.PI/360,C=4/3*Math.sin(n)/(1+Math.cos(n)),k=[],E=0;E<=x;E++){var A,T=a,I=null;E<x&&(I=w.rotate(90).multiply(C),t?(T=t._transformPoint(w),I=t._transformPoint(w.add(I)).subtract(T)):T=b.add(w)),E?(A=w.rotate(-90).multiply(C),t&&(A=t._transformPoint(w.add(A)).subtract(T)),k.push(new q(T,A,I))):r.setHandleOut(I),w=w.rotate(S)}this._add(k)}},lineBy:function(){var t=P.read(arguments),e=L(this)._point;this.lineTo(e.add(t))},curveBy:function(){var t=arguments,e=P.read(t),i=P.read(t),t=z.read(t),n=L(this)._point;this.curveTo(n.add(e),n.add(i),t)},cubicCurveBy:function(){var t=arguments,e=P.read(t),i=P.read(t),t=P.read(t),n=L(this)._point;this.cubicCurveTo(n.add(e),n.add(i),n.add(t))},quadraticCurveBy:function(){var t=arguments,e=P.read(t),t=P.read(t),i=L(this)._point;this.quadraticCurveTo(i.add(e),i.add(t))},arcBy:function(){var t=arguments,e=L(this)._point,i=e.add(P.read(t)),n=z.pick(z.peek(t),!0);"boolean"==typeof n?this.arcTo(i,n):this.arcTo(i,e.add(P.read(t)))},closePath:function(t){this.setClosed(!0),this.join(this,t)}}},{_getBounds:function(t,e){var i=e.handle?"getHandleBounds":e.stroke?"getStrokeBounds":"getBounds";return W[i](this._segments,this._closed,this,t,e)},statics:{getBounds:function(t,e,i,n,r,s){var a=t[0];if(!a)return new x;var o=new Array(6),h=a._transformCoordinates(n,new Array(6)),l=h.slice(0,2),u=l.slice(),c=new Array(2);function d(t){t._transformCoordinates(n,o);for(var e=0;e<2;e++)U._addBounds(h[e],h[e+4],o[e+2],o[e],e,s?s[e]:0,l,u,c);t=h;h=o,o=t}for(var f=1,p=t.length;f<p;f++)d(t[f]);return e&&d(a),new x(l[0],l[1],u[0]-l[0],u[1]-l[1])},getStrokeBounds:function(t,e,i,n,r){var s=i.getStyle(),a=s.hasStroke(),o=s.getStrokeWidth(),h=a&&i._getStrokeMatrix(n,r),l=a&&W._getStrokePadding(o,h),u=W.getBounds(t,e,i,n,r,l);if(a){var c=o/2,d=s.getStrokeJoin(),i=s.getStrokeCap(),f=s.getMiterLimit(),p=new x(new O(l)),g=t.length-(e?0:1);if(0<g){for(var m=1;m<g;m++)y(t[m],d);e?y(t[0],d):(b(t[0],i),b(t[t.length-1],i))}}return u;function _(t){u=u.include(t)}function v(t){u=u.unite(p.setCenter(t._point.transform(n)))}function y(t,e){"round"===e||t.isSmooth()?v(t):W._addBevelJoin(t,e,c,f,n,h,_)}function b(t,e){"round"===e?v(t):W._addSquareCap(t,e,c,n,h,_)}},_getStrokePadding:function(t,e){var i,n,r,s,a;return e?(i=new P(t,0).transform(e),e=new P(0,t).transform(e),a=i.getAngleInRadians(),i=i.getLength(),e=e.getLength(),n=Math.sin(a),r=Math.cos(a),a=Math.tan(a),s=Math.atan2(e*a,i),a=Math.atan2(e,a*i),[Math.abs(i*Math.cos(s)*r+e*Math.sin(s)*n),Math.abs(e*Math.sin(a)*r+i*Math.cos(a)*n)]):[t,t]},_addBevelJoin:function(t,e,i,n,r,s,a,o){var t=t.getCurve(),h=t.getPrevious(),r=t.getPoint1().transform(r),h=h.getNormalAtTime(1).multiply(i).transform(s),t=t.getNormalAtTime(0).multiply(i).transform(s),s=h.getDirectedAngle(t);(s<0||180<=s)&&(h=h.negate(),t=t.negate()),o&&a(r),a(r.add(h)),"miter"===e&&(s=new N(r.add(h),new P(-h.y,h.x),!0).intersect(new N(r.add(t),new P(-t.y,t.x),!0),!0))&&r.getDistance(s)<=n*i&&a(s),a(r.add(t))},_addSquareCap:function(t,e,i,n,r,s,a){n=t._point.transform(n),t=t.getLocation(),t=t.getNormal().multiply(0===t.getTime()?i:-i).transform(r);"square"===e&&(a&&(s(n.subtract(t)),s(n.add(t))),n=n.add(t.rotate(-90))),s(n.add(t)),s(n.subtract(t))},getHandleBounds:function(t,e,i,n,r){for(var s,a,o,h=i.getStyle(),l=(r.stroke&&h.hasStroke()&&(i=i._getStrokeMatrix(n,r),o=r=h.getStrokeWidth()/2,"miter"===h.getStrokeJoin()&&(o=r*h.getMiterLimit()),"square"===h.getStrokeCap()&&(o=Math.max(o,r*Math.SQRT2)),s=W._getStrokePadding(r,i),a=W._getStrokePadding(o,i)),new Array(6)),u=1/0,c=-u,d=u,f=c,p=0,g=t.length;p<g;p++){t[p]._transformCoordinates(n,l);for(var m=0;m<6;m+=2){var _=m?s:a,v=_?_[0]:0,_=_?_[1]:0,y=l[m],b=l[m+1],w=y-v,y=y+v,v=b-_,b=b+_;w<u&&(u=w),c<y&&(c=y),v<d&&(d=v),f<b&&(f=b)}}return new x(u,d,c-u,f-d)}}}),G=(W.inject({statics:new function(){var l=.5522847498307936,a=[new q([-1,0],[0,l],[0,-l]),new q([0,-1],[-l,0],[l,0]),new q([1,0],[0,-l],[0,l]),new q([0,1],[l,0],[-l,0])];function u(t,e,i){var i=z.getNamed(i),n=new W(i&&(1==i.insert?V.INSERT:0==i.insert?V.NO_INSERT:null));return n._add(t),n._closed=e,n.set(i,V.INSERT)}function n(t,e,i){for(var n=new Array(4),r=0;r<4;r++){var s=a[r];n[r]=new q(s._point.multiply(e).add(t),s._handleIn.multiply(e),s._handleOut.multiply(e))}return u(n,!0,i)}return{Line:function(){var t=arguments;return u([new q(P.readNamed(t,"from")),new q(P.readNamed(t,"to"))],!1,t)},Circle:function(){var t=arguments,e=P.readNamed(t,"center"),i=z.readNamed(t,"radius");return n(e,new O(i),t)},Rectangle:function(){var t,e,i=arguments,n=x.readNamed(i,"rectangle"),r=O.readNamed(i,"radius",0,{readNull:!0}),s=n.getBottomLeft(!0),a=n.getTopLeft(!0),o=n.getTopRight(!0),h=n.getBottomRight(!0);return u(!r||r.isZero()?[new q(s),new q(a),new q(o),new q(h)]:(n=(r=O.min(r,n.getSize(!0).divide(2))).width,r=r.height,t=n*l,e=r*l,[new q(s.add(n,0),null,[-t,0]),new q(s.subtract(0,r),[0,e]),new q(a.add(0,r),null,[0,-e]),new q(a.add(n,0),[-t,0],null),new q(o.subtract(n,0),null,[t,0]),new q(o.add(0,r),[0,-e],null),new q(h.subtract(0,r),null,[0,e]),new q(h.subtract(n,0),[t,0])]),!0,i)},RoundRectangle:"#Rectangle",Ellipse:function(){var t=arguments,e=f._readEllipse(t);return n(e.center,e.radius,t)},Oval:"#Ellipse",Arc:function(){var t=arguments,e=P.readNamed(t,"from"),i=P.readNamed(t,"through"),n=P.readNamed(t,"to"),t=z.getNamed(t),r=new W(t&&0==t.insert&&V.NO_INSERT);return r.moveTo(e),r.arcTo(i,n),r.set(t)},RegularPolygon:function(){for(var t=arguments,e=P.readNamed(t,"center"),i=z.readNamed(t,"sides"),n=z.readNamed(t,"radius"),r=360/i,s=i%3==0,a=new P(0,s?-n:n),o=s?-1:.5,h=new Array(i),l=0;l<i;l++)h[l]=new q(e.add(a.rotate((l+o)*r)));return u(h,!0,t)},Star:function(){for(var t=arguments,e=P.readNamed(t,"center"),i=2*z.readNamed(t,"points"),n=z.readNamed(t,"radius1"),r=z.readNamed(t,"radius2"),s=360/i,a=new P(0,-1),o=new Array(i),h=0;h<i;h++)o[h]=new q(e.add(a.rotate(s*h).multiply(h%2?r:n)));return u(o,!0,t)}}}}),Q.extend({_class:"CompoundPath",_serializeFields:{children:[]},beans:!0,initialize:function(t){this._children=[],this._namedChildren={},this._initialize(t)||("string"==typeof t?this.setPathData(t):this.addChildren(Array.isArray(t)?t:arguments))},insertChildren:function t(e,i){var n=i,r=n[0];r&&"number"==typeof r[0]&&(n=[n]);for(var s=i.length-1;0<=s;s--){var a=n[s];n!==i||a instanceof W||(n=z.slice(n)),Array.isArray(a)?n[s]=new W({segments:a,insert:!1}):a instanceof G&&(n.splice.apply(n,[s,1].concat(a.removeChildren())),a.remove())}return t.base.call(this,e,n)},reduce:function t(e){for(var i,n=this._children,r=n.length-1;0<=r;r--)(i=n[r].reduce(e)).isEmpty()&&i.remove();return n.length?t.base.call(this):((i=new W(V.NO_INSERT)).copyAttributes(this),i.insertAbove(this),this.remove(),i)},isClosed:function(){for(var t=this._children,e=0,i=t.length;e<i;e++)if(!t[e]._closed)return!1;return!0},setClosed:function(t){for(var e=this._children,i=0,n=e.length;i<n;i++)e[i].setClosed(t)},getFirstSegment:function(){var t=this.getFirstChild();return t&&t.getFirstSegment()},getLastSegment:function(){var t=this.getLastChild();return t&&t.getLastSegment()},getCurves:function(){for(var t=this._children,e=[],i=0,n=t.length;i<n;i++)z.push(e,t[i].getCurves());return e},getFirstCurve:function(){var t=this.getFirstChild();return t&&t.getFirstCurve()},getLastCurve:function(){var t=this.getLastChild();return t&&t.getLastCurve()},getArea:function(){for(var t=this._children,e=0,i=0,n=t.length;i<n;i++)e+=t[i].getArea();return e},getLength:function(){for(var t=this._children,e=0,i=0,n=t.length;i<n;i++)e+=t[i].getLength();return e},getPathData:function(t,e){for(var i=this._children,n=[],r=0,s=i.length;r<s;r++){var a=i[r],o=a._matrix;n.push(a.getPathData(t&&!o.isIdentity()?t.appended(o):t,e))}return n.join("")},_hitTestChildren:function t(e,i,n){return t.base.call(this,e,i.class===W||"path"===i.type?i:z.set({},i,{fill:!1}),n)},_draw:function(t,e,i,n){var r=this._children;if(r.length){e=e.extend({dontStart:!0,dontFinish:!0}),t.beginPath();for(var s=0,a=r.length;s<a;s++)r[s].draw(t,e,n);e.clip||(this._setStyles(t,e,i),(i=this._style).hasFill()&&(t.fill(i.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),i.hasStroke()&&t.stroke())}},_drawSelected:function(t,e,i){for(var n=this._children,r=0,s=n.length;r<s;r++){var a=n[r],o=a._matrix;i[a._id]||a._drawSelected(t,o.isIdentity()?e:e.appended(o))}}},new function(){function i(t,e){t=t._children;if(e&&!t.length)throw new Error("Use a moveTo() command first");return t[t.length-1]}return z.each(["lineTo","cubicCurveTo","quadraticCurveTo","curveTo","arcTo","lineBy","cubicCurveBy","quadraticCurveBy","curveBy","arcBy"],function(e){this[e]=function(){var t=i(this,!0);t[e].apply(t,arguments)}},{moveTo:function(){var t=i(this),e=t&&t.isEmpty()?t:new W(V.NO_INSERT);e!==t&&this.addChild(e),e.moveTo.apply(e,arguments)},moveBy:function(){var t=i(this,!0),t=t&&t.getLastSegment(),e=P.read(arguments);this.moveTo(t?e.add(t._point):e)},closePath:function(t){i(this,!0).closePath(t)}})},z.each(["reverse","flatten","simplify","smooth"],function(s){this[s]=function(t){for(var e,i=this._children,n=0,r=i.length;n<r;n++)e=i[n][s](t)||e;return e}},{}))),J=(Q.inject(new function(){var O=Math.min,M=Math.max,N=Math.abs,S={unite:{1:!0,2:!0},intersect:{2:!0},subtract:{1:!0},exclude:{1:!0,"-1":!0}};function C(t){return t._children||[t]}function k(t,e){var i=t.clone(!1).reduce({simplify:!0}).transform(null,!0,!0);if(e){for(var n=C(i),r=0,s=n.length;r<s;r++)(t=n[r])._closed||t.isEmpty()||(t.closePath(1e-12),t.getFirstSegment().setHandleIn(0,0),t.getLastSegment().setHandleOut(0,0));i=i.resolveCrossings().reorient("nonzero"===i.getFillRule(),!0)}return i}function E(t,e,i,n,r){var s=new G(V.NO_INSERT);return s.addChildren(t,!0),s=s.reduce({simplify:e}),r&&0==r.insert||s.insertAbove(n&&i.isSibling(n)&&i.getIndex()<n.getIndex()?n:i),s.copyAttributes(i,!0),s}function A(t){return t.hasOverlap()||t.isCrossing()}function i(t,e,i,n){if(n&&(0==n.trace||n.stroke)&&/^(subtract|intersect)$/.test(i))return T(t,e,i);var r,s=k(t,!0),a=e&&t!==e&&k(e,!0),o=S[i],h=(o[i]=!0,a&&(o.subtract||o.exclude)^(a.isClockwise()^s.isClockwise())&&a.reverse(),P(H.expand(s.getIntersections(a,A)))),i=C(s),l=a&&C(a),u=[],c=[];function d(t){for(var e=0,i=t.length;e<i;e++){var n=t[e];z.push(u,n._segments),z.push(c,n.getCurves()),n._overlapsOnly=!0}}function f(t){for(var e=[],i=0,n=t&&t.length;i<n;i++)e.push(c[t[i]]);return e}if(h.length){d(i),l&&d(l);for(var p=new Array(c.length),g=0,m=c.length;g<m;g++)p[g]=c[g].getValues();for(var _=K.findCurveBoundsCollisions(p,p,0,!0),v={},g=0;g<c.length;g++){var y=c[g],b=y._path._id;(v[b]=v[b]||{})[y.getIndex()]={hor:f(_[g].hor),ver:f(_[g].ver)}}for(g=0,m=h.length;g<m;g++)D(h[g]._segment,s,a,v,o);for(g=0,m=u.length;g<m;g++){var w=u[g],x=w._intersection;w._winding||D(w,s,a,v,o),x&&x._overlap||(w._path._overlapsOnly=!1)}r=B(u,o)}else r=L(l?i.concat(l):i.slice(),function(t){return!!o[t]});return E(r,!0,t,e,n)}function T(t,e,i){var n=k(t),r=k(e),s=n.getIntersections(r,A),a="subtract"===i,o="divide"===i,h={},l=[];function u(t){return!h[t._id]&&(o||r.contains(t.getPointAt(t.getLength()/2))^a)&&(l.unshift(t),h[t._id]=!0)}for(var c=s.length-1;0<=c;c--){var d=s[c].split();d&&(u(d)&&d.getFirstSegment().setHandleIn(0,0),n.getLastSegment().setHandleOut(0,0))}return u(n),E(l,!1,t,e)}function x(t,e){for(var i=t;i;){if(i===e)return;i=i._previous}for(;t._next&&t._next!==e;)t=t._next;if(!t._next){for(;e._previous;)e=e._previous;(t._next=e)._previous=t}}function I(t){for(var e=t.length-1;0<=e;e--)t[e].clearHandles()}function L(t,e,i){var n=t&&t.length;if(n){var r=z.each(t,function(t,e){this[t._id]={container:null,winding:t.isClockwise()?1:-1,index:e}},{}),s=t.slice().sort(function(t,e){return N(e.getArea())-N(t.getArea())}),a=s[0],o=K.findItemBoundsCollisions(s,null,F.GEOMETRIC_EPSILON);null==i&&(i=a.isClockwise());for(var h=0;h<n;h++){var l,u=s[h],c=r[u._id],d=0,f=o[h];if(f)for(var p=null,g=f.length-1;0<=g;g--)if(f[g]<h){var p=p||u.getInteriorPoint(),m=s[f[g]];if(m.contains(p)){var _=r[m._id],d=_.winding;c.winding+=d,c.container=_.exclude?_.container:m;break}}e(c.winding)===e(d)?(c.exclude=!0,t[c.index]=null):(l=c.container,u.setClockwise(l?!l.isClockwise():i))}}return t}function P(t,e,i){var n,r,s,a=e&&[],o=!1,h=i||[],l=i&&{};function u(t){return t._path._id+"."+t._segment1._index}for(var c=(i&&i.length)-1;0<=c;c--)(d=i[c])._path&&(l[u(d)]=!0);for(c=t.length-1;0<=c;c--){var d,f=t[c],p=f._time,g=p,m=e&&!e(f);if((d=f._curve)&&(d!==r?(o=!d.hasHandles()||l&&l[u(d)],n=[],s=null,r=d):1e-8<=s&&(p/=s)),m)n&&n.push(f);else{if(e&&a.unshift(f),s=g,p<1e-8)_=d._segment1;else if(1-1e-8<p)_=d._segment2;else{m=d.divideAtTime(p,!0);o&&h.push(d,m);for(var _=m._segment1,v=n.length-1;0<=v;v--){var y=n[v];y._time=(y._time-p)/(1-p)}}f._setSegment(_);var b=_._intersection,g=f._intersection;if(b){x(b,g);for(var w=b;w;)x(w._intersection,b),w=w._next}else _._intersection=g}}return i||I(h),a||t}function R(l,u,c,d,f){var t,e=Array.isArray(u)?u:u[c?"hor":"ver"],p=c?1:0,g=1^p,i=[l.x,l.y],m=i[p],_=i[g],v=1e-6,y=m-1e-9,b=m+1e-9,n=0,r=0,w=0,x=0,S=!1,s=!1,C=1,k=[];function a(t){var e=t[g+0],i=t[g+2],n=t[g+4],r=t[g+6];if(_<=M(e,i,n,r)&&_>=O(e,i,n,r))for(var s,e=t[p+0],i=t[p+2],n=t[p+4],r=t[p+6],a=y>M(e,i,n,r)||b<O(e,i,n,r)?[t]:U.getMonoCurves(t,c),o=0,h=a.length;o<h;o++)if(s=function(t){var e=t[g+0],i=t[g+6];if(!(_<O(e,i)||_>M(e,i))){var n,r,s=t[p+0],a=t[p+2],o=t[p+4],h=t[p+6];if(e!==i)return o=0===(a=_===e?0:_!==i&&!(y>M(s,a,o,h)||b<O(s,a,o,h))&&0<U.solveCubic(t,g,_,k,0,1)?k[0]:1)?s:1===a?h:U.getPoint(t,a)[c?"y":"x"],i=i<e?1:-1,n=I[g]>I[g+6]?1:-1,r=I[p+6],_!==e?(o<y?w+=i:b<o?x+=i:S=!0,m-v<o&&o<m+v&&(C/=2)):(i!=n?s<y?w+=i:b<s&&(x+=i):s!=r&&(r<b&&b<o?(x+=i,S=!0):y<r&&o<y&&(w+=i,S=!0)),C/=4),I=t,!f&&y<o&&o<b&&0===U.getTangent(t,a)[c?"x":"y"]&&R(l,u,!c,d,!0);(s<b&&y<h||h<b&&y<s)&&(S=!0)}}(a[o]))return s}for(var o=0,h=e.length;o<h;o++){var E=e[o],A=E._path,T=E.getValues();if(!(o&&e[o-1]._path===A||(I=null,A._closed||(t=U.getValues(A.getLastCurve().getSegment2(),E.getSegment1(),null,!d))[g]!==t[g+6]&&(I=t),I)))for(var I=T,L=A.getLastCurve();L&&L!==E;){var P=L.getValues();if(P[g]!==P[g+6]){I=P;break}L=L.getPrevious()}if(T=a(T))return T;if(o+1===h||e[o+1]._path!==A){if(t&&(T=a(t)))return T;n+=w=!S||w||x?w:x=A.isClockwise(d)^c?1:-1,r+=x,w=x=0,S=S&&!(s=!0),t=null}}return n=N(n),r=N(r),{winding:M(n,r),windingL:n,windingR:r,quality:C,onPath:s}}function D(t,e,i,n,r){var s=[],a=t,o=0;do{}while((m=t.getCurve())&&(c=m.getLength(),s.push({segment:t,curve:m,length:c}),o+=c),(t=t.getNext())&&!t._intersection&&t!==a);for(var h=[.5,.25,.75],l={winding:0,quality:-1},u=0;u<h.length&&l.quality<.5;u++)for(var c=o*h[u],d=0,f=s.length;d<f;d++){var p=s[d],g=p.length;if(c<=g){var m,p=(m=p.curve)._path,_=p._parent,_=_ instanceof G?_:p,v=F.clamp(m.getTimeAt(c),.001,.999),y=m.getPointAtTime(v),v=N(m.getTangentAtTime(v).y)<Math.SQRT1_2,b=null;if(r.subtract&&i){var w=(_===e?i:e)._getWinding(y,v,!0);if(_===e&&w.winding||_===i&&!w.winding){if(w.quality<1)continue;b={winding:0,quality:1}}}(b=b||R(y,n[p._id][m.getIndex()],v,!0)).quality>l.quality&&(l=b);break}c-=g}for(d=s.length-1;0<=d;d--)s[d].segment._winding=l}function B(t,e){var h,i=[];function l(t){return!(!t||t._visited||e&&(!e[(t=t._winding||{}).winding]||e.unite&&2===t.winding&&t.windingL&&t.windingR))}function u(t){if(t)for(var e=0,i=h.length;e<i;e++)if(t===h[e])return!0;return!1}function n(t){for(var e=t._segments,i=0,n=e.length;i<n;i++)e[i]._visited=!0}t.sort(function(t,e){var i=t._intersection,n=e._intersection,r=!(!i||!i._overlap),s=!(!n||!n._overlap),a=t._path,o=e._path;return r^s?r?1:-1:!i^!n?i?1:-1:a!==o?a._id-o._id:t._index-e._index});for(var r=0,s=t.length;r<s;r++){var a,o,c,d,f,p=t[r],g=l(p),m=null,_=!1,v=!0,y=[];for(g&&p._path._overlapsOnly&&(d=p._path,f=p._intersection._segment._path,d.compare(f))&&(d.getArea()&&i.push(d.clone(!1)),n(d),n(f),g=!1);g;){var b=!m,w=function(s,a){var t=s._intersection,e=t,o=[];function i(t,e){for(;t&&t!==e;){var i,n=t._segment,r=n&&n._path;r&&(i=(r=n.getNext()||r.getFirstSegment())._intersection,n!==s&&(u(n)||u(r)||r&&l(n)&&(l(r)||i&&l(i._segment)))&&o.push(n),a)&&h.push(n),t=t._next}}if(a&&(h=[s]),t){for(i(t);t&&t._previous;)t=t._previous;i(t,e)}return o}(p,b),x=w.shift(),S=!(_=!b&&(u(p)||u(x)))&&x;if(b&&(m=new W(V.NO_INSERT),a=null),_){(p.isFirst()||p.isLast())&&(v=p._path._closed),p._visited=!0;break}if(S&&a&&(y.push(a),a=null),a||(S&&w.push(p),a={start:m._segments.length,crossings:w,visited:o=[],handleIn:c}),!l(p=S?x:p)){m.removeSegments(a.start);for(var C=0,k=o.length;C<k;C++)o[C]._visited=!1;for(o.length=0;(p=a&&a.crossings.shift())&&p._path||(p=null,(a=y.pop())&&(o=a.visited,c=a.handleIn)),a&&!l(p););if(!p)break}b=p.getNext();m.add(new q(p._point,c,b&&p._handleOut)),p._visited=!0,o.push(p),p=b||p._path.getFirstSegment(),c=b&&b._handleIn}_&&(v&&(m.getFirstSegment().setHandleIn(c),m.setClosed(v)),0!==m.getArea())&&i.push(m)}return i}return{_getWinding:function(t,e,i){return R(t,this.getCurves(),e,i)},unite:function(t,e){return i(this,t,"unite",e)},intersect:function(t,e){return i(this,t,"intersect",e)},subtract:function(t,e){return i(this,t,"subtract",e)},exclude:function(t,e){return i(this,t,"exclude",e)},divide:function(t,e){return e&&(0==e.trace||e.stroke)?T(this,t,"divide"):E([this.subtract(t,e),this.intersect(t,e)],!0,this,t,e)},resolveCrossings:function(){var t=this._children,e=t||[this];function i(t,e){t=t&&t._intersection;return t&&t._overlap&&t._path===e}var n=!1,r=!1,s=this.getIntersections(null,function(t){return t.hasOverlap()?n=!0:t.isCrossing()&&(r=!0)}),a=n&&r&&[],s=H.expand(s);if(n)for(var o=P(s,function(t){return t.hasOverlap()},a),h=o.length-1;0<=h;h--){var l=o[h],u=l._path,l=l._segment,c=l.getPrevious(),d=l.getNext();i(c,u)&&i(d,u)&&(l.remove(),c._handleOut._set(0,0),d._handleIn._set(0,0),c===l||c.getCurve().hasLength()||(d._handleIn.set(c._handleIn),c.remove()))}r&&(P(s,n&&function(t){var e=t.getCurve(),i=t.getSegment(),t=t._intersection,n=t._curve,t=t._segment;if(e&&n&&e._path&&n._path)return!0;i&&(i._intersection=null),t&&(t._intersection=null)},a),a&&I(a),e=B(z.each(e,function(t){z.push(this,t._segments)},[])));var f,s=e.length;return 1<s&&t?(e!==t&&this.setChildren(e),f=this):1!==s||t||(e[0]!==this&&this.setSegments(e[0].removeSegments()),f=this),f||((f=new G(V.NO_INSERT)).addChildren(e),(f=f.reduce()).copyAttributes(this),this.replaceWith(f)),f},reorient:function(e,t){var i=this._children;return i&&i.length?this.setChildren(L(this.removeChildren(),function(t){return!!(e?t:1&t)},t)):t!==j&&this.setClockwise(t),this},getInteriorPoint:function(){var t=this.getBounds().getCenter(!0);if(!this.contains(t)){for(var e=this.getCurves(),i=t.y,n=[],r=[],s=0,a=e.length;s<a;s++){var o=e[s].getValues(),h=o[1],l=o[3],u=o[5],c=o[7];if(i>=O(h,l,u,c)&&i<=M(h,l,u,c))for(var d=U.getMonoCurves(o),f=0,p=d.length;f<p;f++){var g=d[f],m=g[1],_=g[7];m!==_&&(m<=i&&i<=_||_<=i&&i<=m)&&(m=i===m?g[0]:i===_?g[6]:1===U.solveCubic(g,1,i,r,0,1)?U.getPoint(g,r[0]).x:(g[0]+g[6])/2,n.push(m))}}1<n.length&&(n.sort(function(t,e){return t-e}),t.x=(n[0]+n[1])/2)}return t}}}),z.extend({_class:"PathFlattener",initialize:function(t,o,e,h,i){var n,r=[],l=[],u=0,c=1/(e||32),s=t._segments,a=s[0];function d(t,e){e=U.getValues(t,e,i);r.push(e),function t(e,i,n,r){{var s,a;!(c<r-n)||h&&U.isStraight(e)||U.isFlatEnough(e,o||.25)?(a=e[6]-e[0],s=e[7]-e[1],0<(a=Math.sqrt(a*a+s*s))&&(u+=a,l.push({offset:u,curve:e,index:i,time:r}))):(s=U.subdivide(e,.5),a=(n+r)/2,t(s[0],i,n,a),t(s[1],i,a,r))}}(e,t._index,0,1)}for(var f=1,p=s.length;f<p;f++)d(a,n=s[f]),a=n;t._closed&&d(n||a,s[0]),this.curves=r,this.parts=l,this.length=u,this.index=0},_get:function(t){for(var e,i=this.parts,n=i.length,r=this.index;(e=r)&&!(i[--r].offset<t););for(;e<n;e++){var s,a,o=i[e];if(o.offset>=t)return s=(a=i[(this.index=e)-1])&&a.index===o.index?a.time:0,a=a?a.offset:0,{index:o.index,time:s+(o.time-s)*(t-a)/(o.offset-a)}}return{index:i[n-1].index,time:1}},drawPart:function(t,e,i){for(var n=this._get(e),r=this._get(i),s=n.index,a=r.index;s<=a;s++){var o=U.getPart(this.curves[s],s===n.index?n.time:0,s===r.index?r.time:1);s===n.index&&t.moveTo(o[0],o[1]),t.bezierCurveTo.apply(t,o.slice(2))}}},z.each(U._evaluateMethods,function(e){this[e+"At"]=function(t){t=this._get(t);return U[e](this.curves[t.index],t.time)}},{}))),tt=z.extend({initialize:function(t){for(var e,i=this.points=[],n=t._segments,t=t._closed,r=0,s=n.length;r<s;r++){var a=n[r].point;e&&e.equals(a)||i.push(e=a.clone())}t&&(i.unshift(i[i.length-1]),i.push(i[1])),this.closed=t},fit:function(t){var e=this.points,i=e.length,n=null;return 0<i&&(n=[new q(e[0])],1<i)&&(this.fitCubic(n,t,0,i-1,e[1].subtract(e[0]),e[i-2].subtract(e[i-1])),this.closed)&&(n.shift(),n.pop()),n},fitCubic:function(t,e,i,n,r,s){var a,o,h=this.points;if(n-i==1)m=h[i],a=h[n],o=m.getDistance(a)/3,this.addCurve(t,[m,m.add(r.normalize(o)),a.add(s.normalize(o)),a]);else{for(var l,u=this.chordLengthParameterize(i,n),c=Math.max(e,e*e),d=!0,f=0;f<=4;f++){var p=this.generateBezier(i,n,u,r,s),g=this.findMaxError(i,n,p,u);if(g.error<e&&d)return void this.addCurve(t,p);if(l=g.index,g.error>=c)break;d=this.reparameterize(i,n,u,p),c=g.error}var m=h[l-1].subtract(h[l+1]);this.fitCubic(t,e,i,l,r,m),this.fitCubic(t,e,l,n,m.negate(),s)}},addCurve:function(t,e){t[t.length-1].setHandleOut(e[1].subtract(e[0])),t.push(new q(e[3],e[2].subtract(e[3])))},generateBezier:function(t,e,i,n,r){for(var s=Math.abs,a=this.points,o=a[t],h=a[e],l=[[0,0],[0,0]],u=[0,0],c=0,d=e-t+1;c<d;c++){var f=i[c],p=1-f,g=3*f*p,m=p*p*p,p=g*p,g=g*f,f=f*f*f,_=n.normalize(p),v=r.normalize(g),m=a[t+c].subtract(o.multiply(m+p)).subtract(h.multiply(g+f));l[0][0]+=_.dot(_),l[0][1]+=_.dot(v),l[1][0]=l[0][1],l[1][1]+=v.dot(v),u[0]+=_.dot(m),u[1]+=v.dot(m)}var y,b,w,x,S,e=l[0][0]*l[1][1]-l[1][0]*l[0][1],e=(1e-12<s(e)?(b=l[0][0]*u[1]-l[1][0]*u[0],y=(u[0]*l[1][1]-u[1]*l[0][1])/e,b=b/e):(e=l[0][0]+l[0][1],w=l[1][0]+l[1][1],y=b=1e-12<s(e)?u[0]/e:1e-12<s(w)?u[1]/w:0),h.getDistance(o)),s=1e-12*e;return y<s||b<s?y=b=e/3:(w=h.subtract(o),x=n.normalize(y),S=r.normalize(b),x.dot(w)-S.dot(w)>e*e&&(y=b=e/3,x=S=null)),[o,o.add(x||n.normalize(y)),h.add(S||r.normalize(b)),h]},reparameterize:function(t,e,i,n){for(var r=t;r<=e;r++)i[r-t]=this.findRoot(n,this.points[r],i[r-t]);for(var r=1,s=i.length;r<s;r++)if(i[r]<=i[r-1])return!1;return!0},findRoot:function(t,e,i){for(var n=[],r=[],s=0;s<=2;s++)n[s]=t[s+1].subtract(t[s]).multiply(3);for(s=0;s<=1;s++)r[s]=n[s+1].subtract(n[s]).multiply(2);var a=this.evaluate(3,t,i),o=this.evaluate(2,n,i),h=this.evaluate(1,r,i),a=a.subtract(e),e=o.dot(o)+a.dot(h);return F.isMachineZero(e)?i:i-a.dot(o)/e},evaluate:function(t,e,i){for(var n=e.slice(),r=1;r<=t;r++)for(var s=0;s<=t-r;s++)n[s]=n[s].multiply(1-i).add(n[s+1].multiply(i));return n[0]},chordLengthParameterize:function(t,e){for(var i=[0],n=t+1;n<=e;n++)i[n-t]=i[n-t-1]+this.points[n].getDistance(this.points[n-1]);for(var n=1,r=e-t;n<=r;n++)i[n]/=i[r];return i},findMaxError:function(t,e,i,n){for(var r=Math.floor((e-t+1)/2),s=0,a=t+1;a<e;a++){var o=this.evaluate(3,i,n[a-t]).subtract(this.points[a]),o=o.x*o.x+o.y*o.y;s<=o&&(s=o,r=a)}return{error:s,index:r}}}),et=V.extend({_class:"TextItem",_applyMatrix:!1,_canApplyMatrix:!1,_serializeFields:{content:null},_boundsOptions:{stroke:!1,handle:!1},initialize:function(t){this._content="",this._lines=[];var e=t&&z.isPlainObject(t)&&t.x===j&&t.y===j;this._initialize(e&&t,!e&&P.read(arguments))},_equals:function(t){return this._content===t._content},copyContent:function(t){this.setContent(t._content)},getContent:function(){return this._content},setContent:function(t){this._content=""+t,this._lines=this._content.split(/\r\n|\n|\r/gm),this._changed(521)},isEmpty:function(){return!this._content},getCharacterStyle:"#getStyle",setCharacterStyle:"#setStyle",getParagraphStyle:"#getStyle",setParagraphStyle:"#setStyle"}),it=et.extend({_class:"PointText",initialize:function(){et.apply(this,arguments)},getPoint:function(){var t=this._matrix.getTranslation();return new l(t.x,t.y,this,"setPoint")},setPoint:function(){var t=P.read(arguments);this.translate(t.subtract(this._matrix.getTranslation()))},_draw:function(t,e,i){if(this._content){this._setStyles(t,e,i);var n=this._lines,e=this._style,r=e.hasFill(),s=e.hasStroke(),a=e.getLeading(),o=t.shadowColor;t.font=e.getFontStyle(),t.textAlign=e.getJustification();for(var h=0,l=n.length;h<l;h++){t.shadowColor=o;var u=n[h];r&&(t.fillText(u,0,0),t.shadowColor="rgba(0,0,0,0)"),s&&t.strokeText(u,0,0),t.translate(0,a)}}},_getBounds:function(t,e){var i=this._style,n=this._lines,r=n.length,s=i.getJustification(),a=i.getLeading(),i=this.getView().getTextWidth(i.getFontStyle(),n),n=0,s=("left"!==s&&(n-=i/("center"===s?2:1)),new x(n,r?-.75*a:0,i,r*a));return t?t._transformBounds(s,s):s}}),S=z.extend(new function(){var _,v={gray:["gray"],rgb:["red","green","blue"],hsb:["hue","saturation","brightness"],hsl:["hue","saturation","lightness"],gradient:["gradient","origin","destination","highlight"]},y={},b={transparent:[0,0,0,0]};var r=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]],i={"rgb-hsb":function(t,e,i){var n=Math.max(t,e,i),r=n-Math.min(t,e,i);return[0==r?0:60*(n==t?(e-i)/r+(e<i?6:0):n==e?(i-t)/r+2:(t-e)/r+4),0===n?0:r/n,n]},"hsb-rgb":function(t,e,i){t=(t/60%6+6)%6;var n=Math.floor(t),t=t-n,i=[i,i*(1-e),i*(1-e*t),i*(1-e*(1-t))];return[i[(n=r[n])[0]],i[n[1]],i[n[2]]]},"rgb-hsl":function(t,e,i){var n=Math.max(t,e,i),r=Math.min(t,e,i),s=n-r,a=0==s,o=(n+r)/2;return[a?0:60*(n==t?(e-i)/s+(e<i?6:0):n==e?(i-t)/s+2:(t-e)/s+4),a?0:o<.5?s/(n+r):s/(2-n-r),o]},"hsl-rgb":function(t,e,i){if(0===e)return[i,i,i];for(var n=[(t=(t/360%1+1)%1)+1/3,t,t-1/3],r=i<.5?i*(1+e):i+e-i*e,s=2*i-r,a=[],o=0;o<3;o++){var h=n[o];h<0&&(h+=1),1<h&&--h,a[o]=6*h<1?s+6*(r-s)*h:2*h<1?r:3*h<2?s+(r-s)*(2/3-h)*6:s}return a},"rgb-gray":function(t,e,i){return[.2989*t+.587*e+.114*i]},"gray-rgb":function(t){return[t,t,t]},"gray-hsb":function(t){return[0,0,t]},"gray-hsl":function(t){return[0,0,t]},"gradient-rgb":function(){return[]},"rgb-gradient":function(){return[]}};return z.each(v,function(t,s){y[s]=[],z.each(t,function(t,e){var i=z.capitalize(t),n=/^(hue|saturation)$/.test(t),r=y[s][e]="gradient"===s?"gradient"===t?function(t){var e=this._components[0];return e!==(t=nt.read(Array.isArray(t)?t:arguments,0,{readNull:!0}))&&(e&&e._removeOwner(this),t)&&t._addOwner(this),t}:function(){return P.read(arguments,0,{readNull:"highlight"===t,clone:!0})}:function(t){return null==t||isNaN(t)?0:+t};this["get"+i]=function(){return(this._type===s||n&&/^hs[bl]$/.test(this._type)?this._components:this._convert(s))[e]},this["set"+i]=function(t){this._type===s||n&&/^hs[bl]$/.test(this._type)||(this._components=this._convert(s),this._properties=v[s],this._type=s),this._components[e]=r.call(this,t),this._changed()}},this)},{_class:"Color",_readIndex:!0,initialize:function t(e){var i,n,r=arguments,s=this.__read,a=0,o=null!=(e=Array.isArray(e)?(r=e)[0]:e)&&typeof e;if("string"===o&&e in v&&(h=e,e=r[1],Array.isArray(e)?(i=e,u=r[2]):(s&&(a=1),r=z.slice(r,1),o=typeof e)),!i){if(n="number"===o?r:"object"===o&&null!=e.length?e:null){var h=h||(3<=n.length?"rgb":"gray"),l=v[h].length,u=n[l];s&&(a+=n===arguments?l+(null!=u?1:0):1),n.length>l&&(n=z.slice(n,0,l))}else if("string"===o){l=function(t){var e=t.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})([\da-f]{2})?$/i)||t.match(/^#([\da-f])([\da-f])([\da-f])([\da-f])?$/i),i="rgb";if(e)for(var n=e[4]?4:3,r=new Array(n),s=0;s<n;s++){var a=e[s+1];r[s]=parseInt(1==a.length?a+a:a,16)/255}else if(e=t.match(/^(rgb|hsl)a?\((.*)\)$/)){i=e[1],r=e[2].trim().split(/[,\s]+/g);for(var o="hsl"===i,s=0,h=Math.min(r.length,4);s<h;s++){var l,u=r[s],a=parseFloat(u);o?0===s?(l=u.match(/([a-z]*)$/)[1],a*={turn:360,rad:180/Math.PI,grad:.9}[l]||1):s<3&&(a/=100):s<3&&(a/=/%$/.test(u)?100:255),r[s]=a}}else{var c,d=b[t];r=(d=d||(T?(_||((_=A.getContext(1,1,{willReadFrequently:!0})).globalCompositeOperation="copy"),_.fillStyle="rgba(0,0,0,0)",_.fillStyle=t,_.fillRect(0,0,1,1),c=_.getImageData(0,0,1,1).data,b[t]=[c[0]/255,c[1]/255,c[2]/255]):[0,0,0])).slice()}return[i,r]}(e);h=l[0],4===(i=l[1]).length&&(u=i[3],i.length--)}else if("object"===o)if(e.constructor===t){if(h=e._type,i=e._components.slice(),u=e._alpha,"gradient"===h)for(var c=1,d=i.length;c<d;c++){var f=i[c];f&&(i[c]=f.clone())}}else if(e.constructor===nt)h="gradient",n=r;else{h="hue"in e?"lightness"in e?"hsl":"hsb":"gradient"in e||"stops"in e||"radial"in e?"gradient":"gray"in e?"gray":"rgb";var p=v[h],g=y[h];this._components=i=[];for(c=0,d=p.length;c<d;c++)null==(m=e[p[c]])&&!c&&"gradient"===h&&"stops"in e&&(m={stops:e.stops,radial:e.radial}),null!=(m=g[c].call(this,m))&&(i[c]=m);u=e.alpha}s&&h&&(a=1)}if(this._type=h||"rgb",!i){this._components=i=[];for(var m,c=0,d=(g=y[this._type]).length;c<d;c++)null!=(m=g[c].call(this,n&&n[c]))&&(i[c]=m)}return this._components=i,this._properties=v[this._type],this._alpha=u,s&&(this.__read=a),this},set:"#initialize",_serialize:function(t,e){var i=this.getComponents();return z.serialize(/^(gray|rgb)$/.test(this._type)?i:[this._type].concat(i),t,!0,e)},_changed:function(){this._canvasStyle=null,this._owner&&(this._setter?this._owner[this._setter](this):this._owner._changed(129))},_convert:function(t){var e;return this._type===t?this._components.slice():(e=i[this._type+"-"+t])?e.apply(this,this._components):i["rgb-"+t].apply(this,i[this._type+"-rgb"].apply(this,this._components))},convert:function(t){return new S(t,this._convert(t),this._alpha)},getType:function(){return this._type},setType:function(t){this._components=this._convert(t),this._properties=v[t],this._type=t},getComponents:function(){var t=this._components.slice();return null!=this._alpha&&t.push(this._alpha),t},getAlpha:function(){return null!=this._alpha?this._alpha:1},setAlpha:function(t){this._alpha=null==t?null:Math.min(Math.max(t,0),1),this._changed()},hasAlpha:function(){return null!=this._alpha},equals:function(t){var e=z.isPlainValue(t,!0)?S.read(arguments):t;return e===this||e&&this._class===e._class&&this._type===e._type&&this.getAlpha()===e.getAlpha()&&z.equals(this._components,e._components)||!1},toString:function(){for(var t=this._properties,e=[],i="gradient"===this._type,n=w.instance,r=0,s=t.length;r<s;r++){var a=this._components[r];null!=a&&e.push(t[r]+": "+(i?a:n.number(a)))}return null!=this._alpha&&e.push("alpha: "+n.number(this._alpha)),"{ "+e.join(", ")+" }"},toCSS:function(t){var e=this._convert("rgb"),i=t||null==this._alpha?1:this._alpha;function n(t){return Math.round(255*(t<0?0:1<t?1:t))}return e=[n(e[0]),n(e[1]),n(e[2])],i<1&&e.push(i<0?0:i),t?"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+e[2]).toString(16).slice(1):(4==e.length?"rgba(":"rgb(")+e.join(",")+")"},toCanvasStyle:function(t,e){if(this._canvasStyle)return this._canvasStyle;if("gradient"!==this._type)return this._canvasStyle=this.toCSS();var i,n=this._components,r=n[0],s=r._stops,a=n[1],o=n[2],n=n[3],e=e&&e.inverted();e&&(a=e._transformPoint(a),o=e._transformPoint(o),n=n&&e._transformPoint(n)),i=r._radial?(e=o.getDistance(a),r=(n=n&&(r=n.subtract(a)).getLength()>e?a.add(r.normalize(e-.1)):n)||a,t.createRadialGradient(r.x,r.y,0,a.x,a.y,e)):t.createLinearGradient(a.x,a.y,o.x,o.y);for(var h=0,l=s.length;h<l;h++){var u=s[h],c=u._offset;i.addColorStop(null==c?h/(l-1):c,u._color.toCanvasStyle())}return this._canvasStyle=i},transform:function(t){if("gradient"===this._type){for(var e=this._components,i=1,n=e.length;i<n;i++){var r=e[i];t._transformPoint(r,r,!0)}this._changed()}},statics:{_types:v,random:function(){var t=Math.random;return new S(t(),t(),t())},_setOwner:function(t,e,i){return t&&!(t=t._owner&&e&&t._owner!==e?t.clone():t)._owner^!e&&(t._owner=e||null,t._setter=i||null),t}}})},new function(){return z.each({add:function(t,e){return t+e},subtract:function(t,e){return t-e},multiply:function(t,e){return t*e},divide:function(t,e){return t/e}},function(a,t){this[t]=function(t){t=S.read(arguments);for(var e=this._type,i=this._components,n=t._convert(e),r=0,s=i.length;r<s;r++)n[r]=a(i[r],n[r]);return new S(e,n,null!=this._alpha?a(this._alpha,t.getAlpha()):null)}},{})}),nt=z.extend({_class:"Gradient",initialize:function(t,e){this._id=o.get(),t&&z.isPlainObject(t)&&(this.set(t),t=e=null),null==this._stops&&this.setStops(t||["white","black"]),null==this._radial&&this.setRadial("string"==typeof e&&"radial"===e||e||!1)},_serialize:function(t,e){return e.add(this,function(){return z.serialize([this._stops,this._radial],t,!0,e)})},_changed:function(){for(var t=0,e=this._owners&&this._owners.length;t<e;t++)this._owners[t]._changed()},_addOwner:function(t){this._owners||(this._owners=[]),this._owners.push(t)},_removeOwner:function(t){t=this._owners?this._owners.indexOf(t):-1;-1!=t&&(this._owners.splice(t,1),this._owners.length||(this._owners=j))},clone:function(){for(var t=[],e=0,i=this._stops.length;e<i;e++)t[e]=this._stops[e].clone();return new nt(t,this._radial)},getStops:function(){return this._stops},setStops:function(t){if(t.length<2)throw new Error("Gradient stop list needs to contain at least two stops.");var e=this._stops;if(e)for(var i=0,n=e.length;i<n;i++)e[i]._owner=j;for(i=0,n=(e=this._stops=rt.readList(t,0,{clone:!0})).length;i<n;i++)e[i]._owner=this;this._changed()},getRadial:function(){return this._radial},setRadial:function(t){this._radial=t,this._changed()},equals:function(t){if(t===this)return!0;if(t&&this._class===t._class){var e=this._stops,i=t._stops,n=e.length;if(n===i.length){for(var r=0;r<n;r++)if(!e[r].equals(i[r]))return!1;return!0}}return!1}}),rt=z.extend({_class:"GradientStop",initialize:function(t,e){var i=t,n=e;"object"==typeof t&&e===j&&(Array.isArray(t)&&"number"!=typeof t[0]?(i=t[0],n=t[1]):("color"in t||"offset"in t||"rampPoint"in t)&&(i=t.color,n=t.offset||t.rampPoint||0)),this.setColor(i),this.setOffset(n)},clone:function(){return new rt(this._color.clone(),this._offset)},_serialize:function(t,e){var i=this._color,n=this._offset;return z.serialize(null==n?[i]:[i,n],t,!0,e)},_changed:function(){this._owner&&this._owner._changed(129)},getOffset:function(){return this._offset},setOffset:function(t){this._offset=t,this._changed()},getRampPoint:"#getOffset",setRampPoint:"#setOffset",getColor:function(){return this._color},setColor:function(){S._setOwner(this._color,null),this._color=S._setOwner(S.read(arguments,0),this,"setColor"),this._changed()},equals:function(t){return t===this||t&&this._class===t._class&&this._color.equals(t._color)&&this._offset==t._offset||!1}}),st=z.extend(new function(){var n={fillColor:null,fillRule:"nonzero",strokeColor:null,strokeWidth:1,strokeCap:"butt",strokeJoin:"miter",strokeScaling:!0,miterLimit:10,dashOffset:0,dashArray:[],shadowColor:null,shadowBlur:0,shadowOffset:new P,selectedColor:null},r=z.set({},n,{fontFamily:"sans-serif",fontWeight:"normal",fontSize:12,leading:null,justification:"left"}),s=z.set({},r,{fillColor:new S}),i={strokeWidth:193,strokeCap:193,strokeJoin:193,strokeScaling:201,miterLimit:193,fontFamily:9,fontWeight:9,fontSize:9,font:9,leading:9,justification:9},a={beans:!0},f={_class:"Style",beans:!0,initialize:function(t,e,i){this._values={},this._owner=e,this._project=e&&e._project||i||B.project,this._defaults=!e||e instanceof g?r:e instanceof et?s:n,t&&this.set(t)}};return z.each(r,function(t,h){var l=/Color$/.test(h),u="shadowOffset"===h,e=z.capitalize(h),o=i[h],c="set"+e,d="get"+e;f[c]=function(t){var e,i=this._owner,n=i&&i._children,r=n&&0<n.length&&!(i instanceof G);if(r)for(var s=0,a=n.length;s<a;s++)n[s]._style[c](t);("selectedColor"===h||!r)&&h in this._defaults&&(e=this._values[h])!==t&&(l&&(e&&(S._setOwner(e,null),e._canvasStyle=null),t)&&t.constructor===S&&(t=S._setOwner(t,i,r&&c)),this._values[h]=t,i)&&i._changed(o||129)},f[d]=function(t){var e,i=this._owner,n=i&&i._children,r=n&&0<n.length&&!(i instanceof G);if(r&&!t)for(var s=0,a=n.length;s<a;s++){var o=n[s]._style[d]();if(s){if(!z.equals(e,o))return j}else e=o}else h in this._defaults&&((e=this._values[h])===j?(e=this._defaults[h])&&e.clone&&(e=e.clone()):!(t=l?S:u?P:null)||e&&e.constructor===t||(this._values[h]=e=t.read([e],0,{readNull:!0,clone:!0})));return e=e&&l?S._setOwner(e,i,r&&c):e},a[d]=function(t){return this._style[d](t)},a[c]=function(t){this._style[c](t)}}),z.each({Font:"FontFamily",WindingRule:"FillRule"},function(t,e){var i="get"+e,e="set"+e;f[i]=a[i]="#get"+t,f[e]=a[e]="#set"+t}),V.inject(a),f},{set:function(t){var e,i=t instanceof st,n=i?t._values:t;if(n)for(var r in n)r in this._defaults&&(e=n[r],this[r]=e&&i&&e.clone?e.clone():e)},equals:function(t){function e(t,e,i){var n,r=t._values,s=e._values,a=e._defaults;for(n in r){var o=r[n],h=s[n];if(!(i&&n in s||z.equals(o,h===j?a[n]:h)))return!1}return!0}return t===this||t&&this._class===t._class&&e(this,t)&&e(t,this,!0)||!1},_dispose:function(){var t=this.getFillColor();t&&(t._canvasStyle=null),(t=this.getStrokeColor())&&(t._canvasStyle=null),(t=this.getShadowColor())&&(t._canvasStyle=null)},hasFill:function(){var t=this.getFillColor();return!!t&&0<t.alpha},hasStroke:function(){var t=this.getStrokeColor();return!!t&&0<t.alpha&&0<this.getStrokeWidth()},hasShadow:function(){var t=this.getShadowColor();return!!t&&0<t.alpha&&(0<this.getShadowBlur()||!this.getShadowOffset().isZero())},getView:function(){return this._project._view},getFontStyle:function(){var t=this.getFontSize();return this.getFontWeight()+" "+t+(/[a-z]/i.test(t+"")?" ":"px ")+this.getFontFamily()},getFont:"#getFontFamily",setFont:"#setFontFamily",getLeading:function t(){var e=t.base.call(this),i=this.getFontSize();return/pt|em|%|px/.test(i)&&(i=this.getView().getPixelSize(i)),null!=e?e:1.2*i}}),c=new function(){function r(t,e,i,n){for(var r=["","webkit","moz","Moz","ms","o"],s=e[0].toUpperCase()+e.substring(1),a=0;a<6;a++){var o=r[a],o=o?o+s:e;if(o in t){if(!i)return t[o];t[o]=n;break}}}return{getStyles:function(t){var e=t&&9!==t.nodeType?t.ownerDocument:t,e=e&&e.defaultView;return e&&e.getComputedStyle(t,"")},getBounds:function(t,e){var i,n=t.ownerDocument,r=n.body,s=n.documentElement;try{i=t.getBoundingClientRect()}catch(t){i={left:0,top:0,width:0,height:0}}var t=i.left-(s.clientLeft||r.clientLeft||0),a=i.top-(s.clientTop||r.clientTop||0);return e||(t+=(e=n.defaultView).pageXOffset||s.scrollLeft||r.scrollLeft,a+=e.pageYOffset||s.scrollTop||r.scrollTop),new x(t,a,i.width,i.height)},getViewportBounds:function(t){var t=t.ownerDocument,e=t.defaultView,t=t.documentElement;return new x(0,0,e.innerWidth||t.clientWidth,e.innerHeight||t.clientHeight)},getOffset:function(t,e){return c.getBounds(t,e).getPoint()},getSize:function(t){return c.getBounds(t,!0).getSize()},isInvisible:function(t){return c.getSize(t).equals(new O(0,0))},isInView:function(t){return!c.isInvisible(t)&&c.getViewportBounds(t).intersects(c.getBounds(t,!0))},isInserted:function(t){return I.body.contains(t)},getPrefixed:function(t,e){return t&&r(t,e)},setPrefixed:function(t,e,i){if("object"==typeof e)for(var n in e)r(t,n,!0,e[n]);else r(t,e,!0,i)}}},R={add:function(t,e){if(t)for(var i in e)for(var n=e[i],r=i.split(/[\s,]+/g),s=0,a=r.length;s<a;s++){var o=r[s];t.addEventListener(o,n,t===I&&("touchstart"===o||"touchmove"===o)&&{passive:!1})}},remove:function(t,e){if(t)for(var i in e)for(var n=e[i],r=i.split(/[\s,]+/g),s=0,a=r.length;s<a;s++)t.removeEventListener(r[s],n,!1)},getPoint:function(t){t=t.targetTouches?(t.targetTouches.length?t.targetTouches:t.changedTouches)[0]:t;return new P(t.pageX||t.clientX+I.documentElement.scrollLeft,t.pageY||t.clientY+I.documentElement.scrollTop)},getTarget:function(t){return t.target||t.srcElement},getRelatedTarget:function(t){return t.relatedTarget||t.toElement},getOffset:function(t,e){return R.getPoint(t).subtract(c.getOffset(e||R.getTarget(t)))}},D=(R.requestAnimationFrame=new function(){var e,n=c.getPrefixed(T,"requestAnimationFrame"),r=!1,s=[];function a(){var t=s;s=[];for(var e=0,i=t.length;e<i;e++)t[e]();(r=n&&s.length)&&n(a)}return function(t){s.push(t),n?r||(n(a),r=!0):e=e||setInterval(a,1e3/60)}},z.extend(t,{_class:"View",initialize:function t(e,i){function n(t){return i[t]||parseInt(i.getAttribute(t),10)}function r(){var t=c.getSize(i);return t.isNaN()||t.isZero()?new O(n("width"),n("height")):t}var s,a,o,h,l;T&&i?(this._id=i.getAttribute("id"),null==this._id&&i.setAttribute("id",this._id="paper-view-"+t._id++),R.add(i,this._viewEvents),c.setPrefixed(i.style,{userDrag:s="none",userSelect:s,touchCallout:s,contentZooming:s,tapHighlightColor:"rgba(0,0,0,0)"}),u.hasAttribute(i,"resize")&&R.add(T,(a=this)._windowEvents={resize:function(){a.setViewSize(r())}}),s=r(),u.hasAttribute(i,"stats")&&"undefined"!=typeof Stats&&(this._stats=new Stats,h=(o=this._stats.domElement).style,l=c.getOffset(i),h.position="absolute",h.left=l.x+"px",h.top=l.y+"px",I.body.appendChild(o))):(s=new O(i),i=null),this._project=e,this._scope=e._scope,this._element=i,this._pixelRatio||(this._pixelRatio=T&&T.devicePixelRatio||1),this._setElementSize(s.width,s.height),this._viewSize=s,t._views.push(this),((t._viewsById[this._id]=this)._matrix=new M)._owner=this,t._focused||(t._focused=this),this._frameItems={},this._frameItemCount=0,this._itemEvents={native:{},virtual:{}},this._autoUpdate=!B.agent.node,this._needsUpdate=!1},remove:function(){if(!this._project)return!1;D._focused===this&&(D._focused=null),D._views.splice(D._views.indexOf(this),1),delete D._viewsById[this._id];var t=this._project;return t._view===this&&(t._view=null),R.remove(this._element,this._viewEvents),R.remove(T,this._windowEvents),this._element=this._project=null,this.off("frame"),this._animate=!1,this._frameItems={},!0},_events:z.each(V._itemHandlers.concat(["onResize","onKeyDown","onKeyUp"]),function(t){this[t]={}},{onFrame:{install:function(){this.play()},uninstall:function(){this.pause()}}}),_animate:!1,_time:0,_count:0,getAutoUpdate:function(){return this._autoUpdate},setAutoUpdate:function(t){(this._autoUpdate=t)&&this.requestUpdate()},update:function(){},draw:function(){this.update()},requestUpdate:function(){var e;this._requested||(e=this,R.requestAnimationFrame(function(){var t;e._requested=!1,e._animate&&(e.requestUpdate(),t=e._element,c.getPrefixed(I,"hidden")&&"true"!==u.getAttribute(t,"keepalive")||!c.isInView(t)||e._handleFrame()),e._autoUpdate&&e.update()}),this._requested=!0)},play:function(){this._animate=!0,this.requestUpdate()},pause:function(){this._animate=!1},_handleFrame:function(){B=this._scope;var t=Date.now()/1e3,e=this._last?t-this._last:0;this._last=t,this.emit("frame",new z({delta:e,time:this._time+=e,count:this._count++})),this._stats&&this._stats.update()},_animateItem:function(t,e){var i=this._frameItems;e?(i[t._id]={item:t,time:0,count:0},1==++this._frameItemCount&&this.on("frame",this._handleFrameItems)):(delete i[t._id],0==--this._frameItemCount&&this.off("frame",this._handleFrameItems))},_handleFrameItems:function(t){for(var e in this._frameItems){e=this._frameItems[e];e.item.emit("frame",new z(t,{time:e.time+=t.delta,count:e.count++}))}},_changed:function(){this._project._changed(4097),this._bounds=this._decomposed=j},getElement:function(){return this._element},getPixelRatio:function(){return this._pixelRatio},getResolution:function(){return 72*this._pixelRatio},getViewSize:function(){var t=this._viewSize;return new n(t.width,t.height,this,"setViewSize")},setViewSize:function(){var t=O.read(arguments),e=t.subtract(this._viewSize);e.isZero()||(this._setElementSize(t.width,t.height),this._viewSize.set(t),this._changed(),this.emit("resize",{size:t,delta:e}),this._autoUpdate&&this.update())},_setElementSize:function(t,e){var i=this._element;i&&(i.width!==t&&(i.width=t),i.height!==e)&&(i.height=e)},getBounds:function(){return this._bounds||(this._bounds=this._matrix.inverted()._transformBounds(new x(new P,this._viewSize))),this._bounds},getSize:function(){return this.getBounds().getSize()},isVisible:function(){return c.isInView(this._element)},isInserted:function(){return c.isInserted(this._element)},getPixelSize:function(t){var e,i,n=this._element;return n?(n=n.parentNode,(i=I.createElement("div")).style.fontSize=t,n.appendChild(i),e=parseFloat(c.getStyles(i).fontSize),n.removeChild(i)):e=parseFloat(e),e},getTextWidth:function(t,e){return 0}},z.each(["rotate","scale","shear","skew"],function(i){var n="rotate"===i;this[i]=function(){var t=arguments,e=(n?z:P).read(t),t=P.read(t,0,{readNull:!0});return this.transform((new M)[i](e,t||this.getCenter(!0)))}},{_decompose:function(){return this._decomposed||(this._decomposed=this._matrix.decompose())},translate:function(){var t=new M;return this.transform(t.translate.apply(t,arguments))},getCenter:function(){return this.getBounds().getCenter()},setCenter:function(){var t=P.read(arguments);this.translate(this.getCenter().subtract(t))},getZoom:function(){var t=this._decompose().scaling;return(t.x+t.y)/2},setZoom:function(t){this.transform((new M).scale(t/this.getZoom(),this.getCenter()))},getRotation:function(){return this._decompose().rotation},setRotation:function(t){var e=this.getRotation();null!=e&&null!=t&&this.rotate(t-e)},getScaling:function(){var t=this._decompose().scaling;return new l(t.x,t.y,this,"setScaling")},setScaling:function(){var t=this.getScaling(),e=P.read(arguments,0,{clone:!0,readNull:!0});t&&e&&this.scale(e.x/t.x,e.y/t.y)},getMatrix:function(){return this._matrix},setMatrix:function(){var t=this._matrix;t.set.apply(t,arguments)},transform:function(t){this._matrix.append(t)},scrollBy:function(){this.translate(P.read(arguments).negate())}}),{projectToView:function(){return this._matrix._transformPoint(P.read(arguments))},viewToProject:function(){return this._matrix._inverseTransform(P.read(arguments))},getEventPoint:function(t){return this.viewToProject(R.getOffset(t,this._element))}},{statics:{_views:[],_viewsById:{},_id:0,create:function(t,e){return I&&"string"==typeof e&&(e=I.getElementById(e)),new(T?at:D)(t,e)}}},new function(){var n,r,p,s,t,e,i,a,o,g,m,l,_,v,y,b,w,x,S,C,k,h;if(T)return s=p=!1,(o=T.navigator).pointerEnabled||o.msPointerEnabled?(t="pointerdown MSPointerDown",e="pointermove MSPointerMove",i="pointerup pointercancel MSPointerUp MSPointerCancel"):(t="touchstart",e="touchmove",i="touchend touchcancel","ontouchstart"in T&&o.userAgent.match(/mobile|tablet|ip(ad|hone|od)|android|silk/i)||(t+=" mousedown",e+=" mousemove",i+=" mouseup")),o={mouseout:function(t){var e,i,n,r=D._focused,s=R.getRelatedTarget(t);!r||s&&"HTML"!==s.nodeName||(e=(s=R.getOffset(t,r._element)).x,i=(n=Math.abs)(e),s.x=n(n=i-(1<<25))<i?n*(e<0?-1:1):e,d(r,t,r.viewToProject(s)))},scroll:c},(a={})[t]=function(t){var e=D._focused=u(t);p||(p=!0,e._handleMouseEvent("mousedown",t))},o[e]=function(t){var e,i=D._focused;s||((e=u(t))?i!==e&&(i&&d(i,t),n=n||i,i=D._focused=r=e):r&&r===i&&(n&&!n.isInserted()&&(n=null),i=D._focused=n,n=null,c())),i&&d(i,t)},o[t]=function(){s=!0},o[i]=function(t){var e=D._focused;e&&p&&e._handleMouseEvent("mouseup",t),s=p=!1},R.add(I,o),R.add(T,{load:c}),m=g=!1,_=!(l={doubleclick:"click",mousedrag:"mousemove"}),h={mousedown:{mousedown:1,mousedrag:1,click:1,doubleclick:1},mouseup:{mouseup:1,mousedrag:1,click:1,doubleclick:1},mousemove:{mousedrag:1,mousemove:1,mouseenter:1,mouseleave:1}},{_viewEvents:a,_handleMouseEvent:function(t,e,i){var n=this._itemEvents,r=n.native[t],s="mousemove"===t,a=this._scope.tool,o=this;function h(t){return n.virtual[t]||o.responds(t)||a&&a.responds(t)}s&&p&&h("mousedrag")&&(t="mousedrag"),i=i||this.getEventPoint(e);var l=this.getBounds().contains(i),u=r&&l&&o._project.hitTest(i,{tolerance:0,fill:!0,stroke:!0}),u=u&&u.item||null,c=!1,d={};if(d[t.substr(5)]=!0,r&&u!==w&&(w&&E(w,null,"mouseleave",e,i),u&&E(u,null,"mouseenter",e,i),w=u),_^l&&(E(this,null,l?"mouseenter":"mouseleave",e,i),c=!0),!l&&!d.drag||i.equals(y)||(A(this,u,s?t:"mousemove",e,i,y),c=!0),_=l,d.down&&l||d.up&&v){if(A(this,u,t,e,i,v),d.down){if(k=u===S&&Date.now()-C<300,b=S=u,!m&&u){for(var f=u;f&&!f.responds("mousedrag");)f=f._parent;f&&(x=u)}v=i}else d.up&&(m||u!==b||(C=Date.now(),A(this,u,k?"doubleclick":"click",e,i,v),k=!1),b=x=null);c=!(_=!1)}y=i,c&&a&&(g=a._handleMouseEvent(t,e,i,d)||g),!1!==e.cancelable&&(g&&!d.move||d.down&&h("mouseup"))&&e.preventDefault()},_handleKeyEvent:function(e,i,n,r){var s,a=this._scope,t=a.tool;function o(t){t.responds(e)&&(B=a,t.emit(e,s=s||new ht(e,i,n,r)))}this.isVisible()&&(o(this),t)&&t.responds(e)&&o(t)},_countItemEvent:function(t,e){var i,n=this._itemEvents,r=n.native,n=n.virtual;for(i in h)r[i]=(r[i]||0)+(h[i][t]||0)*e;n[t]=(n[t]||0)+e},statics:{updateFocus:c,_resetState:function(){p=s=g=_=!1,n=r=v=y=b=w=x=S=C=k=null}}};function u(t){t=R.getTarget(t);return t.getAttribute&&D._viewsById[t.getAttribute("id")]}function c(){var t=D._focused;if(!t||!t.isVisible())for(var e=0,i=D._views.length;e<i;e++)if((t=D._views[e]).isVisible()){D._focused=r=t;break}}function d(t,e,i){t._handleMouseEvent("mousemove",e,i)}function E(t,n,e,r,s,a,i){var o,h=!1;for(;t&&t!==i&&!function t(e,i){if(e.responds(i)){if(o=o||new ut(i,r,s,n||e,a?s.subtract(a):null),e.emit(i,o)&&(g=!0,o.prevented&&(m=!0),o.stopped))return h=!0}else if(i=l[i])return t(e,i)}(t,e);)t=t._parent;return h}function A(t,e,i,n,r,s){t._project.removeOn(i),m=g=!1,x&&E(x,null,i,n,r,s)||e&&e!==x&&!e.isDescendant(x)&&E(e,null,"mousedrag"===i?"mousemove":i,n,r,s,x)||E(t,x||e||t,i,n,r,s)}})),at=D.extend({_class:"CanvasView",initialize:function(t,e){if(!(e instanceof T.HTMLCanvasElement)){var i=O.read(arguments,1);if(i.isZero())throw new Error("Cannot create CanvasView with the provided argument: "+z.slice(arguments,1));e=A.getCanvas(i)}var n,i=this._context=e.getContext("2d");i.save(),this._pixelRatio=1,/^off|false$/.test(u.getAttribute(e,"hidpi"))||(n=T.devicePixelRatio||1,i=c.getPrefixed(i,"backingStorePixelRatio")||1,this._pixelRatio=n/i),D.call(this,t,e),this._needsUpdate=!0},remove:function t(){return this._context.restore(),t.base.call(this)},_setElementSize:function t(e,i){var n,r,s=this._pixelRatio;t.base.call(this,e*s,i*s),1!==s&&(r=this._element,n=this._context,u.hasAttribute(r,"resize")||((r=r.style).width=e+"px",r.height=i+"px"),n.restore(),n.save(),n.scale(s,s))},getContext:function(){return this._context},getPixelSize:function t(e){var i,n,r=B.agent;return r&&r.firefox?i=t.base.call(this,e):(n=(r=this._context).font,r.font=e+" serif",i=parseFloat(r.font),r.font=n),i},getTextWidth:function(t,e){var i=this._context,n=i.font,r=0;i.font=t;for(var s=0,a=e.length;s<a;s++)r=Math.max(r,i.measureText(e[s]).width);return i.font=n,r},update:function(){var t,e,i;return!(!this._needsUpdate||(t=this._project,e=this._context,i=this._viewSize,e.clearRect(0,0,i.width+1,i.height+1),t&&t.draw(e,this._matrix,this._pixelRatio),this._needsUpdate=!1))}}),ot=z.extend({_class:"Event",initialize:function(t){this.event=t,this.type=t&&t.type},prevented:!1,stopped:!1,preventDefault:function(){this.prevented=!0,this.event.preventDefault()},stopPropagation:function(){this.stopped=!0,this.event.stopPropagation()},stop:function(){this.stopPropagation(),this.preventDefault()},getTimeStamp:function(){return this.event.timeStamp},getModifiers:function(){return lt.modifiers}}),ht=ot.extend({_class:"KeyEvent",initialize:function(t,e,i,n){this.type=t,this.event=e,this.key=i,this.character=n},toString:function(){return"{ type: '"+this.type+"', key: '"+this.key+"', character: '"+this.character+"', modifiers: "+this.getModifiers()+" }"}}),lt=new function(){var h,n,i={"\t":"tab"," ":"space","\b":"backspace","":"delete",Spacebar:"space",Del:"delete",Win:"meta",Esc:"escape"},r={tab:"\t",space:" ",enter:"\r"},l={},u={},c=new z({shift:!1,control:!1,alt:!1,meta:!1,capsLock:!1,space:!1}).inject({option:{get:function(){return this.alt}},command:{get:function(){var t=B&&B.agent;return t&&t.mac?this.meta:this.control}}});function s(t){var e=t.key||t.keyIdentifier,e=/^U\+/.test(e)?String.fromCharCode(parseInt(e.substr(2),16)):/^Arrow[A-Z]/.test(e)?e.substr(5):"Unidentified"===e||e===j?String.fromCharCode(t.keyCode):e;return i[e]||(1<e.length?z.hyphenate(e):e.toLowerCase())}function d(t,e,i,n){var r,s=D._focused;if((l[e]=t)?u[e]=i:delete u[e],1<e.length&&(r=z.camelize(e))in c){c[r]=t;var a=B&&B.agent;if("meta"===r&&a&&a.mac)if(t)h={};else{for(var o in h)o in u&&d(!1,o,h[o],n);h=null}}else t&&h&&(h[e]=i);s&&s._handleKeyEvent(t?"keydown":"keyup",n,e,i)}return R.add(I,{keydown:function(t){var e=s(t),i=B&&B.agent;1<e.length||i&&i.chrome&&(t.altKey||i.mac&&t.metaKey||!i.mac&&t.ctrlKey)?d(!0,e,r[e]||(1<e.length?"":e),t):n=e},keypress:function(t){var e,i;n&&(e=s(t),i=32<=(i=t.charCode)?String.fromCharCode(i):1<e.length?"":e,d(!0,e=e!==n?i.toLowerCase():e,i,t),n=null)},keyup:function(t){var e=s(t);e in u&&d(!1,e,u[e],t)}}),R.add(T,{blur:function(t){for(var e in u)d(!1,e,u[e],t)}}),{modifiers:c,isDown:function(t){return!!l[t]}}},ut=ot.extend({_class:"MouseEvent",initialize:function(t,e,i,n,r){this.type=t,this.event=e,this.point=i,this.target=n,this.delta=r},toString:function(){return"{ type: '"+this.type+"', point: "+this.point+", target: "+this.target+(this.delta?", delta: "+this.delta:"")+", modifiers: "+this.getModifiers()+" }"}}),ct=ot.extend({_class:"ToolEvent",_item:null,initialize:function(t,e,i){this.tool=t,this.type=e,this.event=i},_choosePoint:function(t,e){return t||(e?e.clone():null)},getPoint:function(){return this._choosePoint(this._point,this.tool._point)},setPoint:function(t){this._point=t},getLastPoint:function(){return this._choosePoint(this._lastPoint,this.tool._lastPoint)},setLastPoint:function(t){this._lastPoint=t},getDownPoint:function(){return this._choosePoint(this._downPoint,this.tool._downPoint)},setDownPoint:function(t){this._downPoint=t},getMiddlePoint:function(){return!this._middlePoint&&this.tool._lastPoint?this.tool._point.add(this.tool._lastPoint).divide(2):this._middlePoint},setMiddlePoint:function(t){this._middlePoint=t},getDelta:function(){return!this._delta&&this.tool._lastPoint?this.tool._point.subtract(this.tool._lastPoint):this._delta},setDelta:function(t){this._delta=t},getCount:function(){return this.tool[/^mouse(down|up)$/.test(this.type)?"_downCount":"_moveCount"]},setCount:function(t){this.tool[/^mouse(down|up)$/.test(this.type)?"downCount":"count"]=t},getItem:function(){if(!this._item){var t=this.tool._scope.project.hitTest(this.getPoint());if(t){for(var e=t.item,i=e._parent;/^(Group|CompoundPath)$/.test(i._class);)i=(e=i)._parent;this._item=e}}return this._item},setItem:function(t){this._item=t},toString:function(){return"{ type: "+this.type+", point: "+this.getPoint()+", count: "+this.getCount()+", modifiers: "+this.getModifiers()+" }"}}),dt=e.extend({_class:"Tool",_list:"tools",_reference:"tool",_events:["onMouseDown","onMouseUp","onMouseDrag","onMouseMove","onActivate","onDeactivate","onEditOptions","onKeyDown","onKeyUp"],initialize:function(t){e.call(this),this._moveCount=-1,this._downCount=-1,this.set(t)},getMinDistance:function(){return this._minDistance},setMinDistance:function(t){null!=(this._minDistance=t)&&null!=this._maxDistance&&t>this._maxDistance&&(this._maxDistance=t)},getMaxDistance:function(){return this._maxDistance},setMaxDistance:function(t){this._maxDistance=t,null!=this._minDistance&&null!=t&&t<this._minDistance&&(this._minDistance=t)},getFixedDistance:function(){return this._minDistance==this._maxDistance?this._minDistance:null},setFixedDistance:function(t){this._minDistance=this._maxDistance=t},_handleMouseEvent:function(t,e,a,o){B=this._scope,o.drag&&!this.responds(t)&&(t="mousemove");var h=o.move||o.drag,i=this.responds(t),n=this.minDistance,r=this.maxDistance,s=!1,l=this;function u(t,e){var i=a,n=h?l._point:l._downPoint||i;if(h){if(0<=l._moveCount&&i.equals(n))return;if(n&&(null!=t||null!=e)){var r=i.subtract(n),s=r.getLength();if(s<(t||0))return;e&&(i=n.add(r.normalize(Math.min(s,e))))}l._moveCount++}return l._point=i,l._lastPoint=n||i,o.down&&(l._moveCount=-1,l._downPoint=i,l._downCount++),1}function c(){i&&(s=l.emit(t,new ct(l,t,e))||s)}if(o.down)u(),c();else if(o.up)u(null,r),c();else if(i)for(;u(n,r);)c();return s}}),ft=z.extend(t,{_class:"Tween",statics:{easings:new z({linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:2*(2-t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}})},initialize:function t(e,i,n,r,s,a){this.object=e;var e=typeof s,o="function"==e,e=(this.type=o?e:"string"==e?s:"linear",this.easing=o?s:t.easings[this.type],this.duration=r,this.running=!1,this._then=null,this._startTime=null,i||n);this._keys=e?Object.keys(e):[],this._parsedKeys=this._parseKeys(this._keys),this._from=e&&this._getState(i),this._to=e&&this._getState(n),!1!==a&&this.start()},then:function(t){return this._then=t,this},start:function(){return this._startTime=null,this.running=!0,this},stop:function(){return this.running=!1,this},update:function(e){if(this.running){1<=e&&(e=1,this.running=!1);function t(t){return"function"==typeof t?t(i,e):t}for(var i=this.easing(e),n=this._keys,r=0,s=n&&n.length;r<s;r++){var a=n[r],o=t(this._from[a]),h=t(this._to[a]),h=o&&h&&o.__add&&h.__add?h.__subtract(o).__multiply(i).__add(o):(h-o)*i+o;this._setProperty(this._parsedKeys[a],h)}this.responds("update")&&this.emit("update",new z({progress:e,factor:i})),!this.running&&this._then&&this._then(this.object)}return this},_events:{onUpdate:{}},_handleFrame:function(t){var e=this._startTime,i=e?(t-e)/this.duration:0;e||(this._startTime=t),this.update(i)},_getState:function(t){for(var e=this._keys,i={},n=0,r=e.length;n<r;n++){var s,a=e[n],o=this._parsedKeys[a],h=this._getProperty(o);t?(s=this._resolveValue(h,t[a]),this._setProperty(o,s),s=(s=this._getProperty(o))&&s.clone?s.clone():s,this._setProperty(o,h)):s=h&&h.clone?h.clone():h,i[a]=s}return i},_resolveValue:function(t,e){if(e){if(Array.isArray(e)&&2===e.length)return(i=e[0])&&i.match&&i.match(/^[+\-\*\/]=/)?this._calculate(t,i[0],e[1]):e;if("string"==typeof e){var i=e.match(/^[+\-*/]=(.*)/);if(i)return i=JSON.parse(i[1].replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:/g,'"$2": ')),this._calculate(t,e[0],i)}}return e},_calculate:function(t,e,i){return B.PaperScript.calculateBinary(t,e,i)},_parseKeys:function(t){for(var e={},i=0,n=t.length;i<n;i++){var r=t[i],s=r.replace(/\.([^.]*)/g,"/$1").replace(/\[['"]?([^'"\]]*)['"]?\]/g,"/$1");e[r]=s.split("/")}return e},_getProperty:function(t,e){for(var i=this.object,n=0,r=t.length-(e||0);n<r&&i;n++)i=i[t[n]];return i},_setProperty:function(t,e){var i=this._getProperty(t,1);i&&(i[t[t.length-1]]=e)}}),pt=function(i){var n=new b.XMLHttpRequest;return n.open((i.method||"get").toUpperCase(),i.url,z.pick(i.async,!0)),i.mimeType&&n.overrideMimeType(i.mimeType),n.onload=function(){var t=n.status;0===t||200===t?i.onLoad&&i.onLoad.call(n,n.responseText):n.onerror()},n.onerror=function(){var t=n.status,e='Could not load "'+i.url+'" (Status: '+t+")";if(!i.onError)throw new Error(e);i.onError(e,t)},n.send(null)},A=z.exports.CanvasProvider={canvases:[],getCanvas:function(t,e,i){if(!T)return null;var n,r=!0,i=("object"==typeof t&&(e=t.height,t=t.width),this.canvases.length?n=this.canvases.pop():(n=I.createElement("canvas"),r=!1),n.getContext("2d",i||{}));if(i)return n.width===t&&n.height===e?r&&i.clearRect(0,0,t+1,e+1):(n.width=t,n.height=e),i.save(),n;throw new Error("Canvas "+n+" is unable to provide a 2D context.")},getContext:function(t,e,i){t=this.getCanvas(t,e,i);return t?t.getContext("2d",i||{}):null},release:function(t){t=t&&t.canvas?t.canvas:t;t&&t.getContext&&(t.getContext("2d").restore(),this.canvases.push(t))}},gt=new function(){var p,g,m,_,v,y,b,w,x,S,C,a=Math.min,o=Math.max,t=Math.abs;function s(t,e,i){return.2989*t+.587*e+.114*i}function e(t,e,i,n){var r=n-s(t,e,i),n=s(x=t+r,S=e+r,C=i+r),t=a(x,S,C),e=o(x,S,C);t<0&&(x=n+(x-n)*n/(i=n-t),S=n+(S-n)*n/i,C=n+(C-n)*n/i),255<e&&(x=n+(x-n)*(r=255-n)/(t=e-n),S=n+(S-n)*r/t,C=n+(C-n)*r/t)}function i(t,e,i){return o(t,e,i)-a(t,e,i)}function n(t,e,i,n){var r=[t,e,i],s=o(t,e,i),i=a(t,e,i),t=0===a(i=i===t?0:i===e?1:2,s=s===t?0:s===e?1:2)?1===o(i,s)?2:1:0;r[i]<r[s]?(r[t]=(r[t]-r[i])*n/(r[s]-r[i]),r[s]=n):r[t]=r[s]=0,r[i]=0,x=r[0],S=r[1],C=r[2]}var k={multiply:function(){x=v*p/255,S=y*g/255,C=b*m/255},screen:function(){x=v+p-v*p/255,S=y+g-y*g/255,C=b+m-b*m/255},overlay:function(){x=v<128?2*v*p/255:255-2*(255-v)*(255-p)/255,S=y<128?2*y*g/255:255-2*(255-y)*(255-g)/255,C=b<128?2*b*m/255:255-2*(255-b)*(255-m)/255},"soft-light":function(){var t=p*v/255;x=t+v*(255-(255-v)*(255-p)/255-t)/255,S=(t=g*y/255)+y*(255-(255-y)*(255-g)/255-t)/255,C=(t=m*b/255)+b*(255-(255-b)*(255-m)/255-t)/255},"hard-light":function(){x=p<128?2*p*v/255:255-2*(255-p)*(255-v)/255,S=g<128?2*g*y/255:255-2*(255-g)*(255-y)/255,C=m<128?2*m*b/255:255-2*(255-m)*(255-b)/255},"color-dodge":function(){x=0===v?0:255===p?255:a(255,255*v/(255-p)),S=0===y?0:255===g?255:a(255,255*y/(255-g)),C=0===b?0:255===m?255:a(255,255*b/(255-m))},"color-burn":function(){x=255===v?255:0===p?0:o(0,255-255*(255-v)/p),S=255===y?255:0===g?0:o(0,255-255*(255-y)/g),C=255===b?255:0===m?0:o(0,255-255*(255-b)/m)},darken:function(){x=v<p?v:p,S=y<g?y:g,C=b<m?b:m},lighten:function(){x=p<v?v:p,S=g<y?y:g,C=m<b?b:m},difference:function(){(x=v-p)<0&&(x=-x),(S=y-g)<0&&(S=-S),(C=b-m)<0&&(C=-C)},exclusion:function(){x=v+p*(255-v-v)/255,S=y+g*(255-y-y)/255,C=b+m*(255-b-b)/255},hue:function(){n(p,g,m,i(v,y,b)),e(x,S,C,s(v,y,b))},saturation:function(){n(v,y,b,i(p,g,m)),e(x,S,C,s(v,y,b))},luminosity:function(){e(v,y,b,s(p,g,m))},color:function(){e(p,g,m,s(v,y,b))},add:function(){x=a(v+p,255),S=a(y+g,255),C=a(b+m,255)},subtract:function(){x=o(v-p,0),S=o(y-g,0),C=o(b-m,0)},average:function(){x=(v+p)/2,S=(y+g)/2,C=(b+m)/2},negation:function(){x=255-t(255-p-v),S=255-t(255-g-y),C=255-t(255-m-b)}},E=this.nativeModes=z.each(["source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","lighter","darker","copy","xor"],function(t){this[t]=!0},{}),r=A.getContext(1,1,{willReadFrequently:!0});r&&(z.each(k,function(t,e){var i="darken"===e,n=!1;r.save();try{r.fillStyle=i?"#300":"#a00",r.fillRect(0,0,1,1),r.globalCompositeOperation=e,r.globalCompositeOperation===e&&(r.fillStyle=i?"#a00":"#300",r.fillRect(0,0,1,1),n=r.getImageData(0,0,1,1).data[0]!==i?170:51)}catch(t){}r.restore(),E[e]=n}),A.release(r)),this.process=function(t,e,i,n,r){var s=e.canvas,a="normal"===t;if(a||E[t])i.save(),i.setTransform(1,0,0,1,0,0),i.globalAlpha=n,a||(i.globalCompositeOperation=t),i.drawImage(s,r.x,r.y),i.restore();else{var o=k[t];if(o){for(var a=i.getImageData(r.x,r.y,s.width,s.height),h=a.data,l=e.getImageData(0,0,s.width,s.height).data,u=0,c=h.length;u<c;u+=4){p=l[u],v=h[u],g=l[u+1],y=h[u+1],m=l[u+2],b=h[u+2],_=l[u+3],w=h[u+3],o();var d=_*n/255,f=1-d;h[u]=d*x+f*v,h[u+1]=d*S+f*y,h[u+2]=d*C+f*b,h[u+3]=_*n+f*w}i.putImageData(a,r.x,r.y)}}}},_=new function(){var n="http://www.w3.org/2000/svg",t="http://www.w3.org/2000/xmlns",e="http://www.w3.org/1999/xlink",a={href:e,xlink:t,xmlns:t+"/","xmlns:xlink":t+"/"};function r(t,e,i){for(var n in e){var r=e[n],s=a[n];"number"==typeof r&&i&&(r=i.number(r)),s?t.setAttributeNS(s,n,r):t.setAttribute(n,r)}return t}return{svg:n,xmlns:t,xlink:e,create:function(t,e,i){return r(I.createElementNS(n,t),e,i)},get:function(t,e){var i=a[e];return"null"===(i=i?t.getAttributeNS(i,e):t.getAttribute(e))?null:i},set:r}},mt=z.each({fillColor:["fill","color"],fillRule:["fill-rule","string"],strokeColor:["stroke","color"],strokeWidth:["stroke-width","number"],strokeCap:["stroke-linecap","string"],strokeJoin:["stroke-linejoin","string"],strokeScaling:["vector-effect","lookup",{true:"none",false:"non-scaling-stroke"},function(t,e){return!e&&(t instanceof Q||t instanceof f||t instanceof et)}],miterLimit:["stroke-miterlimit","number"],dashArray:["stroke-dasharray","array"],dashOffset:["stroke-dashoffset","number"],fontFamily:["font-family","string"],fontWeight:["font-weight","string"],fontSize:["font-size","number"],justification:["text-anchor","lookup",{left:"start",center:"middle",right:"end"}],opacity:["opacity","number"],blendMode:["mix-blend-mode","style"]},function(t,e){var i=z.capitalize(e),n=t[2];this[e]={type:t[1],property:e,attribute:t[0],toSVG:n,fromSVG:n&&z.each(n,function(t,e){this[t]=e},{}),exportFilter:t[3],get:"get"+i,set:"set"+i}},{});function d(t,e,i){var n,r,s=new z,a=t.getTranslation();return e&&(t.isInvertible()?(n=(t=t._shiftless())._inverseTransform(a),a=null):n=new P,s[i?"cx":"x"]=n.x,s[i?"cy":"y"]=n.y),t.isIdentity()||((e=t.decompose())?(i=[],n=e.rotation,r=e.scaling,e=e.skewing,a&&!a.isZero()&&i.push("translate("+p.point(a)+")"),n&&i.push("rotate("+p.number(n)+")"),F.isZero(r.x-1)&&F.isZero(r.y-1)||i.push("scale("+p.point(r)+")"),e.x&&i.push("skewX("+p.number(e.x)+")"),e.y&&i.push("skewY("+p.number(e.y)+")"),s.transform=i.join(" ")):s.transform="matrix("+t.getValues().join(",")+")"),s}function _t(t,e){for(var i=d(t._matrix),n=t._children,r=_.create("g",i,p),s=0,a=n.length;s<a;s++){var o,h=n[s],l=St(h,e);l&&(h.isClipMask()?((o=_.create("clipPath")).appendChild(l),wt(h,o,"clip"),_.set(r,{"clip-path":"url(#"+o.id+")"})):r.appendChild(l))}return r}function vt(t){var e,i=t._type,n=t._radius,r=d(t._matrix,!0,"rectangle"!==i);return(n="rectangle"===i&&(i="rect",e=(t=t._size).width,t=t.height,r.x-=e/2,r.y-=t/2,r.width=e,r.height=t,n.isZero())?null:n)&&("circle"===i?r.r=n:(r.rx=n.width,r.ry=n.height)),_.create(i,r,p)}function yt(r,t,e){var s={},a=!e&&r.getParent(),o=[];return null!=r._name&&(s.id=r._name),z.each(mt,function(t){var e=t.get,i=t.type,n=r[e]();(t.exportFilter?!t.exportFilter(r,n):a&&z.equals(a[e](),n))||("color"===i&&null!=n&&(e=n.getAlpha())<1&&(s[t.attribute+"-opacity"]=e),"style"===i?o.push(t.attribute+": "+n):s[t.attribute]=null==n?"none":"color"===i?n.gradient?function(t){var e=bt(t,"color");if(!e){for(var i,n,r=t.getGradient(),s=r._radial,a=t.getOrigin(),o=t.getDestination(),h=(s?(i={cx:a.x,cy:a.y,r:a.getDistance(o)},(n=t.getHighlight())&&(i.fx=n.x,i.fy=n.y)):i={x1:a.x,y1:a.y,x2:o.x,y2:o.y},i.gradientUnits="userSpaceOnUse",e=_.create((s?"radial":"linear")+"Gradient",i,p),r._stops),l=0,u=h.length;l<u;l++){var c=h[l],d=c._color,f=d.getAlpha(),c=c._offset;i={offset:null==c?l/(u-1):c},d&&(i["stop-color"]=d.toCSS(!0)),f<1&&(i["stop-opacity"]=f),e.appendChild(_.create("stop",i,p))}wt(t,e,"color")}return"url(#"+e.id+")"}(n):n.toCSS(!0):"array"===i?n.join(","):"lookup"===i?t.toSVG[n]:n)}),o.length&&(s.style=o.join(";")),1===s.opacity&&delete s.opacity,r._visible||(s.visibility="hidden"),_.set(t,s,p)}function bt(t,e){return s=s||{ids:{},svgs:{}},t&&s.svgs[e+"-"+(t._id||t.__id||(t.__id=o.get("svg")))]}function wt(t,e,i){s||bt();var n=s.ids[i]=(s.ids[i]||0)+1;e.id=i+"-"+n,s.svgs[i+"-"+(t._id||t.__id)]=e}function xt(t,e){var i=t,n=null;if(s){for(var r in i="svg"===t.nodeName.toLowerCase()&&t,s.svgs)n||(i||(i=_.create("svg")).appendChild(t),n=i.insertBefore(_.create("defs"),i.firstChild)),n.appendChild(s.svgs[r]);s=null}return e.asString?(new b.XMLSerializer).serializeToString(i):i}function St(t,e,i){var n,r=a[t._class],r=r&&r(t,e);return r&&((n=e.onExport)&&(r=n(t,r,e)||r),n=JSON.stringify(t._data))&&"{}"!==n&&"null"!==n&&r.setAttribute("data-paper-data",n),r&&yt(t,r,i)}function Ct(t){return p=new w((t=t||{}).precision),t}function v(t,e,i,n,r,s){t=_.get(t,e)||s,s=null==t?n?null:i?"":0:i?t:parseFloat(t);return/%\s*$/.test(t)?s/100*(r?1:C[/x|^width/.test(e)?"width":"height"]):s}function y(t,e,i,n,r,s,a){return e=v(t,e||"x",!1,n,r,s),i=v(t,i||"y",!1,n,r,a),!n||null!=e&&null!=i?new P(e,i):null}function kt(t,e,i,n,r){return e=v(t,e||"width",!1,n,r),i=v(t,i||"height",!1,n,r),!n||null!=e&&null!=i?new O(e,i):null}function Et(t,e,i){return"none"===t?null:"number"===e?parseFloat(t):"array"===e?t?t.split(/[\s,]+/g).map(parseFloat):[]:"color"===e?Nt(t)||t:"lookup"===e?i[t]:t}function At(t,e,i,n){var r=t.childNodes,s="clippath"===e,e="defs"===e,a=new g,o=a._project,h=o._currentStyle,l=[];if(s||e||(a=Mt(a,t,n),o._currentStyle=a._style.clone()),n)for(var u=t.querySelectorAll("defs"),c=0,d=u.length;c<d;c++)Rt(u[c],i,!1);for(c=0,d=r.length;c<d;c++){var f=r[c];1!==f.nodeType||/^defs$/i.test(f.nodeName)||!(f=Rt(f,i,!1))||f instanceof m||l.push(f)}return a.addChildren(l),s&&(a=Mt(a.reduce(),t,n)),o._currentStyle=h,(s||e)&&(a.remove(),a=null),a}function Tt(t,e){for(var i=t.getAttribute("points").match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g),n=[],r=0,s=i.length;r<s;r+=2)n.push(new P(parseFloat(i[r]),parseFloat(i[r+1])));t=new W(n);return"polygon"===e&&t.closePath(),t}function It(t,e){var i,n=(v(t,"href",!0)||"").substring(1),e="radialgradient"===e;if(n)(i=k[n].getGradient())._radial^e&&((i=i.clone())._radial=e);else{for(var r=t.childNodes,s=[],a=0,o=r.length;a<o;a++){var h=r[a];1===h.nodeType&&s.push(Mt(new rt,h))}i=new nt(s,e)}var l,u,c,n="userSpaceOnUse"!==v(t,"gradientUnits",!0);return e?(u=(l=y(t,"cx","cy",!1,n,"50%","50%")).add(v(t,"r",!1,!1,n,"50%"),0),c=y(t,"fx","fy",!0,n)):(l=y(t,"x1","y1",!1,n,"0%","0%"),u=y(t,"x2","y2",!1,n,"100%","0%")),Mt(new S(i,l,u,c),t)._scaleToBounds=n,null}function Lt(t,e,i,n){if(t.transform){for(var r=(n.getAttribute(i)||"").split(/\)\s*/g),s=new M,a=0,o=r.length;a<o;a++){var h=r[a];if(!h)break;for(var h=h.split(/\(\s*/),l=h[0],u=h[1].split(/[\s,]+/g),c=0,d=u.length;c<d;c++)u[c]=parseFloat(u[c]);switch(l){case"matrix":s.append(new M(u[0],u[1],u[2],u[3],u[4],u[5]));break;case"rotate":s.rotate(u[0],u[1]||0,u[2]||0);break;case"translate":s.translate(u[0],u[1]||0);break;case"scale":s.scale(u);break;case"skewX":s.skew(u[0],0);break;case"skewY":s.skew(0,u[0])}}t.transform(s)}}function Pt(t,e,i){i="fill-opacity"===i?"getFillColor":"getStrokeColor",t=t[i]&&t[i]();t&&t.setAlpha(parseFloat(e))}function Ot(t,e,i){var n=t.attributes[e],n=n&&n.value;return!n&&t.style&&(e=z.camelize(e),(n=t.style[e])||i.node[e]===i.parent[e]||(n=i.node[e])),n?"none"===n?null:n:j}function Mt(n,r,t){var e=r.parentNode,s={node:c.getStyles(r)||{},parent:!t&&!/^defs$/i.test(e.tagName)&&c.getStyles(e)||{}};return z.each(i,function(t,e){var i=Ot(r,e,s);n=i!==j&&t(n,i,e,r,s)||n}),n}function Nt(t){t=t&&t.match(/\((?:["'#]*)([^"')]+)/),t=t&&t[1],t=t&&k[T?t.replace(T.location.href.split("#")[0]+"#",""):t];return t&&t._scaleToBounds&&((t=t.clone())._scaleToBounds=!0),t}function Rt(t,e,i){var n,r,s,a=t.nodeName.toLowerCase(),o="#document"!==a,h=I.body,l=(i&&o&&(C=B.getView().getSize(),C=kt(t,null,null,!0)||C,n=_.create("svg",{style:"stroke-width: 1px; stroke-miterlimit: 10"}),r=t.parentNode,s=t.nextSibling,n.appendChild(t),h.appendChild(n)),B.settings),u=l.applyMatrix,c=l.insertItems,d=(l.applyMatrix=!1,l.insertItems=!1,E[a]),d=d&&d(t,a,e,i)||null;return l.insertItems=c,l.applyMatrix=u,d&&(!o||d instanceof g||(d=Mt(d,t,i)),a=e.onImport,c=o&&t.getAttribute("data-paper-data"),a&&(d=a(t,d,e)||d),e.expandShapes&&d instanceof f&&(d.remove(),d=d.toPath()),c)&&(d._data=JSON.parse(c)),n&&(h.removeChild(n),r)&&(s?r.insertBefore(t,s):r.appendChild(t)),i&&(k={},d)&&z.pick(e.applyMatrix,u)&&d.matrix.apply(!0,!0),d}function Dt(n,r,s){if(!n)return null;r="function"==typeof r?{onLoad:r}:r||{};var t,a=B,o=null;function e(t){try{var e="object"==typeof t?t:(new b.DOMParser).parseFromString(t.trim(),"image/svg+xml");if(!e.nodeName)throw e=null,new Error("Unsupported SVG source: "+n);B=a,o=Rt(e,r,!0),r&&!1===r.insert||s._insertItem(j,o);var i=r.onLoad;i&&i(o,t)}catch(t){h(t)}}function h(t,e){var i=r.onError;if(!i)throw new Error(t);i(t,e)}if("string"!=typeof n||/^[\s\S]*</.test(n)){if("undefined"!=typeof File&&n instanceof File)return(t=new FileReader).onload=function(){e(t.result)},t.onerror=function(){h(t.error)},t.readAsText(n);e(n)}else{var i=I.getElementById(n);i?e(i):pt({url:n,async:!0,onLoad:e,onError:h})}return o}a={Group:_t,Layer:_t,Raster:function(t,e){var i=d(t._matrix,!0),n=t.getSize(),r=t.getImage();return i.x-=n.width/2,i.y-=n.height/2,i.width=n.width,i.height=n.height,i.href=0==e.embedImages&&r&&r.src||t.toDataURL(),_.create("image",i,p)},Path:function(t,e){if(h=e.matchShapes){var i=t.toShape(!1);if(i)return vt(i)}var n=t._segments,r=n.length,i=d(t._matrix);if(h&&2<=r&&!t.hasHandles())if(2<r){for(var s=t._closed?"polygon":"polyline",a=[],o=0;o<r;o++)a.push(p.point(n[o]._point));i.points=a.join(" ")}else{s="line";var h=n[0]._point,l=n[1]._point;i.set({x1:h.x,y1:h.y,x2:l.x,y2:l.y})}else s="path",i.d=t.getPathData(null,e.precision);return _.create(s,i,p)},Shape:vt,CompoundPath:function(t,e){var i=d(t._matrix);return(t=t.getPathData(null,e.precision))&&(i.d=t),_.create("path",i,p)},SymbolItem:function(t,e){var i=d(t._matrix,!0),n=bt(t=t._definition,"symbol"),r=t._item,s=r.getStrokeBounds();return n||((n=_.create("symbol",{viewBox:p.rectangle(s)})).appendChild(St(r,e)),wt(t,n,"symbol")),i.href="#"+n.id,i.x+=s.x,i.y+=s.y,i.width=s.width,i.height=s.height,i.overflow="visible",_.create("use",i,p)},PointText:function(t){var e=_.create("text",d(t._matrix,!0),p);return e.textContent=t._content,e}},V.inject({exportSVG:function(t){return xt(St(this,t=Ct(t),!0),t)}}),h.inject({exportSVG:function(t){t=Ct(t);var e=this._children,i=this.getView(),n=z.pick(t.bounds,"view"),r=t.matrix||"view"===n&&i._matrix,r=r&&M.read([r]),i="view"===n?new x([0,0],i.getViewSize()):"content"===n?V._getBounds(e,r,{stroke:!0}).rect:x.read([n],0,{readNull:!0}),n={version:"1.1",xmlns:_.svg,"xmlns:xlink":_.xlink},i=(i&&(n.width=i.width,n.height=i.height,i.x||0===i.x||i.y||0===i.y)&&(n.viewBox=p.rectangle(i)),_.create("svg",n,p)),s=i;r&&!r.isIdentity()&&(s=i.appendChild(_.create("g",d(r),p)));for(var a=0,o=e.length;a<o;a++)s.appendChild(St(e[a],t,!0));return xt(i,t)}}),k={},E={"#document":function(t,e,i,n){for(var r=t.childNodes,s=0,a=r.length;s<a;s++){var o=r[s];if(1===o.nodeType)return Rt(o,i,n)}},g:At,svg:At,clippath:At,polygon:Tt,polyline:Tt,path:function(t){return Q.create(t.getAttribute("d"))},lineargradient:It,radialgradient:It,image:function(e){var t=new $(v(e,"href",!0));return t.on("load",function(){var t=kt(e),t=(this.setSize(t),y(e).add(t.divide(2)));this._matrix.append((new M).translate(t))}),t},symbol:function(t,e,i,n){return new m(At(t,e,i,n),!0)},defs:At,use:function(t){var e=(v(t,"href",!0)||"").substring(1),e=k[e],t=y(t);return e?e instanceof m?e.place(t):e.clone().translate(t):null},circle:function(t){return new f.Circle(y(t,"cx","cy"),v(t,"r"))},ellipse:function(t){return new f.Ellipse({center:y(t,"cx","cy"),radius:kt(t,"rx","ry")})},rect:function(t){return new f.Rectangle(new x(y(t),kt(t)),kt(t,"rx","ry"))},line:function(t){return new W.Line(y(t,"x1","y1"),y(t,"x2","y2"))},text:function(t){var e=new it(y(t).add(y(t,"dx","dy")));return e.setContent(t.textContent.trim()||""),e},switch:At},i=z.set(z.each(mt,function(i){this[i.attribute]=function(t,e){t[i.set]&&(t[i.set](Et(e,i.type,i.fromSVG)),"color"===i.type)&&(e=t[i.get]())&&e._scaleToBounds&&(t=t.getBounds(),e.transform((new M).translate(t.getPoint()).scale(t.getSize())))}},{}),{id:function(t,e){(k[e]=t).setName&&t.setName(e)},"clip-path":function(t,e){e=Nt(e);if(e){if((e=e.clone()).setClipMask(!0),!(t instanceof g))return new g(e,t);t.insertChild(0,e)}},gradientTransform:Lt,transform:Lt,"fill-opacity":Pt,"stroke-opacity":Pt,visibility:function(t,e){t.setVisible&&t.setVisible("visible"===e)},display:function(t,e){t.setVisible&&t.setVisible(null!==e)},"stop-color":function(t,e){t.setColor&&t.setColor(e)},"stop-opacity":function(t,e){t._color&&t._color.setAlpha(parseFloat(e))},offset:function(t,e){var i;t.setOffset&&(i=e.match(/(.*)%$/),t.setOffset(i?i[1]/100:parseFloat(e)))},viewBox:function(t,e,i,n,r){var s,a,e=new x(Et(e,"array")),o=kt(n,null,null,!0);t instanceof g?(s=o?o.divide(e.getSize()):1,s=(new M).scale(s).translate(e.getPoint().negate()),a=t):t instanceof m&&(o&&e.setSize(o),a=t._item),a&&("visible"!==Ot(n,"overflow",r)&&((o=new f.Rectangle(e)).setClipMask(!0),a.addChild(o)),s)&&a.transform(s)}}),V.inject({importSVG:function(t,e){return Dt(t,e,this)}}),h.inject({importSVG:function(t,e){return this.activate(),Dt(t,e,this)}}),z.exports.PaperScript=function(){var t,e,i=this,n=i.acorn;if(!n&&void 0!==Bt)try{n=Bt("acorn")}catch(t){}function _(t,e){return(i.acorn||n).parse(t,e)}n||(n=r={},t=this,e=function(t){"use strict";t.version="0.5.0",t.parse=function(t,e){p=String(t),d=p.length,s(e),se();var t=f.program,i=(K=x=g,f.locations&&(h=new a),Z=S=null,c=[],M(),t||D()),n=!0;for(t||(i.body=[]);v!==l;){var r=V();i.body.push(r),n&&ve(r)&&ge(!0),n=!1}return B(i,"Program")};var f,p,d,i,n=t.defaultOptions={ecmaVersion:5,strictSemicolons:!1,allowTrailingCommas:!0,forbidReserved:!1,allowReturnOutsideFunction:!1,locations:!1,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null};function s(t){for(var e in f=t||{},n)Object.prototype.hasOwnProperty.call(f,e)||(f[e]=n[e]);i=f.sourceFile||null}var g,m,_,H,W,v,y,G,b,w,K,x,h,Z,c,S,r=t.getLineInfo=function(t,e){for(var i=1,n=0;;){ie.lastIndex=n;var r=ie.exec(t);if(!(r&&r.index<e))break;++i,n=r.index+r[0].length}return{line:i,column:e-n}};function C(t,e){var i=r(p,t),e=(e+=" ("+i.line+":"+i.column+")",new SyntaxError(e));throw e.pos=t,e.loc=i,e.raisedAt=g,e}t.tokenize=function(t,e){p=String(t),d=p.length,s(e),se();var i={};function n(t){return x=_,M(t),i.start=m,i.end=_,i.startLoc=H,i.endLoc=W,i.type=v,i.value=y,i}return n.jumpTo=function(t,e){var i;if(g=t,f.locations)for(b=1,w=ie.lastIndex=0;(i=ie.exec(p))&&i.index<t;)++b,w=i.index+i[0].length;G=e,oe()},n};var e,$=[],Y={type:"num"},X={type:"regexp"},Q={type:"string"},k={type:"name"},l={type:"eof"},J={keyword:"break"},tt={keyword:"case",beforeExpr:!0},et={keyword:"catch"},it={keyword:"continue"},nt={keyword:"debugger"},rt={keyword:"default"},st={keyword:"do",isLoop:!0},at={keyword:"else",beforeExpr:!0},ot={keyword:"finally"},ht={keyword:"for",isLoop:!0},lt={keyword:"function"},ut={keyword:"if"},ct={keyword:"return",beforeExpr:!0},dt={keyword:"switch"},ft={keyword:"throw",beforeExpr:!0},pt={keyword:"try"},gt={keyword:"var"},mt={keyword:"while",isLoop:!0},_t={keyword:"with"},vt={keyword:"new",beforeExpr:!0},yt={keyword:"this"},bt={keyword:"null",atomValue:null},wt={keyword:"true",atomValue:!0},xt={keyword:"false",atomValue:!1},St={keyword:"in",binop:7,beforeExpr:!0},u={break:J,case:tt,catch:et,continue:it,debugger:nt,default:rt,do:st,else:at,finally:ot,for:ht,function:lt,if:ut,return:ct,switch:dt,throw:ft,try:pt,var:gt,while:mt,with:_t,null:bt,true:wt,false:xt,new:vt,in:St,instanceof:{keyword:"instanceof",binop:7,beforeExpr:!0},this:yt,typeof:{keyword:"typeof",prefix:!0,beforeExpr:!0},void:{keyword:"void",prefix:!0,beforeExpr:!0},delete:{keyword:"delete",prefix:!0,beforeExpr:!0}},Ct={type:"[",beforeExpr:!0},kt={type:"]"},Et={type:"{",beforeExpr:!0},E={type:"}"},A={type:"(",beforeExpr:!0},T={type:")"},I={type:",",beforeExpr:!0},L={type:";",beforeExpr:!0},At={type:":",beforeExpr:!0},Tt={type:"."},It={type:"?",beforeExpr:!0},Lt={binop:10,beforeExpr:!0},Pt={isAssign:!0,beforeExpr:!0},P={isAssign:!0,beforeExpr:!0},Ot={postfix:!0,prefix:!0,isUpdate:!0},Mt={prefix:!0,beforeExpr:!0},Nt={binop:1,beforeExpr:!0},Rt={binop:2,beforeExpr:!0},Dt={binop:3,beforeExpr:!0},Bt={binop:4,beforeExpr:!0},jt={binop:5,beforeExpr:!0},zt={binop:6,beforeExpr:!0},Ft={binop:7,beforeExpr:!0},Vt={binop:8,beforeExpr:!0},qt={binop:9,prefix:!0,beforeExpr:!0},Ut={binop:10,beforeExpr:!0};for(e in t.tokTypes={bracketL:Ct,bracketR:kt,braceL:Et,braceR:E,parenL:A,parenR:T,comma:I,semi:L,colon:At,dot:Tt,question:It,slash:Lt,eq:Pt,name:k,eof:l,num:Y,regexp:X,string:Q},u)t.tokTypes["_"+e]=u[e];function Ht(t){t=t.split(" ");var i="",e=[];t:for(var n=0;n<t.length;++n){for(var r=0;r<e.length;++r)if(e[r][0].length==t[n].length){e[r].push(t[n]);continue t}e.push([t[n]])}function s(t){if(1==t.length)return i+="return str === "+JSON.stringify(t[0])+";";i+="switch(str){";for(var e=0;e<t.length;++e)i+="case "+JSON.stringify(t[e])+":";i+="return true}return false;"}if(3<e.length){e.sort(function(t,e){return e.length-t.length}),i+="switch(str.length){";for(n=0;n<e.length;++n){var a=e[n];i+="case "+a[0].length+":",s(a)}i+="}"}else s(t);return new Function("str",i)}var Wt,Gt=Ht("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"),Kt=Ht("class enum extends super const export import"),Zt=Ht("implements interface let package private protected public static yield"),$t=Ht("eval arguments"),Yt=Ht("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"),Xt=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Qt="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Jt=new RegExp("["+Qt+"]"),te=new RegExp("["+Qt+"̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]"),ee=/[\n\r\u2028\u2029]/,ie=/\r\n|[\n\r\u2028\u2029]/g,ne=t.isIdentifierStart=function(t){return t<65?36===t:t<91||(t<97?95===t:t<123||170<=t&&Jt.test(String.fromCharCode(t)))},re=t.isIdentifierChar=function(t){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||170<=t&&te.test(String.fromCharCode(t))))};function a(){this.line=b,this.column=g-w}function se(){b=1,g=w=0,G=!0,oe()}function O(t,e){_=g,f.locations&&(W=new a),v=t,oe(),y=e,G=t.beforeExpr}function ae(){for(var t=g,e=f.onComment&&f.locations&&new a,i=p.charCodeAt(g+=2);g<d&&10!==i&&13!==i&&8232!==i&&8233!==i;)++g,i=p.charCodeAt(g);f.onComment&&f.onComment(!1,p.slice(t+2,g),t,g,e,f.locations&&new a)}function oe(){for(;g<d;){var t,e=p.charCodeAt(g);if(32===e)++g;else if(13===e)++g,10===(t=p.charCodeAt(g))&&++g,f.locations&&(++b,w=g);else if(10===e||8232===e||8233===e)++g,f.locations&&(++b,w=g);else if(8<e&&e<14)++g;else if(47===e)if(42===(t=p.charCodeAt(g+1))){i=s=r=n=void 0;var i,n=f.onComment&&f.locations&&new a,r=g,s=p.indexOf("*/",g+=2);if(-1===s&&C(g-2,"Unterminated comment"),g=s+2,f.locations)for(ie.lastIndex=r;(i=ie.exec(p))&&i.index<g;)++b,w=i.index+i[0].length;f.onComment&&f.onComment(!0,p.slice(r+2,s),r,g,n,f.locations&&new a)}else{if(47!==t)break;ae()}else{if(160!==e&&!(5760<=e&&Xt.test(String.fromCharCode(e))))break;++g}}}function he(t){switch(t){case 46:return 48<=(c=p.charCodeAt(g+1))&&c<=57?ce(!0):(++g,O(Tt));case 40:return++g,O(A);case 41:return++g,O(T);case 59:return++g,O(L);case 44:return++g,O(I);case 91:return++g,O(Ct);case 93:return++g,O(kt);case 123:return++g,O(Et);case 125:return++g,O(E);case 58:return++g,O(At);case 63:return++g,O(It);case 48:c=p.charCodeAt(g+1);if(120===c||88===c){g+=2;var e=ue(16);null==e&&C(m+2,"Expected hexadecimal number");ne(p.charCodeAt(g))&&C(g,"Identifier directly after number");return O(Y,e);return}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return ce(!1);case 34:case 39:var i=t;g++;for(var n="";;){d<=g&&C(m,"Unterminated string constant");var r=p.charCodeAt(g);if(r===i)return++g,O(Q,n);if(92===r){r=p.charCodeAt(++g);var s=/^[0-7]+/.exec(p.slice(g,g+3));for(s=s&&s[0];s&&255<parseInt(s,8);)s=s.slice(0,-1);if(++g,s="0"===s?null:s)S&&C(g-2,"Octal literal in strict mode"),n+=String.fromCharCode(parseInt(s,8)),g+=s.length-1;else switch(r){case 110:n+="\n";break;case 114:n+="\r";break;case 120:n+=String.fromCharCode(de(2));break;case 117:n+=String.fromCharCode(de(4));break;case 85:n+=String.fromCharCode(de(8));break;case 116:n+="\t";break;case 98:n+="\b";break;case 118:n+="\v";break;case 102:n+="\f";break;case 48:n+="\0";break;case 13:10===p.charCodeAt(g)&&++g;case 10:f.locations&&(w=g,++b);break;default:n+=String.fromCharCode(r)}}else 13!==r&&10!==r&&8232!==r&&8233!==r||C(m,"Unterminated string constant"),n+=String.fromCharCode(r),++g}return;case 47:return e=p.charCodeAt(g+1),G?(++g,le()):61===e?N(P,2):N(Lt,1);case 37:case 42:return 61===p.charCodeAt(g+1)?N(P,2):N(Ut,1);case 124:case 38:return l=t,(u=p.charCodeAt(g+1))===l?N(124===l?Nt:Rt,2):61===u?N(P,2):N(124===l?Dt:jt,1);case 94:return 61===p.charCodeAt(g+1)?N(P,2):N(Bt,1);case 43:case 45:return u=t,(l=p.charCodeAt(g+1))===u?45==l&&62==p.charCodeAt(g+2)&&ee.test(p.slice(x,g))?(g+=3,ae(),oe(),M()):N(Ot,2):61===l?N(P,2):N(qt,1);case 60:case 62:return a=t,o=p.charCodeAt(g+1),h=1,o===a?(h=62===a&&62===p.charCodeAt(g+2)?3:2,61===p.charCodeAt(g+h)?N(P,h+1):N(Vt,h)):33==o&&60==a&&45==p.charCodeAt(g+2)&&45==p.charCodeAt(g+3)?(g+=4,ae(),oe(),M()):(61===o&&(h=61===p.charCodeAt(g+2)?3:2),N(Ft,h));case 61:case 33:return a=t,61===p.charCodeAt(g+1)?N(zt,61===p.charCodeAt(g+2)?3:2):N(61===a?Pt:Mt,1);case 126:return N(Mt,1)}var a,o,h,l,u,c;return!1}function M(t){if(t?g=m+1:m=g,f.locations&&(H=new a),t)return le();if(d<=g)return O(l);t=p.charCodeAt(g);if(ne(t)||92===t)return pe();var e=he(t);if(!1===e){t=String.fromCharCode(t);if("\\"===t||Jt.test(t))return pe();C(g,"Unexpected character '"+t+"'")}return e}function N(t,e){var i=p.slice(g,g+e);g+=e,O(t,i)}function le(){for(var t,e,i=g;;){d<=g&&C(i,"Unterminated regular expression");var n=p.charAt(g);if(ee.test(n)&&C(i,"Unterminated regular expression"),t)t=!1;else{if("["===n)e=!0;else if("]"===n&&e)e=!1;else if("/"===n&&!e)break;t="\\"===n}++g}var r=p.slice(i,g),s=(++g,fe());s&&!/^[gmsiy]*$/.test(s)&&C(i,"Invalid regexp flag");try{var a=new RegExp(r,s)}catch(t){t instanceof SyntaxError&&C(i,t.message),C(t)}return O(X,a)}function ue(t,e){for(var i=g,n=0,r=0,s=null==e?1/0:e;r<s;++r){var a=p.charCodeAt(g),a=97<=a?a-97+10:65<=a?a-65+10:48<=a&&a<=57?a-48:1/0;if(t<=a)break;++g,n=n*t+a}return g===i||null!=e&&g-i!==e?null:n}function ce(t){var e,i=g,n=!1,r=48===p.charCodeAt(g),t=(t||null!==ue(10)||C(i,"Invalid number"),46===p.charCodeAt(g)&&(++g,ue(10),n=!0),p.charCodeAt(g)),t=(69!==t&&101!==t||(43!==(t=p.charCodeAt(++g))&&45!==t||++g,null===ue(10)&&C(i,"Invalid number"),n=!0),ne(p.charCodeAt(g))&&C(g,"Identifier directly after number"),p.slice(i,g));return n?e=parseFloat(t):r&&1!==t.length?/[89]/.test(t)||S?C(i,"Invalid number"):e=parseInt(t,8):e=parseInt(t,10),O(Y,e)}function de(t){t=ue(16,t);return null===t&&C(m,"Bad character escape sequence"),t}function fe(){for(var t,e=!(Wt=!1),i=g;;){var n=p.charCodeAt(g);if(re(n))Wt&&(t+=p.charAt(g)),++g;else{if(92!==n)break;Wt||(t=p.slice(i,g)),Wt=!0,117!=p.charCodeAt(++g)&&C(g,"Expecting Unicode escape sequence \\uXXXX"),++g;var n=de(4),r=String.fromCharCode(n);r||C(g-1,"Invalid Unicode escape"),(e?ne:re)(n)||C(g-4,"Invalid Unicode escape"),t+=r}e=!1}return Wt?t:p.slice(i,g)}function pe(){var t=fe(),e=k;return O(e=!Wt&&Yt(t)?u[t]:e,t)}function R(){K=m,x=_,h=W,M()}function ge(t){if(S=t,g=m,f.locations)for(;g<w;)w=p.lastIndexOf("\n",w-2)+1,--b;oe(),M()}function me(){this.type=null,this.start=m,this.end=null}function _e(){this.start=H,(this.end=null)!==i&&(this.source=i)}function D(){var t=new me;return f.locations&&(t.loc=new _e),f.directSourceFile&&(t.sourceFile=f.directSourceFile),f.ranges&&(t.range=[m,0]),t}function o(t){var e=new me;return e.start=t.start,f.locations&&(e.loc=new _e,e.loc.start=t.loc.start),f.ranges&&(e.range=[t.range[0],0]),e}function B(t,e){return t.type=e,t.end=x,f.locations&&(t.loc.end=h),f.ranges&&(t.range[1]=x),t}function ve(t){return 5<=f.ecmaVersion&&"ExpressionStatement"===t.type&&"Literal"===t.expression.type&&"use strict"===t.expression.value}function j(t){return v===t&&(R(),1)}function ye(){return!f.strictSemicolons&&(v===l||v===E||ee.test(p.slice(x,m)))}function be(){j(L)||ye()||F()}function z(t){(v===t?R:F)()}function F(){C(m,"Unexpected token")}function we(t){"Identifier"!==t.type&&"MemberExpression"!==t.type&&C(t.start,"Assigning to rvalue"),S&&"Identifier"===t.type&&$t(t.name)&&C(t.start,"Assigning to "+t.name+" in strict mode")}var xe={kind:"loop"},Se={kind:"switch"};function V(){(v===Lt||v===P&&"/="==y)&&M(!0);var t,e,i,n=v,r=D();switch(n){case J:case it:R();var s=n===J;j(L)||ye()?r.label=null:(v!==k?F:(r.label=U(),be))();for(var a=0;a<c.length;++a){var o=c[a];if(null==r.label||o.name===r.label.name){if(null!=o.kind&&(s||"loop"===o.kind))break;if(r.label&&s)break}}return a===c.length&&C(r.start,"Unsyntactic "+n.keyword),B(r,s?"BreakStatement":"ContinueStatement");case nt:return R(),be(),B(r,"DebuggerStatement");case st:return R(),c.push(xe),r.body=V(),c.pop(),z(mt),r.test=Ce(),be(),B(r,"DoWhileStatement");case ht:return(R(),c.push(xe),z(A),v===L)?Ee(r,null):(v===gt?(u=D(),R(),Te(u,!0),B(u,"VariableDeclaration"),1===u.declarations.length&&j(St)?Ae:Ee):(u=q(!1,!0),j(St)?(we(u),Ae):Ee))(r,u);case lt:return R(),Ne(r,!0);case ut:return R(),r.test=Ce(),r.consequent=V(),r.alternate=j(at)?V():null,B(r,"IfStatement");case ct:return Z||f.allowReturnOutsideFunction||C(m,"'return' outside of function"),R(),j(L)||ye()?r.argument=null:(r.argument=q(),be()),B(r,"ReturnStatement");case dt:R(),r.discriminant=Ce(),r.cases=[],z(Et),c.push(Se);for(;v!=E;)v===tt||v===rt?(i=v===tt,t&&B(t,"SwitchCase"),r.cases.push(t=D()),t.consequent=[],R(),i?t.test=q():(e&&C(K,"Multiple default clauses"),e=!0,t.test=null),z(At)):(t||F(),t.consequent.push(V()));return t&&B(t,"SwitchCase"),R(),c.pop(),B(r,"SwitchStatement");case ft:return R(),ee.test(p.slice(x,m))&&C(x,"Illegal newline after throw"),r.argument=q(),be(),B(r,"ThrowStatement");case pt:return R(),r.block=ke(),r.handler=null,v===et&&(u=D(),R(),z(A),u.param=U(),S&&$t(u.param.name)&&C(u.param.start,"Binding "+u.param.name+" in strict mode"),z(T),u.guard=null,u.body=ke(),r.handler=B(u,"CatchClause")),r.guardedHandlers=$,r.finalizer=j(ot)?ke():null,r.handler||r.finalizer||C(r.start,"Missing catch or finally clause"),B(r,"TryStatement");case gt:return R(),Te(r),be(),B(r,"VariableDeclaration");case mt:return R(),r.test=Ce(),c.push(xe),r.body=V(),c.pop(),B(r,"WhileStatement");case _t:return S&&C(m,"'with' in strict mode"),R(),r.object=Ce(),r.body=V(),B(r,"WithStatement");case Et:return ke();case L:return R(),B(r,"EmptyStatement");default:var h=y,l=q();if(n===k&&"Identifier"===l.type&&j(At)){for(a=0;a<c.length;++a)c[a].name===h&&C(l.start,"Label '"+h+"' is already declared");var u=v.isLoop?"loop":v===dt?"switch":null;return c.push({name:h,kind:u}),r.body=V(),c.pop(),r.label=l,B(r,"LabeledStatement")}return r.expression=l,be(),B(r,"ExpressionStatement")}}function Ce(){z(A);var t=q();return z(T),t}function ke(t){var e,i=D(),n=!0,r=!1;for(i.body=[],z(Et);!j(E);){var s=V();i.body.push(s),n&&t&&ve(s)&&(e=r,ge(r=!0)),n=!1}return r&&!e&&ge(!1),B(i,"BlockStatement")}function Ee(t,e){return t.init=e,z(L),t.test=v===L?null:q(),z(L),t.update=v===T?null:q(),z(T),t.body=V(),c.pop(),B(t,"ForStatement")}function Ae(t,e){return t.left=e,t.right=q(),z(T),t.body=V(),c.pop(),B(t,"ForInStatement")}function Te(t,e){for(t.declarations=[],t.kind="var";;){var i=D();if(i.id=U(),S&&$t(i.id.name)&&C(i.id.start,"Binding "+i.id.name+" in strict mode"),i.init=j(Pt)?q(!0,e):null,t.declarations.push(B(i,"VariableDeclarator")),!j(I))break}}function q(t,e){var i=Ie(e);if(t||v!==I)return i;var n=o(i);for(n.expressions=[i];j(I);)n.expressions.push(Ie(e));return B(n,"SequenceExpression")}function Ie(t){var e,i=function(t){var e=function(t){return function t(e,i,n){var r=v.binop;if(null!=r&&(!n||v!==St)){var s,a;if(i<r)return(s=o(e)).left=e,s.operator=y,a=v,R(),s.right=t(Le(),r,n),r=B(s,a===Nt||a===Rt?"LogicalExpression":"BinaryExpression"),t(r,i,n)}return e}(Le(),-1,t)}(t);{var i;if(j(It))return(i=o(e)).test=e,i.consequent=q(!0),z(At),i.alternate=q(!0,t),B(i,"ConditionalExpression")}return e}(t);return v.isAssign?((e=o(i)).operator=y,e.left=i,R(),e.right=Ie(t),we(i),B(e,"AssignmentExpression")):i}function Le(){var t;if(v.prefix)return e=D(),t=v.isUpdate,e.operator=y,e.prefix=!0,G=!0,R(),e.argument=Le(),t?we(e.argument):S&&"delete"===e.operator&&"Identifier"===e.argument.type&&C(e.start,"Deleting local variable in strict mode"),B(e,t?"UpdateExpression":"UnaryExpression");for(var e,i=Pe(Oe());v.postfix&&!ye();)(e=o(i)).operator=y,e.prefix=!1,we(e.argument=i),R(),i=B(e,"UpdateExpression");return i}function Pe(t,e){var i;return j(Tt)?((i=o(t)).object=t,i.property=U(!0),i.computed=!1,Pe(B(i,"MemberExpression"),e)):j(Ct)?((i=o(t)).object=t,i.property=q(),i.computed=!0,z(kt),Pe(B(i,"MemberExpression"),e)):!e&&j(A)?((i=o(t)).callee=t,i.arguments=Re(T,!1),Pe(B(i,"CallExpression"),e)):t}function Oe(){switch(v){case yt:var t=D();return R(),B(t,"ThisExpression");case k:return U();case Y:case Q:case X:return(t=D()).value=y,t.raw=p.slice(m,_),R(),B(t,"Literal");case bt:case wt:case xt:return(t=D()).value=v.atomValue,t.raw=v.keyword,R(),B(t,"Literal");case A:var e=H,i=m,n=(R(),q());return n.start=i,n.end=_,f.locations&&(n.loc.start=e,n.loc.end=W),f.ranges&&(n.range=[i,_]),z(T),n;case Ct:t=D();return R(),t.elements=Re(kt,!0,!0),B(t,"ArrayExpression");case Et:var r=D(),s=!0,a=!1;for(r.properties=[],R();!j(E);){if(s)s=!1;else if(z(I),f.allowTrailingCommas&&j(E))break;var o,h={key:Me()},l=!1;if(j(At)?(h.value=q(!0),o=h.kind="init"):5<=f.ecmaVersion&&"Identifier"===h.key.type&&("get"===h.key.name||"set"===h.key.name)?(l=a=!0,o=h.kind=h.key.name,h.key=Me(),v!==A&&F(),h.value=Ne(D(),!1)):F(),"Identifier"===h.key.type&&(S||a))for(var u=0;u<r.properties.length;++u){var c,d=r.properties[u];d.key.name===h.key.name&&(c=!((c=o==d.kind||l&&"init"===d.kind||"init"===o&&("get"===d.kind||"set"===d.kind))&&!S&&"init"===o&&"init"===d.kind)&&c)&&C(h.key.start,"Redefinition of property")}r.properties.push(h)}return B(r,"ObjectExpression");case lt:t=D();return R(),Ne(t,!1);case vt:e=D();return R(),e.callee=Pe(Oe(),!0),j(A)?e.arguments=Re(T,!1):e.arguments=$,B(e,"NewExpression");default:F()}}function Me(){return v===Y||v===Q?Oe():U(!0)}function Ne(t,e){v===k?t.id=U():e?F():t.id=null,t.params=[];var i=!0;for(z(A);!j(T);)i?i=!1:z(I),t.params.push(U());var n=Z,r=c;if(Z=!0,c=[],t.body=ke(!0),Z=n,c=r,S||t.body.body.length&&ve(t.body.body[0]))for(var s=t.id?-1:0;s<t.params.length;++s){var a=s<0?t.id:t.params[s];if((Zt(a.name)||$t(a.name))&&C(a.start,"Defining '"+a.name+"' in strict mode"),0<=s)for(var o=0;o<s;++o)a.name===t.params[o].name&&C(a.start,"Argument name clash in strict mode")}return B(t,e?"FunctionDeclaration":"FunctionExpression")}function Re(t,e,i){for(var n=[],r=!0;!j(t);){if(r)r=!1;else if(z(I),e&&f.allowTrailingCommas&&j(t))break;n.push(i&&v===I?null:q(!0))}return n}function U(t){var e=D();return t&&"everywhere"==f.forbidReserved&&(t=!1),v===k?(!t&&(f.forbidReserved&&(3===f.ecmaVersion?Gt:Kt)(y)||S&&Zt(y))&&-1==p.slice(m,_).indexOf("\\")&&C(m,"The keyword '"+y+"' is reserved"),e.name=y):t&&v.keyword?e.name=v.keyword:F(),G=!1,R(),B(e,"Identifier")}},"object"==typeof r&&"object"==typeof r?e(r):"function"==typeof define&&define.amd?define(["exports"],e):e(t.acorn||(t.acorn={})),n.version)||(n=null);var v={"+":"__add","-":"__subtract","*":"__multiply","/":"__divide","%":"__modulo","==":"__equals","!=":"__equals"},y={"-":"__negate","+":"__self"},r=z.each(["add","subtract","multiply","divide","modulo","equals","negate"],function(t){this["__"+t]="#"+t},{__self:function(){return this}});function p(t,e,i){var n=v[e];if(t&&t[n])return n=t[n](i),"!="===e?!n:n;switch(e){case"+":return t+i;case"-":return t-i;case"*":return t*i;case"/":return t/i;case"%":return t%i;case"==":return t==i;case"!=":return t!=i}}function g(t,e){var i=y[t];if(e&&e[i])return e[i]();switch(t){case"+":return+e;case"-":return-e}}function m(h,t){var s,e,i,n,r,a,o,l,u,c;return h?(s=[],e=(t=t||{}).url||"",i=t.sourceMaps,n=t.paperFeatures||{},r=t.source||h,t=t.offset||0,o=(a=B.agent).versionNumber,l=!1,u=/\r\n|\n|\r/gm,i&&(a.chrome&&30<=o||a.webkit&&537.76<=o||a.firefox&&23<=o||a.node)&&(a.node?t-=2:T&&e&&!T.location.href.indexOf(e)&&(t=(c=I.getElementsByTagName("html")[0].innerHTML).substr(0,c.indexOf(h)+1).match(u).length+1),(c=["AA"+function(t){var e="";for(t=(Math.abs(t)<<1)+(t<0?1:0);t||!e;){var i=31&t;(t>>=5)&&(i|=32),e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[i]}return e}((l=0<t&&!(a.chrome&&36<=o||a.safari&&600<=o||a.firefox&&40<=o||a.node))?0:t)+"A"]).length=(h.match(u)||[]).length+1+(l?t:0),c={version:3,file:e,names:[],mappings:c.join(";AACA"),sourceRoot:"",sources:[e],sourcesContent:[r]}),!1===n.operatorOverloading&&!1===n.moduleExports||m(_(h,{ranges:!0,preserveParens:!0,sourceType:"module"}),null,n),c&&(l&&(h=new Array(t+1).join("\n")+h),/^(inline|both)$/.test(i)&&(h+="\n//# sourceMappingURL=data:application/json;base64,"+b.btoa(unescape(encodeURIComponent(JSON.stringify(c))))),h+="\n//# sourceURL="+(e||"paperscript")),{url:e,source:r,code:h,map:c}):"";function d(t){for(var e=0,i=s.length;e<i;e++){var n=s[e];if(n[0]>=t)break;t+=n[1]}return t}function f(t){return h.substring(d(t.range[0]),d(t.range[1]))}function p(t,e){for(var i=d(t.range[0]),t=d(t.range[1]),n=0,r=s.length-1;0<=r;r--)if(i>s[r][0]){n=r+1;break}s.splice(n,0,[i,e.length-t+i]),h=h.substring(0,i)+e+h.substring(t)}function g(t,e){switch(t.type){case"UnaryExpression":t.operator in y&&"Literal"!==t.argument.type&&(i=f(t.argument),p(t,'$__("'+t.operator+'", '+i+")"));break;case"BinaryExpression":t.operator in v&&"Literal"!==t.left.type&&(n=f(t.left),r=f(t.right),a=t.left,o=t.right,a=h.substring(d(a.range[1]),d(o.range[0])),o=t.operator,p(t,"__$__("+n+","+a.replace(new RegExp("\\"+o),'"'+o+'"')+", "+r+")"));break;case"UpdateExpression":case"AssignmentExpression":var i,n,r,s,a=e&&e.type;"ForStatement"===a||"BinaryExpression"===a&&/^[=!<>]/.test(e.operator)||"MemberExpression"===a&&e.computed||("UpdateExpression"===t.type?(o=(i=f(t.argument))+" = "+(s="__$__("+i+', "'+t.operator[0]+'", 1)'),t.prefix?o="("+o+")":"AssignmentExpression"!==a&&"VariableDeclarator"!==a&&"BinaryExpression"!==a||(o=i+"; "+(o=f(e.left||e.id)===i?s:o)),p(t,o)):/^.=$/.test(t.operator)&&"Literal"!==t.left.type&&(n=f(t.left),r=f(t.right),s=n+" = __$__("+n+', "'+t.operator[0]+'", '+r+")",p(t,/^\(.*\)$/.test(f(t))?"("+s+")":s)))}var a,o}function m(t,e,i){if(t){for(var n in t)if("range"!==n&&"loc"!==n){var r=t[n];if(Array.isArray(r))for(var s=0,a=r.length;s<a;s++)m(r[s],t,i);else r&&"object"==typeof r&&m(r,t,i)}if(!1!==i.operatorOverloading&&g(t,e),!1!==i.moduleExports){var o=t;switch(o.type){case"ExportDefaultDeclaration":p({range:[o.start,o.declaration.start]},"module.exports = ");break;case"ExportNamedDeclaration":var h,l=o.declaration,u=o.specifiers;l?(h=l.declarations)&&(h.forEach(function(t){p(t,"module.exports."+f(t))}),p({range:[o.start,l.start+l.kind.length]},"")):u&&(h=u.map(function(t){t=f(t);return"module.exports."+t+" = "+t+"; "}).join(""))&&p(o,h)}}}}}function o(n,t,e){var i,r=(B=t).getView(),s=/\btool\.\w+|\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)\b/.test(n)&&!/\bnew\s+Tool\b/.test(n)?new dt:null,a=s?s._events:[],o=["onFrame","onResize"].concat(a),h=[],l=[],e="object"==typeof n?n:m(n,e);function u(t,e){for(var i in t)!e&&/^_/.test(i)||!new RegExp("([\\b\\s\\W]|^)"+i.replace(/\$/g,"\\$")+"\\b").test(n)||(h.push(i),l.push(t[i]))}n=e.code,u({__$__:p,$__:g,paper:t,tool:s},!0),u(t),n="var module = { exports: {} }; "+n;var c,d,e=z.each(o,function(t){new RegExp("\\s+"+t+"\\b").test(n)&&(h.push(t),this.push("module.exports."+t+" = "+t+";"))},[]).join("\n"),o=(e&&(n+="\n"+e),n+="\nreturn module.exports;",B.agent);I&&(o.chrome||o.firefox&&o.versionNumber<40)?(c=I.createElement("script"),d=I.head||I.getElementsByTagName("head")[0],o.firefox&&(n="\n"+n),c.appendChild(I.createTextNode("document.__paperscript__ = function("+h+") {"+n+"\n}")),d.appendChild(c),i=I.__paperscript__,delete I.__paperscript__,d.removeChild(c)):i=Function(h,n);var f=(e=i&&i.apply(t,l))||{};return z.each(a,function(t){var e=f[t];e&&(s[t]=e)}),r&&(f.onResize&&r.setOnResize(f.onResize),r.emit("resize",{size:r.size,delta:new P}),f.onFrame&&r.setOnFrame(f.onFrame),r.requestUpdate()),e}function s(t){if(/^text\/(?:x-|)paperscript$/.test(t.type)&&"true"!==u.getAttribute(t,"ignore")){var e,i=u.getAttribute(t,"canvas"),n=I.getElementById(i),r=t.src||t.getAttribute("data-src"),s=u.hasAttribute(t,"async"),a="data-paper-scope";if(n)return e=u.get(n.getAttribute(a))||(new u).setup(n),n.setAttribute(a,e._id),r?pt({url:r,async:s,mimeType:"text/plain",onLoad:function(t){o(t,e,r)}}):o(t.innerHTML,e,t.baseURI),t.setAttribute("data-paper-ignore","true"),e;throw new Error('Unable to find canvas with id "'+i+'"')}}function a(){z.each(I&&I.getElementsByTagName("script"),s)}return P.inject(r),O.inject(r),S.inject(r),T&&("complete"===I.readyState?setTimeout(a):R.add(T,{load:a})),{compile:m,execute:o,load:function(t){return t?s(t):a()},parse:_,calculateBinary:p,calculateUnary:g}}.call(this);var B=new(u.inject(z.exports,{Base:z,Numerical:F,Key:lt,DomEvent:R,DomElement:c,document:I,window:T,Symbol:m,PlacedSymbol:Y}));return B.agent.node&&Bt("./node/extend.js")(B),"function"==typeof define&&define.amd?define("paper",B):"object"==typeof jt&&jt&&(jt.exports=B),B}).call(this,"object"==typeof self?self:null)},{"./node/extend.js":8,"./node/self.js":8,acorn:5}],33:[function(t,e,i){var n,r,e=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}function o(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return(n=setTimeout)(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}var h,l=[],u=!1,c=-1;function d(){u&&h&&(u=!1,h.length?l=h.concat(l):c=-1,l.length)&&f()}function f(){if(!u){for(var t=o(d),e=(u=!0,l.length);e;){for(h=l,l=[];++c<e;)h&&h[c].run();c=-1,e=l.length}h=null,u=!1,!function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return(r=clearTimeout)(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}e.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new p(t,e)),1!==l.length||u||o(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=g,e.addListener=g,e.once=g,e.off=g,e.removeListener=g,e.removeAllListeners=g,e.emit=g,e.prependListener=g,e.prependOnceListener=g,e.listeners=function(t){return[]},e.binding=function(t){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(t){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},{}],34:[function(t,e,i){"use strict";e.exports=function(t,e,i,n){e=e||"&",i=i||"=";var r={};if("string"==typeof t&&0!==t.length){var s=/\+/g,e=(t=t.split(e),1e3),a=(n&&"number"==typeof n.maxKeys&&(e=n.maxKeys),t.length);0<e&&e<a&&(a=e);for(var o=0;o<a;++o){var h,l=t[o].replace(s,"%20"),u=l.indexOf(i),u=0<=u?(h=l.substr(0,u),l.substr(u+1)):(h=l,""),l=decodeURIComponent(h),u=decodeURIComponent(u);Object.prototype.hasOwnProperty.call(r,l)?c(r[l])?r[l].push(u):r[l]=[r[l],u]:r[l]=u}}return r};var c=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],35:[function(t,e,i){"use strict";function s(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}e.exports=function(i,n,r,t){return n=n||"&",r=r||"=","object"==typeof(i=null===i?void 0:i)?o(h(i),function(t){var e=encodeURIComponent(s(t))+r;return a(i[t])?o(i[t],function(t){return e+encodeURIComponent(s(t))}).join(n):e+encodeURIComponent(s(i[t]))}).join(n):t?encodeURIComponent(s(t))+r+encodeURIComponent(s(i)):""};var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var i=[],n=0;n<t.length;n++)i.push(e(t[n],n));return i}var h=Object.keys||function(t){var e,i=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.push(e);return i}},{}],36:[function(t,e,i){"use strict";i.decode=i.parse=t("./decode"),i.encode=i.stringify=t("./encode")},{"./decode":34,"./encode":35}],37:[function(t,e,i){var n=t("buffer"),r=n.Buffer;function s(t,e){for(var i in t)e[i]=t[i]}function a(t,e,i){return r(t,e,i)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(s(n,i),i.Buffer=a),a.prototype=Object.create(r.prototype),s(r,a),a.from=function(t,e,i){if("number"==typeof t)throw new TypeError("Argument must not be a number");return r(t,e,i)},a.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError("Argument must be a number");t=r(t);return void 0!==e?"string"==typeof i?t.fill(e,i):t.fill(e):t.fill(0),t},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:11}],38:[function(n,t,r){!function(l){!function(){var a=n("./lib/request"),t=n("./lib/response"),o=n("xtend"),e=n("builtin-status-codes"),h=n("url"),i=r;i.request=function(t,e){t="string"==typeof t?h.parse(t):o(t);var i=-1===l.location.protocol.search(/^https?:$/)?"http:":"",i=t.protocol||i,n=t.hostname||t.host,r=t.port,s=t.path||"/",i=(n&&-1!==n.indexOf(":")&&(n="["+n+"]"),t.url=(n?i+"//"+n:"")+(r?":"+r:"")+s,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{},new a(t));return e&&i.on("response",e),i},i.get=function(t,e){t=i.request(t,e);return t.end(),t},i.ClientRequest=a,i.IncomingMessage=t.IncomingMessage,i.Agent=function(){},i.Agent.defaultMaxSockets=4,i.globalAgent=new i.Agent,i.STATUS_CODES=e,i.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":40,"./lib/response":41,"builtin-status-codes":12,url:58,xtend:61}],39:[function(t,e,s){!function(r){!function(){var e;function i(){if(void 0===e)if(r.XMLHttpRequest){e=new r.XMLHttpRequest;try{e.open("GET",r.XDomainRequest?"/":"https://example.com")}catch(t){e=null}}else e=null;return e}function t(t){var e=i();if(e)try{return e.responseType=t,e.responseType===t}catch(t){}return!1}function n(t){return"function"==typeof t}s.fetch=n(r.fetch)&&n(r.ReadableStream),s.writableStream=n(r.WritableStream),s.abortController=n(r.AbortController),s.arraybuffer=s.fetch||t("arraybuffer"),s.msstream=!s.fetch&&t("ms-stream"),s.mozchunkedarraybuffer=!s.fetch&&t("moz-chunked-arraybuffer"),s.overrideMimeType=s.fetch||!!i()&&n(i().overrideMimeType),e=null}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],40:[function(a,o,t){!function(u,c,s){!function(){var h=a("./capability"),t=a("inherits"),e=a("./response"),r=a("readable-stream"),i=e.IncomingMessage,l=e.readyStates;e=o.exports=function(e){var t,i=this,n=(r.Writable.call(i),i._opts=e,i._body=[],i._headers={},e.auth&&i.setHeader("Authorization","Basic "+s.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){i.setHeader(t,e.headers[t])}),!0);if("disable-fetch"===e.mode||"requestTimeout"in e&&!h.abortController)t=!(n=!1);else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!h.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}i._mode=(t=t,n=n,h.fetch&&n?"fetch":h.mozchunkedarraybuffer?"moz-chunked-arraybuffer":h.msstream?"ms-stream":h.arraybuffer&&t?"arraybuffer":"text"),i._fetchTimer=null,i._socketTimeout=null,i._socketTimer=null,i.on("finish",function(){i._onFinish()})};t(e,r.Writable),e.prototype.setHeader=function(t,e){var i=t.toLowerCase();-1===n.indexOf(i)&&(this._headers[i]={name:t,value:e})},e.prototype.getHeader=function(t){t=this._headers[t.toLowerCase()];return t?t.value:null},e.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},e.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,i=("timeout"in t&&0!==t.timeout&&e.setTimeout(t.timeout),e._headers),n=null,r=("GET"!==t.method&&"HEAD"!==t.method&&(n=new Blob(e._body,{type:(i["content-type"]||{}).value||""})),[]);if(Object.keys(i).forEach(function(t){var e=i[t].name,t=i[t].value;Array.isArray(t)?t.forEach(function(t){r.push([e,t])}):r.push([e,t])}),"fetch"===e._mode){var s,a=null;h.abortController&&(a=(s=new AbortController).signal,e._fetchAbortController=s,"requestTimeout"in t)&&0!==t.requestTimeout&&(e._fetchTimer=c.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout)),c.fetch(e._opts.url,{method:e._opts.method,headers:r,body:n||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:a}).then(function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()},function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)})}else{var o=e._xhr=new c.XMLHttpRequest;try{o.open(e._opts.method,e._opts.url,!0)}catch(t){return void u.nextTick(function(){e.emit("error",t)})}"responseType"in o&&(o.responseType=e._mode),"withCredentials"in o&&(o.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(o.timeout=t.requestTimeout,o.ontimeout=function(){e.emit("requestTimeout")}),r.forEach(function(t){o.setRequestHeader(t[0],t[1])}),e._response=null,o.onreadystatechange=function(){switch(o.readyState){case l.LOADING:case l.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(o.onprogress=function(){e._onXHRProgress()}),o.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{o.send(n)}catch(t){u.nextTick(function(){e.emit("error",t)})}}}},e.prototype._onXHRProgress=function(){this._resetTimers(!1),function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){}}(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress(this._resetTimers.bind(this)))},e.prototype._connect=function(){var e=this;e._destroyed||(e._response=new i(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},e.prototype._write=function(t,e,i){this._body.push(t),i()},e.prototype._resetTimers=function(t){var e=this;c.clearTimeout(e._socketTimer),e._socketTimer=null,t?(c.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=c.setTimeout(function(){e.emit("timeout")},e._socketTimeout))},e.prototype.abort=e.prototype.destroy=function(t){this._destroyed=!0,this._resetTimers(!0),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort(),t&&this.emit("error",t)},e.prototype.end=function(t,e,i){"function"==typeof t&&(i=t,t=void 0),r.Writable.prototype.end.call(this,t,e,i)},e.prototype.setTimeout=function(t,e){e&&this.once("timeout",e),this._socketTimeout=t,this._resetTimers(!1)},e.prototype.flushHeaders=function(){},e.prototype.setNoDelay=function(){},e.prototype.setSocketKeepAlive=function(){};var n=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}.call(this)}.call(this,a("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},a("buffer").Buffer)},{"./capability":39,"./response":41,_process:33,buffer:11,inherits:20,"readable-stream":56}],41:[function(i,t,n){!function(l,u,c){!function(){var a=i("./capability"),t=i("inherits"),o=i("readable-stream"),h=n.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},e=n.IncomingMessage=function(t,e,i,n){var r=this;if(o.Readable.call(r),r._mode=i,r.headers={},r.rawHeaders=[],r.trailers={},r.rawTrailers=[],r.on("end",function(){l.nextTick(function(){r.emit("close")})}),"fetch"===i){if(r._fetchResponse=e,r.url=e.url,r.statusCode=e.status,r.statusMessage=e.statusText,e.headers.forEach(function(t,e){r.headers[e.toLowerCase()]=t,r.rawHeaders.push(e,t)}),a.writableStream){var i=new WritableStream({write:function(i){return n(!1),new Promise(function(t,e){r._destroyed?e():r.push(c.from(i))?t():r._resumeFetch=t})},close:function(){n(!0),r._destroyed||r.push(null)},abort:function(t){n(!0),r._destroyed||r.emit("error",t)}});try{return void e.body.pipeTo(i).catch(function(t){n(!0),r._destroyed||r.emit("error",t)})}catch(t){}}var s=e.body.getReader();!function e(){s.read().then(function(t){r._destroyed||(n(t.done),t.done?r.push(null):(r.push(c.from(t.value)),e()))}).catch(function(t){n(!0),r._destroyed||r.emit("error",t)})}()}else r._xhr=t,r._pos=0,r.url=t.responseURL,r.statusCode=t.status,r.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach(function(t){var e,t=t.match(/^([^:]+):\s*(.*)/);t&&("set-cookie"===(e=t[1].toLowerCase())?(void 0===r.headers[e]&&(r.headers[e]=[]),r.headers[e].push(t[2])):void 0!==r.headers[e]?r.headers[e]+=", "+t[2]:r.headers[e]=t[2],r.rawHeaders.push(t[1],t[2]))}),r._charset="x-user-defined",a.overrideMimeType||((i=r.rawHeaders["mime-type"])&&(e=i.match(/;\s*charset=([^;])(;|$)/))&&(r._charset=e[1].toLowerCase()),r._charset)||(r._charset="utf-8")};t(e,o.Readable),e.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},e.prototype._onXHRProgress=function(t){var e=this,i=e._xhr,n=null;switch(e._mode){case"text":if((n=i.responseText).length>e._pos){var r=n.substr(e._pos);if("x-user-defined"===e._charset){for(var s=c.alloc(r.length),a=0;a<r.length;a++)s[a]=255&r.charCodeAt(a);e.push(s)}else e.push(r,e._charset);e._pos=n.length}break;case"arraybuffer":i.readyState===h.DONE&&i.response&&(n=i.response,e.push(c.from(new Uint8Array(n))));break;case"moz-chunked-arraybuffer":n=i.response,i.readyState===h.LOADING&&n&&e.push(c.from(new Uint8Array(n)));break;case"ms-stream":var o,n=i.response;i.readyState===h.LOADING&&((o=new u.MSStreamReader).onprogress=function(){o.result.byteLength>e._pos&&(e.push(c.from(new Uint8Array(o.result.slice(e._pos)))),e._pos=o.result.byteLength)},o.onload=function(){t(!0),e.push(null)},o.readAsArrayBuffer(n))}e._xhr.readyState===h.DONE&&"ms-stream"!==e._mode&&(t(!0),e.push(null))}}.call(this)}.call(this,i("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i("buffer").Buffer)},{"./capability":39,_process:33,buffer:11,inherits:20,"readable-stream":56}],42:[function(t,e,i){"use strict";var n={};function r(t,r,e){var i=function(n){var t,e;function i(t,e,i){return n.call(this,(t=t,e=e,i=i,"string"==typeof r?r:r(t,e,i)))||this}return e=n,(t=i).prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e,i}(e=e||Error);i.prototype.name=e.name,i.prototype.code=t,n[t]=i}function h(t,e){var i;return Array.isArray(t)?(i=t.length,t=t.map(function(t){return String(t)}),2<i?"one of ".concat(e," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])):"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(t,e,i){var n,r,s,a,o;return"string"==typeof e&&(a="not ",e.substr(!s||s<0?0:+s,a.length)===a)?(n="must not be",e=e.replace(/^not /,"")):n="must be",s=t,a=" argument",(void 0===o||o>s.length)&&(o=s.length),s=(s.substring(o-a.length,o)===a?"The ".concat(t," "):(o=(r="number"!=typeof r?0:r)+(s=".").length>(o=t).length||-1===o.indexOf(s,r)?"argument":"property",'The "'.concat(t,'" ').concat(o," "))).concat(n," ").concat(h(e,"type")),s+=". Received type ".concat(typeof i)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],43:[function(u,c,t){!function(l){!function(){"use strict";var t=Object.keys||function(t){var e,i=[];for(e in t)i.push(e);return i},e=(c.exports=a,u("./_stream_readable")),i=u("./_stream_writable");u("inherits")(a,e);for(var n=t(i.prototype),r=0;r<n.length;r++){var s=n[r];a.prototype[s]||(a.prototype[s]=i.prototype[s])}function a(t){if(!(this instanceof a))return new a(t);e.call(this,t),i.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen)&&(this.allowHalfOpen=!1,this.once("end",o))}function o(){this._writableState.ended||l.nextTick(h,this)}function h(t){t.end()}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}.call(this)}.call(this,u("_process"))},{"./_stream_readable":45,"./_stream_writable":47,_process:33,inherits:20}],44:[function(t,e,i){"use strict";e.exports=r;var n=t("./_stream_transform");function r(t){if(!(this instanceof r))return new r(t);n.call(this,t)}t("inherits")(r,n),r.prototype._transform=function(t,e,i){i(null,t)}},{"./_stream_transform":46,inherits:20}],45:[function(z,F,t){!function(B,j){!function(){"use strict";function p(t,e){return t.listeners(e).length}(F.exports=b).ReadableState=y,z("events").EventEmitter;var n,r=z("./internal/streams/stream"),u=z("buffer").Buffer,c=j.Uint8Array||function(){};var s,t,i,e=z("util"),g=e&&e.debuglog?e.debuglog("stream"):function(){},a=z("./internal/streams/buffer_list"),e=z("./internal/streams/destroy"),o=z("./internal/streams/state").getHighWaterMark,h=z("../errors").codes,d=h.ERR_INVALID_ARG_TYPE,f=h.ERR_STREAM_PUSH_AFTER_EOF,l=h.ERR_METHOD_NOT_IMPLEMENTED,m=h.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,_=(z("inherits")(b,r),e.errorOrDestroy),v=["error","close","destroy","pause","resume"];function y(t,e,i){n=n||z("./_stream_duplex"),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=o(this,t,"readableHighWaterMark",i),this.buffer=new a,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(s=s||z("string_decoder/").StringDecoder,this.decoder=new s(t.encoding),this.encoding=t.encoding)}function b(t){if(n=n||z("./_stream_duplex"),!(this instanceof b))return new b(t);var e=this instanceof n;this._readableState=new y(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy)&&(this._destroy=t.destroy),r.call(this)}function w(t,e,i,n,r){g("readableAddChunk",e);var s,a,o,h,l=t._readableState;if(null===e)l.reading=!1,a=t,o=l,g("onEofChunk"),o.ended||(o.decoder&&(h=o.decoder.end())&&h.length&&(o.buffer.push(h),o.length+=o.objectMode?1:h.length),o.ended=!0,o.sync?k(a):(o.needReadable=!1,o.emittedReadable||(o.emittedReadable=!0,E(a))));else if(s=r?s:function(t,e){var i;!function(t){return u.isBuffer(t)||t instanceof c}(e)&&"string"!=typeof e&&void 0!==e&&!t.objectMode&&(i=new d("chunk",["string","Buffer","Uint8Array"],e));return i}(l,e))_(t,s);else if(l.objectMode||e&&0<e.length)if("string"==typeof e||l.objectMode||Object.getPrototypeOf(e)===u.prototype||(h=e,e=u.from(h)),n)l.endEmitted?_(t,new m):x(t,l,e,!0);else if(l.ended)_(t,new f);else{if(l.destroyed)return!1;l.reading=!1,!l.decoder||i||(e=l.decoder.write(e),l.objectMode)||0!==e.length?x(t,l,e,!1):A(t,l)}else n||(l.reading=!1,A(t,l));return!l.ended&&(l.length<l.highWaterMark||0===l.length)}function x(t,e,i,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,n?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&k(t)),A(t,e)}Object.defineProperty(b.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),b.prototype.destroy=e.destroy,b.prototype._undestroy=e.undestroy,b.prototype._destroy=function(t,e){e(t)},b.prototype.push=function(t,e){var i,n=this._readableState;return n.objectMode?i=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=u.from(t,e),e=""),i=!0),w(this,t,e,!1,i)},b.prototype.unshift=function(t){return w(this,t,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(t){for(var e=new(s=s||z("string_decoder/").StringDecoder)(t),i=(this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding,this._readableState.buffer.head),n="";null!==i;)n+=e.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var S=1073741824;function C(t,e){var i;return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?(e.flowing&&e.length?e.buffer.head.data:e).length:(t>e.highWaterMark&&(e.highWaterMark=(S<=(i=t)?i=S:(i--,i=(i=(i=(i=(i|=i>>>1)|i>>>2)|i>>>4)|i>>>8)|i>>>16,i++),i)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function k(t){var e=t._readableState;g("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(g("emitReadable",e.flowing),e.emittedReadable=!0,B.nextTick(E,t))}function E(t){var e=t._readableState;g("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,O(t)}function A(t,e){e.readingMore||(e.readingMore=!0,B.nextTick(T,t,e))}function T(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var i=e.length;if(g("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}function I(t){var e=t._readableState;e.readableListening=0<t.listenerCount("readable"),e.resumeScheduled&&!e.paused?e.flowing=!0:0<t.listenerCount("data")&&t.resume()}function L(t){g("readable nexttick read 0"),t.read(0)}function P(t,e){g("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),O(t),e.flowing&&!e.reading&&t.read(0)}function O(t){var e=t._readableState;for(g("flow",e.flowing);e.flowing&&null!==t.read(););}function M(t,e){var i;return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i)}function N(t){var e=t._readableState;g("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,B.nextTick(D,e,t))}function D(t,e){g("endReadableNT",t.endEmitted,t.length),t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy&&(!(t=e._writableState)||t.autoDestroy&&t.finished)&&e.destroy())}function R(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1}b.prototype.read=function(t){g("read",t),t=parseInt(t,10);var e,i=this._readableState,n=t;return 0!==t&&(i.emittedReadable=!1),0===t&&i.needReadable&&((0!==i.highWaterMark?i.length>=i.highWaterMark:0<i.length)||i.ended)?(g("read: emitReadable",i.length,i.ended),(0===i.length&&i.ended?N:k)(this),null):0===(t=C(t,i))&&i.ended?(0===i.length&&N(this),null):(e=i.needReadable,g("need readable",e),(0===i.length||i.length-t<i.highWaterMark)&&g("length less than watermark",e=!0),i.ended||i.reading?g("reading or ended",e=!1):e&&(g("do read"),i.reading=!0,i.sync=!0,0===i.length&&(i.needReadable=!0),this._read(i.highWaterMark),i.sync=!1,i.reading||(t=C(n,i))),null===(e=0<t?M(t,i):null)?(i.needReadable=i.length<=i.highWaterMark,t=0):(i.length-=t,i.awaitDrain=0),0===i.length&&(i.ended||(i.needReadable=!0),n!==t)&&i.ended&&N(this),null!==e&&this.emit("data",e),e)},b.prototype._read=function(t){_(this,new l("_read()"))},b.prototype.pipe=function(i,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=i;break;case 1:r.pipes=[r.pipes,i];break;default:r.pipes.push(i)}r.pipesCount+=1,g("pipe count=%d opts=%j",r.pipesCount,t);t=(!t||!1!==t.end)&&i!==B.stdout&&i!==B.stderr?a:f;function s(t,e){g("onunpipe"),t===n&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,g("cleanup"),i.removeListener("close",c),i.removeListener("finish",d),i.removeListener("drain",o),i.removeListener("error",u),i.removeListener("unpipe",s),n.removeListener("end",a),n.removeListener("end",f),n.removeListener("data",l),h=!0,!r.awaitDrain||i._writableState&&!i._writableState.needDrain||o())}function a(){g("onend"),i.end()}r.endEmitted?B.nextTick(t):n.once("end",t),i.on("unpipe",s);e=n;var e,o=function(){var t=e._readableState;g("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&p(e,"data")&&(t.flowing=!0,O(e))},h=(i.on("drain",o),!1);function l(t){g("ondata");t=i.write(t);g("dest.write",t),!1===t&&((1===r.pipesCount&&r.pipes===i||1<r.pipesCount&&-1!==R(r.pipes,i))&&!h&&(g("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function u(t){g("onerror",t),f(),i.removeListener("error",u),0===p(i,"error")&&_(i,t)}function c(){i.removeListener("finish",d),f()}function d(){g("onfinish"),i.removeListener("close",c),f()}function f(){g("unpipe"),n.unpipe(i)}return n.on("data",l),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener(e,i);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]:t.on(e,i)}(i,"error",u),i.once("close",c),i.once("finish",d),i.emit("pipe",n),r.flowing||(g("pipe resume"),n.resume()),i},b.prototype.unpipe=function(t){var e=this._readableState,i={hasUnpiped:!1};if(0!==e.pipesCount)if(1===e.pipesCount)t&&t!==e.pipes||(t=t||e.pipes,e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,i));else if(t){var n=R(e.pipes,t);-1!==n&&(e.pipes.splice(n,1),--e.pipesCount,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,i))}else{var r=e.pipes,s=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var a=0;a<s;a++)r[a].emit("unpipe",this,{hasUnpiped:!1})}return this},b.prototype.addListener=b.prototype.on=function(t,e){var e=r.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=0<this.listenerCount("readable"),!1!==i.flowing&&this.resume()):"readable"!==t||i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,g("on readable",i.length,i.reading),i.length?k(this):i.reading||B.nextTick(L,this)),e},b.prototype.removeListener=function(t,e){e=r.prototype.removeListener.call(this,t,e);return"readable"===t&&B.nextTick(I,this),e},b.prototype.removeAllListeners=function(t){var e=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||B.nextTick(I,this),e},b.prototype.resume=function(){var t,e,i=this._readableState;return i.flowing||(g("resume"),i.flowing=!i.readableListening,t=this,(e=i).resumeScheduled)||(e.resumeScheduled=!0,B.nextTick(P,t,e)),i.paused=!1,this},b.prototype.pause=function(){return g("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(g("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},b.prototype.wrap=function(e){var t,i=this,n=this._readableState,r=!1;for(t in e.on("end",function(){var t;g("wrapped end"),n.decoder&&!n.ended&&(t=n.decoder.end())&&t.length&&i.push(t),i.push(null)}),e.on("data",function(t){g("wrapped data"),n.decoder&&(t=n.decoder.write(t)),n.objectMode&&null==t||(n.objectMode||t&&t.length)&&!i.push(t)&&(r=!0,e.pause())}),e)void 0===this[t]&&"function"==typeof e[t]&&(this[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t));for(var s=0;s<v.length;s++)e.on(v[s],this.emit.bind(this,v[s]));return this._read=function(t){g("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(b.prototype[Symbol.asyncIterator]=function(){return(t=void 0===t?z("./internal/streams/async_iterator"):t)(this)}),Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(b.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(b.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),b._fromList=M,Object.defineProperty(b.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(b.from=function(t,e){return(i=void 0===i?z("./internal/streams/from"):i)(b,t,e)})}.call(this)}.call(this,z("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":42,"./_stream_duplex":43,"./internal/streams/async_iterator":48,"./internal/streams/buffer_list":49,"./internal/streams/destroy":50,"./internal/streams/from":52,"./internal/streams/state":54,"./internal/streams/stream":55,_process:33,buffer:11,events:17,inherits:20,"string_decoder/":57,util:8}],46:[function(t,e,i){"use strict";e.exports=h;var e=t("../errors").codes,n=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,s=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=e.ERR_TRANSFORM_WITH_LENGTH_0,o=t("./_stream_duplex");function h(t){if(!(this instanceof h))return new h(t);o.call(this,t),this._transformState={afterTransform:function(t,e){var i=this._transformState,n=(i.transforming=!1,i.writecb);if(null===n)return this.emit("error",new r);i.writechunk=null,(i.writecb=null)!=e&&this.push(e),n(t),(i=this._readableState).reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush)&&(this._flush=t.flush),this.on("prefinish",l)}function l(){var i=this;"function"!=typeof this._flush||this._readableState.destroyed?u(this,null,null):this._flush(function(t,e){u(i,t,e)})}function u(t,e,i){if(e)return t.emit("error",e);if(null!=i&&t.push(i),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;t.push(null)}t("inherits")(h,o),h.prototype.push=function(t,e){return this._transformState.needTransform=!1,o.prototype.push.call(this,t,e)},h.prototype._transform=function(t,e,i){i(new n("_transform()"))},h.prototype._write=function(t,e,i){var n=this._transformState;n.writecb=i,n.writechunk=t,n.writeencoding=e,!n.transforming&&(i=this._readableState,n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)},h.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},h.prototype._destroy=function(t,e){o.prototype._destroy.call(this,t,function(t){e(t)})}},{"../errors":42,"./_stream_duplex":43,inherits:20}],47:[function(L,P,t){!function(T,I){!function(){"use strict";function c(s){var a=this;this.next=null,this.entry=null,this.finish=function(){var t=a,e=s,i=void 0,n=t.entry;for(t.entry=null;n;){var r=n.callback;e.pendingcb--,r(i),n=n.next}e.corkedRequestsFree.next=t}}(P.exports=w).WritableState=b;var i,t={deprecate:L("util-deprecate")},n=L("./internal/streams/stream"),l=L("buffer").Buffer,u=I.Uint8Array||function(){};var r,e=L("./internal/streams/destroy"),s=L("./internal/streams/state").getHighWaterMark,a=L("../errors").codes,d=a.ERR_INVALID_ARG_TYPE,o=a.ERR_METHOD_NOT_IMPLEMENTED,f=a.ERR_MULTIPLE_CALLBACK,h=a.ERR_STREAM_CANNOT_PIPE,p=a.ERR_STREAM_DESTROYED,g=a.ERR_STREAM_NULL_VALUES,m=a.ERR_STREAM_WRITE_AFTER_END,_=a.ERR_UNKNOWN_ENCODING,v=e.errorOrDestroy;function y(){}function b(t,u,e){i=i||L("./_stream_duplex"),t=t||{},"boolean"!=typeof e&&(e=u instanceof i),this.objectMode=!!t.objectMode,e&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=s(this,t,"writableHighWaterMark",e),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;e=(this.destroyed=!1)===t.decodeStrings;this.decodeStrings=!e,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){var e=u,i=e._writableState,n=i.sync,r=i.writecb;if("function"!=typeof r)throw new f;var s,a,o,h,l=i;l.writing=!1,l.writecb=null,l.length-=l.writelen,l.writelen=0,t?(l=e,a=n,o=t,h=r,--(s=i).pendingcb,a?(T.nextTick(h,o),T.nextTick(A,l,s),l._writableState.errorEmitted=!0,v(l,o)):(h(o),l._writableState.errorEmitted=!0,v(l,o),A(l,s))):((t=k(i)||e.destroyed)||i.corked||i.bufferProcessing||!i.bufferedRequest||C(e,i),n?T.nextTick(S,e,i,t,r):S(e,i,t,r))},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}L("inherits")(w,n),b.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e};try{Object.defineProperty(b.prototype,"buffer",{get:t.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}function w(t){var e=this instanceof(i=i||L("./_stream_duplex"));if(!e&&!r.call(w,this))return new w(t);this._writableState=new b(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final)&&(this._final=t.final),n.call(this)}function x(t,e,i,n,r,s,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new p("write")):i?t._writev(r,e.onwrite):t._write(r,s,e.onwrite),e.sync=!1}function S(t,e,i,n){var r;i||(i=t,0===(r=e).length&&r.needDrain&&(r.needDrain=!1,i.emit("drain"))),e.pendingcb--,n(),A(t,e)}function C(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){for(var n=e.bufferedRequestCount,r=new Array(n),n=e.corkedRequestsFree,s=(n.entry=i,0),a=!0;i;)(r[s]=i).isBuf||(a=!1),i=i.next,s+=1;r.allBuffers=a,x(t,e,!0,e.length,r,"",n.finish),e.pendingcb++,e.lastBufferedRequest=null,n.next?(e.corkedRequestsFree=n.next,n.next=null):e.corkedRequestsFree=new c(e),e.bufferedRequestCount=0}else{for(;i;){var o=i.chunk,h=i.encoding,l=i.callback;if(x(t,e,!1,e.objectMode?1:o.length,o,h,l),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function k(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(e,i){e._final(function(t){i.pendingcb--,t&&v(e,t),i.prefinished=!0,e.emit("prefinish"),A(e,i)})}function A(t,e){var i,n,r=k(e);return r&&(i=t,(n=e).prefinished||n.finalCalled||("function"!=typeof i._final||n.destroyed?(n.prefinished=!0,i.emit("prefinish")):(n.pendingcb++,n.finalCalled=!0,T.nextTick(E,i,n))),0===e.pendingcb)&&(e.finished=!0,t.emit("finish"),e.autoDestroy)&&(!(i=t._readableState)||i.autoDestroy&&i.endEmitted)&&t.destroy(),r}"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(r=Function.prototype[Symbol.hasInstance],Object.defineProperty(w,Symbol.hasInstance,{value:function(t){return!!r.call(this,t)||this===w&&t&&t._writableState instanceof b}})):r=function(t){return t instanceof this},w.prototype.pipe=function(){v(this,new h)},w.prototype.write=function(t,e,i){var n,r,s,a=this._writableState,o=!1,h=!a.objectMode&&(h=t,l.isBuffer(h)||h instanceof u);return h&&!l.isBuffer(t)&&(n=t,t=l.from(n)),"function"==typeof e&&(i=e,e=null),e=h?"buffer":e||a.defaultEncoding,"function"!=typeof i&&(i=y),a.ending?(n=this,r=i,s=new m,v(n,s),T.nextTick(r,s)):(h||function(t,e,i,n){var r;if(null===i?r=new g:"string"==typeof i||e.objectMode||(r=new d("chunk",["string","Buffer"],i)),!r)return 1;v(t,r),T.nextTick(n,r)}(this,a,t,i))&&(a.pendingcb++,o=function(t,e,i,n,r,s){i||(a=function(t,e,i){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,i));return e}(e,n,r),n!==a&&(i=!0,r="buffer",n=a));var a=e.objectMode?1:n.length,o=(e.length+=a,e.length<e.highWaterMark);o||(e.needDrain=!0);{var h;e.writing||e.corked?(h=e.lastBufferedRequest,e.lastBufferedRequest={chunk:n,encoding:r,isBuf:i,callback:s,next:null},h?h.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1):x(t,e,!1,a,n,r,s)}return o}(this,a,h,t,e,i)),o},w.prototype.cork=function(){this._writableState.corked++},w.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||C(this,t))},w.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase()))return this._writableState.defaultEncoding=t,this;throw new _(t)},Object.defineProperty(w.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),w.prototype._write=function(t,e,i){i(new o("_write()"))},w.prototype._writev=null,w.prototype.end=function(t,e,i){var n=this._writableState;if("function"==typeof t?(i=t,e=t=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),!n.ending){t=this,e=n,n=i;e.ending=!0,A(t,e),n&&(e.finished?T.nextTick(n):t.once("finish",n)),e.ended=!0,t.writable=!1}return this},Object.defineProperty(w.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(w.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),w.prototype.destroy=e.destroy,w.prototype._undestroy=e.undestroy,w.prototype._destroy=function(t,e){e(t)}}.call(this)}.call(this,L("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":42,"./_stream_duplex":43,"./internal/streams/destroy":50,"./internal/streams/state":54,"./internal/streams/stream":55,_process:33,buffer:11,inherits:20,"util-deprecate":60}],48:[function(n,m,t){!function(g){!function(){"use strict";var t;function i(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}var r=n("./end-of-stream"),s=Symbol("lastResolve"),a=Symbol("lastReject"),o=Symbol("error"),h=Symbol("ended"),l=Symbol("lastPromise"),u=Symbol("handlePromise"),c=Symbol("stream");function d(t,e){return{value:t,done:e}}function f(t){var e,i=t[s];null!==i&&null!==(e=t[c].read())&&(t[l]=null,t[s]=null,t[a]=null,i(d(e,!1)))}var e=Object.getPrototypeOf(function(){}),p=Object.setPrototypeOf((i(t={get stream(){return this[c]},next:function(){var i=this,t=this[o];if(null!==t)return Promise.reject(t);if(this[h])return Promise.resolve(d(void 0,!0));if(this[c].destroyed)return new Promise(function(t,e){g.nextTick(function(){i[o]?e(i[o]):t(d(void 0,!0))})});var e,n,r,t=this[l];if(t)e=new Promise((n=t,r=this,function(t,e){n.then(function(){r[h]?t(d(void 0,!0)):r[u](t,e)},e)}));else{t=this[c].read();if(null!==t)return Promise.resolve(d(t,!1));e=new Promise(this[u])}return this[l]=e}},Symbol.asyncIterator,function(){return this}),i(t,"return",function(){var t=this;return new Promise(function(e,i){t[c].destroy(null,function(t){t?i(t):e(d(void 0,!0))})})}),t),e);m.exports=function(t){var e,n=Object.create(p,(i(e={},c,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,o,{value:null,writable:!0}),i(e,h,{value:t._readableState.endEmitted,writable:!0}),i(e,u,{value:function(t,e){var i=n[c].read();i?(n[l]=null,n[s]=null,n[a]=null,t(d(i,!1))):(n[s]=t,n[a]=e)},writable:!0}),e));return n[l]=null,r(t,function(t){var e;t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code?(null!==(e=n[a])&&(n[l]=null,n[s]=null,n[a]=null,e(t)),n[o]=t):(null!==(e=n[s])&&(n[l]=null,n[s]=null,e(d(void 0,!(n[a]=null)))),n[h]=!0)}),t.on("readable",function(t){g.nextTick(f,t)}.bind(null,n)),n}}.call(this)}.call(this,n("_process"))},{"./end-of-stream":51,_process:33}],49:[function(t,e,i){"use strict";function s(e,t){var i,n=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)),n}function r(n){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach(function(t){var e,i;e=n,i=r[t=t],t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(r,t))})}return n}function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var o=t("buffer").Buffer,h=t("util").inspect,l=h&&h.custom||"inspect";e.exports=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}var e,i,n;return e=t,(i=[{key:"push",value:function(t){t={data:t,next:null};0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(t){t={data:t,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){var t;if(0!==this.length)return t=this.head.data,1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,i,n=o.allocUnsafe(t>>>0),r=this.head,s=0;r;)e=r.data,i=s,o.prototype.copy.call(e,n,i),s+=r.data.length,r=r.next;return n}},{key:"consume",value:function(t,e){var i;return t<this.head.data.length?(i=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):i=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,i=1,n=e.data;for(t-=n.length;e=e.next;){var r=e.data,s=t>r.length?r.length:t;if(s===r.length?n+=r:n+=r.slice(0,t),0===(t-=s)){s===r.length?(++i,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e).data=r.slice(s);break}++i}return this.length-=i,n}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),i=this.head,n=1;for(i.data.copy(e),t-=i.data.length;i=i.next;){var r=i.data,s=t>r.length?r.length:t;if(r.copy(e,e.length-t,0,s),0===(t-=s)){s===r.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i).data=r.slice(s);break}++n}return this.length-=n,e}},{key:l,value:function(t,e){return h(this,r({},e,{depth:0,customInspect:!1}))}}])&&a(e.prototype,i),n&&a(e,n),t}()},{buffer:11,util:8}],50:[function(t,e,i){!function(h){!function(){"use strict";function s(t,e){o(t,e),a(t)}function a(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function o(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var i=this,n=this._readableState&&this._readableState.destroyed,r=this._writableState&&this._writableState.destroyed;return n||r?e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,h.nextTick(o,this,t)):h.nextTick(o,this,t)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?i._writableState?i._writableState.errorEmitted?h.nextTick(a,i):(i._writableState.errorEmitted=!0,h.nextTick(s,i,t)):h.nextTick(s,i,t):e?(h.nextTick(a,i),e(t)):h.nextTick(a,i)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var i=t._readableState,n=t._writableState;i&&i.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}}.call(this)}.call(this,t("_process"))},{_process:33}],51:[function(t,e,i){"use strict";var _=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function v(){}e.exports=function t(e,i,n){var r,s,a,o,h,l,u,c,d,f,p,g,m;return"function"==typeof i?t(e,null,i):(r=n||v,s=!1,n=function(){if(!s){s=!0;for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];r.apply(this,e)}},a=(i=i||{}).readable||!1!==i.readable&&e.readable,o=i.writable||!1!==i.writable&&e.writable,h=function(){e.writable||u()},l=e._writableState&&e._writableState.finished,u=function(){l=!(o=!1),a||n.call(e)},c=e._readableState&&e._readableState.endEmitted,d=function(){c=!(a=!1),o||n.call(e)},f=function(t){n.call(e,t)},p=function(){var t;return a&&!c?(e._readableState&&e._readableState.ended||(t=new _),n.call(e,t)):o&&!l?(e._writableState&&e._writableState.ended||(t=new _),n.call(e,t)):void 0},g=function(){e.req.on("finish",u)},(m=e).setHeader&&"function"==typeof m.abort?(e.on("complete",u),e.on("abort",p),e.req?g():e.on("request",g)):o&&!e._writableState&&(e.on("end",h),e.on("close",h)),e.on("end",d),e.on("finish",u),!1!==i.error&&e.on("error",f),e.on("close",p),function(){e.removeListener("complete",u),e.removeListener("abort",p),e.removeListener("request",g),e.req&&e.req.removeListener("finish",u),e.removeListener("end",h),e.removeListener("close",h),e.removeListener("finish",u),e.removeListener("end",d),e.removeListener("error",f),e.removeListener("close",p)})}},{"../../../errors":42}],52:[function(t,e,i){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],53:[function(h,t,e){"use strict";var l;var i=h("../../../errors").codes,o=i.ERR_MISSING_ARGS,u=i.ERR_STREAM_DESTROYED;function c(t){if(t)throw t}function d(i,t,e,n){r=n,s=!1;var r,s,a=!(n=function(){s||(s=!0,r.apply(void 0,arguments))}),o=(i.on("close",function(){a=!0}),(l=void 0===l?h("./end-of-stream"):l)(i,{readable:t,writable:e},function(t){if(t)return n(t);a=!0,n()}),!1);return function(t){var e;if(!a&&!o)return o=!0,(e=i).setHeader&&"function"==typeof e.abort?i.abort():"function"==typeof i.destroy?i.destroy():void n(t||new u("pipe"))}}function f(t){t()}function p(t,e){return t.pipe(e)}t.exports=function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];var i,r,s=!(i=n).length||"function"!=typeof i[i.length-1]?c:i.pop();if((n=Array.isArray(n[0])?n[0]:n).length<2)throw new o("streams");var a=n.map(function(t,e){var i=e<n.length-1;return d(t,i,0<e,function(t){r=r||t,t&&a.forEach(f),i||(a.forEach(f),s(r))})});return n.reduce(p)}},{"../../../errors":42,"./end-of-stream":51}],54:[function(t,e,i){"use strict";var a=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,i,n){s=n,r=i;var r,s=null!=(e=e).highWaterMark?e.highWaterMark:s?e[r]:null;if(null==s)return t.objectMode?16:16384;if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new a(n?i:"highWaterMark",s);return Math.floor(s)}}},{"../../../errors":42}],55:[function(t,e,i){e.exports=t("events").EventEmitter},{events:17}],56:[function(t,e,i){(((i=e.exports=t("./lib/_stream_readable.js")).Stream=i).Readable=i).Writable=t("./lib/_stream_writable.js"),i.Duplex=t("./lib/_stream_duplex.js"),i.Transform=t("./lib/_stream_transform.js"),i.PassThrough=t("./lib/_stream_passthrough.js"),i.finished=t("./lib/internal/streams/end-of-stream.js"),i.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":43,"./lib/_stream_passthrough.js":44,"./lib/_stream_readable.js":45,"./lib/_stream_transform.js":46,"./lib/_stream_writable.js":47,"./lib/internal/streams/end-of-stream.js":51,"./lib/internal/streams/pipeline.js":53}],57:[function(t,e,i){"use strict";var n=t("safe-buffer").Buffer,r=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"==typeof e||n.isEncoding!==r&&r(t))return e||t;throw new Error("Unknown encoding: "+t)}function a(t){var e;switch(this.encoding=s(t),this.encoding){case"utf16le":this.text=l,this.end=u,e=4;break;case"utf8":this.fillLast=h,e=4;break;case"base64":this.text=c,this.end=d,e=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function h(t){var e,i=this.lastTotal-this.lastNeed,n=(e=this,128!=(192&(n=t)[0])?(e.lastNeed=0,"�"):1<e.lastNeed&&1<n.length?128!=(192&n[1])?(e.lastNeed=1,"�"):2<e.lastNeed&&2<n.length&&128!=(192&n[2])?(e.lastNeed=2,"�"):void 0:void 0);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,i,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,i,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1);e=t.toString("utf16le",e);if(e){var i=e.charCodeAt(e.length-1);if(55296<=i&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],e.slice(0,-1)}return e}function u(t){var e,t=t&&t.length?this.write(t):"";return this.lastNeed?(e=this.lastTotal-this.lastNeed,t+this.lastChar.toString("utf16le",0,e)):t}function c(t,e){var i=(t.length-e)%3;return 0==i?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,1==i?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}function d(t){t=t&&t.length?this.write(t):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}(i.StringDecoder=a).prototype.write=function(t){if(0===t.length)return"";var e,i;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""},a.prototype.end=function(t){t=t&&t.length?this.write(t):"";return this.lastNeed?t+"�":t},a.prototype.text=function(t,e){var i=function(t,e,i){var n=e.length-1;if(!(n<i)){var r=o(e[n]);if(0<=r)return 0<r&&(t.lastNeed=r-1),r;if(!(--n<i||-2===r)){if(0<=(r=o(e[n])))return 0<r&&(t.lastNeed=r-2),r;if(!(--n<i||-2===r)&&0<=(r=o(e[n])))return 0<r&&(2===r?r=0:t.lastNeed=r-3),r}}return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;i=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},a.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":37}],58:[function(t,e,i){"use strict";var S=t("punycode"),C=t("./util");function w(){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}i.parse=r,i.resolve=function(t,e){return r(t,!1,!0).resolve(e)},i.resolveObject=function(t,e){return t?r(t,!1,!0).resolveObject(e):e},i.format=function(t){C.isString(t)&&(t=r(t));return t instanceof w?t.format():w.prototype.format.call(t)},i.Url=w;var k=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,E=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,i=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),A=["'"].concat(i),T=["%","/","?",";","#"].concat(A),I=["/","?","#"],L=/^[+a-z0-9A-Z_-]{0,63}$/,P=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,O={javascript:!0,"javascript:":!0},M={javascript:!0,"javascript:":!0},N={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},R=t("querystring");function r(t,e,i){var n;return t&&C.isObject(t)&&t instanceof w?t:((n=new w).parse(t,e,i),n)}w.prototype.parse=function(t,e,i){if(!C.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),n=-1!==n&&n<t.indexOf("#")?"?":"#",r=t.split(n);r[0]=r[0].replace(/\\/g,"/");var s=(s=t=r.join(n)).trim();if(!i&&1===t.split("#").length){r=E.exec(s);if(r)return this.path=s,this.href=s,this.pathname=r[1],r[2]?(this.search=r[2],this.query=e?R.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var a,n=k.exec(s);if(n&&(a=(n=n[0]).toLowerCase(),this.protocol=a,s=s.substr(n.length)),!(i||n||s.match(/^\/\/[^@\/]+@[^@\/]+/))||!(b="//"===s.substr(0,2))||n&&M[n]||(s=s.substr(2),this.slashes=!0),!M[n]&&(b||n&&!N[n])){for(var o=-1,h=0;h<I.length;h++)-1!==(l=s.indexOf(I[h]))&&(-1===o||l<o)&&(o=l);-1!==(t=-1===o?s.lastIndexOf("@"):s.lastIndexOf("@",o))&&(r=s.slice(0,t),s=s.slice(t+1),this.auth=decodeURIComponent(r));for(var l,o=-1,h=0;h<T.length;h++)-1!==(l=s.indexOf(T[h]))&&(-1===o||l<o)&&(o=l);-1===o&&(o=s.length),this.host=s.slice(0,o),s=s.slice(o),this.parseHost(),this.hostname=this.hostname||"";i="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!i)for(var u=this.hostname.split(/\./),h=0,c=u.length;h<c;h++){var d=u[h];if(d&&!d.match(L)){for(var f="",p=0,g=d.length;p<g;p++)127<d.charCodeAt(p)?f+="x":f+=d[p];if(!f.match(L)){var m=u.slice(0,h),_=u.slice(h+1),v=d.match(P);v&&(m.push(v[1]),_.unshift(v[2])),_.length&&(s="/"+_.join(".")+s),this.hostname=m.join(".");break}}}255<this.hostname.length?this.hostname="":this.hostname=this.hostname.toLowerCase(),i||(this.hostname=S.toASCII(this.hostname));var y=this.port?":"+this.port:"",b=this.hostname||"";this.host=b+y,this.href+=this.host,i&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0])&&(s="/"+s)}if(!O[a])for(h=0,c=A.length;h<c;h++){var w,x=A[h];-1!==s.indexOf(x)&&((w=encodeURIComponent(x))===x&&(w=escape(x)),s=s.split(x).join(w))}n=s.indexOf("#"),-1!==n&&(this.hash=s.substr(n),s=s.slice(0,n)),t=s.indexOf("?");return-1!==t?(this.search=s.substr(t),this.query=s.substr(t+1),e&&(this.query=R.parse(this.query)),s=s.slice(0,t)):e&&(this.search="",this.query={}),s&&(this.pathname=s),N[a]&&this.hostname&&!this.pathname&&(this.pathname="/"),(this.pathname||this.search)&&(y=this.pathname||"",r=this.search||"",this.path=y+r),this.href=this.format(),this},w.prototype.format=function(){var t=this.auth||"",e=(t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@"),this.protocol||""),i=this.pathname||"",n=this.hash||"",r=!1,s="",t=(this.host?r=t+this.host:this.hostname&&(r=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port)&&(r+=":"+this.port),this.query&&C.isObject(this.query)&&Object.keys(this.query).length&&(s=R.stringify(this.query)),this.search||s&&"?"+s||"");return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||N[e])&&!1!==r?(r="//"+(r||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):r=r||"",n&&"#"!==n.charAt(0)&&(n="#"+n),t&&"?"!==t.charAt(0)&&(t="?"+t),e+r+(i=i.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(t=t.replace("#","%23"))+n},w.prototype.resolve=function(t){return this.resolveObject(r(t,!1,!0)).format()},w.prototype.resolveObject=function(t){C.isString(t)&&((d=new w).parse(t,!1,!0),t=d);for(var e=new w,i=Object.keys(this),n=0;n<i.length;n++){var r=i[n];e[r]=this[r]}if(e.hash=t.hash,""!==t.href)if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var o=s[a];"protocol"!==o&&(e[o]=t[o])}N[e.protocol]&&e.hostname&&!e.pathname&&(e.path=e.pathname="/")}else if(t.protocol&&t.protocol!==e.protocol)if(N[t.protocol]){if(e.protocol=t.protocol,t.host||M[t.protocol])e.pathname=t.pathname;else{for(var h=(t.pathname||"").split("/");h.length&&!(t.host=h.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),e.pathname=h.join("/")}e.search=t.search,e.query=t.query,e.host=t.host||"",e.auth=t.auth,e.hostname=t.hostname||t.host,e.port=t.port,(e.pathname||e.search)&&(d=e.pathname||"",f=e.search||"",e.path=d+f),e.slashes=e.slashes||t.slashes}else for(var l=Object.keys(t),u=0;u<l.length;u++){var c=l[u];e[c]=t[c]}else{var d=e.pathname&&"/"===e.pathname.charAt(0),f=t.host||t.pathname&&"/"===t.pathname.charAt(0),d=f||d||e.host&&t.pathname,p=d,g=e.pathname&&e.pathname.split("/")||[],h=t.pathname&&t.pathname.split("/")||[],m=e.protocol&&!N[e.protocol];if(m&&(e.hostname="",e.port=null,e.host&&(""===g[0]?g[0]=e.host:g.unshift(e.host)),e.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===h[0]?h[0]=t.host:h.unshift(t.host)),t.host=null),d=d&&(""===h[0]||""===g[0])),f)e.host=(t.host||""===t.host?t:e).host,e.hostname=(t.hostname||""===t.hostname?t:e).hostname,e.search=t.search,e.query=t.query,g=h;else if(h.length)(g=g||[]).pop(),g=g.concat(h),e.search=t.search,e.query=t.query;else if(!C.isNullOrUndefined(t.search))return m&&(e.hostname=e.host=g.shift(),b=!!(e.host&&0<e.host.indexOf("@"))&&e.host.split("@"))&&(e.auth=b.shift(),e.host=e.hostname=b.shift()),e.search=t.search,e.query=t.query,C.isNull(e.pathname)&&C.isNull(e.search)||(e.path=(e.pathname||"")+(e.search||"")),e.href=e.format(),e;if(g.length){for(var _=g.slice(-1)[0],f=(e.host||t.host||1<g.length)&&("."===_||".."===_)||""===_,v=0,y=g.length;0<=y;y--)"."===(_=g[y])?g.splice(y,1):".."===_?(g.splice(y,1),v++):v&&(g.splice(y,1),v--);if(!d&&!p)for(;v--;)g.unshift("..");!d||""===g[0]||g[0]&&"/"===g[0].charAt(0)||g.unshift(""),f&&"/"!==g.join("/").substr(-1)&&g.push("");var b,p=""===g[0]||g[0]&&"/"===g[0].charAt(0);m&&(e.hostname=e.host=!p&&g.length?g.shift():"",b=!!(e.host&&0<e.host.indexOf("@"))&&e.host.split("@"))&&(e.auth=b.shift(),e.host=e.hostname=b.shift()),(d=d||e.host&&g.length)&&!p&&g.unshift(""),g.length?e.pathname=g.join("/"):(e.pathname=null,e.path=null),C.isNull(e.pathname)&&C.isNull(e.search)||(e.path=(e.pathname||"")+(e.search||"")),e.auth=t.auth||e.auth,e.slashes=e.slashes||t.slashes}else e.pathname=null,e.search?e.path="/"+e.search:e.path=null}return e.href=e.format(),e},w.prototype.parseHost=function(){var t=this.host,e=n.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":59,punycode:10,querystring:36}],59:[function(t,e,i){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],60:[function(t,i,e){!function(e){!function(){function n(t){try{if(!e.localStorage)return}catch(t){return}t=e.localStorage[t];return null!=t&&"true"===String(t).toLowerCase()}i.exports=function(t,e){if(n("noDeprecation"))return t;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],61:[function(t,e,i){e.exports=function(){for(var t={},e=0;e<arguments.length;e++){var i,n=arguments[e];for(i in n)r.call(n,i)&&(t[i]=n[i])}return t};var r=Object.prototype.hasOwnProperty},{}],62:[function(u,c,t){!function(l){!function(){"use strict";const e=u("https");var t=u("@tarekraafat/autocomplete.js");let s={};var i="#search-id";let r=10;const a=document.querySelector(i),n=()=>{let r={};return new Promise((i,n)=>{var t=a.getAttribute("data-npc");t||i([]),e.get(t,t=>{let e=[];t.on("data",t=>{e.push(t)}),t.on("error",t=>n(t)),t.on("end",()=>{JSON.parse(l.concat(e).toString()).forEach(t=>{r[t.loc]||(r[t.loc]=[]),r[t.loc].push(t.name),s[t.name]=s[t.name]&&-1==s[t.name].indexOf(t.loc)?s[t.name].concat([t.loc]):[t.loc]}),i(r)})})})};let o,h=(o=new t({selector:i,data:{src:async()=>{await n();let t=Object.keys(s);return t=t.map(t=>({value:s[t],text:t}))},keys:["text"],cache:!0},resultItem:{tag:"a",class:"dropdown-item",selected:"active",highlight:!0},resultsList:{tag:"div",class:"npc-autocomplete dropdown-menu show",maxResults:void 0,destination:"#search .advancedAutoComplete"},submit:!1}),!0);document.querySelector(i).addEventListener("selection",function(t){t.detail.selection.value instanceof Function?t.detail.selection.value():(t.detail.selection.value&&(a.value=t.detail.selection.value.value),a.form.requestSubmit())}),document.querySelector(i).addEventListener("keyup",t=>{13==t.keyCode&&(h&&o.select(0),""===a.value.trim()||isNaN(a.value)||a.form.requestSubmit())}),document.querySelector(i).addEventListener("navigate",t=>{h=!1}),document.querySelector(i).addEventListener("results",function(n){let t=n.detail.results;var e=t.length;0<e&&(t.sort((t,e)=>{var t=t.value.text.toLowerCase(),e=e.value.text.toLowerCase(),i=n.detail.query.toLowerCase();return t.startsWith(i)&&!e.startsWith(i)?-1:!t.startsWith(n.detail.query)&&e.startsWith(i)?1:t.localeCompare(e)}),t=t.slice(0,r),e>r)&&t.push({value:function(){var t=r+10;o.start(),r=t},match:"Więcej..."}),n.detail.results=t}),a.addEventListener("input",t=>{r=10}),c.exports={downloadNpc:n,findNpc:t=>{return null!=(t=s[t])&&t}}}.call(this)}.call(this,u("buffer").Buffer)},{"@tarekraafat/autocomplete.js":4,buffer:11,https:18}],63:[function(t,e,i){"use strict";t("paper");e.exports={Preview:class{constructor(t,e){this.map=t,this.preview=document.querySelector(".preview-container"),this.previewImgContainer=document.querySelector(".preview"),this.previewImg=document.querySelector(".preview-img"),this.previewPanContainer=document.querySelector(".preview-pan-container"),this.previewPan=document.querySelector(".preview-pan"),this.pageControls=e}init(t){return this.controls=t,this.view=t.renderer.paper.view,window.view=this.view,this.backgroundLayer=t.renderer.backgroundLayer,window.pv=this,window.backgroundLayer=this.backgroundLayer,this.baseBounds={left:this.view.bounds.left,top:this.view.bounds.top},new Promise((i,t)=>{setTimeout(()=>{var t=this.view.size.width/this.backgroundLayer.bounds.width,e=this.view.size.height/this.backgroundLayer.bounds.height;this.view.size.width>this.view.size.height?(this.previewImg.style.maxWidth=100*t+"%",this.previewImg.style.maxHeight="100%"):(this.previewImg.style.maxWidth="100%",this.previewImg.style.maxHeight=100*e+"%"),this.previewImg.setAttribute("src",this.map.toDataURL()),this.previewImg.addEventListener("load",()=>{this.previewPanContainer.style.width=this.previewImg.width+"px",this.previewPanContainer.style.height=this.previewImg.height+"px",this.update(),i()},{once:!0}),this.preview.style.opacity=0,this.previewImgContainer.style.background=this.controls.renderer.settings.mapBackground,this.previewImg.style.background=this.controls.renderer.settings.mapBackground},10)})}update(){var t;this.pageControls.settings.preview&&(this.preview.style.opacity=1,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.preview.style.opacity=0,4e3),t=this.view.minZoom/this.view.zoom,this.previewPan.style.width=100*t+"%",this.previewPan.style.height=100*t+"%",this.previewPan.style.left=-((this.baseBounds.left-this.view.bounds.left)/this.view.bounds.width)*(100*t)+"%",this.previewPan.style.top=-((this.baseBounds.top-this.view.bounds.top)/this.view.bounds.height)*(100*t)+"%")}}}},{paper:32}],64:[function(t,e,i){!function(s){!function(){"use strict";const r=t("https");e.exports={downloadVersion:(t,e)=>new Promise((i,n)=>{r.get(e.replace("%tag%",t),t=>{let e=[];t.on("data",t=>{e.push(t)}),t.on("error",t=>n(t)),t.on("end",()=>{var t=JSON.parse(s.concat(e).toString());i(t)})})}),downloadTags:t=>new Promise((i,n)=>{r.get(t,t=>{let e=[];t.on("data",t=>{e.push(t)}),t.on("error",t=>n(t)),t.on("end",()=>{var t=JSON.parse(s.concat(e).toString());i(t)})})})}}.call(this)}.call(this,t("buffer").Buffer)},{buffer:11,https:18}]},{},[1]);
|