@mapgis/webclient-vue-cesium 17.4.0 → 17.4.2

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.
@@ -1120,7 +1120,7 @@ e["default"]=r["a"].defineLocale("uz",{months:"январ_феврал_март_
1120
1120
  * onFinally(hasChanged, hasNativeSupport, benchmark)
1121
1121
  * });
1122
1122
  */
1123
- function _At(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="cssVars(): ",n=Wgt({},pAt,t);function r(t,r,i,o){!n.silent&&window.console&&console.error("".concat(e).concat(t,"\n"),r),n.onError(t,r,i,o)}function i(t){!n.silent&&window.console&&console.warn("".concat(e).concat(t)),n.onWarning(t)}function o(t){n.onFinally(Boolean(t),dAt,kAt()-n.__benchmark)}if(hAt){if(n.watch)return n.watch=pAt.watch,xAt(n),void _At(n);if(!1===n.watch&&vAt&&(vAt.disconnect(),vAt=null),!n.__benchmark){if(AAt===n.rootElement)return void SAt(t);var a=[].slice.call(n.rootElement.querySelectorAll('[data-cssvars]:not([data-cssvars="out"])'));if(n.__benchmark=kAt(),n.exclude=[vAt?'[data-cssvars]:not([data-cssvars=""])':'[data-cssvars="out"]',"link[disabled]:not([data-cssvars])",n.exclude].filter((function(t){return t})).join(","),n.variables=LAt(n.variables),a.forEach((function(t){var e="style"===t.nodeName.toLowerCase()&&t.__cssVars.text,n=e&&t.textContent!==t.__cssVars.text;e&&n&&(t.sheet&&(t.sheet.disabled=!1),t.setAttribute("data-cssvars",""))})),!vAt){var s=[].slice.call(n.rootElement.querySelectorAll('[data-cssvars="out"]'));s.forEach((function(t){var e=t.getAttribute("data-cssvars-group"),r=e?n.rootElement.querySelector('[data-cssvars="src"][data-cssvars-group="'.concat(e,'"]')):null;r||t.parentNode.removeChild(t)})),yAt&&a.length<yAt&&(yAt=a.length,gAt.dom={})}}if("loading"!==document.readyState)if(dAt&&n.onlyLegacy){var c=!1;if(n.updateDOM){var u=n.rootElement.host||(n.rootElement===document?document.documentElement:n.rootElement);Object.keys(n.variables).forEach((function(t){var e=n.variables[t];c=c||e!==getComputedStyle(u).getPropertyValue(t),u.style.setProperty(t,e)}))}o(c)}else!wAt&&(n.shadowDOM||n.rootElement.shadowRoot||n.rootElement.host)?qgt({rootElement:pAt.rootElement,include:pAt.include,exclude:n.exclude,skipDisabled:!1,onSuccess:function(t,e,n){var r=(e.sheet||{}).disabled&&!e.__cssVars;return!r&&(t=t.replace(mAt.cssComments,"").replace(mAt.cssMediaQueries,""),t=(t.match(mAt.cssVarDeclRules)||[]).join(""),t||!1)},onComplete:function(t,e,r){rAt(t,{store:gAt.dom,onWarning:i}),wAt=!0,_At(n)}}):(AAt=n.rootElement,qgt({rootElement:n.rootElement,include:n.include,exclude:n.exclude,skipDisabled:!1,onBeforeSend:n.onBeforeSend,onError:function(t,e,n){var i=t.responseURL||TAt(n,location.href),o=t.statusText?"(".concat(t.statusText,")"):"Unspecified Error"+(0===t.status?" (possibly CORS related)":""),a="CSS XHR Error: ".concat(i," ").concat(t.status," ").concat(o);r(a,e,t,i)},onSuccess:function(t,e,r){var i=(e.sheet||{}).disabled&&!e.__cssVars;if(i)return!1;var o="link"===e.nodeName.toLowerCase(),a="style"===e.nodeName.toLowerCase()&&t!==e.textContent,s=n.onSuccess(t,e,r);return t=void 0!==s&&!1===Boolean(s)?"":s||t,n.updateURLs&&(o||a)&&(t=MAt(t,r)),t},onComplete:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=Wgt({},gAt.dom,gAt.user),c=!1;if(gAt.job={},a.forEach((function(t,o){var a=e[o];if(t.__cssVars=t.__cssVars||{},t.__cssVars.text=a,mAt.cssVars.test(a))try{var s=nAt(a,{preserveStatic:n.preserveStatic,removeComments:!0});rAt(s,{parseHost:Boolean(n.rootElement.host),store:gAt.dom,onWarning:i}),t.__cssVars.tree=s}catch(c){r(c.message,t)}})),Wgt(gAt.job,gAt.dom),n.updateDOM?(Wgt(gAt.user,n.variables),Wgt(gAt.job,gAt.user)):(Wgt(gAt.job,gAt.user,n.variables),Wgt(s,n.variables)),c=fAt.job>0&&Boolean(Object.keys(gAt.job).length>Object.keys(s).length||Boolean(Object.keys(s).length&&Object.keys(gAt.job).some((function(t){return gAt.job[t]!==s[t]})))),c)EAt(n.rootElement),_At(n);else{var u=[],l=[],h=!1;if(n.updateDOM&&fAt.job++,a.forEach((function(t,o){var a=!t.__cssVars.tree;if(t.__cssVars.tree)try{cAt(t.__cssVars.tree,Wgt({},n,{variables:gAt.job,onWarning:i}));var s=iAt(t.__cssVars.tree);if(n.updateDOM){var c=e[o],d=mAt.cssVarFunc.test(c);if(t.getAttribute("data-cssvars")||t.setAttribute("data-cssvars","src"),s.length&&d){var f=t.getAttribute("data-cssvars-group")||++fAt.group,p=s.replace(/\s/g,""),m=n.rootElement.querySelector('[data-cssvars="out"][data-cssvars-group="'.concat(f,'"]'))||document.createElement("style");h=h||mAt.cssKeyframes.test(s),n.preserveStatic&&t.sheet&&(t.sheet.disabled=!0),m.hasAttribute("data-cssvars")||m.setAttribute("data-cssvars","out"),p===t.textContent.replace(/\s/g,"")?(a=!0,m&&m.parentNode&&(t.removeAttribute("data-cssvars-group"),m.parentNode.removeChild(m))):p!==m.textContent.replace(/\s/g,"")&&([t,m].forEach((function(t){t.setAttribute("data-cssvars-job",fAt.job),t.setAttribute("data-cssvars-group",f)})),m.textContent=s,u.push(s),l.push(m),m.parentNode||t.parentNode.insertBefore(m,t.nextSibling))}}else t.textContent.replace(/\s/g,"")!==s&&u.push(s)}catch(g){r(g.message,t)}a&&t.setAttribute("data-cssvars","skip"),t.hasAttribute("data-cssvars-job")||t.setAttribute("data-cssvars-job",fAt.job)})),yAt=n.rootElement.querySelectorAll('[data-cssvars]:not([data-cssvars="out"])').length,n.shadowDOM)for(var d,f=[].concat(n.rootElement).concat([].slice.call(n.rootElement.querySelectorAll("*"))),p=0;d=f[p];++p)if(d.shadowRoot&&d.shadowRoot.querySelector("style")){var m=Wgt({},n,{rootElement:d.shadowRoot});_At(m)}n.updateDOM&&h&&CAt(n.rootElement),AAt=!1,n.onComplete(u.join(""),l,JSON.parse(JSON.stringify(gAt.job)),kAt()-n.__benchmark),o(l.length)}}}));else document.addEventListener("DOMContentLoaded",(function e(n){_At(t),document.removeEventListener("DOMContentLoaded",e)}))}}function xAt(t){function e(t){var e=n(t)&&t.hasAttribute("disabled"),r=(t.sheet||{}).disabled;return e||r}function n(t){var e="link"===t.nodeName.toLowerCase()&&-1!==(t.getAttribute("rel")||"").indexOf("stylesheet");return e}function r(t){return"style"===t.nodeName.toLowerCase()}function i(r){var i=!1;if("attributes"===r.type&&n(r.target)&&!e(r.target)){var o="disabled"===r.attributeName,a="href"===r.attributeName,s="skip"===r.target.getAttribute("data-cssvars"),c="src"===r.target.getAttribute("data-cssvars");o?i=!s&&!c:a&&(s?r.target.setAttribute("data-cssvars",""):c&&EAt(t.rootElement,!0),i=!0)}return i}function o(t){var e=!1;if("childList"===t.type){var n=r(t.target),i="out"===t.target.getAttribute("data-cssvars");e=n&&!i}return e}function a(t){var i=!1;return"childList"===t.type&&(i=[].slice.call(t.addedNodes).some((function(t){var i=1===t.nodeType,o=i&&t.hasAttribute("data-cssvars"),a=r(t)&&mAt.cssVars.test(t.textContent),s=!o&&(n(t)||a);return s&&!e(t)}))),i}function s(e){var n=!1;return"childList"===e.type&&(n=[].slice.call(e.removedNodes).some((function(e){var n=1===e.nodeType,r=n&&"out"===e.getAttribute("data-cssvars"),i=n&&"src"===e.getAttribute("data-cssvars"),o=i;if(i||r){var a=e.getAttribute("data-cssvars-group"),s=t.rootElement.querySelector('[data-cssvars-group="'.concat(a,'"]'));i&&EAt(t.rootElement,!0),s&&s.parentNode.removeChild(s)}return o}))),n}window.MutationObserver&&(vAt&&(vAt.disconnect(),vAt=null),vAt=new MutationObserver((function(e){var n=e.some((function(t){return i(t)||o(t)||a(t)||s(t)}));n&&_At(t)})),vAt.observe(document.documentElement,{attributes:!0,attributeFilter:["disabled","href"],childList:!0,subtree:!0}))}function SAt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;clearTimeout(bAt),bAt=setTimeout((function(){t.__benchmark=null,_At(t)}),e)}function CAt(t){var e=["animation-name","-moz-animation-name","-webkit-animation-name"].filter((function(t){return getComputedStyle(document.body)[t]}))[0];if(e){for(var n=[].slice.call(t.querySelectorAll("*")),r=[],i="__CSSVARSPONYFILL-KEYFRAMES__",o=0,a=n.length;o<a;o++){var s=n[o],c=getComputedStyle(s)[e];"none"!==c&&(s.style[e]+=i,r.push(s))}document.body.offsetHeight;for(var u=0,l=r.length;u<l;u++){var h=r[u].style;h[e]=h[e].replace(i,"")}}}function MAt(t,e){var n=t.replace(mAt.cssComments,"").match(mAt.cssUrls)||[];return n.forEach((function(n){var r=n.replace(mAt.cssUrls,"$1"),i=TAt(r,e);t=t.replace(n,n.replace(r,i))})),t}function LAt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=/^-{2}/;return Object.keys(t).reduce((function(n,r){var i=e.test(r)?r:"--".concat(r.replace(/^-+/,""));return n[i]=t[r],n}),{})}function TAt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.href,n=document.implementation.createHTMLDocument(""),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),r.href=e,i.href=t,i.href}function kAt(){return hAt&&(window.performance||{}).now?window.performance.now():(new Date).getTime()}function EAt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[].slice.call(t.querySelectorAll('[data-cssvars="skip"],[data-cssvars="src"]'));n.forEach((function(t){return t.setAttribute("data-cssvars","")})),e&&(gAt.dom={})}_At.reset=function(){for(var t in fAt.job=0,fAt.group=0,AAt=!1,vAt&&(vAt.disconnect(),vAt=null),yAt=0,bAt=null,wAt=!1,gAt)gAt[t]={}};Ugt&&Ugt[1],Qgt&&Qgt[0];var OAt="undefined"!==typeof window;OAt&&window.CSS&&window.CSS.supports&&window.CSS.supports("(--a: 0)");function PAt(t,e){if(!t)return t;var n=.65,r=Ggt()(t),i=r.getAlpha();r.setAlpha(i*e/n);var o=r.toRgbString();return o}var BAt,IAt,DAt={name:"Theme",props:{background:String,textColor:String,colorGroup:Array},data:function(){return{backgroundData:"",textColorsData:"",collapseCardBackgroundData:"",collapseCardHeaderBgData:"",tablePopupBgData:"",colorGroupsData:[]}},created:function(){this.initThemeData(),this.registerPropListener()},mounted:function(){var t=this;Vgt.$on("change-theme",(function(e){var n=t.getSelfProps();n.forEach((function(n){var r=t.getDataNameOfProp(n);t[r]=e[n]})),t.collapseCardHeaderBgData=e["collapseCardHeaderBg"],t.collapseCardBackgroundData=e["collapseCardBackground"],t.tablePopupBgData=e["messageBackground"],t.$emit("themeStyleChanged")}))},methods:{getBackgroundStyle:function(){return{background:this.backgroundData}},collapseCardBackgroundStyle:function(){return{background:this.collapseCardBackgroundData}},collapseCardHeaderBgStyle:function(){return{background:this.collapseCardHeaderBgData}},tablePopupBgStyle:function(){return{background:this.tablePopupBgData}},getTextColorStyle:function(){return{color:this.textColorsData}},headingTextColorStyle:function(){return{color:PAt(this.textColorsData,.85)}},secondaryTextColorStyle:function(){return{color:PAt(this.textColorsData,.45)}},disabledTextColorStyle:function(){return{color:PAt(this.textColorsData,.25)}},getBackground:function(){return this.backgroundData},getTextColor:function(){return this.textColorsData},getColorStyle:function(){return function(t){return{color:this.colorGroupsData[t]}}},getColor:function(){return function(t){return this.colorGroupsData[t]}},initThemeData:function(){var t=this,e=Vgt.$options.theme||{},n=this.getSelfProps();n.forEach((function(n){var r=t.getDataNameOfProp(n);t[r]=t[n]||e[n]})),this.collapseCardHeaderBgData=this.background||e["collapseCardHeaderBg"],this.collapseCardBackgroundData=this.background||e["collapseCardBackground"],this.tablePopupBgData=this.background||e["messageBackground"]},registerPropListener:function(){var t=this,e=Vgt.$options.theme||{},n=this,r=this.getSelfProps();r.forEach((function(r){t.$watch(r,(function(t){var i=this.getDataNameOfProp(r);n[i]=t,"background"===r&&(n.collapseCardBackgroundData=t||e["collapseCardBackground"],n.collapseCardHeaderBgData=t||e["collapseCardHeaderBg"],n.tablePopupBgData=t||e["messageBackground"])}))}))},getSelfProps:function(){return Object.keys(this.$props)},getDataNameOfProp:function(t){switch(t){case"textColor":return"textColorsData";case"colorGroup":return"colorGroupsData";default:return"".concat(t,"Data")}}}},NAt={closable:kgt.bool.def(!0),destroyOnClose:kgt.bool,getContainer:kgt.any,maskClosable:kgt.bool.def(!0),mask:kgt.bool.def(!0),maskStyle:kgt.object,wrapStyle:kgt.object,bodyStyle:kgt.object,headerStyle:kgt.object,drawerStyle:kgt.object,title:kgt.any,visible:kgt.bool,width:kgt.oneOfType([kgt.string,kgt.number]).def(256),height:kgt.oneOfType([kgt.string,kgt.number]).def(256),zIndex:kgt.number,prefixCls:kgt.string,placement:kgt.oneOf(["top","right","bottom","left"]).def("right"),level:kgt.any.def(null),wrapClassName:kgt.string,handle:kgt.any,afterVisibleChange:kgt.func,keyboard:kgt.bool.def(!0)},FAt={name:"mapgis-ui-drawer",wrapperUI:lgt,mixins:[zgt,DAt],inheritAttrs:!1,props:NAt,methods:{}},jAt=FAt,RAt=je(jAt,BAt,IAt,!1,null,null,null);RAt.exports;function HAt(t){return HAt="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},HAt(t)}function zAt(t){return GAt(t)||YAt(t)||VAt(t)||UAt()}function UAt(){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 VAt(t,e){if(t){if("string"==typeof t)return QAt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?QAt(t,e):void 0}}function YAt(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function GAt(t){if(Array.isArray(t))return QAt(t)}function QAt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function WAt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */WAt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof A?e:A,a=Object.create(o.prototype),s=new E(r||[]);return i(a,"_invoke",{value:M(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function A(){}function v(){}function y(){}var b={};u(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(O([])));_&&_!==n&&r.call(_,a)&&(b=_);var x=y.prototype=A.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(i,o,a,s){var c=h(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==HAt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function M(e,n,r){var i=d;return function(o,a){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var u=h(e,n,r);if("normal"===u.type){if(i=r.done?m:f,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(HAt(e)+" is not iterable")}return v.prototype=y,i(x,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(C.prototype),u(C.prototype,s,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new C(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),u(x,c,"Generator"),u(x,a,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function KAt(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function qAt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){KAt(o,r,i,a,s,"next",t)}function s(t){KAt(o,r,i,a,s,"throw",t)}a(void 0)}))}}function XAt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $At(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?XAt(Object(n),!0).forEach((function(e){JAt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):XAt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function JAt(t,e,n){return(e=ZAt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ZAt(t){var e=tvt(t,"string");return"symbol"==HAt(e)?e:e+""}function tvt(t,e){if("object"!=HAt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=HAt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var evt={type:"FeatureCollection",dataCount:2,features:[{type:"Feature",properties:{oid:1,AREA:0}},{type:"Feature",properties:{oid:2,AREA:1}}]},nvt={name:"mapgis-3d-explosion-analysis",inject:["Cesium","vueCesium","viewer"],mixins:[Tr],props:$At($At({},ln),{},{layout:{type:String,default:"vertical"},models:{type:Array,default:function(){return[]}},setting:{type:Object,default:function(){return{groupType:"MapgisUiExplosionUnique",explosionField:"oid",distance:1}}}}),computed:{rangeFormOptions:function(){return[{id:this.vueIndex,type:this.settingCopy.groupType,props:{size:"small",field:this.settingCopy.explosionField,dataSource:this.dataSource||evt,segments:this.segments},customProps:{showBorder:!1}}]}},data:function(){return{settingCopy:{groupType:"MapgisUiExplosionUnique",explosionField:"oid",distance:1e3},groupTypes:[{label:"单值",value:"MapgisUiExplosionUnique"},{label:"分段",value:"MapgisUiExplosionRange"}],currentModelId:void 0,explosionFields:[],dataSource:void 0,openAdvancedSetting:!1,disableGroupTypeChange:!1,segments:5,info:"爆炸距离默认值为模型包围盒高度/2。爆炸方向默认为垂直方向。要素平移距离默认值=(要素中心点高程-索引号最小的要素中心点高程)*爆炸距离。"}},watch:{models:{handler:function(t){this.currentModelId=void 0},deep:!0},setting:{handler:function(t){this.settingCopy=JSON.parse(JSON.stringify(t))},deep:!0,immediate:!0}},created:function(){},mounted:function(){this.mount()},destroyed:function(){this.unmount()},methods:{createCesiumObject:function(){var t=qAt(WAt().mark((function t(){return WAt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.baseUrl,this.options,t.abrupt("return",new Promise((function(t){t()}),(function(t){})));case 2:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),mount:function(){this.Cesium,this.viewer;var t=this.vueCesium,e=this.vueKey,n=this.vueIndex,r=this,i=this.createCesiumObject();i.then((function(i){r.$emit("load",r),t.ExplosionManager.addSource(e,n,i,{modelExplosionTool:void 0,m3dSet:void 0})}))},unmount:function(){this.removeExplosion();var t=this.vueCesium,e=this.vueKey,n=this.vueIndex;t.ExplosionManager.findSource(e,n);t.ExplosionManager.deleteSource(e,n),this.$emit("unload",this)},_m3dIsReady:function(){var t=this,e=this.vueKey,n=this.currentModelId;return new Promise((function(r,i){n.length>0?t.$_getAll3DTileSetArray((function(t){t&&t.length>0?r(t):i(null)}),e,n):i(null)}))},onExplosionFieldChange:function(t){if(this.explosionFields){var e=this.explosionFields.find((function(e){return e.name===t})),n=e.type;this.dataSource.dataCount<3||"string"===n.toLowerCase()?this.disableGroupTypeChange=!0:this.disableGroupTypeChange=!1}},onSelectedModelChange:function(t){var e=this,n=this.Cesium,r=this.vueCesium,i=this.vueKey,o=this.vueIndex;this.removeExplosion(),r.ExplosionManager.changeOptions(i,o,"modelExplosionTool",void 0),r.ExplosionManager.changeOptions(i,o,"m3dSet",void 0),this.currentModelId=t;var a=this.models.find((function(e){return e.id===t})),s=a.url,c=a.searchParams;if(c&&c.searchName){var u=new URL(s),l=u.origin;this.getFields({domain:l,searchParams:c})}this._m3dIsReady().then((function(t){if(t&&t.length>0){var a=new n.ModelExplosion(viewer);r.ExplosionManager.changeOptions(i,o,"modelExplosionTool",a),r.ExplosionManager.changeOptions(i,o,"m3dSet",t);var s=t[0],c=s._root.boundingVolume.minimumHeight,u=s._root.boundingVolume.maximumHeight;e.settingCopy.distance=Math.ceil((u-c)/2),e.getDataSource()}}))},getM3DFeatures:function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(r.children&&r.children.length>0){var i=this.getM3DFeatures(r.children);e=[].concat(zAt(e),zAt(i))}else for(var o=r.content._attMap._obj,a=r._boundingVolume.minimumHeight,s=r._boundingVolume.maximumHeight,c=Object.keys(o),u=0;u<c.length;u++){var l={type:"Feature",id:c[u],centerHeight:(a+s)/2,properties:o[c[u]]};e.push(l)}}return e},getFields:function(){var t=qAt(WAt().mark((function t(e){var n,r,i,o,a;return WAt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.domain,r=e.searchParams,i=r.searchName,r.searchServiceType,o={domain:n,url:i,pageCount:99999,page:0,returnGeometry:!0},t.next=6,Kf.igsQueryResourceServer(o);case 6:return this.geoJSONData=t.sent,a=this.geoJSONData.fields,this.explosionFields=a,this.settingCopy.explosionField=a[0].name,this.getDataSource(),this.onExplosionFieldChange(a[0].name),t.abrupt("return",a);case 13:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),getDataSource:function(){var t,e=this,n=this.vueCesium,r=this.vueKey,i=this.vueIndex,o=n.ExplosionManager.findSource(r,i);o&&o.options&&(t=o.options.m3dSet);var a=this.models.find((function(t){return t.id===e.currentModelId})),s=a.searchParams;if((!s||!s.searchName)&&t&&t.length>0){var c=t[0],u=this.getM3DFeatures(c._root.children);u.sort((function(t,e){return t.id-e.id}));for(var l=0,h=[],d=[],f=0;f<u.length;f++){var p=u[f],m=void 0;if(0===f){l=p.centerHeight,m="0, 0, 0";for(var g=p.properties,A=Object.keys(g),v=0;v<A.length;v++){var y={type:HAt(g[A[v]]),name:A[v]};d.push(y)}}else m="0,0,".concat((p.centerHeight-l)*this.settingCopy.distance);h.push({type:p.type,properties:p.properties,direction:m,id:p.id})}this.dataSource={type:"FeatureCollection",dataCount:h.length,features:h},JSON.stringify(this.explosionFields)!==JSON.stringify(d)&&(this.explosionFields=d,this.settingCopy.explosionField=d[0].name,this.onExplosionFieldChange(this.explosionFields[0].name))}else if(this.geoJSONData){var b=this.geoJSONData.features,w=[],_=0;b[0].attributes&&b[0].attributes.FID&&b.sort((function(t,e){return t.attributes.FID-e.attributes.FID}));for(var x=0;x<b.length;x++){var S=b[x],C=S.attributes,M=S.bound,L=M.zmin,T=M.zmax,k=void 0,E=(L+T)/2;if(0===x)_=E,k="0, 0, 0";else{var O=Number((E-_).toFixed(2));0===O&&(O=.1),k="0,0,".concat(O*this.settingCopy.distance)}w.push({type:"Feature",properties:C,bound:M,direction:k,id:void 0!==C.FID?C.FID:x})}this.dataSource={type:"FeatureCollection",dataCount:b.length,features:w}}},explosion:function(){var t,e,n=this,r=(this.Cesium,this.vueCesium),i=this.vueKey,o=this.vueIndex,a=this.settingCopy,s=(a.groupType,a.explosionField,r.ExplosionManager.findSource(i,o));if(s&&s.options&&(t=s.options.modelExplosionTool,e=s.options.m3dSet),e&&e.length>0){var c=n.getValueGroups();t.explosionByField(e,{valueGroups:c,type:"unique",field:"oid",singleDirection:!1,enableFrameFunction:!0})}},getValueGroups:function(){var t=[],e=this.$refs.rangeForm.$_getForm(),n=e[this.vueIndex],r=this.settingCopy.explosionField,i=[];if("MapgisUiExplosionRange"===this.settingCopy.groupType){for(var o=this.dataSource.features,a=0;a<o.length;a++)if(""!==o[a].properties[r]&&null!==o[a].properties[r]&&void 0!==o[a].properties[r]){var s={};s[r]=o[a].properties[r],s.direction=o[a].direction,s.id=o[a].id,i.push(s)}i.sort((function(t,e){return t[r]-e[r]}))}for(var c=0;c<n.length;c+=1){var u=n[c].direction,l=u.split(",");switch(u=new Cesium.Cartesian3(Number(l[0]),Number(l[1]),Number(l[2])),this.settingCopy.groupType){case"MapgisUiExplosionUnique":var h=Number(n[c].id);t.push({value:h,direction:u});break;case"MapgisUiExplosionRange":for(var d=n[c],f=d.start,p=d.end,m=0;m<i.length;m++)if(i[m][r]>=f&&i[m][r]<=p){var g=i[m].id;t.push({value:g,direction:u})}break;default:break}}return t},removeExplosion:function(){var t,e=this.vueCesium,n=this.vueKey,r=this.vueIndex,i=e.ExplosionManager.findSource(n,r);i&&i.options&&i.options.modelExplosionTool&&(t=i.options.modelExplosionTool,t._fieldM3DSets&&t._fieldM3DSets.length>0&&t._fieldM3DSets[0].ready&&t.resetExplosionByField())}}},rvt=nvt,ivt=(n("1e63"),je(rvt,xft,Sft,!1,null,"013f7460",null)),ovt=ivt.exports,avt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._t("default",(function(){return[n("div",{staticClass:"mapgis-widget-excavate-analysis"},[n("mapgis-ui-row",{staticClass:"model"},[t.checkboxOptions.length>0?n("mapgis-ui-checkbox-group",{model:{value:t.checked,callback:function(e){t.checked=e},expression:"checked"}},t._l(t.checkboxOptions,(function(e,r){return n("mapgis-ui-row",{key:"model-"+r},[n("mapgis-ui-checkbox",{staticStyle:{"line-height":"32px"},attrs:{value:e.value}},[t._v("\n "+t._s(e.label)+"\n ")])],1)})),1):n("div",[t._v("暂无数据!")])],1),n("mapgis-ui-form-item",{attrs:{label:"剖面纹理"}},[n("mapgis-ui-select",{staticClass:"mapgis-3d-fill-image mapgis-3d-select",attrs:{autoWidth:!0,size:"default",placeholder:"请选择纹理"},model:{value:t.selectTerrainWall,callback:function(e){t.selectTerrainWall=e},expression:"selectTerrainWall"}},t._l(t.terrainWallFillImages,(function(e,r){return n("mapgis-ui-select-option",{key:r,attrs:{value:e.value}},[t._v(t._s(e.label))])})),1)],1),n("mapgis-ui-form-item",{attrs:{label:"底面纹理"}},[n("mapgis-ui-select",{staticClass:"mapgis-3d-fill-image mapgis-3d-select",attrs:{autoWidth:!0,size:"default",placeholder:"请选择纹理"},model:{value:t.selectTerrainGround,callback:function(e){t.selectTerrainGround=e},expression:"selectTerrainGround"}},t._l(t.terrainGroundFillImages,(function(e,r){return n("mapgis-ui-select-option",{key:r,attrs:{value:e.value}},[t._v(t._s(e.label))])})),1)],1),n("mapgis-ui-input-number-panel",{staticClass:"mapgis-excavate-form",attrs:{size:"large",label:"开挖深度(米)",range:[0,2e3]},model:{value:t.excavateDepth,callback:function(e){t.excavateDepth=e},expression:"excavateDepth"}}),n("mapgis-ui-input-number-panel",{staticClass:"mapgis-excavate-form",attrs:{size:"large",label:"开挖精度",range:[1,100]},model:{value:t.samplePrecision,callback:function(e){t.samplePrecision=e},expression:"samplePrecision"}}),n("mapgis-ui-switch-panel",{attrs:{label:"开启模型封边",size:"default"},model:{value:t.useModelFill,callback:function(e){t.useModelFill=e},expression:"useModelFill"}}),n("mapgis-ui-setting-footer",[n("mapgis-ui-button",{attrs:{type:"primary"},on:{click:t.analysis}},[t._v("分析")]),n("mapgis-ui-button",{on:{click:t.removeCuttingPlane}},[t._v("清除")])],1)],1)]})),n("mapgis-ui-mask",{attrs:{parentDivClass:"cesium-map-wrapper",loading:t.maskShow,text:t.maskText,showSvg:!0}})],2)},svt=[];function cvt(t){return cvt="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},cvt(t)}function uvt(t){return fvt(t)||dvt(t)||hvt(t)||lvt()}function lvt(){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 hvt(t,e){if(t){if("string"==typeof t)return pvt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pvt(t,e):void 0}}function dvt(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function fvt(t){if(Array.isArray(t))return pvt(t)}function pvt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function mvt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */mvt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof A?e:A,a=Object.create(o.prototype),s=new E(r||[]);return i(a,"_invoke",{value:M(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function A(){}function v(){}function y(){}var b={};u(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(O([])));_&&_!==n&&r.call(_,a)&&(b=_);var x=y.prototype=A.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(i,o,a,s){var c=h(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==cvt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function M(e,n,r){var i=d;return function(o,a){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var u=h(e,n,r);if("normal"===u.type){if(i=r.done?m:f,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(cvt(e)+" is not iterable")}return v.prototype=y,i(x,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(C.prototype),u(C.prototype,s,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new C(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),u(x,c,"Generator"),u(x,a,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function gvt(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Avt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){gvt(o,r,i,a,s,"next",t)}function s(t){gvt(o,r,i,a,s,"throw",t)}a(void 0)}))}}function vvt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yvt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vvt(Object(n),!0).forEach((function(e){bvt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vvt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function bvt(t,e,n){return(e=wvt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wvt(t){var e=_vt(t,"string");return"symbol"==cvt(e)?e:e+""}function _vt(t,e){if("object"!=cvt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=cvt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var xvt={name:"mapgis-3d-excavate-analysis",inject:["Cesium","vueCesium","viewer"],mixins:[Tr],props:yvt(yvt({},ln),{},{models:{type:Array,default:function(){return[]}},terrainGroundFillImages:{type:Array,default:function(){return[]}},terrainWallFillImages:{type:Array,default:function(){return[]}},modelFillImage:{type:String,default:""}}),watch:{models:{handler:function(t){var e=this;if(this.checkboxOptions=[],this.vueIndexs=[],this.layerIndexs=[],t.length>0){var n=t[t.length-1];this.checkboxOptions.find((function(t){return t.value===n.vueIndex}))||this.checked.includes(n.vueIndex)||this.checked.push(n.vueIndex),t.forEach((function(t){var n=t.title,r=t.vueIndex,i={label:n,value:r};e.checkboxOptions.push(i)}))}},deep:!0,immediate:!0}},data:function(){return{useModelFill:!0,maskText:"正在分析中, 请稍等...",maskShow:!1,samplePrecision:10,excavateDepth:100,checkboxOptions:[],checked:[],pnts:[],selectTerrainGround:"",selectTerrainWall:"",isDepthTestAgainstTerrainEnable:void 0}},computed:{samplePrecisionComputed:function(){var t=50;return t/this.samplePrecision}},mounted:function(){this.mount()},destroyed:function(){this.unmount()},methods:{m3dIsReady:function(){var t=this,e=this.vueKey,n=this.checked;return new Promise((function(r,i){n.length>0?t.$_getAll3DTileSetArray((function(t){t&&t.length>0?r(t):i(null)}),e,n):i(null)}))},_restoreCesiumSetting:function(){void 0!==this.isDepthTestAgainstTerrainEnable&&this.isDepthTestAgainstTerrainEnable!==I(this.viewer)&&D(this.isDepthTestAgainstTerrainEnable,this.viewer)},mount:function(){this.viewer;var t=this.vueCesium,e=this.vueKey,n=this.vueIndex;this.isDepthTestAgainstTerrainEnable=I(this.viewer),this.isDepthTestAgainstTerrainEnable||D(!0,this.viewer);var r=this,i=Promise.resolve();i.then((function(i){r.$emit("load",r),t.ExcavateAnalysisManager.addSource(e,n,i,{drawElement:null,cutTool:null})}))},unmount:function(){this.removeCuttingPlane(),this._restoreCesiumSetting()},getCutLayers:function(){var t=Avt(mvt().mark((function t(){var e;return mvt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,!this.models||!this.models.length){t.next=6;break}return t.next=4,this.m3dIsReady();case 4:return e=t.sent,t.abrupt("return",e);case 6:return t.abrupt("return",[]);case 9:return t.prev=9,t.t0=t["catch"](0),t.abrupt("return",[]);case 12:case"end":return t.stop()}}),t,this,[[0,9]])})));function e(){return t.apply(this,arguments)}return e}(),analysis:function(){var t=Avt(mvt().mark((function t(){var e,n,r,i,o,a,s,c,u,l,h;return mvt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=this.vueCesium,n=this.vueKey,r=this.vueIndex,i=this.Cesium,o=this.viewer,a=e.ExcavateAnalysisManager.findSource(n,r),s=a||{},c=s.options,u=c||{},l=u.cutTool,h=u.drawElement,h=h||new i.DrawElement(o),e.ExcavateAnalysisManager.changeOptions(n,r,"drawElement",h),this.removeCuttingPlane(),t.next=9,this.getCutLayers();case 9:this.m3dLayers=t.sent,l=new i.CuttingTool(o,uvt(this.m3dLayers),{isCuttingTerrain:!0,onErrorCallback:function(t,e){console.warn("错误信息:"+t+":"+e)}}),this.drawTerrainPolygon(h,l),e.ExcavateAnalysisManager.changeOptions(n,r,"cutTool",l);case 13:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),drawPolygonCallBack:function(){var t=Avt(mvt().mark((function t(e,n,r){var i,o,a,s,c,u,l,h,d;return mvt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:for(t.prev=0,i=this.Cesium,o=e.positions,this.pnts=[],a=[],s=0;s<o.length;s++)c=o[s],u=i.Cartographic.fromCartesian(c),a.push(u),l=new i.Cartesian3(i.Math.toDegrees(u.longitude),i.Math.toDegrees(u.latitude),u.height),this.pnts.push(l);if(h=this.prepareWell(uvt(o),this.samplePrecisionComputed),this.m3dLayers&&this.m3dLayers.length&&this.useModelFill&&(this.sampledPositions=this.getModelSampleHeight(h)),d=0,!viewer.terrainProvider._layers){t.next=13;break}return t.next=12,this.getTerrainSampleHeight(a);case 12:d=t.sent;case 13:this.createTerrainCuttingVolume(r,d),n.stopDrawing(),this.maskShow=!1,t.next=21;break;case 18:t.prev=18,t.t0=t["catch"](0),console.warn(t.t0);case 21:case"end":return t.stop()}}),t,this,[[0,18]])})));function e(e,n,r){return t.apply(this,arguments)}return e}(),drawTerrainPolygon:function(t,e){var n=this;t.startDrawingPolygon({callback:function(r){n.maskShow=!0,requestAnimationFrame((function(){requestAnimationFrame((function(){return n.drawPolygonCallBack(r,t,e)}))}))}})},removeCuttingPlane:function(){var t=this.vueCesium,e=this.vueKey,n=this.vueIndex,r=this.viewer,i=t.ExcavateAnalysisManager.findSource(e,n),o=i||{},a=o.options,s=a||{},c=s.cutTool,u=s.drawElement;r.scene.primitives.remove(this.wallSpace),c&&c.removeAll(),u&&u.stopDrawing()},createTerrainCuttingVolume:function(t,e){if(!t)return!1;var n=-1*(this.excavateDepth-e),r={unionClippingRegions:!0,showCuttingPlane:!1,getCoordinates:this.getCoordinates,samplePrecision:this.samplePrecisionComputed};this.selectTerrainWall&&(r.terrainWallFillImage=this.selectTerrainWall),this.selectTerrainGround&&(r.terrainGroundFillImage=this.selectTerrainGround);var i=5e3;t.createModelCuttingVolume(this.pnts,n,i,r)},prepareWell:function(t,e){var n=this.Cesium,r=t.length;if(r>0){for(var i=[],o=0;o<r;o++){var a=o==r-1?0:o+1,s=n.Cartographic.fromCartesian(t[o]),c=n.Cartographic.fromCartesian(t[a]),u=[s.longitude,s.latitude],l=[c.longitude,c.latitude];0==o&&i.push(n.Cartesian3.fromRadians(u[0],u[1],0));for(var h=n.Cartesian3.distance(t[o],t[a]),d=Math.ceil(h/e),f=1;f<=d;f++){var p=n.Math.lerp(u[0],l[0],f/d),m=n.Math.lerp(u[1],l[1],f/d);o==r-1&&f==d||i.push(n.Cartesian3.fromRadians(p,m,0))}}return i}},getTerrainSampleHeight:function(){var t=Avt(mvt().mark((function t(e){var n,r,i,o;return mvt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=this.Cesium,r=this.viewer,t.next=3,n.sampleTerrainMostDetailed(r.terrainProvider,e);case 3:return i=t.sent,o=i.reduce((function(t,e){return t+e.height}),0),t.abrupt("return",o/i.length);case 6:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),getModelSampleHeight:function(t){for(var e=this.Cesium,n=this.viewer,r=t.map((function(t){var n=e.Cartographic.fromCartesian(t);return n})),i=[],o=0;o<r.length;o++)r[o].height=n.scene.sampleHeight(r[o]),i.push(r[o].clone());return i},getCoordinates:function(t){this.m3dLayers&&this.m3dLayers.length&&this.useModelFill&&this.createWellWall(t,this.sampledPositions)},createWellWall:function(t,e){if(t.length){for(var n=this.Cesium,r=this.viewer,i=[],o=[],a=[],s=0;s<e.length;s++){var c=e[s];if(c.height){var u=n.Cartesian3.fromRadians(c.longitude,c.latitude,c.height),l=n.Cartographic.fromCartesian(t[s]);a.push(u),i.push(c.height),o.push(l.height)}}var h=new n.WallGeometry({positions:a,maximumHeights:i,minimumHeights:o}),d=n.WallGeometry.createGeometry(h),f=new n.Material({fabric:{materials:{diffuseMaterial:{type:"DiffuseMap",uniforms:{image:this.modelFillImage}}},components:{diffuse:"diffuseMaterial.diffuse"}}}),p=new n.MaterialAppearance({translucent:!1,flat:!0,material:f,faceForward:!0,closed:!1}),m=new n.Primitive({geometryInstances:new n.GeometryInstance({geometry:d,attributes:{color:n.ColorGeometryInstanceAttribute.fromColor(n.Color.GREY)}}),appearance:p,asynchronous:!1});this.wallSpace=r.scene.primitives.add(m)}}}},Svt=xvt,Cvt=(n("33ab"),je(Svt,avt,svt,!1,null,"6b26a23e",null)),Mvt=Cvt.exports,Lvt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span")},Tvt=[],kvt={inject:["Cesium","vueCesium","viewer"],props:{vueKey:{type:String,default:"default"},vueIndex:{type:Number,default:function(){return Number((1e8*Math.random()).toFixed(0))}}},data:function(){return{waitManagerName:void 0}},methods:{$_init:function(t){var e=this,n=setInterval((function(){var r=e.$_getObject();r&&(clearInterval(n),t&&t())}),50)},$_getObject:function(t,e){var n,r=this.waitManagerName;if(t&&(r=t),"GlobesManager"===r){var i=this.viewer;if("default"===this.vueKey)n=i;else{var o=window.vueCesium.GlobesManager;o[this.vueKey]&&(n=o[this.vueKey][0].source)}}else n=window.vueCesium[r].findSource(this.vueKey,this.vueIndex);return e&&e(n),n},$_deleteManger:function(t,e){var n=this.vueKey,r=this.vueIndex,i=window.vueCesium[t].findSource(n,r);i&&(e(i),window.vueCesium[t].deleteSource(n,r))}}},Evt={name:"mapgis-3d-component-mix",inject:["Cesium","vueCesium","viewer"],mixins:[kvt],props:{geoJson:{type:Object},vueKey:{type:String,default:"default"},vueIndex:{type:[String,Number],default:function(){return(1e8*Math.random()).toFixed(0)}},url:{type:[String,Object],required:!0},options:{type:Object},layerStyle:{type:Object},ruleJson:{type:Object},activeTitle:{type:Array},highLight:{},activeCircle:{type:Boolean,default:!1}},data:function(){return{waitManagerName:"M3DIgsManager",legend:"",position:{longitude:0,latitude:0,height:0},current:{feature:void 0,originalColor:new Cesium.Color},handlerAction:void 0}},created:function(){},mounted:function(){var t=this;this.$_init(t.mount)},destroyed:function(){this.unmount()},watch:{activeTitle:function(t){t&&this.changeColor(t)},highLight:function(t){t&&this.highlightColor(t)}},methods:{createCesiumObject:function(){var t=this.url;return new Cesium.GeoJsonDataSource.load(t)},findSource:function(){var t=this.vueKey,e=this.vueIndex,n=-1,r=window.CesiumZondy.GeojsonManager[t].find((function(t,r){var i=!1;return!t||t.key!==e&&t.key!=="".concat(e)||(n=r,i=!0),i})),i=r?r.source:void 0;return{index:n,source:i}},mount:function(){var t=this,e=this.viewer,n=(this.options,this.layerStyle,this.ruleJson),r=(this.url,this.vueKey),i=this.vueIndex,o=this.activeCircle,a=e.dataSources,s=(e.scene,this.createCesiumObject());s.then((function(e){if(o){var s=t.intersect(e),c=new Cesium.GeoJsonDataSource.load(s);c.then((function(t){a.add(t).then((function(){window.CesiumZondy.GeojsonManager.addSource(r,i,t.entities.values,{outline:void 0,rule:n})}))}))}else a.add(e).then((function(){window.CesiumZondy.GeojsonManager.addSource(r,i,e.entities.values,{outline:void 0,rule:n})}))})),t.pickModel()},unmount:function(){var t=this.viewer,e=this.vueKey,n=this.vueIndex;console.log("vueKey",e,n);var r=t.dataSources,i=(t.scene,window.CesiumZondy.GeojsonManager.findSource(e,n));i&&r&&(r.remove(i.source,!0),t.entities.remove(i.options.outline)),window.CesiumZondy.GeojsonManager.deleteSource(e,n),this.$emit("unload",this.layer)},initColor:function(){var t=this.findSource();if(t&&t.source)for(var e=t.source,n=this.options,r=this.ruleJson,i=this.layerStyle,o=n.type,a=(n.clampToGround,i.width,i.alpha),s=function(){var t=e[c];if(!o)return 1;if("Polygon"===o){var n=t.properties.地类名称._value;t.name=n;for(var i=0;i<r.rule.length;i++){var s=r.rule[i].color,u=r.rule[i].rule,l=u.find((function(t){return t.name===n}));if(l){var h=new Cesium.Color.fromCssColorString(s).withAlpha(a);t.polygon.material=h}}}},c=0;c<e.length;c++)s()},changeColor:function(t){var e=this.findSource();if(e&&e.source){e.options&&e.options.popup&&this.viewer.entities.remove(e.options.popup);for(var n=e.source,r=this.options,i=(this.ruleJson,this.layerStyle),o=(r.outlineColor,r.type),a=(r.glowPower,r.taperPower,r.clampToGround),s=(i.width,i.alpha),c=0;c<n.length;c++){var u=n[c];if(o)if("LineString"===o);else if("Polygon"===o){u.polygon.height=void 0;for(var l=u.properties.地类名称._value,h=!1,d=0;d<t.length;d++)if(t[d].name===l){h=!0,u.name=l;var f=t[d].color;if(f){var p=new Cesium.Color.fromCssColorString(f).withAlpha(s);u.polygon.material=p,u.polygon.outlineColor=p}a&&(u.polygon.clampToGround=a,u.polygon.classificationType=Cesium.ClassificationType.BOTH);break}if(!h){var m="#000000";u.polygon.material=new Cesium.Color.fromCssColorString(m).withAlpha(0)}}}}},pickModel:function(){var t=this,e=this.viewer;this.handlerAction=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.handlerAction.setInputAction((function(e){t.highlightPicking}),Cesium.ScreenSpaceEventType.LEFT_CLICK),new CesiumZondy.Manager.AnalysisManager({viewer:e})},highlightPicking:function(t){var e=this,n=this.viewer,r=this.vueKey,i=this.vueIndex,o=n.scene.pick(t.position);if(Cesium.defined(e.current.feature)&&e.current.feature!==o){var a=window.CesiumZondy.GeojsonManager.findSource(r,i);if(n.entities.remove(a.options.popup),a.options.id&&a.options.originColor)for(var s=a.source,c=0;c<s.length;c++){var u=s[c];u.id===a.options.id&&a.options.name===u.properties.地类名称._value&&(u.polygon.material.color=a.options.originColor)}e.current.feature=void 0}if(Cesium.defined(o)&&e.current.feature!==o){var l;e.current.feature=o,l=[e.current.feature.id];var h,d=l[0].name,f=l[0].id,p=window.CesiumZondy.GeojsonManager.findSource(r,i);if(p&&p.source)for(var m=p.source,g=0;g<m.length;g++){var A=m[g],v=A.properties.地类名称._value;if(v===d&&f===A.id){h=A.polygon.material.color;var y=new Cesium.Color(1,0,0,.8);A.polygon.material=y;for(var b=A.polygon.hierarchy._value.positions,w=[],_=0;_<b.length;_++){var x=[],S=Cesium.Cartographic.fromCartesian(b[_]),C=Cesium.Math.toDegrees(S.longitude),M=Cesium.Math.toDegrees(S.latitude);x.push(C),x.push(M),w.push(x)}w=Yn["polygon"]([w]);var L=Yn["area"](w),T=Yn["center"](w),k=T.geometry.coordinates;e.position.longitude=k[0],e.position.latitude=k[1],e.position.height=L<1e5?4*Math.log(L):20*Math.log(L);var E=parseInt(L).toString(),O=E.length;if(O>3){var P=O%3;E=P>0?E.slice(0,P)+","+E.slice(P,O).match(/\d{3}/g).join(","):E.slice(P,O).match(/\d{3}/g).join(",")}console.log("viewer.entities",n.entities);var B=n.entities.add({position:Cesium.Cartesian3.fromDegrees(e.position.longitude,e.position.latitude,e.position.height),label:{text:"地块名称:"+v+"\r\n地块面积:"+E+"m²",showBackground:!0,font:"16px bold 微软雅黑",backgroundColor:Cesium.Color.GREY.withAlpha(.7),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,show:!0},polyline:{positions:[Cesium.Cartesian3.fromDegrees(e.position.longitude,e.position.latitude,0),Cesium.Cartesian3.fromDegrees(e.position.longitude,e.position.latitude,e.position.height)],material:Cesium.PolylineGlowMaterialProperty({color:Cesium.Color.GREY,dashLength:32})}});window.CesiumZondy.GeojsonManager.deleteSource(r,i),window.CesiumZondy.GeojsonManager.addSource(r,i,m,{popup:B,originColor:h,id:f,name:v})}}}},intersect:function(t){var e=this,n=e.$_getObject(e.waitManagerName),r=n.source[0].boundingSphere.center,i=[],o=Cesium.Cartographic.fromCartesian(r);i.push(Cesium.Math.toDegrees(o.longitude)),i.push(Cesium.Math.toDegrees(o.latitude));for(var a=1,s={steps:64,units:"kilometers"},c=Yn["circle"](i,a,s),u=t.entities.values,l={type:"FeatureCollection",features:[]},h=[],d=0;d<u.length;d++){for(var f=u[d].polygon.hierarchy._value.positions,p=[],m=0;m<f.length;m++){var g=[],A=Cesium.Cartographic.fromCartesian(f[m]),v=Cesium.Math.toDegrees(A.longitude),y=Cesium.Math.toDegrees(A.latitude);g.push(v),g.push(y),p.push(g)}var b=Yn["polygon"]([p]);if(Yn["intersect"](c,b)){var w=Yn["intersect"](c,b);w.properties=u[d].properties,l.features.push(w),"Polygon"===w.geometry.type||w.geometry.type}h.push(p)}return l}}},Ovt=Evt,Pvt=(n("00cf"),je(Ovt,Lvt,Tvt,!1,null,"532f842c",null)),Bvt=Pvt.exports,Ivt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{directives:[{name:"show",rawName:"v-show",value:!0===t.viewInfo,expression:"viewInfo === true"}],staticClass:"chart-legend-wrapper"},[n("div",{staticClass:"header"},[n("div",{staticClass:"buttons"},[t._v("图例信息")]),n("mapgis-ui-icon",{staticClass:"header-close",attrs:{type:"close"},on:{click:t.handleClose}})],1),n("div",{staticClass:"area-count"},[t._v("面积:"+t._s(t.allAreaString)+" ㎡")]),t.showtab?n("div",{staticClass:"legend-tabs-wrapper"},[n("span",{staticClass:"legend-tabs-scoll",on:{mousedown:function(e){return t.scrollTab("left")}}},[t._v(t._s(t.lefttab))]),n("div",{ref:"scrolltab",staticClass:"legend-tabs-content"},t._l([{name:"全部"}].concat(t.echartdata.series),(function(e,r){return n("div",{key:e.name,staticClass:"area-tab"},[n("div",{class:{"area-tab-name":!0,active:r-1===t.curindex},on:{click:function(e){t.curindex=r-1}}},[t._v("\n "+t._s(e.name)+"\n ")])])})),0),n("span",{staticClass:"legend-tabs-scoll",on:{mousedown:function(e){return t.scrollTab("right")}}},[t._v(t._s(t.righttab))])]):t._e(),n("div",{staticClass:"legend-check-groups"},[n("div",{staticClass:"legend-check-group-header"},[n("input",{staticClass:"legend-item-checkbox",attrs:{type:"checkbox"},domProps:{checked:t.curcheck.length===t.curlegend.length},on:{change:t.onAllChange}}),n("div",{staticClass:"legend-item-text"},[t._v("全选")]),n("div",{staticClass:"legend-item-count"},[t._v("面积(m²)")]),n("div",{staticClass:"legend-item-percent"},[t._v("占比")])]),t._l(t.curlegend,(function(e){return n("div",{key:e.name,staticClass:"legend-check-group"},[n("input",{staticClass:"legend-item-checkbox",attrs:{name:"group",type:"checkbox"},domProps:{checked:t.curcheck.indexOf(e.name)>=0,value:e.name},on:{change:t.onSingleChange}}),n("div",{staticClass:"legend-item-color",style:{background:e.color}}),n("div",{staticClass:"legend-item-text",on:{click:t.onLengendItemClick}},[t._v("\n "+t._s(e.name)+"\n ")]),n("div",{staticClass:"legend-item-count-text"},[t._v("\n "+t._s(t.areaString(e.count.toFixed(2)))+"\n ")]),n("div",{staticClass:"legend-item-percent-text"},[t._v("\n "+t._s((100*e.percent).toFixed(2))+"\n ")])])}))],2)])])},Dvt=[];function Nvt(t){return Nvt="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},Nvt(t)}function Fvt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function jvt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Fvt(Object(n),!0).forEach((function(e){Rvt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fvt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Rvt(t,e,n){return(e=Hvt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hvt(t){var e=zvt(t,"string");return"symbol"==Nvt(e)?e:e+""}function zvt(t,e){if("object"!=Nvt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Nvt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Uvt={name:"mapgis-3d-component-legend",props:{ruleJson:{type:Object},geoJson:{type:Object},vueKey:{type:String,default:"default"},vueIndex:{type:[String,Number],default:function(){return(1e8*Math.random()).toFixed(0)}}},inject:["Cesium","vueCesium","viewer"],mixins:[kvt],data:function(){return{waitManagerName:"GeojsonManager",curcheck:[],curlegend:[],echartdata:{series:[]},curData:[],showtab:!0,lefttab:"〈",righttab:"〉",allArea:0,curindex:-1,viewInfo:!0,rules:"",innerActive:[],activeMode:""}},computed:{allAreaString:function(){var t=String(this.allArea.toFixed(0)),e=t.indexOf(".")>-1?/(\d)(?=(\d{3})+\.)/g:/(\d)(?=(?:\d{3})+$)/g;return t.replace(e,"$1,")}},watch:{curcheck:function(t){"tabChange"!==this.activeMode&&this.checkChange(t)},curindex:function(t){this.activeMode="tabChange",this.parseCheck(t),-1===t?this.changeLegendColors(!1,-1):this.changeLegendColors(!0,t)}},mounted:function(){var t=this;t.getManager()},methods:{getManager:function(){var t=this.initData.bind(this);this.$_init(t)},areaString:function(t){var e=String(t),n=e.indexOf(".")>-1?/(\d)(?=(\d{3})+\.)/g:/(\d)(?=(?:\d{3})+$)/g;return e.replace(n,"$1,")},initData:function(){var t=this,e=t.geoJson,n=t.ruleJson;t.rules=n,t.curcheck=t.rules.rule.map((function(t){return t.title}))||[];for(var r,i=[],o=(t.rules.rule.map((function(t){return t.title})),function(){var t=Yn["polygon"](e.features[a].geometry.coordinates),n=Yn["area"](t),r=e.features[a].properties.地类名称,o=i.find((function(t){return t&&t.name===r}));o?o.value+=n:i.push({value:n,name:r})}),a=0;a<e.features.length;a++)o();t.rules.rule.forEach((function(t){r=[],i.forEach((function(e){for(var n=0;n<t.rule.length;n++)if(e.name===t.rule[n].name){r.push(e);break}})),t.series=r})),t.rules.series=t.rules.rule.map((function(t){var e=0;return t.series.forEach((function(t){return e+=Number(t.value)})),{name:t.title,value:Number(e.toFixed(2)),color:t.color}})),t.echartdata=t.rules,t.showtab=!!t.echartdata.hasSecond,t.allArea=0,t.echartdata.series.forEach((function(e){e&&e.value&&(t.allArea+=e.value)})),t.curdata=t.rules.series,t.curlegend=t.rules.series.map((function(e){var n=t.curdata.find((function(t){return t.name===e.name}));return n?(e.count=n.value,e.percent=n.value/t.allArea,e.color=n.color):(e.count=0,e.percent=0),e})),t.curlegend=t.curlegend.filter((function(t){return t.count>0})),t.onInitIndex()},onInitIndex:function(){this.curindex=-1},scrollTab:function(t){switch(t){case"left":this.$refs.scrolltab.scrollLeft-=150;break;case"right":this.$refs.scrolltab.scrollLeft+=150;break}},handleClose:function(){vm.viewInfo=!1},onAllChange:function(t){var e=this;e.activeMode="checkboxChange";var n=t.target.checked;e.curcheck=n?e.curlegend.map((function(t){return t.name})):[]},onSingleChange:function(t){var e=this;e.activeMode="checkboxChange";var n=t.target.value,r=t.target.checked;r?e.curcheck.indexOf(n)<0&&(e.curcheck=e.curcheck.concat([n])):e.curcheck=e.curcheck.filter((function(t){return t!==n}))},parseCheck:function(t){var e=this.echartdata,n=this;if(n.showtab=!!e.hasSecond,-1===t)n.allArea=0,e.series.forEach((function(t){t&&t.value&&(n.allArea+=t.value)})),n.curdata=e.series,n.curlegend=e.series.map((function(t){var e=n.curdata.find((function(e){return e.name===t.name}));return e?(t.count=e.value,t.percent=e.value/n.allArea,t.color=e.color):(t.count=0,t.percent=0),t})),n.curlegend=n.curlegend.filter((function(t){return t.count>0})),n.curcheck=e.rule.map((function(t){return t.title}));else{var r=e.rule[t].title;e.rule.forEach((function(t){r===t.title&&(n.allArea=0,t.series.forEach((function(t){t&&t.value&&(n.allArea+=t.value)})),n.curdata=t.series,n.curlegend=t.series.map((function(e){var r=n.curdata.find((function(t){return t.name===e.name}));r?(e.count=r.value,e.percent=r.value/n.allArea,e.color=r.color):(e.count=0,e.percent=0);var i=t.rule.find((function(t){return t.name===e.name}));return i&&(e.color=i.color),e})),n.curlegend=n.curlegend.filter((function(t){return t.count>0})),n.curcheck=t.series.map((function(t){return t.name})))}))}},checkChange:function(t){var e=this,n=this.echartdata,r=JSON.parse(JSON.stringify(n)),i=[],o=[];t&&t.length>=0&&r.rule.forEach((function(n){if(t.indexOf(n.title)>=0&&(n.rule.forEach((function(t){return t.color=n.color})),i=i.concat(n.rule)),t.indexOf(n.title)<0)for(var r=function(n){o=e.curlegend.filter((function(e){return e.name==t[n]})),i=i.concat(o)},a=0;a<t.length;a++)r(a)})),this.innerActive=i,this.$emit("colorChange",this.innerActive)},changeLegendColors:function(t,e){var n=this,r=this.echartdata,i=[];t?i=n.curlegend:r.rule.forEach((function(t,e){i=i.concat(t.rule.map((function(t){var n=jvt({},t);return n.color=r.rule[e].color,n})))})),this.innerActive=i,this.$emit("colorChange",this.innerActive)},onLengendItemClick:function(t){var e=this,n=this.echartdata,r=this,i=!1;r.showtab=!!n.hasSecond,n.rule.forEach((function(n,o){t.currentTarget.innerText===n.title&&(i=!0,n.rule&&n.rule.length>0?(r.allArea=0,n.series.forEach((function(t){t&&t.value&&(r.allArea+="string"===typeof t.value?parseFloat(t.value):t.value)})),r.curdata=n.series,r.curlegend=n.series.map((function(t){var e=r.curdata.find((function(e){return e.name===t.name}));return e?(t.count=e.value,t.percent=e.value/r.allArea):(t.count=0,t.percent=0),t})),r.curlegend=r.curlegend.filter((function(t){return t.count>0})),r.curindex=o,r.changeLegendColors(!0,o)):n.rule&&0===n.rule.length&&e.$store.commit("SET_LEGEND_HIGHTLIGHTS",{index:e.index,highlights:[n.title]}))})),i||this.$emit("highlight",[t.currentTarget.innerText])}}},Vvt=Uvt,Yvt=(n("4f5b"),je(Vvt,Ivt,Dvt,!1,null,"e22dbc94",null)),Gvt=Yvt.exports,Qvt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mapgis-3d-scene-setting"},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],staticClass:"setting-control",style:t.panelStyle},[n("mapgis-ui-tabs",{attrs:{animated:!1,tabBarStyle:t.tabBarStyle,"default-active-key":"1"}},[n("mapgis-ui-tab-pane",{key:"1",staticClass:"control-content",attrs:{tab:"基本设置"}},[n("basic-setting",{ref:"attr",attrs:{initBasicSetting:t.initBasicSetting,initialDepthTest:t.depthTest,"initial-scene-mode":t.sceneMode,stuffWidth:t.stuffWidth},on:{updateSpin:t.changeSpinning,updateBasicSetting:t.updateBasicSetting}})],1),n("mapgis-ui-tab-pane",{key:"2",staticClass:"control-content",attrs:{"force-render":"",tab:"相机"}},[n("camera-setting",{ref:"cameraSetting",attrs:{initCameraSetting:t.initCameraSetting,boundingSphereRadius:t.boundingSphereRadius,baseLayerIds:t.baseLayerIds},on:{updateCameraSetting:t.updateCameraSetting,updateSpin:t.changeSpinning}})],1),n("mapgis-ui-tab-pane",{key:"3",staticClass:"control-content",attrs:{"force-render":"",tab:"光照"}},[n("light-setting",{ref:"effect",attrs:{initLightSetting:t.initLightSetting},on:{updateLightSetting:t.updateLightSetting,updateSpin:t.changeSpinning}})],1),n("mapgis-ui-tab-pane",{key:"4",staticClass:"control-content",attrs:{"force-render":"",tab:"天气"}},[n("weather-setting",{ref:"effect",attrs:{initWeatherSetting:t.initWeatherSetting,isFavorites:t.isFavorites},on:{updateWeatherSetting:t.updateWeatherSetting,updateSpin:t.changeSpinning}})],1),n("mapgis-ui-tab-pane",{key:"5",staticClass:"control-content",attrs:{"force-render":"",tab:"特效"}},[n("effect-setting",{ref:"effect",attrs:{initEffectSetting:t.initEffectSetting},on:{updateEffectSetting:t.updateEffectSetting,updateSpin:t.changeSpinning}})],1),n("mapgis-ui-tab-pane",{key:"6",staticClass:"control-content",attrs:{"force-render":"",tab:"漫游操控"}},[n("autonomous-roaming-setting",{attrs:{publicPath:t.publicPath,isWidgetOpen:t.isWidgetOpen}})],1)],1)],1),n("mapgis-ui-spin",{staticStyle:{top:"50%",left:"50%"},attrs:{spinning:t.spinning,size:"large"}})],1)},Wvt=[],Kvt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"basic-setting"},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"地球",checked:t.basicSetting.earth},on:{changeChecked:t.enableEarth}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"大气层",checked:t.basicSetting.skyAtmosphere},on:{changeChecked:t.enableSkyAtmosphere}})],1)],1),n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"阴影效果",checked:t.basicSetting.shadow},on:{changeChecked:t.enableShadow}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"深度检测",checked:t.basicSetting.depthTest},on:{changeChecked:t.enableDepthTest}})],1)],1),n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"显示帧率",checked:t.basicSetting.FPS},on:{changeChecked:t.enableFPS}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"时间轴",checked:t.basicSetting.timeline},on:{changeChecked:t.enableTimeline}})],1)],1),n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"状态栏",checked:t.basicSetting.statebar},on:{changeChecked:t.handleChangeStatebar}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"平面模式",checked:t.basicSetting.sceneMode},on:{changeChecked:t.handleChangeSceneMode}})],1)],1),n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"罗盘控件",checked:t.basicSetting.compass},on:{changeChecked:t.enableCompass}})],1)],1),n("compass-position-setting",{directives:[{name:"show",rawName:"v-show",value:t.basicSetting.compass,expression:"basicSetting.compass"}],attrs:{position:t.compassPosition},on:{updateCompassPosition:t.updateCompassPosition}}),n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"颜色校正",checked:t.basicSetting.colorCorrection},on:{changeChecked:t.enableColorCorrection}}),t.showColorCorrectionSetting?n("div",[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"亮度",value:t.basicSetting.brightness,range:t.ColorCorrectionRange,step:.1},on:{change:t.brtChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"对比度",value:t.basicSetting.contrast,range:t.contrastRange,step:.1},on:{change:t.ctrstChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"色相",value:t.basicSetting.hue,range:t.ColorCorrectionRange,step:.1},on:{change:t.hueChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"饱和度",value:t.basicSetting.saturation,range:t.ColorCorrectionRange,step:.1},on:{change:t.saturationChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"曝光度",value:t.basicSetting.exposure,range:t.ColorCorrectionRange,step:.1},on:{change:t.exposureChange}})],1):t._e(),t.basicSetting.statebar?n("mapgis-3d-statebar",{attrs:{frame:60,bottomMap:!0}}):t._e()],1)},qvt=[],Xvt=(n("4015"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.compassPosition?n("mapgis-ui-form",{ref:"form",attrs:{model:t.compassPosition,labelCol:{lg:{span:8},sm:{span:8}},wrapperCol:{lg:{span:16},sm:{span:16}}}},[n("mapgis-ui-form-item",{staticClass:"form-item",attrs:{label:"罗盘位置",prop:"anchor"}},[n("mapgis-ui-select",{attrs:{placeholder:"请选择"},on:{change:t.changePosition},model:{value:t.compassPosition.anchor,callback:function(e){t.$set(t.compassPosition,"anchor",e)},expression:"compassPosition.anchor"}},[n("mapgis-ui-select-option",{attrs:{value:"top-left"}},[t._v("左上")]),n("mapgis-ui-select-option",{attrs:{value:"top-right"}},[t._v("右上")]),n("mapgis-ui-select-option",{attrs:{value:"bottom-left"}},[t._v("左下")]),n("mapgis-ui-select-option",{attrs:{value:"bottom-right"}},[t._v("右下")])],1)],1),"top-left"===t.compassPosition.anchor||"bottom-left"===t.compassPosition.anchor?n("mapgis-ui-form-item",{staticClass:"form-item",attrs:{prop:"horizontalOffset",label:"左边框距离"}},[n("mapgis-ui-input-number-addon",{attrs:{"addon-after":"px",min:0,step:1},on:{change:t.changePosition},model:{value:t.compassPosition.horizontalOffset,callback:function(e){t.$set(t.compassPosition,"horizontalOffset",t._n(e))},expression:"compassPosition.horizontalOffset"}})],1):t._e(),"top-right"===t.compassPosition.anchor||"bottom-right"===t.compassPosition.anchor?n("mapgis-ui-form-item",{staticClass:"form-item",attrs:{prop:"horizontalOffset",label:"右边框距离"}},[n("mapgis-ui-input-number-addon",{attrs:{"addon-after":"px",min:0,step:1},on:{change:t.changePosition},model:{value:t.compassPosition.horizontalOffset,callback:function(e){t.$set(t.compassPosition,"horizontalOffset",e)},expression:"compassPosition.horizontalOffset"}})],1):t._e(),"top-left"===t.compassPosition.anchor||"top-right"===t.compassPosition.anchor?n("mapgis-ui-form-item",{staticClass:"form-item",attrs:{prop:"verticalOffset",label:"上边框距离"}},[n("mapgis-ui-input-number-addon",{attrs:{"addon-after":"px",min:0,step:1},on:{change:t.changePosition},model:{value:t.compassPosition.verticalOffset,callback:function(e){t.$set(t.compassPosition,"verticalOffset",e)},expression:"compassPosition.verticalOffset"}})],1):t._e(),"bottom-left"===t.compassPosition.anchor||"bottom-right"===t.compassPosition.anchor?n("mapgis-ui-form-item",{staticClass:"form-item",attrs:{prop:"verticalOffset",label:"下边框距离"}},[n("mapgis-ui-input-number-addon",{attrs:{"addon-after":"px",min:0,step:1},on:{change:t.changePosition},model:{value:t.compassPosition.verticalOffset,callback:function(e){t.$set(t.compassPosition,"verticalOffset",e)},expression:"compassPosition.verticalOffset"}})],1):t._e()],1):t._e()}),$vt=[],Jvt={name:"CompassPositionSetting",props:{position:{type:Object,default:function(){return{anchor:"top-left",horizontalOffset:10,verticalOffset:36}}}},watch:{position:{handler:function(t){this.compassPosition=this.position,this.changePosition()},deep:!0,immediate:!0}},data:function(){return{rules:{},compassPosition:{anchor:"top-left",horizontalOffset:10,verticalOffset:36}}},methods:{changePosition:function(){var t=document.querySelector(".compass");if(t){var e=this.compassPosition,n=e.anchor,r=e.horizontalOffset,i=e.verticalOffset;switch(n){case"top-left":t.style.left="".concat(r,"px"),t.style.top="".concat(i,"px"),t.style.right="unset",t.style.bottom="unset";break;case"top-right":t.style.left="unset",t.style.top="".concat(i,"px"),t.style.right="".concat(r,"px"),t.style.bottom="unset";break;case"bottom-left":t.style.left="".concat(r,"px"),t.style.top="unset",t.style.right="unset",t.style.bottom="".concat(i,"px");break;case"bottom-right":t.style.left="unset",t.style.top="unset",t.style.right="".concat(r,"px"),t.style.bottom="".concat(i,"px");break}this.$emit("updateCompassPosition",this.compassPosition)}}}},Zvt=Jvt,tyt=(n("d4d8"),je(Zvt,Xvt,$vt,!1,null,"85bbac22",null)),eyt=tyt.exports,nyt=void 0,ryt={name:"BasicSetting",components:{CompassPositionSetting:eyt},mixins:[Ve,_n],props:{initialStatebar:{type:Boolean,default:!1},initialDepthTest:{type:Boolean,default:!1},initialSceneMode:{type:Boolean,default:!1},initBasicSetting:{type:Object,default:function(){return nyt.basicSetting}},stuffWidth:{type:Number}},data:function(){return{contrastRange:[0,2],ColorCorrectionRange:[-1,1],compassPosition:void 0,basicSetting:{earth:!0,skyAtmosphere:!0,shadow:!1,depthTest:!1,FPS:!1,timeline:!1,compass:!1,compassPosition:void 0,zoom:!1,statebar:!0,sceneMode:!1,colorCorrection:!1,brightness:0,contrast:1,hue:0,saturation:0,exposure:0},showColorCorrectionSetting:!1}},mounted:function(){var t=this.vueKey,e=this.vueIndex,n=window.vueCesium["SettingToolManager"].findSource(t,e);n||window.vueCesium.SettingToolManager.addSource(t,e,null,{timeline:null}),this.basicSetting=this.defaultParams(),this.init()},watch:{initialDepthTest:{handler:function(t){this.basicSetting.depthTest=t},deep:!0,immediate:!0},initBasicSetting:{handler:function(t){this.basicSetting=JSON.parse(JSON.stringify(this.initBasicSetting)),this.init()},deep:!0,immediate:!0},basicSetting:{handler:function(t){this.$emit("updateBasicSetting",this.basicSetting)},deep:!0},stuffWidth:{handler:function(t){this.basicSetting.compassPosition?"top-left"!==this.basicSetting.compassPosition.anchor&&"bottom-left"!==this.basicSetting.compassPosition.anchor||(this.basicSetting.compassPosition.horizontalOffset=this.stuffWidth):this.basicSetting.compassPosition={anchor:"top-left",horizontalOffset:this.stuffWidth,verticalOffset:400},this.compassPosition=this.basicSetting.compassPosition},deep:!0,immediate:!0}},methods:{defaultParams:function(){var t=!0,e=!0,n=!1,r=!1,i=!1,o=!1,a=this.viewer;return a&&(t=a.scene.globe.show,e=a.scene.globe.showGroundAtmosphere,r=a.scene.globe.depthTestAgainstTerrain,n=a.shadows,i=a.scene.debugShowFramesPerSecond,o=a.scene.colorCorrection.enabled),{earth:t,skyAtmosphere:e,shadow:n,depthTest:r,FPS:i,timeline:!1,compass:!1,compassPosition:void 0,zoom:!1,statebar:!0,sceneMode:!1,colorCorrection:o,brightness:a.scene.brightness||0,contrast:a.scene.contrast||1,hue:a.scene.hue||0,saturation:a.scene.saturation||0,exposure:a.scene.exposure||0}},init:function(){if(this.basicSetting){var t=this.vueKey,e=this.vueIndex,n=window.vueCesium["SettingToolManager"].findSource(t,e);n||window.vueCesium.SettingToolManager.addSource(t,e,null,{timeline:null});var r=this.basicSetting,i=r.earth,o=r.skyAtmosphere,a=r.shadow,s=r.depthTest,c=r.FPS,u=r.timeline,l=r.compass,h=r.zoom,d=r.statebar,f=r.sceneMode,p=r.colorCorrection,m=r.brightness,g=r.contrast,A=r.hue,v=r.saturation,y=r.exposure;this.showColorCorrectionSetting=p,this.enableEarth(i),this.enableSkyAtmosphere(o),this.enableShadow(a),this.enableDepthTest(s),this.enableFPS(c),this.enableTimeline(u),this.enableCompass(l),this.enableZoom(h),this.brtChange(m),this.ctrstChange(g),this.hueChange(A),this.saturationChange(v),this.exposureChange(y),this.handleChangeStatebar(d),this.handleChangeSceneMode(f)}},enableEarth:function(t){var e=this.viewer;this.basicSetting.earth=t,this.basicSetting.earth?e.scene.skyAtmosphere.show=this.basicSetting.skyAtmosphere:e.scene.skyAtmosphere.show=!1,e.scene.globe.show=this.basicSetting.earth},enableSkyAtmosphere:function(t){var e=this.viewer;this.basicSetting.skyAtmosphere=t,e.scene.skyAtmosphere.show=this.basicSetting.skyAtmosphere},enableShadow:function(t){var e=this.viewer;this.Cesium;this.basicSetting.shadow=t,e.shadows=this.basicSetting.shadow},enableDepthTest:function(t){var e=this.viewer;this.basicSetting.depthTest=t,e.scene.globe.depthTestAgainstTerrain=this.basicSetting.depthTest},enableFPS:function(t){var e=this.viewer;this.basicSetting.FPS=t,e.scene.debugShowFramesPerSecond=this.basicSetting.FPS},enableTimeline:function(t){var e=this.viewer,n=this.Cesium,r=this.vueKey,i=this.vueIndex;this.basicSetting.timeline=t;var o=this;if(o.basicSetting.timeline){var a=document.getElementsByClassName("cesium-viewer-timelineContainer");a.length>0&&a[0].parentNode.removeChild(a[0]);var s=e.container,c=document.createElement("div");c.className="cesium-viewer-timelineContainer",c.style="left:0px;right:0px",o.basicSetting.statebar&&o.$nextTick((function(){var t=document.getElementsByClassName("mapgis-3d-statebar"),e=window.getComputedStyle(t[0]);"0px"===e.bottom&&(c.style.bottom="30px")})),s.appendChild(c);var u=new n.Timeline(c,e.clock);u.addEventListener("settime",o.onTimelineScrubfunction,!1),u.zoomTo(e.clock.startTime,e.clock.stopTime),window.vueCesium["SettingToolManager"].changeOptions(r,i,"timeline",u)}else{var l=this.vueKey,h=this.vueIndex,d=window.vueCesium["SettingToolManager"].findSource(l,h);d&&d.options&&d.options.timeline&&(d.options.timeline.destroy(),window.vueCesium["SettingToolManager"].changeOptions(l,h,"timeline",null));var f=document.getElementsByClassName("cesium-viewer-timelineContainer");f.length>0&&f[0].parentNode.removeChild(f[0])}},onTimelineScrubfunction:function(t){var e=t.clock;e.currentTime=t.timeJulian,e.shouldAnimate=!1},enableCompass:function(t){var e=this.viewer;this.basicSetting.compass=t,e.cesiumNavigation&&e.cesiumNavigation.destroy();var n={};n.enableCompass=this.basicSetting.compass,n.enableZoomControls=this.basicSetting.zoom||!1,e.createNavigationTool(n);var r=this;this.$nextTick((function(){r.basicSetting.compassPosition||(r.basicSetting.compassPosition={anchor:"top-left",horizontalOffset:r.stuffWidth,verticalOffset:400}),r.compassPosition=r.basicSetting.compassPosition}))},updateCompassPosition:function(t){this.basicSetting.compassPosition=t,this.compassPosition=this.basicSetting.compassPosition},enableZoom:function(t){var e=this.viewer;this.basicSetting.zoom=t,e.cesiumNavigation&&e.cesiumNavigation.destroy();var n={};n.enableCompass=this.basicSetting.compass,n.enableZoomControls=this.basicSetting.zoom||!1,e.createNavigationTool(n);var r=this;this.$nextTick((function(){r.basicSetting.compassPosition||(r.basicSetting.compassPosition={anchor:"top-left",horizontalOffset:r.stuffWidth,verticalOffset:400}),r.compassPosition=r.basicSetting.compassPosition}))},enableColorCorrection:function(t){this.basicSetting.colorCorrection=t,this.showColorCorrectionSetting=t,viewer.scene.colorCorrection.enabled=t},brtChange:function(t){this.basicSetting.brightness=t,this.basicSetting.colorCorrection&&(viewer.scene.brightness=t)},ctrstChange:function(t){this.basicSetting.contrast=t,this.basicSetting.colorCorrection&&(viewer.scene.contrast=t)},hueChange:function(t){this.basicSetting.hue=t,this.basicSetting.colorCorrection&&(viewer.scene.hue=t)},saturationChange:function(t){this.basicSetting.saturation=t,this.basicSetting.colorCorrection&&(viewer.scene.saturation=t)},exposureChange:function(t){this.basicSetting.exposure=t,this.basicSetting.colorCorrection&&(viewer.scene.exposure=t)},handleChangeStatebar:function(t){var e=this.viewer;this.basicSetting.statebar=t;var n=this;e.statebar=this.basicSetting.statebar;var r=document.getElementsByClassName("mapgis-3d-statebar");r&&r.length>0&&(e.statebar?r[0].style.display="block":r[0].style.display="none"),n.basicSetting.timeline?n.$nextTick((function(){var t=document.getElementsByClassName("cesium-viewer-timelineContainer"),e=window.getComputedStyle(t[0]);if("0px"===e.bottom&&n.basicSetting.statebar){var r=document.getElementsByClassName("mapgis-3d-statebar"),i=r[0];i.style.bottom="24px"}})):n.$nextTick((function(){var t=document.getElementsByClassName("mapgis-3d-statebar"),e=t[0];e&&(e.style.bottom="0px")}))},handleChangeSceneMode:function(t){this.basicSetting.sceneMode=t;var e=this;if(t)e.viewer.scene.mode=1;else{e.viewer.scene.mode=3;var n=e.viewer.camera.computeViewRectangle();if(!n){var r=Cesium.Camera.DEFAULT_VIEW_RECTANGLE,i=r.north,o=r.south,a=r.east,s=r.west,c=Cesium.Math.toDegrees((a+s)/2),u=Cesium.Math.toDegrees((i+o)/2),l=16846164;e.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(c,u,l)})}}}}},iyt=ryt,oyt=(n("f0d1"),je(iyt,Kvt,qvt,!1,null,"2c058e40",null)),ayt=oyt.exports,syt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"camera-setting"},[n("mapgis-ui-switch-panel",{ref:"selfAdaption",attrs:{size:"default",label:"地表自适应透明",checked:t.cameraSetting.selfAdaption},on:{changeChecked:t.enableSelfAdaption}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"阈值",value:t.cameraSetting.selfAdaptionParams.maxHeigh,range:[0,1e6],step:100},on:{change:t.setSelfAdaption}})],1),n("mapgis-ui-switch-panel",{ref:"Undgrd",attrs:{size:"default",label:"地下模式",checked:t.cameraSetting.undgrd},on:{changeChecked:t.enableUndgrd}},[n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"影像透明度独立控制",checked:t.cameraSetting.undgrdParams.enableIndependentTranslucency},on:{changeChecked:t.enableIndependentTranslucency}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"地表透明度",value:t.cameraSetting.undgrdParams.groundAlpha,range:t.range,step:.1},on:{change:t.setGlobeBackFaceAlpha}})],1),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"FOV设置",value:t.cameraSetting.fov,range:t.fovRange,step:15},on:{change:t.setFOV}})],1)},cyt=[],uyt=void 0,lyt={name:"CameraSetting",mixins:[Ve],props:{initCameraSetting:{type:Object,default:function(){return uyt.cameraSetting}},boundingSphereRadius:{type:Number,default:0}},data:function(){return{range:[0,1],fovRange:[0,180],cameraSetting:{selfAdaption:!1,selfAdaptionParams:{maxHeigh:4e5},undgrd:!1,undgrdParams:{groundAlpha:.5,enableIndependentTranslucency:!1},fov:60}}},watch:{initCameraSetting:{handler:function(t){this.cameraSetting=JSON.parse(JSON.stringify(this.initCameraSetting)),this.init()},deep:!0,immediate:!0},cameraSetting:{handler:function(t){this.$emit("updateCameraSetting",this.cameraSetting)},deep:!0},boundingSphereRadius:{handler:function(t){this.boundingSphereRadius=t,this.boundingSphereRadius>0&&(this._setSelfAdaption(),this.openSelfAdaptionPanel())},deep:!0}},methods:{init:function(){var t=this;if(this.cameraSetting){void 0==this.cameraSetting.selfAdaption&&(this.cameraSetting.selfAdaption=!1),this.cameraSetting.selfAdaptionParams&&this.cameraSetting.selfAdaptionParams.maxHeigh||(this.cameraSetting.selfAdaptionParams={maxHeigh:4e5});var e=this.cameraSetting,n=e.selfAdaption,r=e.fov,i=e.undgrd;this.initImageLayersTranslucencyManager(),setTimeout((function(){t.boundingSphereRadius>0&&t._enableSelfAdaption(n),t._setFOV(r),t._enableUndgrd(i)}),1e3)}},enableIndependentTranslucency:function(t){this.cameraSetting.undgrdParams.enableIndependentTranslucency=t,this._enableIndependentTranslucency(this.cameraSetting.undgrdParams.enableIndependentTranslucency)},_enableIndependentTranslucency:function(t){var e=this.getImageLayersTranslucencyManager();if(e){var n=[];if(this.cameraSetting.undgrd)if(t){for(var r=1;r<viewer.imageryLayers._layers.length;r++)n.push(viewer.imageryLayers._layers[r]);e.imageryLayers=n,e.globeFaceAlpha=this.cameraSetting.undgrdParams.groundAlpha}else e.frontFaceAlpha=this.cameraSetting.undgrdParams.groundAlpha,e.backFaceAlpha=this.cameraSetting.undgrdParams.groundAlpha,e.imageryLayers=n}},updateIndependentTranslucency:function(){this._enableIndependentTranslucency(this.cameraSetting.undgrdParams.enableIndependentTranslucency)},enableUndgrd:function(t){this.cameraSetting.undgrd=t,this._enableUndgrd(this.cameraSetting.undgrd)},_enableUndgrd:function(t){var e=this.viewer;e.scene.screenSpaceCameraController.enableCollisionDetection=!this.cameraSetting.undgrd,this.cameraSetting.undgrd?this._setGlobeBackFaceAlpha(this.cameraSetting.undgrdParams.groundAlpha):this._setGlobeBackFaceAlpha(1)},enableSelfAdaption:function(t){this.cameraSetting.selfAdaption=t,this._enableSelfAdaption(this.cameraSetting.selfAdaption)},_enableSelfAdaption:function(t){if(this.boundingSphereRadius<=0)return this.closeSelfAdaptionPanel(),void this.$message.warning("场景中未添加符合要求的模型数据!");var e=this.getImageLayersTranslucencyManager();e&&(t?this._setSelfAdaption():this.closeSelfAdaption())},setGlobeBackFaceAlpha:function(t){this.cameraSetting.undgrdParams.groundAlpha=t,this._setGlobeBackFaceAlpha(this.cameraSetting.undgrdParams.groundAlpha)},_setGlobeBackFaceAlpha:function(t){var e=this.getImageLayersTranslucencyManager();e&&(e.imageryLayers.length>0?e.globeFaceAlpha=t:(e.frontFaceAlpha=t,e.backFaceAlpha=t))},setFOV:function(t){this.cameraSetting.fov=t,this._setFOV(this.cameraSetting.fov)},_setFOV:function(t){var e=this.viewer,n=this.Cesium;e.scene.camera.frustum.fov=n.Math.toRadians(this.cameraSetting.fov)},setSelfAdaption:function(t){this.cameraSetting.selfAdaptionParams.maxHeigh=t,this._setSelfAdaption()},_setSelfAdaption:function(){var t=this._getStepHeight(),e=this.getImageLayersTranslucencyManager();if(e){var n=e.imageryLayers;n.length>0?e.globeFaceAlphaByDistance=new Cesium.NearFarScalar(t,0,5*t,1):e.frontFaceAlphaByDistance=new Cesium.NearFarScalar(t,0,5*t,1)}},closeSelfAdaptionPanel:function(){this.cameraSetting.selfAdaption=!1,this.$refs.selfAdaption&&(this.$refs.selfAdaption.innerChecked=!1,this.$refs.selfAdaption.maxHeight="0px")},openSelfAdaptionPanel:function(){this.cameraSetting.selfAdaption=!0,this.$refs.selfAdaption&&(this.$refs.selfAdaption.innerChecked=!0,this.$refs.selfAdaption.maxHeight="fit-content")},closeSelfAdaption:function(){var t=this.getImageLayersTranslucencyManager();t&&(t.globeFaceAlphaByDistance=new Cesium.NearFarScalar(0,1,1,1),t.frontFaceAlphaByDistance=new Cesium.NearFarScalar(0,1,1,1),t.backFaceAlphaByDistance=new Cesium.NearFarScalar(0,1,1,1))},getImageLayersTranslucencyManager:function(){var t=this.vueCesium,e=this.vueIndex,n=this.vueKey,r=t.ImageLayersTranslucencyManager.findSource(n,e);if(r&&r.source)return r.source},initImageLayersTranslucencyManager:function(){var t=this.Cesium,e=this.vueCesium,n=this.vueKey,r=this.vueIndex,i=e.ImageLayersTranslucencyManager.findSource(n,r);return i||(i=new t.GlobeIndependentTranslucency(viewer),i.enabled=!0,e.ImageLayersTranslucencyManager.addSource(n,r,i)),i},_getStepHeight:function(){var t=this.boundingSphereRadius||0,e=this.cameraSetting.selfAdaptionParams.maxHeigh||4e5;return Math.min(e,t)}}},hyt=lyt,dyt=je(hyt,syt,cyt,!1,null,"a3356f68",null),fyt=dyt.exports,pyt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"light-setting"},[n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"光照",checked:t.lightSetting.sunlight},on:{changeChecked:t.enableSunlight}},[n("mapgis-ui-form",{attrs:{layout:"vertical"}},[n("mapgis-ui-form-item",{attrs:{label:"光照类型"}},[n("mapgis-ui-select",{model:{value:t.lightingModes[0].key,callback:function(e){t.$set(t.lightingModes[0],"key",e)},expression:"lightingModes[0].key"}},[n("mapgis-ui-select-option",{attrs:{value:"DAYNIGHT_SHADING"}},[t._v("\n 太阳光照\n ")]),n("mapgis-ui-select-option",{attrs:{value:"VERTEX_LIGHTING"}},[t._v("\n 顶点光照\n ")])],1)],1)],1),n("mapgis-ui-color-pick-panel",{attrs:{label:"光照颜色",color:t.lightSetting.sunlightParams.lightColor,disableAlpha:!1,labelCol:24,wrapperCol:24},on:{input:t.lightColorChange}})],1),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"模型亮度",range:[1,200]},on:{change:t.lightIntensityChange},model:{value:t.lightSetting.lightIntensity,callback:function(e){t.$set(t.lightSetting,"lightIntensity",e)},expression:"lightSetting.lightIntensity"}})],1)},myt=[],gyt=void 0,Ayt={name:"SceneEffect",mixins:[Ve],props:{initLightSetting:{type:Object,default:function(){return gyt.lightSetting}}},computed:{lightingMode:{get:function(){return this.lightSetting.sunlightParams.lightingMode},set:function(t){var e=this.viewer,n=this.Cesium;this.lightSetting.sunlightParams.lightingMode=t,e.scene.globe.lightingMode=n.LightingMode[t]}}},data:function(){return{lightingModes:[{key:"DAYNIGHT_SHADING",value:"太阳光照"},{key:"VERTEX_LIGHTING",value:"顶点光照"}],lightSetting:{sunlight:!1,sunlightParams:{lightingMode:"DAYNIGHT_SHADING",lightColor:"rgba(255,255,255,255)"},lightIntensity:10}}},watch:{initLightSetting:{handler:function(t){this.lightSetting=JSON.parse(JSON.stringify(this.initLightSetting)),this.init()},deep:!0,immediate:!0},lightSetting:{handler:function(t){this.$emit("updateLightSetting",this.lightSetting)},deep:!0}},methods:{init:function(){if(this.lightSetting){var t=this.lightSetting,e=t.sunlight,n=t.sunlightParams,r=t.lightIntensity,i=n.lightColor,o=n.lightingMode;if(this.enableSunlight(e),e){var a=this.Cesium,s=this.viewer,c=a.Color.fromCssColorString(i);s.scene.light.color=c,s.scene.globe.lightingMode=a.LightingMode[o]}this.lightIntensityChange(r)}},enableSunlight:function(t){var e=this.viewer;this.lightSetting.sunlight=t,this.$emit("updateSpin",!0);var n=this;setTimeout((function(){e.scene.globe.enableLighting=n.lightSetting.sunlight,n.$emit("updateSpin",!1)}),400)},lightColorChange:function(t){this.lightSetting.sunlightParams.lightColor="rgba(".concat(t.rgba.r,", ").concat(t.rgba.g,", ").concat(t.rgba.b,", ").concat(t.rgba.a,")");var e=this.Cesium,n=this.viewer,r=e.Color.fromCssColorString(this.lightSetting.sunlightParams.lightColor);n.scene.light.color=r},lightIntensityChange:function(t){var e=this.viewer;this.lightSetting.lightIntensity=t,e.scene.light.intensity=this.lightSetting.lightIntensity}}},vyt=Ayt,yyt=(n("4ab5"),je(vyt,pyt,myt,!1,null,"508f31b5",null)),byt=yyt.exports,wyt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"weather-setting"},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"太阳",checked:t.weatherSetting.sun},on:{changeChecked:t.enableSun}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"月亮",checked:t.weatherSetting.moon},on:{changeChecked:t.enableMoon}})],1)],1),n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"星空",checked:t.weatherSetting.sceneSkybox},on:{changeChecked:t.enableSceneSkybox}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"天空盒",checked:t.weatherSetting.skybox},on:{changeChecked:t.$_enableSkyBox}})],1)],1),n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"云层",checked:t.weatherSetting.clouds},on:{changeChecked:t.$_enableClouds}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"周期/秒",value:t.weatherSetting.cloudsParams.cloudsduration,range:t.cloudsRange},on:{change:t.cloudsDurationChange}})],1),n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"雨",checked:t.weatherSetting.rain},on:{changeChecked:t.$_enableRain}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雨速度",value:t.weatherSetting.rainParams.speed,range:t.speedRange},on:{change:t.speedChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雨透明度",value:t.weatherSetting.rainParams.rainOpacity,range:t.rainOpacityRange,step:.1},on:{change:t.rainOpacityChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雨角度",value:t.weatherSetting.rainParams.angle,range:t.angleRange,step:5},on:{change:t.angleChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雨丝长度",value:t.weatherSetting.rainParams.length,range:t.lengthRange,step:1},on:{change:t.lengthChange}})],1),n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"雪",checked:t.weatherSetting.snow},on:{changeChecked:t.$_enableSnow}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雪粒大小",value:t.weatherSetting.snowParams.size,range:t.sizeRange,step:5},on:{change:t.szChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雪密度",value:t.weatherSetting.snowParams.density,range:t.densityRange,step:5},on:{change:t.dstChange}})],1),n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"雾",checked:t.weatherSetting.fog},on:{changeChecked:t.$_enableFog}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雾透明度",value:t.weatherSetting.fogParams.fogOpacity,range:t.fogOpacityRange,step:.1},on:{change:t.fogOpacityChange}})],1),n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"雾化效果",checked:t.weatherSetting.surficialFog},on:{changeChecked:t.enableSurficialFog}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"密度",value:t.weatherSetting.surfFogParams.surfFogDst,range:t.surfFogDstRange,step:2e-4},on:{change:t.enableSurficialFog}})],1)],1)},_yt=[],xyt=void 0,Syt={name:"WeatherSetting",mixins:[Ve],props:{initWeatherSetting:{type:Object,default:function(){return xyt.weatherSetting}},isFavorites:{type:Boolean,default:!1}},data:function(){return{cloudsRange:[1,10],speedRange:[1,20],rainOpacityRange:[0,1],angleRange:[-30,30],lengthRange:[0,10],sizeRange:[5,20],densityRange:[5,20],fogOpacityRange:[0,1],surfFogDstRange:[2e-4,.002],weatherSetting:{sun:!0,moon:!0,sceneSkybox:!0,skybox:!1,clouds:!1,cloudsParams:{cloudsduration:5},rain:!1,rainParams:{speed:18,rainOpacity:.6,angle:-30,length:1},snow:!1,snowParams:{size:5,density:5},fog:!1,fogParams:{fogOpacity:.5,color:"#FFFFFF"},surficialFog:!0,surfFogParams:{surfFogDst:2e-4}}}},watch:{initWeatherSetting:{handler:function(t){this.weatherSetting=JSON.parse(JSON.stringify(this.initWeatherSetting)),this.init()},deep:!0,immediate:!0},weatherSetting:{handler:function(t){this.$emit("updateWeatherSetting",this.weatherSetting)},deep:!0}},mounted:function(){var t=this.vueKey,e=this.vueIndex;window.vueCesium.SettingToolManager.addSource(t,e,{},{GlobeCloud:null,SkyBox:null,Rain:null,Fog:null,Snow:null})},methods:{init:function(){var t=this.weatherSetting,e=t.sun,n=t.moon,r=t.sceneSkybox,i=t.skybox,o=t.clouds,a=t.cloudsParams,s=t.rain,c=(t.rainParams,t.snow),u=t.snowParams,l=t.fog,h=t.fogParams,d=t.surficialFog,f=t.surfFogParams;if(this.enableSun(e,!0),this.enableMoon(n,!0),this.enableSceneSkybox(r),this.$_enableSkyBox(i),this.$_enableClouds(o),o&&this.cloudsDurationChange(a.cloudsduration),this.$_enableRain(s),s){var p=this.rainParams,m=p.speed,g=p.rainOpacity,A=p.angle,v=p.length;this.speedChange(m),this.rainOpacityChange(g),this.angleChange(A),this.lengthChange(v)}if(this.$_enableSnow(c),c){var y=u.size,b=u.density;this.szChange(y),this.dstChange(b)}if(this.$_enableFog(l),l){var w=h.fogOpacity;h.color;this.fogOpacityChange(w)}if(this.enableSurficialFog(d),d){var _=f.surfFogDst;this.enableSurficialFog(_)}},enableSun:function(t,e){var n=this.viewer;if(this.weatherSetting.sun=t,!(n.scene.sun.show===this.weatherSetting.sun||this.isFavorites&&e))if(n.scene.sun.show=this.weatherSetting.sun,this.weatherSetting.sun){var r=n.scene.sun._boundingVolume.center;0!==r.x&&0!==r.y&&0!==r?n.camera.flyTo({destination:new Cesium.Cartesian3(-r.x/2e3,-r.y/2e3,-r.z/4e3),orientation:{heading:Cesium.Math.toRadians(90),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(-20)},duration:.5}):n.camera.flyHome(.5)}else n.camera.flyHome(.5)},enableMoon:function(t,e){var n=this.viewer;if(this.weatherSetting.moon=t,!(n.scene.moon.show===this.weatherSetting.moon||this.isFavorites&&e))if(n.scene.moon.show=this.weatherSetting.moon,this.weatherSetting.moon){var r=n.scene.moon._ellipsoidPrimitive._boundingSphere.center;0!==r.x&&0!==r.y&&0!==r?n.camera.flyTo({destination:new Cesium.Cartesian3(r.x/1.2,r.y/1.2,r.z/1.2),orientation:{heading:0,pitch:Cesium.Math.toRadians(90),roll:0},duration:.5}):n.camera.flyHome(.5)}else n.camera.flyHome(.5)},enableSceneSkybox:function(t){var e=this.viewer;this.weatherSetting.sceneSkybox=t,e.scene.skyBox.show=this.weatherSetting.sceneSkybox},$_enableSkyBox:function(t){this.weatherSetting.skybox=t;var e=this;e.weatherSetting.skybox?e.enableSkyBox():e.removeSkyBox()},enableSkyBox:function(){var t=this.vueKey,e=this.vueIndex,n=this.viewer,r=this.Cesium,i=new r.GlobeEffect(n,{cloudsDuration:1e5});i.addDefaultSkyBox("SkyBox3"),window.vueCesium.SettingToolManager.changeOptions(t,e,"SkyBox",i)},removeSkyBox:function(){var t=this.vueKey,e=this.vueIndex,n=(this.viewer,this.Cesium,window.vueCesium["SettingToolManager"].findSource(t,e));n&&n.options&&n.options.SkyBox&&(n.options.SkyBox.removeSkyBox(),window.vueCesium["SettingToolManager"].changeOptions(t,e,"SkyBox",null))},$_enableClouds:function(t){this.$emit("updateSpin",!0),this.weatherSetting.clouds=t;var e=this;setTimeout((function(){e.weatherSetting.clouds?e.enableClouds():e.removeClouds(),e.$emit("updateSpin",!1)}),400)},cloudsDurationChange:function(t){var e=this;this.weatherSetting.cloudsParams.cloudsduration=t,this.weatherSetting.clouds&&(e.removeClouds(),e.enableClouds())},enableClouds:function(){var t=this.vueKey,e=this.vueIndex,n=this.viewer,r=this.Cesium,i=1e3*this.weatherSetting.cloudsParams.cloudsduration,o=new r.GlobeEffect(n,{cloudsDuration:i,cloudsImgSource:r.buildModuleUrl("Assets/Images/clouds.png")});o.addGlobeClouds(),window.vueCesium["SettingToolManager"].changeOptions(t,e,"GlobeCloud",o)},removeClouds:function(){var t=this.vueKey,e=this.vueIndex,n=(this.viewer,this.Cesium,window.vueCesium["SettingToolManager"].findSource(t,e));n&&n.options&&n.options.GlobeCloud&&(n.options.GlobeCloud.removeGlobeClouds(),window.vueCesium["SettingToolManager"].changeOptions(t,e,"GlobeCloud",null))},$_enableRain:function(t){this.$emit("updateSpin",!0),this.weatherSetting.rain=t;var e=this;setTimeout((function(){e.weatherSetting.rain?e.enableRain():e.removeWeather("Rain"),e.$emit("updateSpin",!1)}),400)},speedChange:function(t){var e=this;this.weatherSetting.rainParams.speed=t,this.weatherSetting.rain&&e.enableRain()},rainOpacityChange:function(t){var e=this;this.weatherSetting.rainParams.rainOpacity=t,this.weatherSetting.rain&&e.enableRain()},angleChange:function(t){var e=this;this.weatherSetting.rainParams.angle=t,this.weatherSetting.rain&&e.enableRain()},lengthChange:function(t){var e=this;this.weatherSetting.rainParams.length=t,this.weatherSetting.rain&&e.enableRain()},$_enableSnow:function(t){this.$emit("updateSpin",!0),this.weatherSetting.snow=t;var e=this;setTimeout((function(){e.weatherSetting.snow?e.enableSnow():e.removeWeather("Snow"),e.$emit("updateSpin",!1)}),400)},szChange:function(t){var e=this;this.weatherSetting.snowParams.size=t,this.weatherSetting.snow&&e.enableSnow()},dstChange:function(t){var e=this;this.weatherSetting.snowParams.density=t,this.weatherSetting.snow&&e.enableSnow()},$_enableFog:function(t){this.$emit("updateSpin",!0),this.weatherSetting.fog=t;var e=this;setTimeout((function(){e.weatherSetting.fog?e.enableFog():e.removeWeather("Fog"),e.$emit("updateSpin",!1)}),400)},fogOpacityChange:function(t){var e=this;this.weatherSetting.fogParams.fogOpacity=t,this.weatherSetting.fog&&e.enableFog()},enableRain:function(){var t=this.weatherSetting.rainParams,e=t.speed,n=t.angle,r=t.length,i=t.rainOpacity,o={speed:e,angle:n,rainLength:r,alpha:i};this.$_enableWeather("Rain",o)},enableSnow:function(){var t=this.weatherSetting.snowParams,e=t.density,n=t.size,r={size:e,scale:n};this.$_enableWeather("Snow",r)},enableFog:function(){var t=this.Cesium,e=t.Color.fromCssColorString(this.weatherSetting.fogParams.color),n={fogcolor:e,alpha:this.weatherSetting.fogParams.fogOpacity};this.$_enableWeather("Fog",n)},$_enableWeather:function(t,e){var n=this.vueKey,r=this.vueIndex,i=this.viewer,o=this.Cesium;this.removeWeather(t);var a=new o.WeatherEffect(i);switch(t){case"Rain":a.addRain(e),window.vueCesium["SettingToolManager"].changeOptions(n,r,"Rain",a);break;case"Snow":a.addSnow(e),window.vueCesium["SettingToolManager"].changeOptions(n,r,"Snow",a);break;case"Fog":a.addFog(e),window.vueCesium["SettingToolManager"].changeOptions(n,r,"Fog",a);break;default:a.log("传参错误");break}},removeWeather:function(t){var e=this.vueKey,n=this.vueIndex,r=window.vueCesium["SettingToolManager"].findSource(e,n);r&&r.options&&Object.keys(r.options).forEach((function(i){if(i===t&&r.options[t]){switch(t){case"Rain":r.options.Rain.removeRain();break;case"Snow":r.options.Snow.removeSnow();break;case"Fog":r.options.Fog.removeFog();break}window.vueCesium["SettingToolManager"].changeOptions(e,n,t,null)}}))},enableSurficialFog:function(t){var e=this.viewer,n=this;"boolean"===typeof t?n.weatherSetting.surficialFog=t:n.weatherSetting.surfFogParams.surfFogDst=t,e.scene.fog.density=this.weatherSetting.surfFogParams.surfFogDst,e.scene.fog.enabled=this.weatherSetting.surficialFog}}},Cyt=Syt,Myt=(n("9fbc"),je(Cyt,wyt,_yt,!1,null,"4e8ee64a",null)),Lyt=Myt.exports,Tyt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"effect-setting"},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"黑白照片",checked:t.effectSetting.blckWhite},on:{changeChecked:t.blackAndWhiteChange}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"夜视效果",checked:t.effectSetting.ntVision},on:{changeChecked:t.nightVision}})],1)],1),n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"场景泛光",checked:t.effectSetting.bloom},on:{changeChecked:t.enableBloom}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"亮度",value:t.effectSetting.bloomParams.bloomBrt,range:t.bloomBrtRange,step:.05},on:{change:t.bloomBrtChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"对比度",value:t.effectSetting.bloomParams.bloomCtrst,range:t.bloomCtrstRange,step:10},on:{change:t.bloomCtrstChange}})],1)],1)},kyt=[],Eyt=void 0,Oyt={name:"EffectSetting",mixins:[Ve],props:{initEffectSetting:{type:Object,default:function(){return Eyt.effectSetting}}},data:function(){return{bloomBrtRange:[-.6,.2],bloomCtrstRange:[-255,255],effectSetting:{blckWhite:!1,ntVision:!1,bloom:!1,bloomParams:{bloomBrt:-.3,bloomCtrst:128}}}},watch:{initEffectSetting:{handler:function(t){this.effectSetting=JSON.parse(JSON.stringify(this.initEffectSetting)),this.init()},deep:!0,immediate:!0},effectSetting:{handler:function(t){this.$emit("updateEffectSetting",this.effectSetting)},deep:!0}},methods:{init:function(){if(this.effectSetting){var t=this.effectSetting,e=t.blckWhite,n=t.ntVision,r=t.bloom,i=t.bloomParams,o=i.bloomBrt,a=i.bloomCtrst;this.enableBloom(r),r&&(this.bloomBrtRange(o),this.bloomCtrstRange(a)),this.blackAndWhiteChange(e),this.nightVision(n)}},enableBloom:function(t){var e=this.viewer;this.effectSetting.bloom=t,this.$emit("updateSpin",!0);var n=this;setTimeout((function(){e.scene.postProcessStages.bloom.enabled=n.effectSetting.bloom,n.$emit("updateSpin",!1)}),400)},bloomBrtChange:function(t){var e=this.viewer;this.effectSetting.bloomParams.bloomBrt=t,e.scene.postProcessStages.bloom.uniforms.brightness=this.effectSetting.bloomParams.bloomBrt},bloomCtrstChange:function(t){var e=this.viewer;this.effectSetting.bloomParams.bloomCtrst=t,e.scene.postProcessStages.bloom.uniforms.contrast=this.effectSetting.bloomParams.bloomCtrst},blackAndWhiteChange:function(t){var e=this.viewer,n=this.Cesium;this.effectSetting.blckWhite=t;var r=this;if(r.effectSetting.blckWhite){r.removeOtherStages();var i=e.scene.postProcessStages.add(n.PostProcessStageLibrary.createBlackAndWhiteStage());i.uniforms.gradations=5}else r.removeOtherStages()},nightVision:function(t){var e=this.viewer,n=this.Cesium;this.effectSetting.ntVision=t;var r=this;r.effectSetting.ntVision?(r.removeOtherStages(),e.scene.postProcessStages.add(n.PostProcessStageLibrary.createNightVisionStage())):r.removeOtherStages()},removeOtherStages:function(){var t=this.viewer,e=t.scene.postProcessStages._activeStages.length;e>0&&t.scene.postProcessStages.removeAll()}}},Pyt=Oyt,Byt=(n("2290"),je(Pyt,Tyt,kyt,!1,null,"cb87d5fa",null)),Iyt=Byt.exports,Dyt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.isWidgetOpen?n("autonomous-roaming",{staticClass:"mapgis-3d-autonomous-roaming",attrs:{isRunning:t.isRunning},on:{load:t.load,unload:t.unload}},[n("div",{staticClass:"footer",attrs:{slot:""},slot:"default"},[n("mapgis-ui-collapse",{attrs:{"expand-icon-position":"right"}},[n("mapgis-ui-collapse-panel",{key:"1",attrs:{header:"查看操作说明"}},[n("img",{staticStyle:{width:"100%"},attrs:{src:t.imgSrc}})])],1),n("div",{staticClass:"footer-operate"},[n("mapgis-ui-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.fullScreenRoaming(!0)}}},[t._v("全屏漫游")]),n("mapgis-ui-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.fullScreenRoaming(!1)}}},[t._v("非全屏漫游")]),n("mapgis-ui-button",{attrs:{type:"primary",size:"small"},on:{click:t.stopRoaming}},[t._v("停止漫游")])],1)],1)]):t._e()},Nyt=[],Fyt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"autonomous-roaming"},[n("mapgis-ui-switch-row-left",{attrs:{title:"鼠标控制模式",disabled:t.isRunning},on:{change:t.enableEnableMouseLook},model:{value:t.roamingSettings.enableMouseLook,callback:function(e){t.$set(t.roamingSettings,"enableMouseLook",e)},expression:"roamingSettings.enableMouseLook"}}),n("mapgis-ui-switch-row-left",{attrs:{title:"碰撞检测"},on:{change:t.enableCollisionDetectionChange},model:{value:t.roamingSettings.enableCollisionDetection,callback:function(e){t.$set(t.roamingSettings,"enableCollisionDetection",e)},expression:"roamingSettings.enableCollisionDetection"}}),n("mapgis-ui-input-number-panel",{staticStyle:{"padding-left":"10px"},attrs:{size:"large",label:"移动步长",range:[0,10]},on:{change:t.moveStepChange},model:{value:t.roamingSettings.moveStep,callback:function(e){t.$set(t.roamingSettings,"moveStep",e)},expression:"roamingSettings.moveStep"}}),t._t("default")],2)},jyt=[],Ryt={name:"AutonomousRoaming",inject:["Cesium","vueCesium","viewer"],props:{isRunning:{type:Boolean,default:!1}},data:function(){return{roamingSettings:{enableCollisionDetection:!1,enableMouseLook:!1,moveStep:1}}},mounted:function(){this.mount()},destroyed:function(){this.unmount()},methods:{mount:function(){var t=this.roamingSettings,e=t.enableCollisionDetection,n=t.enableMouseLook,r=t.moveStep;this.roamingTool=new Cesium.KeyboardCameraController(viewer,{enableMouseLook:n,mouseSensitivity:6,enableDynamicMoveStep:!1,moveStep:r,rotateStep:1,enableCollisionDetection:e}),this.$emit("load",this.roamingTool)},unmount:function(){this.roamingTool&&(this.roamingTool=null),this.$emit("unload",this.roamingTool)},enableCollisionDetectionChange:function(t){this.roamingTool.enableCollisionDetection=t},moveStepChange:function(t){this.roamingTool.moveStep=t},enableEnableMouseLook:function(t){this.roamingTool.enableMouseLook=t}}},Hyt=Ryt,zyt=(n("167d"),je(Hyt,Fyt,jyt,!1,null,"3f5191c5",null)),Uyt=zyt.exports,Vyt={name:"AutonomousRoamingSetting",components:{AutonomousRoaming:Uyt},props:{publicPath:{type:String},isWidgetOpen:{type:Boolean,default:!1}},data:function(){return{isRunning:!1}},computed:{imgSrc:function(){return"".concat(this.publicPath,"autonomousRoaming/autonomous-roaming-keyboard-demo.png")}},mounted:function(){},methods:{load:function(t){this.roamingTool=t},fullScreenRoaming:function(t){this.isRunning=!0,this.roamingTool.enableMouseLook=t,this.roamingTool.start()},stopRoaming:function(){this.isRunning=!1,this.roamingTool.stop()},unload:function(t){this.stopRoaming(),this.roamingTool=t}}},Yyt=Vyt,Gyt=(n("38dd"),n("221a"),je(Yyt,Dyt,Nyt,!1,null,"dcc8c176",null)),Qyt=Gyt.exports,Wyt={name:"mapgis-3d-scene-setting",components:{BasicSetting:ayt,CameraSetting:fyt,LightSetting:byt,WeatherSetting:Lyt,EffectSetting:Iyt,AutonomousRoamingSetting:Qyt},mixins:[Ve],props:{panelStyle:{type:Object},initParams:{type:Object,default:function(){return{}}},initFavoritesParams:{type:Object,default:function(){return{}}},boundingSphereRadius:{type:Number,default:0},baseLayerIds:{type:Array,default:function(){return[]}},publicPath:{type:String,default:"/"},isWidgetOpen:{type:Boolean,default:!1},stuffWidth:{type:Number}},computed:{initBasicSetting:function(){return this.initFavoritesBasicSetting?this.initFavoritesBasicSetting:this.initParams.basicSetting||{earth:!0,skyAtmosphere:!0,shadow:!1,depthTest:!1,FPS:!1,timeline:!1,compass:!1,zoom:!1,statebar:!0,sceneMode:!1,layerbrightness:1,layercontrast:1,layerhue:0,layersaturation:1}},initFavoritesBasicSetting:function(){return this.initFavoritesParams.basicSetting},initCameraSetting:function(){return this.initFavoritesCameraSetting?this.initFavoritesCameraSetting:this.initParams.cameraSetting||{selfAdaption:!1,selfAdaptionParams:{maxHeigh:4e5},undgrd:!1,undgrdParams:{groundAlpha:.5,enableIndependentTranslucency:!1},fov:60}},initFavoritesCameraSetting:function(){return this.initFavoritesParams.cameraSetting},initLightSetting:function(){return this.initFavoritesLightSetting?this.initFavoritesLightSetting:this.initParams.lightSetting||{sunlight:!1,sunlightParams:{lightingMode:"DAYNIGHT_SHADING",lightColor:"rgba(255,255,255,255)"},lightIntensity:10}},initFavoritesLightSetting:function(){return this.initFavoritesParams.lightSetting},initWeatherSetting:function(){return this.initFavoritesWeatherSetting?(this.isFavorites=!0,this.initFavoritesWeatherSetting):(this.isFavorites=!1,this.initParams.weatherSetting||{sun:!0,moon:!0,sceneSkybox:!0,skybox:!1,clouds:!1,cloudsParams:{cloudsduration:5},rain:!1,rainParams:{speed:18,rainOpacity:.6,angle:-30,length:1},snow:!1,snowParams:{size:5,density:5},fog:!1,fogParams:{fogOpacity:.5,color:"#FFFFFF"},surficialFog:!0,surfFogParams:{surfFogDst:2e-4}})},initFavoritesWeatherSetting:function(){return this.initFavoritesParams.weatherSetting},initEffectSetting:function(){return this.initFavoritesEffectSetting?this.initFavoritesEffectSetting:this.initParams.effectSetting||{blckWhite:!1,ntVision:!1,bloom:!1,bloomParams:{bloomBrt:-.3,bloomCtrst:128}}},initFavoritesEffectSetting:function(){return this.initFavoritesParams.effectSetting}},data:function(){return{modelBloom:!1,transform:void 0,tabBarStyle:{margin:"0px",textAlign:"center"},show:!0,hover:!1,spinning:!1,depthTest:void 0,sceneMode:void 0,basicSetting:void 0,cameraSetting:void 0,LightSetting:void 0,weatherSetting:void 0,effectSetting:void 0,isFavorites:!1}},mounted:function(){this.mount()},destroyed:function(){this.unmount()},methods:{mount:function(){var t=this.viewer;this.depthTest=I(t),this.sceneMode=3!==t.scene.mode,this.$emit("loaded",this)},unmount:function(){this.$_deleteManger("SettingToolManager",(function(t){console.log("destroyed")})),this.$emit("unload")},togglePanel:function(){this.show=!this.show},closePanel:function(){this.show=!1},changeSpinning:function(t){this.spinning=t},updateBasicSetting:function(t){this.basicSetting=t},getBasicSetting:function(t){return this.basicSetting||this.initBasicSetting},updateCameraSetting:function(t){this.cameraSetting=t},getCameraSetting:function(t){return this.cameraSetting||this.initCameraSetting},updateLightSetting:function(t){this.lightSetting=t},getLightSetting:function(t){return this.lightSetting||this.initLightSetting},updateWeatherSetting:function(t){this.weatherSetting=t},getWeatherSetting:function(t){return this.weatherSetting||this.initWeatherSetting},updateEffectSetting:function(t){this.effectSetting=t},getEffectSetting:function(t){return this.effectSetting||this.initEffectSetting},updateIndependentTranslucency:function(){this.$refs.cameraSetting.updateIndependentTranslucency()}}},Kyt=Wyt,qyt=(n("e24d"),je(Kyt,Qvt,Wvt,!1,null,"4af2b6c7",null)),Xyt=qyt.exports,$yt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._t("default",(function(){return[n("div",{staticClass:"mapgis-widget-scene-roaming"},[t.roaming?n("div",[n("mapgis-ui-group-tab",[n("div",{staticClass:"header",attrs:{slot:"title"},on:{click:t.onGotoHome},slot:"title"},[n("div",[n("mapgis-ui-iconfont",{staticClass:"return",attrs:{type:"mapgis-left"}})],1),n("div",{staticClass:"name"},[t._v(t._s(t.roamingPath.name))])])]),n("path-roaming",{ref:"refPathRoaming",attrs:{positions:t.roamingPath.path,models:t.models,setting:t.roamingPath.para},on:{"update-setting":t.updateSetting,"remove-road":t.removeRoad,"show-road":t.showRoad,"toggle-road":t.toggleRoad}})],1):n("div",[t.interactiveAdding?n("div",{staticClass:"path-container"},[n("mapgis-ui-group-tab",{attrs:{title:"基本信息"}}),n("mapgis-ui-setting-form",{staticClass:"mapgis-ui-setting-form",attrs:{layout:t.layout,size:"default"}},[n("mapgis-ui-form-item",{attrs:{label:"名称"}},[n("mapgis-ui-input",{staticClass:"full-width",attrs:{allowClear:""},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}})],1)],1),n("mapgis-ui-group-tab",{attrs:{title:"路线坐标"}}),t.positions&&t.positions.length>0?n("mapgis-ui-table",{staticClass:"path-list position-list",attrs:{size:"small",columns:t.addedPositionsColumns,"data-source":t.positions,rowKey:function(t){return t.number}},scopedSlots:t._u([t._l(["x","y","z"],(function(e){return{key:e,fn:function(r,i){return[i.editable?n("mapgis-ui-input",{key:e,attrs:{value:r},on:{change:function(n){return t.handleChange(n.target.value,i.number,e)}}}):n("div",{key:e,staticClass:"path-position",attrs:{title:r}},[t._v("\n "+t._s(r)+"\n ")])]}}})),{key:"operation",fn:function(e,r){return[r.editable?n("span",[n("a",{on:{click:function(e){return t.savePosition(r.number)}}},[t._v("保存")])]):n("span",[n("a",{on:{click:function(e){return t.editPosition(r.number)}}},[t._v("编辑")])])]}}],null,!0)}):n("mapgis-ui-empty",{attrs:{image:t.emptyImage,description:t.emptyDescription}})],1):n("div",{staticClass:"path-container"},[n("mapgis-ui-group-tab",{attrs:{title:t.pathTotal}},[n("mapgis-ui-toolbar",{attrs:{slot:"handle",bordered:!1},slot:"handle"},t._l(t.toolbarList,(function(t,e){return n("mapgis-ui-toolbar-command",{key:e,attrs:{icon:t.icon,title:t.title},on:{click:t.click}})})),1)],1),n("div",{staticClass:"path-list"},t._l(t.pathsCopy,(function(e,r){return n("path-item",{key:r,attrs:{path:e},on:{"goto-path":function(n){return t.onGotoPath(e)},"delete-path":function(n){return t.onDeletePath(e)},"change-path-name":function(n){t.onChangePathName(n,e.id)}}})})),1)],1),n("mapgis-ui-setting-footer",[t.interactiveAdding?n("div",[n("mapgis-ui-button",{on:{click:t.onAddPathCancel}},[t._v("\n 取消\n ")]),n("mapgis-ui-button",{attrs:{type:"primary",disabled:t.addedPositions.length<2},on:{click:t.onAddPathComplete}},[t._v("\n 完成\n ")])],1):n("div",{staticClass:"full-width"},[n("mapgis-ui-button",{staticClass:"full-width",attrs:{type:"primary"},on:{click:t.onAddPathStart}},[t._v("\n 添加路线\n ")])],1)])],1)]),t.pathImportModalVisible?n("path-import",{attrs:{visible:t.pathImportModalVisible,importModalType:t.importModalType},on:{"close-path-import-modal":t.closePathImportModal,"update-paths":t.updatePaths,"update-wl":t.updateWl}}):t._e()]}))],2)},Jyt=[],Zyt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("mapgis-ui-card",{staticClass:"path-item",attrs:{type:"inner"}},[n("div",{staticClass:"path-content"},[t.editable?[t.editable?n("mapgis-ui-input",{staticClass:"name-input",attrs:{value:t.name},on:{change:function(e){return t._onNameChange(e.target.value)}}}):t._e(),n("a",{on:{click:t.onSavePathName}},[t._v("保存")]),n("mapgis-ui-divider",{staticClass:"name-action-divider",attrs:{type:"vertical"}}),n("a",{on:{click:t.onCancelRenamePath}},[t._v("取消")])]:[n("div",{staticClass:"name",on:{click:function(e){return t.$emit("goto-path")}}},[t._v("\n "+t._s(t.name)+"\n ")]),n("div",{class:["actions",t.actionMenuVisible?"actions-visible":""]},[n("mapgis-ui-iconfont",{attrs:{type:"mapgis-info",title:t.path.path.join()}}),n("mapgis-ui-popover",{attrs:{placement:"bottomLeft","arrow-point-at-center":"",trigger:"click",overlayClassName:"scene-roaming-path-item-popover",getPopupContainer:function(t){return t.parentNode}},model:{value:t.actionMenuVisible,callback:function(e){t.actionMenuVisible=e},expression:"actionMenuVisible"}},[n("mapgis-ui-list",{attrs:{slot:"content",gutter:10},slot:"content"},[n("mapgis-ui-list-item",{on:{click:t.onRenamePath}},[t._v("\n 重命名\n ")]),n("mapgis-ui-list-item",{on:{click:t.onDeletePath}},[t._v("\n 删除\n ")])],1),n("mapgis-ui-iconfont",{attrs:{type:"mapgis-more"}})],1)],1)]],2)])},tbt=[],ebt={name:"path-item",props:{path:{type:Object,required:!0,default:function(){}}},watch:{"path.name":{handler:function(){this.name=this.path.name},immediate:!0}},data:function(){return{name:"",actionMenuVisible:!1,editable:!1}},methods:{onRenamePath:function(){this.actionMenuVisible=!1,this.editable=!0},_onNameChange:function(t){this.name=t},onSavePathName:function(){this.editable=!1,this.$emit("change-path-name",this.name)},onCancelRenamePath:function(){this.editable=!1,this.name=this.path.name},onDeletePath:function(){this.actionMenuVisible=!1,this.$emit("delete-path")}}},nbt=ebt,rbt=(n("a7ad"),je(nbt,Zyt,tbt,!1,null,"7f160102",null)),ibt=rbt.exports,obt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._t("default",(function(){return[n("div",{staticClass:"mapgis-path-roaming"},[n("mapgis-ui-setting-form",{attrs:{layout:t.layout,size:"default"}},[n("mapgis-ui-form-item",{attrs:{label:"移动速度"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-input-number-addon",{attrs:{min:1,"addon-after":"公里/小时",disabled:!!t.isStart},model:{value:t.settingCopy.speed,callback:function(e){t.$set(t.settingCopy,"speed",t._n(e))},expression:"settingCopy.speed"}})],1)],1)],1),n("mapgis-ui-form-item",{attrs:{label:"高程类型"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-radio-group",{model:{value:t.settingCopy.elevationType,callback:function(e){t.$set(t.settingCopy,"elevationType",e)},expression:"settingCopy.elevationType"}},[n("mapgis-ui-radio",{attrs:{value:"addition"}},[t._v("\n 附加高程\n ")]),n("mapgis-ui-radio",{attrs:{value:"absolute"}},[t._v("\n 绝对高程\n ")])],1)],1)],1)],1),n("mapgis-ui-form-item",{attrs:{label:"高程"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-input-number-addon",{attrs:{min:0,"addon-after":"米",disabled:!!t.isStart},model:{value:t.settingCopy.exHeight,callback:function(e){t.$set(t.settingCopy,"exHeight",t._n(e))},expression:"settingCopy.exHeight"}})],1)],1)],1),n("mapgis-ui-input-number-panel",{directives:[{name:"show",rawName:"v-show",value:1!==t.settingCopy.animationType,expression:"settingCopy.animationType !== 1"}],attrs:{size:"large",label:"方位角",range:[-180,180],disabled:1===t.settingCopy.animationType},on:{change:function(e){return t.onEffectsChange(e,"heading")}},model:{value:t.settingCopy.heading,callback:function(e){t.$set(t.settingCopy,"heading",e)},expression:"settingCopy.heading"}}),n("mapgis-ui-input-number-panel",{directives:[{name:"show",rawName:"v-show",value:2===t.settingCopy.animationType,expression:"settingCopy.animationType === 2"}],attrs:{size:"large",label:"俯仰角",range:[-180,180],disabled:2!==t.settingCopy.animationType},on:{change:function(e){return t.onEffectsChange(e,"pitch")}},model:{value:t.settingCopy.pitch,callback:function(e){t.$set(t.settingCopy,"pitch",e)},expression:"settingCopy.pitch"}}),n("mapgis-ui-input-number-panel",{directives:[{name:"show",rawName:"v-show",value:t.showDistanceSlider(),expression:"showDistanceSlider()"}],attrs:{size:"large",label:"距离",range:[1,200],disabled:1===t.settingCopy.animationType},on:{change:function(e){return t.changeRange(e)}},model:{value:t.settingCopy.range,callback:function(e){t.$set(t.settingCopy,"range",e)},expression:"settingCopy.range"}}),n("mapgis-ui-form-item",{attrs:{label:"视角"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-select",{on:{change:t.onTypeChange},model:{value:t.settingCopy.animationType,callback:function(e){t.$set(t.settingCopy,"animationType",e)},expression:"settingCopy.animationType"}},t._l(t.perspectiveOptions,(function(e){return n("mapgis-ui-select-option",{key:e.value},[t._v("\n "+t._s(e.label)+"\n ")])})),1)],1)],1)],1),n("mapgis-ui-form-item",{attrs:{label:"插值"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-select",{attrs:{disabled:!!t.isStart},model:{value:t.settingCopy.interpolationAlgorithm,callback:function(e){t.$set(t.settingCopy,"interpolationAlgorithm",e)},expression:"settingCopy.interpolationAlgorithm"}},t._l(t.interpolationOptions,(function(e){return n("mapgis-ui-select-option",{key:e.value},[t._v("\n "+t._s(e.label)+"\n ")])})),1)],1)],1)],1),n("mapgis-ui-form-item",{attrs:{label:"模型"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-select",{attrs:{disabled:t.isStart},on:{change:t.onModelChange},model:{value:t.modelUrl,callback:function(e){t.modelUrl=e},expression:"modelUrl"}},t._l(t.models,(function(e){return n("mapgis-ui-select-option",{key:e.value},[t._v("\n "+t._s(e.label)+"\n ")])})),1)],1)],1)],1),t.modelUrl?n("mapgis-ui-form-item",{attrs:{label:"模型缩放比例"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-input-number-addon",{attrs:{min:0,step:.1,disabled:!!t.isStart},model:{value:t.settingCopy.modelScale,callback:function(e){t.$set(t.settingCopy,"modelScale",t._n(e))},expression:"settingCopy.modelScale"}})],1)],1)],1):t._e(),t.modelUrl?n("mapgis-ui-form-item",[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"模型方位角",range:[-180,180]},on:{change:function(e){return t.modelHeadingChange(e)}},model:{value:t.settingCopy.modelHeading,callback:function(e){t.$set(t.settingCopy,"modelHeading",e)},expression:"settingCopy.modelHeading"}})],1):t._e()],1),n("div",[n("mapgis-ui-checkbox",{staticStyle:{"line-height":"32px"},attrs:{checked:t.settingCopy.isLoop},on:{change:function(e){return t.onCheckBoxChange(e.target.checked,"isLoop")}}},[t._v("\n 循环\n ")]),n("mapgis-ui-checkbox",{staticStyle:{"line-height":"32px"},attrs:{checked:t.settingCopy.showPath},on:{change:function(e){return t.onCheckBoxChange(e.target.checked,"showPath")}}},[t._v("\n 显示路径\n ")]),n("mapgis-ui-checkbox",{staticStyle:{"line-height":"32px"},attrs:{checked:t.settingCopy.showInfo},on:{change:function(e){return t.onCheckBoxChange(e.target.checked,"showInfo")}}},[t._v("\n 显示提示信息\n ")])],1)],1),n("mapgis-ui-setting-footer",[n("mapgis-ui-button",{attrs:{type:"primary",title:t.playTitle},on:{click:t.onClickStartOrPauseOrResume}},[t._v(t._s(t.playTitle))]),n("mapgis-ui-button",{attrs:{type:"primary",disabled:!t.isStart},on:{click:function(e){return t.onClickStop(!1)}}},[t._v("停止")])],1)]}))],2)},abt=[];function sbt(t){return sbt="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},sbt(t)}function cbt(t){return dbt(t)||hbt(t)||lbt(t)||ubt()}function ubt(){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 lbt(t,e){if(t){if("string"==typeof t)return fbt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fbt(t,e):void 0}}function hbt(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function dbt(t){if(Array.isArray(t))return fbt(t)}function fbt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function pbt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */pbt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof A?e:A,a=Object.create(o.prototype),s=new E(r||[]);return i(a,"_invoke",{value:M(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function A(){}function v(){}function y(){}var b={};u(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(O([])));_&&_!==n&&r.call(_,a)&&(b=_);var x=y.prototype=A.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(i,o,a,s){var c=h(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==sbt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function M(e,n,r){var i=d;return function(o,a){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var u=h(e,n,r);if("normal"===u.type){if(i=r.done?m:f,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(sbt(e)+" is not iterable")}return v.prototype=y,i(x,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(C.prototype),u(C.prototype,s,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new C(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),u(x,c,"Generator"),u(x,a,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function mbt(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function gbt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){mbt(o,r,i,a,s,"next",t)}function s(t){mbt(o,r,i,a,s,"throw",t)}a(void 0)}))}}function Abt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function vbt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Abt(Object(n),!0).forEach((function(e){ybt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Abt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ybt(t,e,n){return(e=bbt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bbt(t){var e=wbt(t,"string");return"symbol"==sbt(e)?e:e+""}function wbt(t,e){if("object"!=sbt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=sbt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var _bt={name:"mapgis-3d-path-roaming",inject:["Cesium","vueCesium","viewer"],props:vbt(vbt({},ln),{},{layout:{type:String,default:"vertical"},setting:{type:Object,default:function(){return{speed:10,elevationType:"addition",exHeight:1,heading:90,pitch:0,range:1,animationType:1,interpolationAlgorithm:"LagrangePolynomialApproximation",isLoop:!0,showPath:!0,showInfo:!0,modelUrl:"",modelScale:1,modelHeading:0}}},positions:{type:Array,required:!0,default:function(){return[]}},models:{type:Array,required:!0,default:function(){return[]}}}),computed:{playTitle:function(){return this.isStart?this.isPause?"继续":"暂停":"开始"}},watch:{models:{handler:function(){this.models.length>0&&this.models[0].value?""!==this.modelUrl&&this.models.includes(this.modelUrl)||(this.modelUrl=this.models[0].value):this.modelUrl=""},deep:!0,immediate:!0},setting:{handler:function(){this.settingCopy=JSON.parse(JSON.stringify(this.setting)),this.modelUrl=this.settingCopy.modelUrl&&""!==this.settingCopy.modelUrl?this.settingCopy.modelUrl:"",this.settingCopy.elevationType||(this.settingCopy.elevationType="addition"),"number"!==typeof this.settingCopy.modelScale&&this.$set(this.settingCopy,"modelScale",1),"number"!==typeof this.settingCopy.modelHeading&&this.$set(this.settingCopy,"modelHeading",0)},immediate:!0}},data:function(){return{settingCopy:{speed:10,exHeight:1,heading:90,pitch:0,range:1,animationType:1,interpolationAlgorithm:"LagrangePolynomialApproximation",isLoop:!0,showPath:!0,showInfo:!0,modelScale:1},isStart:!1,isPause:!1,perspectiveOptions:[{label:"跟随",value:1},{label:"锁定第一视角",value:2},{label:"上帝视角",value:3}],interpolationOptions:[{label:"拉格朗日插值",value:"LagrangePolynomialApproximation"},{label:"线性近似",value:"LinearApproximation"},{label:"埃尔米特插值",value:"HermitePolynomialApproximation"}],modelUrl:"",showPathBack:!0,showInfoBack:!0}},created:function(){},mounted:function(){this.mount()},destroyed:function(){this.unmount()},methods:{createCesiumObject:function(){var t=gbt(pbt().mark((function t(){return pbt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){t()}),(function(t){})));case 1:case"end":return t.stop()}}),t)})));function e(){return t.apply(this,arguments)}return e}(),mount:function(){window.SceneWanderManager={animation:null},window.SceneWanderManager.animation=new this.Cesium.AnimationTool(this.viewer,{modelUrl:this.modelUrl,model:{scale:this.settingCopy.modelScale},onPositionTag:!0,isSetModelPosture:!0,callback:function(t){}});var t=this,e=this.createCesiumObject();e.then((function(e){t.$emit("load",t)}))},unmount:function(){this.onClickStop(!0),this.$emit("unload",this)},onClickStartOrPauseOrResume:function(){var t,e=this;this.isStart?(this.isPause?window.SceneWanderManager.animation.pause=!1:window.SceneWanderManager.animation.pause=!0,this.isPause=!this.isPause):(this.$emit("remove-road"),this.positions.length>0&&(t=this.positions[0]instanceof Object?JSON.parse(JSON.stringify(this.positions)).flatMap((function(t){return[t.x,t.y,"addition"===e.settingCopy.elevationType?t.z:e.settingCopy.exHeight]})).flat():"addition"===this.settingCopy.elevationType?JSON.parse(JSON.stringify(this.positions)):this.getAbsolutePositions(),window.SceneWanderManager.animation.positions=this.Cesium.Cartesian3.fromDegreesArrayHeights(t),this._setAnimationAttr(),window.SceneWanderManager.animation.start(),this.isStart=!0,this.isPause=!1))},onClickStop:function(t){this.isStart&&window.SceneWanderManager.animation.stop(),this.isStart=!1,this.isPause=!1,t?this.$emit("update-setting",this.settingCopy):this.$emit("show-road")},_setAnimationAttr:function(){var t=this.settingCopy,e=t.speed,n=t.elevationType,r=t.exHeight,i=t.heading,o=t.pitch,a=t.animationType,s=t.interpolationAlgorithm,c=t.isLoop,u=t.showPath,l=t.showInfo,h=t.modelScale,d=t.modelHeading;switch(window.SceneWanderManager.animation.speed=(.28*e).toFixed(2),window.SceneWanderManager.animation.exHeight="addition"===n?r:1,window.SceneWanderManager.animation.heading=Cesium.Math.toRadians(i),window.SceneWanderManager.animation.pitch=Cesium.Math.toRadians(o),window.SceneWanderManager.animation.animationType=a,window.SceneWanderManager.animation.isLoop=c,window.SceneWanderManager.animation.isShowPath=u,window.SceneWanderManager.animation.showInfo=l,window.SceneWanderManager.animation.modelHeading=d,this.modelUrl&&(window.SceneWanderManager.animation._model.scale=h),s){case"LagrangePolynomialApproximation":window.SceneWanderManager.animation.interpolationAlgorithm=this.Cesium.LagrangePolynomialApproximation;break;case"LinearApproximation":window.SceneWanderManager.animation.interpolationAlgorithm=this.Cesium.LinearApproximation;break;case"HermitePolynomialApproximation":window.SceneWanderManager.animation.interpolationAlgorithm=this.Cesium.HermitePolynomialApproximation;break;default:break}3===window.SceneWanderManager.animation.animationType?this.settingCopy.range=200:2===window.SceneWanderManager.animation.animationType?this.settingCopy.range=10:this.settingCopy.range=1,window.SceneWanderManager.animation.range=this.settingCopy.range,2===window.SceneWanderManager.animation.animationType&&(window.SceneWanderManager.animation.isShowPath=!1,window.SceneWanderManager.animation.showInfo=!1,this.settingCopy.showPath=!1,this.settingCopy.showInfo=!1),this.$emit("remove-road")},onCheckBoxChange:function(t,e){this.settingCopy[e]=t,"showPath"===e&&(this.showPathBack=t,this.$emit("toggle-road",{show:t})),"showInfo"===e&&(this.showInfoBack=t),window.SceneWanderManager.animation[e]=t},onEffectsChange:function(t,e){window.SceneWanderManager.animation[e]=this.Cesium.Math.toRadians(parseInt(t))},changeRange:function(t){window.SceneWanderManager.animation.range=parseInt(t)},onTypeChange:function(t){window.SceneWanderManager.animation.animationType=t,3===window.SceneWanderManager.animation.animationType?this.settingCopy.range=200:2===window.SceneWanderManager.animation.animationType?(this.settingCopy.range=10,this.settingCopy.showPath=!1,this.settingCopy.showInfo=!1):this.settingCopy.range=1,window.SceneWanderManager.animation.range=this.settingCopy.range,2!==t&&(this.settingCopy.showPath=this.showPathBack,this.settingCopy.showInfo=this.showInfoBack)},onModelChange:function(t){window.SceneWanderManager.animation._modelUrl=t,this.settingCopy.modelUrl=t},modelHeadingChange:function(t){window.SceneWanderManager.animation.modelHeading=t,this.settingCopy.modelHeading=t},getAbsolutePositions:function(){for(var t=cbt(this.positions),e=2;e<t.length;e+=3)t[e]=this.settingCopy.exHeight;return t},showDistanceSlider:function(){return 1===this.settingCopy.animationType||3===this.settingCopy.animationType}}},xbt=_bt,Sbt=(n("21f1"),je(xbt,obt,abt,!1,null,"31adf0d2",null)),Cbt=Sbt.exports,Mbt=n("3059"),Lbt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("mapgis-ui-modal",{staticClass:"path-import-wrapper",attrs:{visible:t.visible,title:t.title,width:300,mask:!1},on:{cancel:t.onImportCancel,ok:t.onImportOk}},[n("template",{slot:"footer"},[n("mapgis-ui-button",{key:"cancel",on:{click:t.onImportCancel}},[t._v("\n 取消\n ")]),n("mapgis-ui-button",{key:"ok",attrs:{type:"primary",loading:t.loading},on:{click:t.onImportOk}},[t._v("\n 确定\n ")])],1),n("div",{staticClass:"path-import-body"},[n("mapgis-ui-row",[n("input",{attrs:{type:"file",id:"file",accept:"."+t.importModalType},on:{input:t.readOrUploadFile}})])],1)],2)},Tbt=[];function kbt(t){return kbt="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},kbt(t)}function Ebt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ebt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof A?e:A,a=Object.create(o.prototype),s=new E(r||[]);return i(a,"_invoke",{value:M(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function A(){}function v(){}function y(){}var b={};u(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(O([])));_&&_!==n&&r.call(_,a)&&(b=_);var x=y.prototype=A.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(i,o,a,s){var c=h(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==kbt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function M(e,n,r){var i=d;return function(o,a){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var u=h(e,n,r);if("normal"===u.type){if(i=r.done?m:f,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(kbt(e)+" is not iterable")}return v.prototype=y,i(x,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(C.prototype),u(C.prototype,s,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new C(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),u(x,c,"Generator"),u(x,a,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Obt(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Pbt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Obt(o,r,i,a,s,"next",t)}function s(t){Obt(o,r,i,a,s,"throw",t)}a(void 0)}))}}var Bbt={name:"path-import",inject:["ip","port"],props:{visible:{type:Boolean,default:!1},importModalType:{type:String,default:""}},computed:{title:function(){return"json"===this.importModalType?"导入漫游路径":"上传文件"}},data:function(){return{data:null,node:null,loading:!1}},methods:{onImportCancel:function(){this.node=null,this.data=null,this.$emit("close-path-import-modal",!1)},onImportOk:function(){this.$emit("close-path-import-modal",!1),"json"===this.importModalType?this.$emit("update-paths",this.data):this.$emit("update-wl",this.node)},readOrUploadFile:function(t){this.loading=!0,"json"===this.importModalType?this.readImportFile(t):this.uploadFile(t)},uploadFile:function(){var t=Pbt(Ebt().mark((function t(e){var n,r,i,o,a,s;return Ebt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.target.files[0],r=new FormData,r.append("files",n),t.prev=3,t.next=6,this.uploadRequest(r);case 6:if(i=t.sent,!(i&&Object.keys(i).length>0)){t.next=12;break}return t.next=10,this.featureQuery(i.uploadFiles[0].path);case 10:o=t.sent,o&&Object.keys(o).length>0&&(a=o.features[0].geometry.coordinates,s=a.map((function(t){return[t[0],t[1],0]})),this.node={path:s.join(",").split(","),name:o.name.split(".")[0]},this.loading=!1);case 12:t.next=16;break;case 14:t.prev=14,t.t0=t["catch"](3);case 16:case"end":return t.stop()}}),t,this,[[3,14]])})));function e(e){return t.apply(this,arguments)}return e}(),uploadRequest:function(t){var e=this,n=new Promise((function(n,r){qe()({method:"post",url:"".concat(window.location.protocol,"//").concat(e.ip,":").concat(e.port,"/igs/rest/services/system/ResourceServer/files"),headers:{"Content-type":"multipart/form-data"},data:t,timeout:2e4}).then((function(t){t&&t.data?n(t.data):n(null)}))}));return n.then((function(t){return t}))},featureQuery:function(t){var e=this,n=new Promise((function(n,r){qe()({method:"get",url:"".concat(window.location.protocol,"//").concat(e.ip,":").concat(e.port,"/igs/rest/services/system/ResourceServer/tempData/features/query?f=json&url=").concat(t),timeout:2e4}).then((function(t){t&&t.data?n(t.data):n(null)}))}));return n.then((function(t){return t}))},readImportFile:function(t){var e=this,n=t.target.files[0],r=new FileReader;r.readAsText(n),r.onload=function(t){var n=JSON.parse(t.target.result);e.data=n,e.loading=!1}}}},Ibt=Bbt,Dbt=je(Ibt,Lbt,Tbt,!1,null,null,null),Nbt=Dbt.exports;function Fbt(t){return Fbt="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},Fbt(t)}function jbt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */jbt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof A?e:A,a=Object.create(o.prototype),s=new E(r||[]);return i(a,"_invoke",{value:M(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function A(){}function v(){}function y(){}var b={};u(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(O([])));_&&_!==n&&r.call(_,a)&&(b=_);var x=y.prototype=A.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(i,o,a,s){var c=h(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Fbt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function M(e,n,r){var i=d;return function(o,a){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var u=h(e,n,r);if("normal"===u.type){if(i=r.done?m:f,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Fbt(e)+" is not iterable")}return v.prototype=y,i(x,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(C.prototype),u(C.prototype,s,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new C(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),u(x,c,"Generator"),u(x,a,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Rbt(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Hbt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Rbt(o,r,i,a,s,"next",t)}function s(t){Rbt(o,r,i,a,s,"throw",t)}a(void 0)}))}}function zbt(t){return Gbt(t)||Ybt(t)||Vbt(t)||Ubt()}function Ubt(){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 Vbt(t,e){if(t){if("string"==typeof t)return Qbt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qbt(t,e):void 0}}function Ybt(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function Gbt(t){if(Array.isArray(t))return Qbt(t)}function Qbt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Wbt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Kbt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wbt(Object(n),!0).forEach((function(e){qbt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wbt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function qbt(t,e,n){return(e=Xbt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xbt(t){var e=$bt(t,"string");return"symbol"==Fbt(e)?e:e+""}function $bt(t,e){if("object"!=Fbt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Fbt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Jbt={name:"mapgis-3d-scene-roaming",inject:["Cesium","vueCesium","viewer"],components:{PathItem:ibt,PathRoaming:Cbt,PathImport:Nbt},props:Kbt(Kbt({},ln),{},{layout:{type:String,default:"vertical"},setting:{type:Object,default:function(){return{speed:10,elevationType:"addition",exHeight:1,heading:90,pitch:0,range:1,animationType:1,interpolationAlgorithm:"LagrangePolynomialApproximation",isLoop:!0,showPath:!0,showInfo:!0,modelUrl:""}}},models:{type:Array,required:!0,default:function(){return[]}},paths:{type:Array,required:!0,default:function(){return[]}}}),computed:{pathTotal:function(){return"".concat(this.pathsCopy.length,"条路线")},positions:{get:function(){return this.addedPositions.map((function(t,e){return Kbt({number:e+1},t)}))},set:function(t){this.addedPositions=zbt(t)}}},watch:{paths:{handler:function(){this.pathsCopy=JSON.parse(JSON.stringify(this.paths))},deep:!0,immediate:!0}},data:function(){return{interactiveAdding:!1,roaming:!1,roamingPath:null,name:"",addedPositions:[],addedPositionsColumns:[{title:"序号",dataIndex:"number",align:"center",ellipsis:!0,width:42},{title:"经度",dataIndex:"x",align:"center",ellipsis:!0,scopedSlots:{customRender:"x"}},{title:"纬度",dataIndex:"y",align:"center",ellipsis:!0,scopedSlots:{customRender:"y"}},{title:"高度",dataIndex:"z",align:"center",ellipsis:!0,scopedSlots:{customRender:"z"},width:60},{title:"操作",dataIndex:"operation",align:"center",ellipsis:!0,scopedSlots:{customRender:"operation"}}],pathsCopy:[],emptyImage:Mbt["MapgisUiEmpty"].PRESENTED_IMAGE_SIMPLE,emptyDescription:"暂无数据",lastClickLineId:void 0,toolbarList:[{icon:"mapgis-upload",title:"上传wl文件",click:this._uploadPaths},{icon:"mapgis-Import",title:"导入",click:this._importPaths},{icon:"mapgis-export",title:"导出",click:this._exportPaths},{icon:"mapgis-save",title:"保存",click:this._savePaths}],pathImportModalVisible:!1,importModalType:""}},created:function(){},mounted:function(){this.mount()},destroyed:function(){this.unmount()},methods:{createCesiumObject:function(){var t=Hbt(jbt().mark((function t(){return jbt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){t()}),(function(t){})));case 1:case"end":return t.stop()}}),t)})));function e(){return t.apply(this,arguments)}return e}(),mount:function(){var t=this,e=this.createCesiumObject();e.then((function(e){t.$emit("load",t)})),this.pointArr=[]},unmount:function(){this.onGotoHome(),this._stopAdded(),this._stopRoaming(),this.$emit("unload",this)},onAddPathStart:function(){this.interactiveAdding=!0;var t=this.getPathId();this.name="路线".concat(t),this.draw=new this.Cesium.DrawElement(this.viewer);var e=this.Cesium.Material.fromType("Color");e.uniforms.color=new this.Cesium.Color(.9,.6,.1,.5),this.linePoints=[];var n=this;this.draw.startDrawingMarker({material:e,addDefaultMark:!1,callback:function(t){var e=n.viewer.scene.globe.ellipsoid,r=e.cartesianToCartographic(t.position),i=n.Cesium.Math.toDegrees(r.longitude),o=n.Cesium.Math.toDegrees(r.latitude),a=r.height;n.addedPositions.push({x:i,y:o,z:a}),n.linePoints.push(i),n.linePoints.push(o),n.linePoints.push(a),n.addedPositions.length>1&&(n.removeRoad(),n.polyline=n.viewer.entities.add({name:"scence-roaming",polyline:{positions:n.Cesium.Cartesian3.fromDegreesArrayHeights(n.linePoints),width:2,material:n.Cesium.Color.RED,clampToGround:!1}})),n.drawPoint(!0)}})},getPathId:function(){var t=1;if(this.pathsCopy.length>0){var e=this.pathsCopy.map((function(t,e){return t.id||e+1})).sort((function(t,e){return t-e}));t=+e[e.length-1]+1}return t},onAddPathComplete:function(){var t=this.getPathId(),e=this.setting,n=e.speed,r=e.elevationType,i=e.exHeight,o=e.heading,a=e.pitch,s=e.range,c=e.animationType,u=e.interpolationAlgorithm,l=e.isLoop,h=e.showPath,d=e.showInfo,f=this.addedPositions.map((function(t){return[t.x,t.y,t.z]})).reduce((function(t,e){return t.concat(e)})),p={name:this.name,id:t,path:f,para:{speed:n,elevationType:r,exHeight:i,heading:o,pitch:a,range:s,animationType:c,interpolationAlgorithm:u,isLoop:l,showPath:h,showInfo:d,modelUrl:""}};this.pathsCopy.push(p),this._stopAdded()},onAddPathCancel:function(){this._stopAdded()},onGotoPath:function(t){this.roamingPath=t;for(var e=0;e<this.roamingPath.path.length;e++)this.roamingPath.path[e]=Number(this.roamingPath.path[e]);this.roaming=!0,this.lastClickLineId=t.id+"",this.showRoad()},onGotoHome:function(){this.$refs.refPathRoaming&&this.$refs.refPathRoaming.onClickStop(!0),this.roaming=!1,this.removeRoad()},onDeletePath:function(t){var e=this.pathsCopy.indexOf(t);e>-1&&this.pathsCopy.splice(e,1)},onChangePathName:function(t,e){var n=zbt(this.pathsCopy),r=n.find((function(t){return t.id===e}));r&&(r.name=t,this.pathsCopy=n)},updateSetting:function(t){var e=this;this.pathsCopy.map((function(n){return n.id==e.roamingPath.id&&(n.para=Kbt({},t)),n}))},removeRoad:function(){this.polyline&&(this.viewer.entities.remove(this.polyline),this.polyline=void 0)},removePoint:function(){var t=this;this.pointArr&&this.pointArr.length>0&&(this.pointArr.forEach((function(e){t.viewer.entities.remove(e)})),this.pointArr=[])},showRoad:function(){this.removeRoad(),this.polyline=this.viewer.entities.add({id:this.roamingPath.id+"",polyline:{positions:this.Cesium.Cartesian3.fromDegreesArrayHeights(this.roamingPath.path),width:2,material:this.Cesium.Color.RED,clampToGround:!1}}),this.viewer.flyTo(this.polyline)},toggleRoad:function(t){this.polyline&&(this.polyline.show=t.show)},drawPoint:function(t){if(t){var e=[this.linePoints[this.linePoints.length-3],this.linePoints[this.linePoints.length-2],this.linePoints[this.linePoints.length-1]],n=this.viewer.entities.add({position:this.Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),point:{pixelSize:10,color:this.Cesium.Color.RED}});this.pointArr.push(n)}else{this.removePoint();for(var r=0;r<this.linePoints.length-1;r+=3){var i=[this.linePoints[r],this.linePoints[r+1],this.linePoints[r+2]],o=this.viewer.entities.add({position:this.Cesium.Cartesian3.fromDegrees(i[0],i[1],i[2]),point:{pixelSize:10,color:this.Cesium.Color.RED}});this.pointArr.push(o)}}},_stopAdded:function(){this.removeRoad(),this.removePoint(),this.draw&&this.draw.stopDrawing(),this.interactiveAdding=!1,this.addedPositions=[],this.linePoints=[]},_stopRoaming:function(){this.$refs.refPathRoaming&&this.$refs.refPathRoaming.onClickStop(!0)},onGetPathRoaming:function(){return this.$refs.refPathRoaming},_savePaths:function(){this.$emit("save-paths",this.pathsCopy)},_importPaths:function(){this.importModalType="json",this.pathImportModalVisible=!this.pathImportModalVisible},_uploadPaths:function(){this.importModalType="wl",this.pathImportModalVisible=!this.pathImportModalVisible},_exportPaths:function(){if(this.pathsCopy&&this.pathsCopy.length>0){var t={pathData:this.pathsCopy,version:1},e=JSON.stringify(t),n=Date.now(),r=new Blob([e],{type:"application/json;charset=utf-8"});Object(Ec["saveAs"])(r,"pathJson_".concat(n,".json")),this.$message.success("导出成功")}},closePathImportModal:function(t){this.pathImportModalVisible=!1},updateWl:function(t){var e=t.path,n=t.name,r=this.getPathId(),i=this.setting,o=i.speed,a=i.elevationType,s=i.exHeight,c=i.heading,u=i.pitch,l=i.range,h=i.animationType,d=i.interpolationAlgorithm,f=i.isLoop,p=i.showPath,m=i.showInfo,g={name:"".concat(n).concat(r),id:r,path:e,para:{speed:o,elevationType:a,exHeight:s,heading:c,pitch:u,range:l,animationType:h,interpolationAlgorithm:d,isLoop:f,showPath:p,showInfo:m,modelUrl:""}};this.pathsCopy.push(g)},updatePaths:function(t){var e=this;if(!t)return this.$message.error("导入失败,未获取到漫游路径");t.pathData.forEach((function(t){var n=e.pathsCopy.findIndex((function(e){return e.id===t.id}));n>-1?e.pathsCopy.splice(n,1,t):e.pathsCopy.push(t)}))},savePosition:function(t){for(var e=zbt(this.positions),n=0;n<e.length;n++)e[n].x=Number(e[n].x),e[n].y=Number(e[n].y),e[n].z=Number(e[n].z);var r=e.find((function(e){return t===e.number}));r&&(delete r.editable,this.positions=e),this.resizeRoaming()},editPosition:function(t){var e=zbt(this.positions),n=e.find((function(e){return e.number===t}));n.editable=!0,this.positions=e},handleChange:function(t,e,n){var r=zbt(this.positions),i=r.find((function(t){return e===t.number}));i&&(i[n]=t,this.positions=r)},resizeRoaming:function(){var t=this;this.linePoints=[],this.addedPositions.forEach((function(e){t.linePoints.push(e.x),t.linePoints.push(e.y),t.linePoints.push(e.z)})),this.addedPositions.length>1&&(this.removeRoad(),this.polyline=this.viewer.entities.add({name:"scence-roaming",polyline:{positions:this.Cesium.Cartesian3.fromDegreesArrayHeights(this.linePoints),width:2,material:this.Cesium.Color.RED,clampToGround:!1}})),this.drawPoint()}}},Zbt=Jbt,twt=(n("84f1"),je(Zbt,$yt,Jyt,!1,null,"f6b54c84",null)),ewt=twt.exports,nwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("mapgis-ui-comprehensive-query",{attrs:{geoJSONExtent:t.geoJSONExtent,logo:t.logo,districtName:t.districtName,widgetInfo:t.widgetInfo,defaultMarkerIcon:t.defaultMarkerIcon,selectedMarkerIcon:t.selectedMarkerIcon},on:{onClose:t.onClose,onSearch:t.onSearch,"current-result":t.currentResult,"select-markers":t.selectMarkers,"click-item":t.clickItem,"change-cluster":t.changeCluster,"open-attribute-table":t.openAttributeTable,"remove-attribute-table":t.removeAttributeTable,"color-cluster":t.setColorCluster}}),n("place-name-cesium",{attrs:{defaultMarkerIcon:t.defaultMarkerIcon,selectedMarkerIcon:t.selectedMarkerIcon,hoverMarker:t.hoverMarker,cluster:t.cluster,geojson:t.current,colorCluster:t.colorCluster}})],1)},rwt=[],iwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.cluster?t.geojson&&t.geojson.features&&t.geojson.features.length>0&&t.colorCluster?n("mapgis-3d-mapv-layer",{attrs:{geojson:t.geojson,options:t.options,"count-field":"count"}}):t._e():n("mapgis-3d-dynamic-marker-layer",{attrs:{data:t.geojson,selects:t.hoverMarker,highlight:!1,layerStyle:t.layerStyle,highlightStyle:t.highlightStyle,idField:"markerId"}})],1)},owt=[],awt=K["Style"].MarkerStyle,swt=K["Style"].LineStyle,cwt=K["Style"].PointStyle,uwt=K["Style"].FillStyle,lwt={name:"place-name-cesium",inject:["Cesium","vueCesium","viewer"],props:{selectedMarkerIcon:{type:String,default:""},defaultMarkerIcon:{type:String,default:""},cluster:{type:Boolean,default:!1},colorCluster:{type:String,default:""},geojson:{type:Object,default:function(){return{}}},hoverMarker:{type:Array,default:function(){return[]}}},computed:{layerStyle:function(){return new awt({symbol:this.defaultMarkerIcon})},highlightStyle:function(){return{enableHoverMarker:!1,enableHoverFeature:!1,marker:new awt({symbol:this.selectedMarkerIcon}),point:new cwt,line:new swt,polygon:new uwt}},options:function(){return{fillStyle:this.colorCluster,size:50/3/2,minSize:8,maxSize:31,globalAlpha:.8,clusterRadius:150,maxClusterZoom:18,maxZoom:19,minPoints:5,extent:400,label:{show:!0,fillStyle:"white"},gradient:{0:"blue",.5:"yellow",1:"rgb(255,0,0)"},cesium:{postRender:!0,postRenderFrame:0},draw:"cluster",context:"2d"}}}},hwt=lwt,dwt=je(hwt,iwt,owt,!1,null,null,null),fwt=dwt.exports,pwt={name:"mapgis-3d-comprehensive-query",components:{PlaceNameCesium:fwt},inject:["Cesium","vueCesium","viewer"],props:{logo:{type:String,default:""},defaultMarkerIcon:{type:String,default:""},selectedMarkerIcon:{type:String,default:""},districtName:{type:String,default:""},geoJSONExtent:{type:Object,default:function(){return{}}},widgetInfo:{type:Object,default:function(){return{}}}},data:function(){return{cluster:!1,colorCluster:"",current:{type:"FeatureCollection",features:[]},hoverMarker:[],district:null}},methods:{onClose:function(){this.$emit("onClose")},onSearch:function(){this.$emit("onSearch")},setColorCluster:function(t){this.colorCluster=t},currentResult:function(t){this.current=t},clickItem:function(t){var e=wf(t);this.flyTo(e[0],e[1])},flyTo:function(t,e,n,r){var i=this.viewer,o=this.Cesium;if(null===n||""===n||void 0===n){var a=Math.ceil(i.camera.positionCartographic.height);n=a}i.camera.flyTo({destination:o.Cartesian3.fromDegrees(t,e,n),duration:r,orientation:{heading:o.Math.toRadians(0),pitch:o.Math.toRadians(-90),roll:o.Math.toRadians(0)}})},selectMarkers:function(t){this.hoverMarker=t},changeCluster:function(t){this.current={type:"FeatureCollection",features:[]},this.cluster=t},openAttributeTable:function(t){this.$emit("open-attribute-table",t)},removeAttributeTable:function(t){this.$emit("remove-attribute-table",t)}}},mwt=pwt,gwt=je(mwt,nwt,rwt,!1,null,null,null),Awt=gwt.exports,vwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._l(t.popups,(function(e,r){return[t.enablePopup?n("mapgis-3d-popup",{key:r,attrs:{position:{longitude:e.lng,latitude:e.lat,height:e.alt},forceRender:!0,isDataFlow:"",vueIndex:e.vueIndex},on:{change:t.$_toggle},model:{value:e.show,callback:function(n){t.$set(e,"show",n)},expression:"popup.show"}},[n("mapgis-ui-popup-content",{attrs:{feature:e.properties,width:260}},[n("mapgis-3d-popup-iot",{attrs:{properties:e.properties}})],1)],1):t._e()]}))],2)},ywt=[];function bwt(t){return bwt="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},bwt(t)}function wwt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _wt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?wwt(Object(n),!0).forEach((function(e){xwt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wwt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function xwt(t,e,n){return(e=Swt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Swt(t){var e=Cwt(t,"string");return"symbol"==bwt(e)?e:e+""}function Cwt(t,e){if("object"!=bwt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=bwt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Mwt=K["Style"].PointStyle,Lwt=K["Style"].ModelStyle,Twt=K["Style"].MarkerStyle,kwt={name:"mapgis-3d-data-flow-layer",inject:["viewer","Cesium"],props:{baseUrl:{type:String},UUID:{type:String,default:"imei"},updateInterval:{type:Number,default:300},options:{type:Object},layerStyle:{type:Object,default:function(){return{}}},enableFlyTo:{type:Boolean,default:!1},showPosition:{type:Boolean,default:!0},flyToOptions:{type:Object,default:function(){return{}}},vueKey:{type:String,default:"default"},vueIndex:{type:[String,Number],default:function(){return(1e8*Math.random()).toFixed(0)}},enablePopup:{type:Boolean,default:!1},popupOptions:{type:Object,default:function(){return{}}},enableDirect:{type:Boolean,default:!0},publicPath:{type:String,default:"/"}},watch:{layerStyle:{handler:function(){var t,e=this.layerStyle.type||this.defaultStyle.type;t=this.layerStyle[e]&&"{}"!==this.layerStyle[e]?this.layerStyle[e]:this.defaultStyle[e],this.layerStyleCopy=_wt(_wt({type:e,fixNum:10},t),this.layerStyle.layerStyle);var n=window.vueCesium.DataFlowManager.findSource(this.vueKey,this.vueIndex);if(n&&n.source){var r,i,o=n.source,a=this,s=[];if(this.currentType!==this.layerStyleCopy.type){this.websocket.close(),clearInterval(this.interval);for(var c=0;c<o.length;c++){switch(this.viewer.entities.remove(o[c]),this.layerStyleCopy.type){case"point":r=this.getOptions("point");var u=new Mwt(r);i=this.viewer.entities.add({id:this.features[c].properties[this.UUID],position:Cesium.Cartesian3.fromDegrees(this.features[c].geometry.coordinates[0],this.features[c].geometry.coordinates[1],20),point:u.toCesiumStyle(Cesium),properties:this.features[c].properties,keys:Object.keys(this.features[c].properties)});break;case"model":r=this.getOptions("model");var l=new Lwt(r);i=this.viewer.entities.add({id:this.features[c].properties[this.UUID],position:Cesium.Cartesian3.fromDegrees(this.features[c].geometry.coordinates[0],this.features[c].geometry.coordinates[1],20),model:l.toCesiumStyle(Cesium),properties:this.features[c].properties,keys:Object.keys(this.features[c].properties)});break;case"marker":r=this.getOptions("marker");var h=new K["Style"].MarkerStyle;h=h.toCesiumStyle(r,this.features[c],Cesium),i=this.viewer.entities.add({id:this.features[c].properties[this.UUID],position:Cesium.Cartesian3.fromDegrees(this.features[c].geometry.coordinates[0],this.features[c].geometry.coordinates[1],20),billboard:h.billboard,label:h.label,properties:this.features[c].properties,keys:Object.keys(this.features[c].properties)});break}s.push(i)}window.vueCesium.DataFlowManager.deleteSource(this.vueKey,this.vueIndex),window.vueCesium.DataFlowManager.addSource(this.vueKey,this.vueIndex,s),this.currentType=this.layerStyleCopy.type,this.websocket=new WebSocket(this.baseUrl),this.websocket.onmessage=function(t){a.$_webSocketCallBack(t,a)},this.$_setUpdatedEvent()}else switch(this.layerStyleCopy.type){case"point":r=this.getOptions("point");for(var d=0;d<o.length;d++){var f=new K["Style"].PointStyle(r);o[d]["point"]=o[d]["point"]||{},o[d]["point"]=Object.assign(o[d][this.layerStyleCopy.type],f.toCesiumStyle(Cesium))}break;case"marker":r=this.getOptions("marker");for(var p=0;p<o.length;p++){var m=new K["Style"].MarkerStyle;m=m.toCesiumStyle(r,{},Cesium),o[p]["billboard"]=o[p]["billboard"]||{},o[p]["billboard"]=Object.assign(o[p]["billboard"],m.billboard),o[p]["label"]=o[p]["label"]||{text:""},m.label.text=o[p]["label"].text,o[p]["label"]=Object.assign(o[p]["label"],m.label)}break;case"model":r=this.getOptions("model");for(var g=0;g<o.length;g++){var A=new K["Style"].ModelStyle(r);o[g]["model"]=o[g]["model"]||{},o[g]["model"]=Object.assign(o[g][r.type],A.toCesiumStyle(Cesium))}break}}},deep:!0}},data:function(){return{features:[],firstAdd:!0,popups:[],websocket:void 0,currentType:void 0,interval:void 0,layerStyleCopy:{fixNum:10},popupOption:{postRender:!1},defaultStyle:{type:"point",marker:{yOffset:0,xOffset:0,markerUrl:"/file/data/2023/09/22/测试图片_20230922092705A003.png",rotation:0,width:20,imageScale:1,height:20},model:{modelUrl:"/CesiumModels/Cesium_Man.glb",scale:1e3},point:{radius:10,color:"rgb(255,255,102)",outlineColor:"rgb(255,255,102)",outlineWidth:8,outlineOpacity:1}}}},created:function(){var t=this.layerStyle[this.layerStyle.type];if(this.layerStyle.type&&Object.keys(t).length>0)this.layerStyleCopy=_wt(_wt({type:this.layerStyle.type,fixNum:10},this.layerStyle[this.layerStyle.type]),this.layerStyle.layerStyle);else{var e=this.layerStyle.type||this.defaultStyle.type;this.layerStyleCopy=_wt(_wt({type:e,fixNum:10},this.defaultStyle[e]),this.layerStyle.layerStyle)}},mounted:function(){this.$_addEntityLayer()},destroyed:function(){var t=this.vueKey,e=this.vueIndex,n=window.vueCesium.DataFlowManager.findSource(t,e);if(n&&n.source){var r=n.source;this.websocket.close(),this.handler&&this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);for(var i=0;i<r.length;i++)this.viewer.entities.remove(r[i]);for(var o=0;o<this.popups.length;o++){var a,s=window.vueCesium.PopupManager.findSource(this.vueKey,this.popups[o].vueIndex);null===s||void 0===s||null===(a=s.source)||void 0===a||a.remove(),window.vueCesium.PopupManager.deleteSource(this.vueKey,this.popups[o].vueIndex)}this.popups=[],vueCesium.DataFlowManager.deleteSource(t,e)}},methods:{$_toggle:function(t,e){for(var n=0;n<this.popups.length;n++)if(this.popups[n].vueIndex===e){this.popups[n].show=t;break}},setModelDirection:function(t,e,n){var r=Cesium.Cartesian3.fromDegrees(t,e,20),i=Cesium.Math.toRadians(n),o=0,a=0,s=new Cesium.HeadingPitchRoll(i,o,a),c=Cesium.Transforms.headingPitchRollQuaternion(r,s);return c},$_cartesian3ToLongLat:function(t){var e={},n=Cesium.Cartographic.fromCartesian(t);return e.lat=Cesium.Math.toDegrees(n.latitude),e.lng=Cesium.Math.toDegrees(n.longitude),e.alt=n.height,e},$_webSocketCallBack:function(t,e){var n,r,i=e.vueKey,o=e.vueIndex,a=JSON.parse(t.data),s=!0,c=window.vueCesium.DataFlowManager.findSource(i,o);if(e.firstAdd&&e.enableFlyTo){var u={duration:6},l=1400,h=e.flyToOptions.height;(0===h||h)&&(l=Number(h)),u=Object.assign(u,e.flyToOptions),e.viewer.camera.flyTo(_wt({destination:Cesium.Cartesian3.fromDegrees(a.geometry.coordinates[0],a.geometry.coordinates[1],l)},u)),e.firstAdd=!1}if(c&&c.source){r=c.source;for(var d=0;d<r.length;d++)if(r[d].properties[e.UUID].getValue()===a.properties[e.UUID]){s=!1,n=d;break}}if(s){var f,p;r||(r=[],window.vueCesium.DataFlowManager.addSource(i,o,r));var m=Object.keys(a.properties);switch(e.features.push({type:"point",geometry:a.geometry,properties:a.properties}),e.layerStyleCopy.type){case"point":f=this.getOptions("point");var g=new Mwt(f);p=e.viewer.entities.add({id:a.properties[e.UUID],position:Cesium.Cartesian3.fromDegrees(a.geometry.coordinates[0],a.geometry.coordinates[1],20),point:g.toCesiumStyle(Cesium),properties:a.properties,keys:m});break;case"model":f=this.getOptions("model");var A=new Lwt(f),v=new Cesium.HeadingPitchRoll(0,0,0),y=Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(a.geometry.coordinates[0],a.geometry.coordinates[1]),v);p=e.viewer.entities.add({id:a.properties[e.UUID],orientation:y,position:Cesium.Cartesian3.fromDegrees(a.geometry.coordinates[0],a.geometry.coordinates[1],20),model:A.toCesiumStyle(Cesium),properties:a.properties,keys:m});break;case"marker":f=this.getOptions("marker");var b=new Twt;b=b.toCesiumStyle(f,a,Cesium),e.layerStyleCopy&&e.layerStyleCopy.fixNum&&b.label.text&&b.label.text.length>e.layerStyleCopy.fixNum&&(b.label.text=b.label.text.substring(0,e.layerStyleCopy.fixNum)),p=e.viewer.entities.add({id:a.properties[e.UUID],position:Cesium.Cartesian3.fromDegrees(a.geometry.coordinates[0],a.geometry.coordinates[1],20),billboard:b.billboard,label:b.label,properties:a.properties,keys:m});break}r.push(p)}else{for(var w,_,x,S,C,M=0;M<e.features.length;M++)if(e.features[M].properties[e.UUID]===a.properties[e.UUID]){"model"===e.layerStyleCopy.type&&e.enableDirect&&(_=e.features[M].geometry.coordinates[0],S=e.features[M].geometry.coordinates[1],x=a.geometry.coordinates[0],C=a.geometry.coordinates[1],w=Math.atan2(C-S,x-_)),e.features[M].geometry.coordinates=a.geometry.coordinates,e.features[M].properties=a.properties;break}if(r[n].properties=a.properties,r[n].position=Cesium.Cartesian3.fromDegrees(a.geometry.coordinates[0],a.geometry.coordinates[1],20),"model"===e.layerStyleCopy.type&&e.enableDirect){var L=new Cesium.HeadingPitchRoll(-1*w,0,0);r[n].orientation=Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(_,S),L)}for(var T=0;T<e.popups.length;T++)if(e.popups[T].properties[e.UUID]===a.properties[e.UUID]){e.popups[T].lng=a.geometry.coordinates[0],e.popups[T].lat=a.geometry.coordinates[1],e.popups[T].alt=50;break}}},$_setUpdatedEvent:function(){var t=this;this.interval=setInterval((function(){t.$emit("updated",t.features)}),this.updateInterval)},$_addEntityLayer:function(){var t=this;this.currentType=this.layerStyleCopy.type,this.websocket=new WebSocket(this.baseUrl),this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.canvas),this.handler.setInputAction((function(e){var n=t.viewer.scene.pick(e.position);if(Cesium.defined(n)&&t.featureInCurrentLayer(n)){for(var r,i=!1,o=0;o<t.popups.length;o++)if(t.popups[o].properties[t.UUID]===n.id.properties[t.UUID].getValue()){i=!0,r=o;break}for(var a=0;a<t.popups.length;a++)t.popups[a].show=!1;if(i)t.popups[r].show=!0;else{var s=t.$_cartesian3ToLongLat(n.primitive.position||n.primitive.id.position);s.height=50,s.keys=n.id.keys,s.show=!0,s.vueIndex=Math.ceil(1e7*Math.random()),s.properties={};for(var c=0;c<n.id.keys.length;c++){var u=n.id.keys[c];s.properties[u]=n.id.properties[u].getValue()}var l=t.popupOptions.type;l=l||"default";var h={fields:s.keys,style:{containerStyle:{width:"360px"}}};h=Object.assign(h,t.popupOptions),t.showPosition&&(s.keys.push("经度","纬度","高程"),s.properties["经度"]=s.lng,s.properties["纬度"]=s.lat,s.properties["高程"]=s.alt),t.popups.push(s)}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK),this.websocket.onmessage=function(e){t.$_webSocketCallBack(e,t)},t.$emit("updated",t.features),this.$_setUpdatedEvent()},featureInCurrentLayer:function(t){var e=this.vueKey,n=this.vueIndex,r=window.vueCesium.DataFlowManager.findSource(e,n);if(r){var i,o=r.source,a=null===t||void 0===t||null===(i=t.id)||void 0===i?void 0:i.id;return o.find((function(t){return t.id===a}))}return!1},getOptions:function(t){var e;switch(t){case"point":e=_wt({},this.layerStyleCopy);break;case"marker":e=_wt({},this.layerStyleCopy);try{new URL(e.markerUrl);e.url=e.markerUrl}catch(n){e.url=this.publicPath+e.markerUrl,console.log("marker组装地址",e.url,window.location.origin,this.publicPath)}delete e.markerUrl;break;case"model":e=_wt({},this.layerStyleCopy);try{new URL(e.modelUrl);e.url=e.modelUrl}catch(n){e.url=this.publicPath+e.modelUrl,console.log("model组装地址",e.url,window.location.origin,this.publicPath)}delete e.modelUrl;break}return e}}},Ewt=kwt,Owt=je(Ewt,vwt,ywt,!1,null,"73f216d5",null),Pwt=Owt.exports,Bwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"mapgis-track-player"},[n("div",{staticClass:"mapgis-track-player-container",staticStyle:{"padding-top":"20px"}},[n("mapgis-ui-slider",{staticClass:"mapgis-track-player-slider",attrs:{max:t.maxSlider},on:{afterChange:t.$_sliderClick},model:{value:t.currentSlider,callback:function(e){t.currentSlider=e},expression:"currentSlider"}})],1),n("div",{staticClass:"mapgis-track-player-container mapgis-track-player-option"},[n("span",{staticClass:"mapgis-track-player-start"},[t._v(t._s(t.playStartTime))]),n("img",{ref:"back",staticClass:"mapgis-track-player-back",attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNDQ0RUQxMzM4N0MxMUVDQkJGOUYxQjlBODkxNzI1OCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNDQ0RUQxNDM4N0MxMUVDQkJGOUYxQjlBODkxNzI1OCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM0NDRFRDExMzg3QzExRUNCQkY5RjFCOUE4OTE3MjU4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM0NDRFRDEyMzg3QzExRUNCQkY5RjFCOUE4OTE3MjU4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+4zi8vgAAAOlJREFUeNpi/P//PwMlgImBQoBigJ1HxGEQJsUAFmQOMzOLDS6FQIMFgVQXEAcf2rFCCKsBLCwsWDU7+cREAeX6gUwxvC5gYWVDkXQLTFICUtOB4m5EeYGVDWKAT0QWK5AqZmPnqAPSnESHARsbO5gGRu1RIGVKciDCDAACRrJigRVqABMTkxXIC0BM0Aso6YCNnR2M50+q/Q3EHcAw0AHiXUDMgIxxGsAKjAVWpJiY2V16D4jdgV6LBuJXIC8ieZOwATAwuTVvGVBcA4jnAPF73CmRhfUIrgDsa8gAaUyFYjhgHPDcCBBgAIw4LgcxS9SEAAAAAElFTkSuQmCC",alt:"后退"},on:{click:t.back,mouseleave:t.$_backLeave,mouseenter:t.$_backEnter}}),t.shouldAnimate?t._e():n("img",{ref:"play",staticClass:"mapgis-track-player-play",attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowRDg0MzE4RDM4N0MxMUVDOTUzMEM0MEIyNDE1QjZEOCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowRDg0MzE4RTM4N0MxMUVDOTUzMEM0MEIyNDE1QjZEOCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjBEODQzMThCMzg3QzExRUM5NTMwQzQwQjI0MTVCNkQ4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjBEODQzMThDMzg3QzExRUM5NTMwQzQwQjI0MTVCNkQ4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+iIYkxAAAAcFJREFUeNqsls0rBHEYx78zViTaC1LKHok9ulGSkgvFwXtuykVyELm4eSnCQTk4KVoOlD/ALvEfrOLiZXPCRTYRzfr+9KzQzs9vxjz1aWrmme93fm/PM1bFSgaaqCL9pJnUkjLyRm7JDUmQHXLlJmC5GCjhedJN8qAPR0ymSOr3QzvHCx0kSfoMxLMaKvdMrlqDMbJPSuA9iskWGXcz6CHLLqMyDYssidYPAzXnG5Lw37BEq+q7wZwMMahQWgtZgwjp1WWfjwCLLUC4wJOJ2oERW8S1866EB6LAyRDQVW1s8KltyyEyitIiYK0NiHXy08JGrzQrg6jXCW7i8iUGgdF6IF+/56LqcamfVSwMAdMNwEG3Nq3MDmJP/rUQD36EX96B2VOgfVebdh+SGlLpRfyIJW3ykOX08c/UpDJgKlpNhB+egZljYO/C+FvitpRaR5f1+MoqxvrauOlJ/LOMqxFck13daa5Z97X+SvM6u4smSTrAWpQWza8SoTrRMMkEIJ4RrdTvfhCTZuH8U3xCtHJ2tFXCSoMnn9MyKA1H25MPpD7FDEfjSG4d2Tb9q8j126IEyuX+nRzQuOyWSzeBDwEGAGtXX2HVYW0fAAAAAElFTkSuQmCC",alt:"播放"},on:{mouseleave:t.$_playerLeave,mouseenter:t.$_playerEnter,click:t.play}}),t.shouldAnimate?n("img",{ref:"pause",staticClass:"mapgis-track-player-play",attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowRUNEOEJENDM4N0MxMUVDODQ4MEVGMTIzMjhCM0ExOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowRUNEOEJENTM4N0MxMUVDODQ4MEVGMTIzMjhCM0ExOSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjBFQ0Q4QkQyMzg3QzExRUM4NDgwRUYxMjMyOEIzQTE5IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjBFQ0Q4QkQzMzg3QzExRUM4NDgwRUYxMjMyOEIzQTE5Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+0oSpJgAAAYFJREFUeNq0lrFKw1AUhm8S3OpmxSmCo/YJ3PoCgotWcXVxUDoIfQPbQVQoTq5KdRF8AOsDiFPdpNbSSd0Ul9LE/+Af0Jpzibb3wEfg9Pb/c09O7ok3cxgbS4RgHRTBPMiDPuiBJ3ADzsGjJuApBiJcBSsgMPaIaFIB3eEf/ZQ/LIEWWMsgnmjI2nterQY74BJMmr9HDpyCsmawCg6UXWUND+xT64eB1PyEC0YNj1rhd4M9bvFXVBaNedj6utpyKeWqJV00i2tbK01vG08a99Qf4Jbqek7prjkRLdnqHrBoE4E9p3RXyedL5CqKYlBwaFAQgymHBnnfOA4xeHWo/+LzDHEVLTG4dmjQ9HnURtqKAU9zealsOe0YF4MOuNBW1W+N+cCIOb6z51JCNDvJwAn5LHJjKs07WJABlLSpTKJNEI9BPKZWd3geNDgsohHFd6mVOtGOwDJ4+2dZNjhwrDP5iudTI+NuIq6Vmp9l/apI+2wRgWnmn9kUTXZLWxP4FGAAq2FjjeJrfkEAAAAASUVORK5CYII=",alt:"暂停"},on:{mouseleave:t.$_pauseLeave,mouseenter:t.$_pauseEnter,click:t.play}}):t._e(),n("img",{ref:"forward",staticClass:"mapgis-track-player-forward",attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNERBNTNBMDM4N0MxMUVDOTYyNEEwRDg3NEMxQUI2QiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNERBNTNBMTM4N0MxMUVDOTYyNEEwRDg3NEMxQUI2QiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM0REE1MzlFMzg3QzExRUM5NjI0QTBEODc0QzFBQjZCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM0REE1MzlGMzg3QzExRUM5NjI0QTBEODc0QzFBQjZCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Br2+XwAAAONJREFUeNpi/P//PwMlgJGuBth5RBwG0Yd2rLCFibGgKXgHpNYCcRlQ0Xt0A5iZWWzQxZiQOSwsLIJAnALEN5x8YqLQFQPFwRi3AaxsMCwGxEvdApN2ArESujyKHmQOGzsHuqVuQHzFJyKrCUj3srKxYYQLigHsmAaAACcQtwNxECMjI1kGwGMMmyCqARyc2NR8B2KwF/79+/cLrwFYwmAXEGfO7C69B+KkFnfgdwEbGzuM+QqICye35i1DlmdlJRCIQAXvYQmpryEDIyERNACoSQhfKDKzsB5BD0zGAc+NAAEGAOxjOj4Wq8AXAAAAAElFTkSuQmCC",alt:"前进"},on:{click:t.forward,mouseleave:t.$_forwardLeave,mouseenter:t.$_forwardEnter}}),n("span",{staticClass:"mapgis-track-player-end"},[t._v(t._s(t.endTime))])])])])},Iwt=[],Dwt=(K["Style"].PointStyle,K["Style"].ModelStyle),Nwt=(K["Style"].MarkerStyle,K["Style"].TrackStyle),Fwt={name:"mapgis-3d-track-layer",inject:["viewer"],data:function(){return{currentSlider:0,maxSlider:110,interval:void 0,playStartTime:void 0,shouldAnimate:!1}},props:{startTime:{type:String},endTime:{type:String},speed:{type:Number,default:10},trackPointStyle:{type:Object},trackStyle:{type:Object},dataSource:{type:[Object,Array]}},watch:{},mounted:function(){this.viewer.scene.globe.depthTestAgainstTerrain=!0,this.playStartTime=this.$_getPlayStartTime(0),this.$_addTrack()},methods:{$_backLeave:function(){this.$refs.back.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNDQ0RUQxMzM4N0MxMUVDQkJGOUYxQjlBODkxNzI1OCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNDQ0RUQxNDM4N0MxMUVDQkJGOUYxQjlBODkxNzI1OCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM0NDRFRDExMzg3QzExRUNCQkY5RjFCOUE4OTE3MjU4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM0NDRFRDEyMzg3QzExRUNCQkY5RjFCOUE4OTE3MjU4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+4zi8vgAAAOlJREFUeNpi/P//PwMlgImBQoBigJ1HxGEQJsUAFmQOMzOLDS6FQIMFgVQXEAcf2rFCCKsBLCwsWDU7+cREAeX6gUwxvC5gYWVDkXQLTFICUtOB4m5EeYGVDWKAT0QWK5AqZmPnqAPSnESHARsbO5gGRu1RIGVKciDCDAACRrJigRVqABMTkxXIC0BM0Aso6YCNnR2M50+q/Q3EHcAw0AHiXUDMgIxxGsAKjAVWpJiY2V16D4jdgV6LBuJXIC8ieZOwATAwuTVvGVBcA4jnAPF73CmRhfUIrgDsa8gAaUyFYjhgHPDcCBBgAIw4LgcxS9SEAAAAAElFTkSuQmCC"},$_backEnter:function(){this.$refs.back.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNjIxNkRDNjM4N0MxMUVDOUNERDhBNERBODEyOERCRCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNjIxNkRDNzM4N0MxMUVDOUNERDhBNERBODEyOERCRCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM2MjE2REM0Mzg3QzExRUM5Q0REOEE0REE4MTI4REJEIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2MjE2REM1Mzg3QzExRUM5Q0REOEE0REE4MTI4REJEIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+PWvmjAAAANZJREFUeNpi/P//PwMlgImBQoBigOxkhsMgTIoBLMgcZkYGG1wKFaYwCAKpLiAOfpDDIITdABweUp7GEAWU6wcyxfC7AM0AtRkMSkBqOlDcjSgvsDBCaK2ZDKxAqhjIrwPSnESHAQvCBUeB2JTkQEQygJGsaASFARRbAXElEH9HEoNjnAaAXADCpxMZfgNxB5CtA8S7YOIwTNAAGDgez3APiN2BYtFA/IqgAcCEBMbo4HAswzKguAYQzwHi98hyjMiZyXkZOBkz7o3CnSLRAeOA50aAAAMAn1gn18iM2TcAAAAASUVORK5CYII="},$_forwardLeave:function(){this.$refs.forward.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNERBNTNBMDM4N0MxMUVDOTYyNEEwRDg3NEMxQUI2QiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNERBNTNBMTM4N0MxMUVDOTYyNEEwRDg3NEMxQUI2QiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM0REE1MzlFMzg3QzExRUM5NjI0QTBEODc0QzFBQjZCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM0REE1MzlGMzg3QzExRUM5NjI0QTBEODc0QzFBQjZCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Br2+XwAAAONJREFUeNpi/P//PwMlgJGuBth5RBwG0Yd2rLCFibGgKXgHpNYCcRlQ0Xt0A5iZWWzQxZiQOSwsLIJAnALEN5x8YqLQFQPFwRi3AaxsMCwGxEvdApN2ArESujyKHmQOGzsHuqVuQHzFJyKrCUj3srKxYYQLigHsmAaAACcQtwNxECMjI1kGwGMMmyCqARyc2NR8B2KwF/79+/cLrwFYwmAXEGfO7C69B+KkFnfgdwEbGzuM+QqICye35i1DlmdlJRCIQAXvYQmpryEDIyERNACoSQhfKDKzsB5BD0zGAc+NAAEGAOxjOj4Wq8AXAAAAAElFTkSuQmCC"},$_forwardEnter:function(){this.$refs.forward.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNjdENzM5RjM4N0MxMUVDOTQyNUQ0NTdBMTJEMzFERiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNjdENzNBMDM4N0MxMUVDOTQyNUQ0NTdBMTJEMzFERiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM2N0Q3MzlEMzg3QzExRUM5NDI1RDQ1N0ExMkQzMURGIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2N0Q3MzlFMzg3QzExRUM5NDI1RDQ1N0ExMkQzMURGIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+k5y39wAAAM1JREFUeNpi/P//PwMlgJGuBshOZjgMoh/nMtjCxFiQFShMYXgHpNYCcdmDHIb36AYwMzLYoIsxoShgYhAE4hQgvqE8jSEKwwAmCMZnAAyLAfFStRkMO4FYCZ8BKF5gYcTwthsQX9GaydAEpHuxyKMZwIQ17DiBuB2Ig7BJEmMAPMawCeIKA2T8HYgrgdiKcBhgumAXEGcej2e4B+JYLiTeC6+AuPBwLMMyQl5kQUso72EJ6UAM1oSE3wCgJiF8oQj0/xH0wGQc8NwIEGAA3BcwGOe59OgAAAAASUVORK5CYII="},$_pauseLeave:function(){this.$refs.pause.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowRUNEOEJENDM4N0MxMUVDODQ4MEVGMTIzMjhCM0ExOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowRUNEOEJENTM4N0MxMUVDODQ4MEVGMTIzMjhCM0ExOSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjBFQ0Q4QkQyMzg3QzExRUM4NDgwRUYxMjMyOEIzQTE5IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjBFQ0Q4QkQzMzg3QzExRUM4NDgwRUYxMjMyOEIzQTE5Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+0oSpJgAAAYFJREFUeNq0lrFKw1AUhm8S3OpmxSmCo/YJ3PoCgotWcXVxUDoIfQPbQVQoTq5KdRF8AOsDiFPdpNbSSd0Ul9LE/+Af0Jpzibb3wEfg9Pb/c09O7ok3cxgbS4RgHRTBPMiDPuiBJ3ADzsGjJuApBiJcBSsgMPaIaFIB3eEf/ZQ/LIEWWMsgnmjI2nterQY74BJMmr9HDpyCsmawCg6UXWUND+xT64eB1PyEC0YNj1rhd4M9bvFXVBaNedj6utpyKeWqJV00i2tbK01vG08a99Qf4Jbqek7prjkRLdnqHrBoE4E9p3RXyedL5CqKYlBwaFAQgymHBnnfOA4xeHWo/+LzDHEVLTG4dmjQ9HnURtqKAU9zealsOe0YF4MOuNBW1W+N+cCIOb6z51JCNDvJwAn5LHJjKs07WJABlLSpTKJNEI9BPKZWd3geNDgsohHFd6mVOtGOwDJ4+2dZNjhwrDP5iudTI+NuIq6Vmp9l/apI+2wRgWnmn9kUTXZLWxP4FGAAq2FjjeJrfkEAAAAASUVORK5CYII="},$_pauseEnter:function(){this.$refs.pause.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowRTVGREMyQjM4N0MxMUVDQjY2QUUyNDMyM0E2RTYyQyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowRTVGREMyQzM4N0MxMUVDQjY2QUUyNDMyM0E2RTYyQyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjBFNUZEQzI5Mzg3QzExRUNCNjZBRTI0MzIzQTZFNjJDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjBFNUZEQzJBMzg3QzExRUNCNjZBRTI0MzIzQTZFNjJDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+a1B7mgAAAYBJREFUeNq0lr9KA0EQxufWa4TYGctL65/4ECltBAlqFMHKWixE30AtROxtlVMRwQcwPkREK00OK7XTQjDc+Q3OQTxvltNkB34czO59HzvZzJw3EyZkiQAsgxqYBGXwCZ5AB9yAU/CoCXiKAQvvggUwRPaIxWQbRNlFk/PCLGiBpQLiqQbvvZWn1WAdXIIR+nuUwDHY0AwWwYFyqqLhgX3R+mHANT+SDf2GJ1pBr8GOHPFXrE4TXdS/n7ZcTrn2UoMKaGg75yeIhn2i+rg9lxN8AytGxNW6Gymab+w55XY1jPyJXEWNDaoODapsMOrQoGzIcbDBq0P9FyM9xFW02ODaoUHTSKuN1V4s3bwb23NaG2eDNjjTdp3fEX100Rru7bmcYM12OnAC+S1KAyrNO5jiAZReU55EayAZgHgiWlF2HoQyLOI+xTdFK3eiHYI58PbPsqzIwLHO5CvpT2HB08Syl2t+kl30lZciGeBbPZ8tLDAm689yKZpyWx409y8BBgCr2Frzb7D2qQAAAABJRU5ErkJggg=="},$_playerLeave:function(){this.$refs.play.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowRDg0MzE4RDM4N0MxMUVDOTUzMEM0MEIyNDE1QjZEOCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowRDg0MzE4RTM4N0MxMUVDOTUzMEM0MEIyNDE1QjZEOCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjBEODQzMThCMzg3QzExRUM5NTMwQzQwQjI0MTVCNkQ4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjBEODQzMThDMzg3QzExRUM5NTMwQzQwQjI0MTVCNkQ4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+iIYkxAAAAcFJREFUeNqsls0rBHEYx78zViTaC1LKHok9ulGSkgvFwXtuykVyELm4eSnCQTk4KVoOlD/ALvEfrOLiZXPCRTYRzfr+9KzQzs9vxjz1aWrmme93fm/PM1bFSgaaqCL9pJnUkjLyRm7JDUmQHXLlJmC5GCjhedJN8qAPR0ymSOr3QzvHCx0kSfoMxLMaKvdMrlqDMbJPSuA9iskWGXcz6CHLLqMyDYssidYPAzXnG5Lw37BEq+q7wZwMMahQWgtZgwjp1WWfjwCLLUC4wJOJ2oERW8S1866EB6LAyRDQVW1s8KltyyEyitIiYK0NiHXy08JGrzQrg6jXCW7i8iUGgdF6IF+/56LqcamfVSwMAdMNwEG3Nq3MDmJP/rUQD36EX96B2VOgfVebdh+SGlLpRfyIJW3ykOX08c/UpDJgKlpNhB+egZljYO/C+FvitpRaR5f1+MoqxvrauOlJ/LOMqxFck13daa5Z97X+SvM6u4smSTrAWpQWza8SoTrRMMkEIJ4RrdTvfhCTZuH8U3xCtHJ2tFXCSoMnn9MyKA1H25MPpD7FDEfjSG4d2Tb9q8j126IEyuX+nRzQuOyWSzeBDwEGAGtXX2HVYW0fAAAAAElFTkSuQmCC"},$_playerEnter:function(){this.$refs.play.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowREY0RTE1MjM4N0MxMUVDQTRFRUI2MUQzNEI1MTc4MCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowREY0RTE1MzM4N0MxMUVDQTRFRUI2MUQzNEI1MTc4MCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjBERjRFMTUwMzg3QzExRUNBNEVFQjYxRDM0QjUxNzgwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjBERjRFMTUxMzg3QzExRUNBNEVFQjYxRDM0QjUxNzgwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+ZGoY0gAAAc9JREFUeNqsljtLA1EQhWfXJVgoWBgJCAnYqcFCEOw0CGoawSY+sLCxFguNP0B8gCKChYiWhmhhwB9gbCwVhVjYaBIsgloIppCIG8+NE4lh93o32YGPBHZyzu7snZlo4XiRJOEH0yAEuoAXfIInkAEX4Bg82gloNgZCeB1EQAPJw2STZZCtvqhb/GAMpMCUgnhZQ+Te8afUYB4kQDM5jyZwBBbsDCbAts1TqYYGtljrj4Go+QEn1Bsaa/krDdb4Ed0KobVRNgiASVn2yTheTh9+5XFkIk5gQGdxad2F8EgH0X6YaDCgbFDS1rmJlKKlkWipn2hlgMinVtCQMAg6LXCvj2hvFDXoJDLkZy4oLrfW8hY9aMHZHqLNIWmaV3fjTMrCAK+g3alw4YsohuFwei9NezF4hjgyuM4R7V4R5fL/pqaEwTkYVhF++8BRvcGMzijfS9LgUbsq64V8gegSG+Dw9ue7YpTGuDBIi2aVdXMkUdP7F5rp8l1HxY26OIvyrPlbFrGJ5kDRBfEia2Wr90Gcl4VZp/gia1lutB2A2UnvNZZlhheOdCef8XyKKz6NybndIGbVyVaR5QUerfjbIgTa+PozN2iST8uDnfu3AAMAGj9gGBYQ1b0AAAAASUVORK5CYII="},$_sliderClick:function(t){this.viewer.clockViewModel.currentTime=Cesium.JulianDate.fromIso8601(this.$_getPlayStartTime(t)),this.playStartTime=this.$_getPlayStartTime(t)},$_getPlayStartTime:function(t){var e=this.startTime.split("T")[1];e=e.split("Z")[0];var n=Number(e.split(":")[2]),r=Number(e.split(":")[1]),i=Number(e.split(":")[0]),o=t%60;o+=n,o=o<10?"0"+o:o;var a=Math.floor(t/60)%60;a+=r,a=a<10?"0"+a:a;var s=Math.floor(t/3600)%24;s+=i,s=s<10?"0"+s:s;var c=this.startTime.replace(e,s+":"+a+":"+o);return c},$_getCZML:function(){var t;function e(t){var e=!1;if(t instanceof Array)for(var n=0;n<t.length;n++)if(t[n].id&&"document"===t[n].id){e=!0;break}return e}if(e(this.dataSource))t=this.dataSource;else{var n=new Dwt(this.trackPointStyle);n=n.toCesiumStyle(Cesium),n.uri&&(n.gltf=n.uri);var r=new Nwt(this.trackStyle);r=r.toCesiumStyle(Cesium),t=[{id:"document",name:"CZML Path",version:"1.0",clock:{interval:this.startTime+"/"+this.endTime,currentTime:this.startTime,multiplier:this.speed}},{id:"path",name:"path with GPS flight data",description:"<p>Hang gliding flight log data from Daniel H. Friedman.<br>Icon created by Larisa Skosyrska from the Noun Project</p>",availability:this.startTime+"/"+this.endTime,path:r,model:n,position:{interpolationAlgorithm:"LINEAR",forwardExtrapolationType:"HOLD",epoch:this.startTime,cartographicDegrees:this.$_geoJSONToPath()}}]}return t},$_geoJSONToPath:function(){var t=[];if(this.dataSource instanceof Array)"number"===typeof this.dataSource[0]&&(t=this.dataSource,this.maxSlider=this.dataSource[this.dataSource.length-4]);else if(this.dataSource instanceof Object&&this.dataSource.hasOwnProperty("features")){for(var e=this.dataSource.features,n=0;n<e.length;n++){var r=e[n].geometry.coordinates;t.push(Number(e[n].properties.timeStep),Number(r[0]),Number(r[1]),Number(r[2]))}this.maxSlider=t[t.length-4]}return t},$_addTrack:function(){var t=this;window.czml=new Cesium.CzmlDataSource,this.viewer.dataSources.add(window.czml.load(this.$_getCZML())).then((function(e){var n=e.entities.getById("path");t.viewer.trackedEntity=n,n.orientation=new Cesium.VelocityOrientationProperty(n.position)}))},play:function(){var t=this;this.viewer.clockViewModel.shouldAnimate=!this.viewer.clockViewModel.shouldAnimate,this.shouldAnimate=this.viewer.clockViewModel.shouldAnimate,this.viewer.clockViewModel.shouldAnimate?this.interval=setInterval((function(){t.currentSlider+=t.viewer.clockViewModel.multiplier,t.playStartTime=t.$_getPlayStartTime(t.currentSlider),t.currentSlider>=t.maxSlider&&(t.currentSlider=t.maxSlider,t.shouldAnimate=!1,t.playStartTime=t.endTime,clearInterval(t.interval)),t.currentSlider<=0&&(t.currentSlider=0,t.shouldAnimate=!1,t.playStartTime=t.startTime,clearInterval(t.interval))}),1e3):clearInterval(this.interval)},forward:function(){this.viewer.clockViewModel.multiplier<0&&(this.viewer.clockViewModel.multiplier=-1*this.viewer.clockViewModel.multiplier)},back:function(){this.viewer.clockViewModel.multiplier>0&&(this.viewer.clockViewModel.multiplier=-1*this.viewer.clockViewModel.multiplier)},speedUp:function(){var t=this;clearInterval(this.interval),this.viewer.clockViewModel.multiplier+=this.viewer.clockViewModel.multiplier;var e=Math.floor(this.multiplier/this.viewer.clockViewModel.multiplier*1e3);this.interval=setInterval((function(){t.currentSlider+=this.viewer.clockViewModel.multiplier,t.currentSlider>=t.maxSlider&&(t.currentSlider=t.maxSlider,clearInterval(t.interval))}),e)}}},jwt=Fwt,Rwt=(n("6292"),je(jwt,Bwt,Iwt,!1,null,"a2b54b5c",null)),Hwt=Rwt.exports,zwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("panel-one",{ref:"panel",on:{chooseTool:t.$_chooseTool}}),n("edit-panel",{attrs:{show:t.showEditPanel,editOptions:t.toolOptions}})],1)},Uwt=[],Vwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"mapgis-plotting-tool-panel",class:{plottingLayOff:t.layOffTool,plottingLayOut:t.layOutTool}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.showTool,expression:"showTool"}],staticClass:"mapgis-plotting-toolbar"},t._l(t.tools,(function(e,r){return n("div",{key:r,staticClass:"mapgis-plotting-tool"},[n("img",{staticClass:"mapgis-plotting-tool-icon",class:{mapgisPlottingActive:t.activeTool===e},attrs:{src:t.imgs[e+"Image"],title:t.toolTips[r]},on:{click:function(n){return t.$_chooseTool(e)}}}),n("img",{staticClass:"mapgis-plotting-tool-split",attrs:{src:t.imgs.splitImg}})])})),0),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.showTool,expression:"!showTool"}],staticClass:"mapgis-plotting-tool"},[n("img",{staticClass:"mapgis-plotting-tool-icon",attrs:{src:t.layOffImg},on:{click:function(e){return t.$_chooseTool("point")}}})])]),n("div",{staticClass:"mapgis-plotting-tool-lay",class:{plottingLayOff:t.layOffTool,plottingLayOut:t.layOutTool}},[n("img",{directives:[{name:"show",rawName:"v-show",value:t.switchIcon,expression:"switchIcon"}],staticClass:"mapgis-plotting-tool-lay-off",attrs:{src:t.imgs.layOff},on:{click:t.$_layOff}}),n("img",{directives:[{name:"show",rawName:"v-show",value:!t.switchIcon,expression:"!switchIcon"}],staticClass:"mapgis-plotting-tool-lay-off",attrs:{src:t.imgs.layOut},on:{click:t.$_layOut}})])])},Ywt=[],Gwt={name:"panelOne",data:function(){return{imgs:r,layOffTool:!1,layOutTool:!1,showTool:!0,switchIcon:!0,layOffImg:void 0,activeTool:void 0,tools:["point","marker","text","line","curve","polygon","rectangle","circle","cube","polygonCube","cuboid","cylinder","cone","ellipsoid","model"],toolTips:["点","标签","文字","直线","曲线","多边形","矩形","圆","正方体","立体多边形","长方体","圆柱体","圆锥体","球体","模型"]}},methods:{$_layOff:function(){this.layOffTool=!0,this.layOutTool=!1;var t=this;setTimeout((function(){t.switchIcon=!1,t.showTool=!1}),1500)},$_layOut:function(){this.layOffTool=!1,this.layOutTool=!0,this.showTool=!0;var t=this;setTimeout((function(){t.switchIcon=!0}),1500)},$_chooseTool:function(t){this.activeTool=t,this.layOffImg=this.imgs[t+"Image"],this.$emit("chooseTool",t)}}},Qwt=Gwt,Wwt=(n("24c7"),je(Qwt,Vwt,Ywt,!1,null,"61bdcefb",null)),Kwt=Wwt.exports,qwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.editOptionsCopy?n("div",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],staticClass:"mapgis-plotting-edit-panel"},[n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row mapgis-plotting-edit-tool-row-title"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[n("span",{staticStyle:{"font-size":"16px","margin-left":"17px"}},[t._v("编辑区域")])]),n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",staticStyle:{"padding-left":"5px"},attrs:{span:16}},[n("img",{staticClass:"mapgis-plotting-edit-panel-close",attrs:{src:t.closeImg},on:{click:t.$_closePanel}})])],1),n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v("类型 "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",staticStyle:{"padding-left":"5px"},attrs:{span:16}},[t._v("\n "+t._s(t.editOptionsCopy.type)+"\n ")])],1),t._l(t.editOptionsCopy.options,(function(e,r){return n("div",{key:r},["input"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("mapgis-ui-input",{staticClass:"mapgis-plotting-edit-input",model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}})],1)],1):t._e(),"inputNumber"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("mapgis-ui-input-number",{staticClass:"mapgis-plotting-edit-input",model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}})],1)],1):t._e(),"color"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("div",{staticClass:"mapgis-plotting-edit-tool-material-color"},[n("mapgis-ui-sketch-color-picker",{attrs:{color:e.value},on:{"update:color":function(n){return t.$set(e,"value",n)},input:t.$_changeMaterialColor}})],1)])],1):t._e(),"slider"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:9}},[n("mapgis-ui-slider",{staticClass:"mapgis-plotting-edit-slider",attrs:{min:e.min,max:e.max,step:e.step},model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}})],1),n("mapgis-ui-col",{attrs:{span:7}},[n("mapgis-ui-input-number",{staticClass:"mapgis-plotting-edit-input-slider",model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}})],1)],1):t._e(),"switch"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:10}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:14}},[n("mapgis-ui-switch",{staticClass:"mapgis-plotting-edit-tool-switch",attrs:{"checked-children":"开","un-checked-children":"关"},on:{change:function(n){return t.$_switchChange(e.fields,e.value)}},model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}})],1)],1):t._e(),"collapse"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row",staticStyle:{"margin-bottom":"6px"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:10}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:14}},[n("mapgis-ui-switch",{staticClass:"mapgis-plotting-edit-tool-switch",attrs:{"checked-children":"开","un-checked-children":"关"},on:{change:function(n){return t.$_switchChange(e.key,e.value,e)}},model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}})],1)],1),n("div",{staticClass:"mapgis-plotting-edit-collapse",style:{maxHeight:e.height}},t._l(e.options,(function(e,r){return n("div",{key:r},["inputNumber"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-collapse-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("mapgis-ui-input-number",{staticClass:"mapgis-plotting-edit-input",model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"o.value"}})],1)],1):t._e(),"input"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-collapse-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("mapgis-ui-input",{staticClass:"mapgis-plotting-edit-input",model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"o.value"}})],1)],1):t._e(),"color"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-collapse-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v("\n "+t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("div",{staticClass:"mapgis-plotting-edit-tool-material-color"},[n("mapgis-ui-sketch-color-picker",{attrs:{color:e.value},on:{"update:color":function(n){return t.$set(e,"value",n)},input:t.$_changeMaterialColor}})],1)])],1):t._e()],1)})),0)],1):t._e(),"select"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("mapgis-ui-select",{staticClass:"mapgis-plotting-edit-select",model:{value:t.material,callback:function(e){t.material=e},expression:"material"}},t._l(e.value,(function(e,r){return n("mapgis-ui-select-option",{key:r,attrs:{value:e}},[t._v("\n "+t._s(e)+"\n ")])})),1)],1)],1):t._e()],1)}))],2):t._e()},Xwt=[],$wt={name:"EditPanel",props:{editOptions:{type:Object,default:function(){return{}}},show:{type:Boolean,default:!1}},data:function(){return{materials:["纯色"],material:"纯色",materialColor:"rgba(0,0,0,255)",editOptionsCopy:void 0,closeImg:void 0,maxHeight:0}},watch:{editOptions:{handler:function(){this.editOptionsCopy=this.editOptions}}},mounted:function(){this.editOptionsCopy=this.editOptions},methods:{$_closePanel:function(){this.show=!1},$_changeMaterialColor:function(t){var e="rgba(".concat(t.rgba.r,", ").concat(t.rgba.g,", ").concat(t.rgba.b,", ").concat(t.rgba.a,")");this.$emit("change",e)},$_switchOption:function(t,e){for(var n=0;n<t.length;n++)for(var r=0;r<this.editOptionsCopy.options.length;r++)if(this.editOptionsCopy.options[r].title===t[n]){this.editOptionsCopy.options[r].show=e;break}},$_switchChange:function(t,e,n){e?(this.activeTool=t,n.height=n.maxHeight+"px"):(this.activeTool=void 0,n.height="0")}}},Jwt=$wt,Zwt=(n("431a"),je(Jwt,qwt,Xwt,!1,null,"57ac8662",null)),t_t=Zwt.exports;function e_t(t){return o_t(t)||i_t(t)||r_t(t)||n_t()}function n_t(){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 r_t(t,e){if(t){if("string"==typeof t)return a_t(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a_t(t,e):void 0}}function i_t(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function o_t(t){if(Array.isArray(t))return a_t(t)}function a_t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var s_t=[{type:"switch",title:"是否贴地",key:"enableClampToGround",value:!1,fields:[]},{type:"switch",title:"是否启用阴影",key:"enableShadows",value:!1,fields:[]}],c_t=[{type:"select",title:"表面材质",key:"materials",value:["纯色","纯色1"]},{type:"color",title:"颜色",key:"color",value:"#000000"},{type:"slider",title:"透明度",key:"opacity",value:1,min:0,max:1,step:.01},{type:"inputNumber",title:"边线宽度",key:"outlineWidth",value:1},{type:"color",title:"边线颜色",key:"outlineColor",value:"#000000"},{type:"slider",title:"边线透明度",key:"outlineOpacity",value:1,min:0,max:1,step:.01}].concat(s_t),u_t=[{type:"inputNumber",title:"长",key:"length",value:100},{type:"inputNumber",title:"宽",key:"width",value:100},{type:"inputNumber",title:"高",key:"height",value:100}].concat(e_t(c_t)),l_t=[{type:"inputNumber",title:"半径",key:"radius",value:6},{type:"inputNumber",title:"高度",key:"height",value:6},{type:"select",title:"表面材质",key:"materials",value:["纯色","纯色1"]},{type:"color",title:"颜色",key:"color",value:"#000000"},{type:"inputNumber",title:"边线宽度",key:"outlineWidth",value:1},{type:"color",title:"边线颜色",key:"outlineColor",value:"#000000"}].concat(s_t),h_t=([{type:"inputNumber",title:"宽度",key:"width",value:1},{type:"select",title:"表面材质",key:"materials",value:["纯色","纯色1"]},{type:"color",title:"颜色",key:"color",value:"#000000"}].concat(s_t),[{type:"inputNumber",title:"宽度",key:"width",value:1},{type:"select",title:"表面材质",key:"materials",value:["纯色","纯色1"]},{type:"color",title:"颜色",key:"color",value:"#000000"}].concat(s_t),[{type:"inputNumber",title:"高",key:"height",value:100}].concat(e_t(c_t)),[{type:"inputNumber",title:"半径",key:"height",value:100}].concat(e_t(c_t)),[{type:"input",title:"模型资源",key:"url",value:"www.baidu.com"},{type:"inputNumber",title:"模型大小",key:"scale",value:1}].concat(s_t),{Point:"point",Picked:"pick",UnPicked:"unPick",Added:"added"}),d_t=h_t,f_t=K["Style"].PointStyle,p_t=(K["Style"].ModelStyle,K["Style"].MarkerStyle,{inject:["Cesium","viewer"],data:function(){return{drawMode:void 0}},props:{vueKey:{type:String,default:"plottingDraw"},vueIndex:{type:Number,default:function(){return Number((1e8*Math.random()).toFixed(0))}}},methods:{$_draw:function(t,e,n,r,i,o){var a=this,s=window.vueCesium.DrawToolManager.findSource(i,o);if(!s){var c=new Cesium.ScreenSpaceEventHandler(this.viewer.canvas);c.setInputAction((function(c){var u=viewer.camera.pickEllipsoid(c.position,viewer.scene.globe.ellipsoid),l=viewer.scene.pick(c.position);if(Cesium.defined(l))a.drawMode=d_t.Picked;else if(a.drawMode&&a.drawMode!==d_t.UnPicked&&a.drawMode!==d_t.Picked&&a.drawMode!==d_t.Added){var h;switch(a.drawMode){case"point":r&&a.mapgisPlottingeDrawStyle&&(t=a.mapgisPlottingeDrawStyle);var d=new f_t(t);h=a.viewer.entities.add({position:u,point:d.toCesiumStyle(Cesium),extraOptions:n}),a.drawMode=d_t.Added,l=h;break}h&&(s=window.vueCesium.DrawToolManager.findSource(i,o),s.options.push(h))}else a.drawMode=d_t.UnPicked;e&&e(a.drawMode,l)}),Cesium.ScreenSpaceEventType.LEFT_CLICK),window.vueCesium.DrawToolManager.addSource(i,o,c,[])}},drawPoint:function(t,e,n,r,i,o){i=i||this.vueKey,o=o||this.vueIndex,this.drawMode=d_t.Point,this.$_draw(t,e,n,r,i,o)},updateEntityStyle:function(t,e){var n=new f_t(e);n=n.toCesiumStyle(Cesium),t.point=n}}});function m_t(t){return y_t(t)||v_t(t)||A_t(t)||g_t()}function g_t(){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 A_t(t,e){if(t){if("string"==typeof t)return b_t(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b_t(t,e):void 0}}function v_t(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function y_t(t){if(Array.isArray(t))return b_t(t)}function b_t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var w_t={name:"mapgis-3d-plotting-layer",components:{"panel-one":Kwt,"edit-panel":t_t},mixins:[p_t],data:function(){return{editOptions:editOptions,toolOptions:void 0,showEditPanel:!1,mapgisPlottingeDrawStyle:void 0,entityId:void 0}},watch:{toolOptions:{handler:function(){if(this.drawMode&&this.drawMode!==d_t.UnPicked)if(this.drawMode===d_t.Picked||this.drawMode===d_t.Added){for(var t=this.$_getStyleFromOptions(this.toolOptions.options),e=window.vueCesium.DrawToolManager.findSource(this.vueKey,this.vueIndex),n=e.options,r=0;r<n.length;r++)if(this.entityId===n[r].id){console.log("更新数据",t),this.updateEntityStyle(n[r],t);break}}else this.mapgisPlottingeDrawStyle=this.$_getStyleFromOptions(this.toolOptions.options)},deep:!0}},mounted:function(){},methods:{$_getStyleFromOptions:function(t){for(var e={},n=0;n<t.length;n++)e[t[n].key]=t[n].value;return e},$_chooseTool:function(t){var e=this;this.showEditPanel=!0,this.toolOptions=this.editOptions[t];var n=m_t(t);n[0]=n[0].toUpperCase();var r=n.join("");this.mapgisPlottingeDrawStyle=this.$_getStyleFromOptions(this.toolOptions.options),this["draw"+r](this.style,(function(t,n){t===d_t.Added?(e.$refs.panel.activeTool=void 0,e.entityId=n.id):t===d_t.UnPicked?e.showEditPanel=!1:t===d_t.Picked&&(e.showEditPanel=!0,e.toolOptions=n.id.extraOptions,e.entityId=n.id.id)}),this.toolOptions,!0)}}},__t=w_t,x_t=je(__t,zwt,Uwt,!1,null,"504a22fc",null),S_t=x_t.exports,C_t=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mapgis-3d-map-story-container",style:{width:t.containerWidth}},[n("project-panel",{ref:"projectPanel",attrs:{"data-source":t.dataSourceCopy,height:t.height,width:t.width,enableOneMap:t.enableOneMap,models:t.models},on:{changeChapter:t.$_changeChapter,setCamera:t.$_setCamera,save:t.$_save,close:t.$_close,addChapter:t.$_addChapter,copyChapter:t.$_addChapter,deleteChapter:t.$_deleteChapter,addStory:t.$_addStory,deleteStory:t.$_deleteStory,changeStory:t.$_changeStory,storyPreview:t.$_storyPreview,chapterPreview:t.$_chapterPreview}}),n("input",{staticStyle:{display:"none"},attrs:{type:"file",id:t.inputId,accept:".json"}}),t._l(t.optArr,(function(t,e){return n("map-collection",{key:e,attrs:{options:t}})})),t._l(t.projectMaps,(function(t){return n("map-collection",{key:t.vueIndex,attrs:{options:t}})})),t._l(t.popups,(function(e){return[n("mapgis-3d-popup",{key:e.vueIndex,attrs:{position:{longitude:e.lng,latitude:e.lat,height:e.alt},forceRender:!0,vueIndex:e.vueIndex},model:{value:e.show,callback:function(n){t.$set(e,"show",n)},expression:"popup.show"}},[n("div",[n("div",{staticClass:"mapgis-3d-map-story-small-popup-container"},[e.title?n("div",{staticClass:"mapgis-3d-map-story-small-popup-title"},[t._v("\n "+t._s(e.title)+"\n ")]):t._e(),n("mapgis-ui-carousel",{staticClass:"mapgis-3d-map-story-small-popup-carousel",attrs:{autoplay:""}},t._l(e.images,(function(t,e){return n("div",{key:e+1e4,staticClass:"mapgis-3d-map-story-small-popup-img-div"},[n("img",{staticClass:"mapgis-3d-map-story-small-popup-img",attrs:{src:t,alt:""}})])})),0),n("div",{staticClass:"mapgis-3d-map-story-small-popup",domProps:{innerHTML:t._s(e.content)}})],1)])])]})),t.enableOneMap?t._e():n("mapgis-3d-preview-map-story",{directives:[{name:"show",rawName:"v-show",value:t.showPreview,expression:"showPreview"}],ref:"preview",attrs:{height:t.height,width:t.width,dataSource:t.storyDataSource},on:{closePanel:t.$_closePreview}})],2)},M_t=[],L_t=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("project-panel-ui",{directives:[{name:"show",rawName:"v-show",value:t.showProjectPanel,expression:"showProjectPanel"}],ref:"projectP",attrs:{height:t.height,width:t.width,models:t.models,"data-source":t.dataSourceCopy,enableImport:t.enableImport,enableOneMap:t.enableOneMap},on:{addMap:t.$_addChapterMap,addStory:t.$_addStory,deleteStory:t.$_deleteStory,editProject:t.$_editStory,toggleChapterFeatures:t.$_toggleChapterFeatures,addChapter:t.$_addChapter,copyChapter:t.$_copyChapter,deleteChapter:t.$_deleteChapter,changeChapter:t.$_changeChapter,changeStory:t.$_changeStory,storyPreview:t.$_storyPreview,setCamera:t.$_setCamera,selectCamera:t.$_selectCamera,showProject:t.$_showStory,chapterPreview:t.$_chapterPreview,export:t.$_export,import:t.$_import,save:t.$_save,close:t.$_close}})],1)},T_t=[],k_t=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"mapgis-ui-project-panel",style:{height:t.height+"px",width:t.width+"px"},on:{click:t.$_click}},[n("div",{directives:[{name:"show",rawName:"v-show",value:!t.showStoryEdit,expression:"!showStoryEdit"}],staticClass:"mapgis-ui-project-panel-content",style:{height:t.height+"px"}},[t.enableOneMap?t._e():n("mapgis-ui-row",{staticClass:"mapgis-ui-project-panel-back"},[n("span",[t._v("\n 地图故事\n ")]),n("mapgis-ui-svg-icon",{staticStyle:{position:"absolute",right:"-16px",top:"0"},attrs:{iconStyle:{width:"18px"},type:"close"},on:{click:t.$_close}})],1),n("mapgis-ui-project-header",{attrs:{enableImport:t.enableImport},on:{import:t.$_import,search:t.$_search}}),n("mapgis-ui-project-row",{attrs:{projects:t.dataSourceCopy,hideArr:t.hideArr,width:t.width},on:{editProject:t.$_editStory,deleted:t.$_deleteStory,export:t.$_export,import:t.$_import,showProjected:t.$_showProject,marked:t.$_markerStory,storyPreview:t.$_storyPreview}})],1),n("mapgis-ui-row",{directives:[{name:"show",rawName:"v-show",value:!t.showStoryEdit,expression:"!showStoryEdit"}],staticClass:"mapgis-ui-project-add-story-row"},[n("mapgis-ui-col",{attrs:{span:"24"}},[n("mapgis-ui-button",{staticClass:"mapgis-ui-project-add-story",attrs:{type:"primary"},on:{click:t.$_addStory}},[t._v("\n 新建故事\n ")])],1)],1),n("project-edit",{directives:[{name:"show",rawName:"v-show",value:t.showStoryEdit,expression:"showStoryEdit"}],ref:"panelEdit",attrs:{"data-source":t.currentStory,width:t.width,height:t.height,models:t.models,cameras:t.cameras,enableOneMap:t.enableOneMap},on:{changeChapter:t.$_changeChapter,changeStory:t.$_changeStory,addMap:t.$_addMap,setCamera:t.$_setCamera,selectCamera:t.$_selectCamera,toggleChapterFeatures:t.$_toggleChapterFeatures,storyPreview:t.$_storyPreview,chapterPreview:t.$_chapterPreview,addChapter:t.$_addChapter,deleteChapter:t.$_deleteChapter,copyChapter:t.$_copyChapter,export:t.$_export,save:t.$_save,back:t.$_back,close:t.$_close}})],1)])},E_t=[],O_t=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mapgis-ui-project-edit-panel",style:{height:t.height+"px",width:t.width+"px"},attrs:{id:t.id},on:{click:t.$_clickPanel}},[t.enableOneMap?t._e():n("mapgis-ui-row",{staticClass:"mapgis-ui-project-edit-back"},[n("mapgis-ui-svg-icon",{staticStyle:{position:"absolute",left:"5px",top:"0"},attrs:{iconStyle:{width:"18px"},type:"back"},on:{click:t.$_back}}),n("span",{on:{click:t.$_back}},[t._v("\n 返回上一级\n ")]),n("mapgis-ui-svg-icon",{staticStyle:{position:"absolute",right:"-16px",top:"0"},attrs:{iconStyle:{width:"18px"},type:"close"},on:{click:t.$_close}})],1),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.editChapter&&!t.showSetting,expression:"!editChapter && !showSetting"}],style:{height:t.height-38+"px"}},[n("div",{staticClass:"mapgis-ui-project-edit-top-bar"},[n("mapgis-ui-row",{staticClass:"mapgis-ui-project-edit-top-tool"},[n("mapgis-ui-col",{staticClass:"mapgis-ui-project-edit-top-left",attrs:{span:"18"}}),n("mapgis-ui-col",{staticClass:"mapgis-ui-project-edit-top-right",attrs:{span:"6"}})],1),n("mapgis-ui-row",{staticClass:"mapgis-ui-project-edit-title"},[t.dataSourceCopy&&t.dataSourceCopy.title?n("mapgis-ui-col",{attrs:{span:"24"}},[n("span",{directives:[{name:"show",rawName:"v-show",value:!t.editTitle,expression:"!editTitle"}],staticClass:"mapgis-ui-project-edit-title-value"},[t._v(t._s(t.dataSourceCopy.title))]),n("mapgis-ui-svg-icon",{directives:[{name:"show",rawName:"v-show",value:!t.editTitle,expression:"!editTitle"}],staticClass:"mapgis-ui-project-edit-edit-icon mapgis-ui-project-edit-edit-icon-p",attrs:{id:"mpEdit",iconStyle:{color:"white"},type:"edit"},on:{click:t.$_editTitle}}),n("mapgis-ui-input",{directives:[{name:"show",rawName:"v-show",value:t.editTitle,expression:"editTitle"}],staticClass:"mapgis-ui-project-edit-title-edit",attrs:{title:"标题",id:"mpTitle"},on:{change:t.$_titleChange},model:{value:t.dataSourceCopy.title,callback:function(e){t.$set(t.dataSourceCopy,"title",e)},expression:"dataSourceCopy.title"}})],1):t._e()],1)],1),n("mapgis-ui-row",[t.dataSourceCopy&&t.dataSourceCopy.chapters?n("mapgis-ui-feature-row",{attrs:{width:t.width},on:{editChapter:t.$_editChapter,deleteChapter:t.$_deleteChapter},model:{value:t.dataSourceCopy.chapters,callback:function(e){t.$set(t.dataSourceCopy,"chapters",e)},expression:"dataSourceCopy.chapters"}}):t._e()],1)],1),t.dataSourceCopy&&t.dataSourceCopy.map?n("mapgis-ui-map-multi-rows",{directives:[{name:"show",rawName:"v-show",value:t.showSetting,expression:"showSetting"}],attrs:{showTitleIcon:!1,showMoreTitle:"",map:t.dataSourceCopy.map,title:"附加地图"},on:{addMap:t.$_addProjectMap}}):t._e(),n("mapgis-ui-row",{directives:[{name:"show",rawName:"v-show",value:!t.editChapter&&!t.showSetting,expression:"!editChapter && !showSetting"}],staticClass:"mapgis-ui-project-edit-new-feature"},[n("mapgis-ui-col",{attrs:{span:"24"}},[n("mapgis-ui-dropdown",[n("mapgis-ui-menu",{attrs:{slot:"overlay"},slot:"overlay"},[n("mapgis-ui-menu-item",{key:"4",on:{click:t.$_copyChapter}},[t._v("\n 复制上一章节\n ")])],1),n("mapgis-ui-button",{staticClass:"mapgis-ui-project-edit-feature-button",on:{click:t.$_addChapter}},[t._v("\n 新建章节\n ")])],1),n("mapgis-ui-button",{staticClass:"mapgis-ui-project-edit-feature-preview",attrs:{type:"primary"},on:{click:t.$_storyPreview}},[t._v("\n 预览\n ")])],1)],1),n("div",{directives:[{name:"show",rawName:"v-show",value:t.editChapter,expression:"editChapter"}]},[n("feature-edit",{ref:"featureEdit",attrs:{"data-source":t.currentChapter,cameras:t.cameras,height:t.panelHeight,editList:t.editList,enableOneMap:t.enableOneMap,models:t.models},on:{change:t.$_changeChapter,setCamera:t.$_setCamera,selectCamera:t.$_selectCamera,addMap:t.$_addMap,chapterPreview:t.$_chapterPreview,animationTimeChanged:t.$_changeAnimationTime,save:t.$_save}})],1)],1)},P_t=[],B_t=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticStyle:{position:"relative",width:"100%"},style:{height:t.height-40+"px"}},[t.dataSourceCopy?n("div",{staticClass:"mapgis-ui-feature-edit-panel",style:{height:t.height-85+"px"}},[n("mapgis-ui-input-row-left",{attrs:{title:"标题",paddingLeft:"7px",paddingRight:"6px",fontSize:"14px"},model:{value:t.dataSourceCopy.title,callback:function(e){t.$set(t.dataSourceCopy,"title",e)},expression:"dataSourceCopy.title"}}),n("mapgis-ui-map-multi-rows",{directives:[{name:"show",rawName:"v-show",value:t.showMoreMap,expression:"showMoreMap"}],attrs:{showMoreTitle:t.showMoreTitle,map:t.dataSourceCopy.map,title:"附加地图"},on:{showMore:t.$_showAdvance,addMap:t.$_addMap}}),n("mapgis-ui-set-camera-view-select",{attrs:{showTitleIcon:!1,cameras:t.cameras,titleStyle:t.cameraTitleStyle,mainStyle:t.cameraMainStyle},on:{click:t.$_setCamera,showDetail:t.$_showCameraDetail,selectCamera:t.$_selectCamera}}),n("mapgis-ui-set-camera-view",{directives:[{name:"show",rawName:"v-show",value:t.showCameraDetail,expression:"showCameraDetail"}],attrs:{showTitle:!1,showButton:!1,disableInput:!0},model:{value:t.camera,callback:function(e){t.camera=e},expression:"camera"}}),n("mapgis-ui-input-row-left",{attrs:{title:"漫游时间",paddingLeft:"7px",paddingRight:"5px",fontSize:"14px"},on:{change:t.$_setAnimationTime},model:{value:t.dataSourceCopy.animationTime,callback:function(e){t.$set(t.dataSourceCopy,"animationTime",e)},expression:"dataSourceCopy.animationTime"}}),n("mapgis-ui-choose-picture-right",{attrs:{showTitleIcon:!1,useInternetImg:!0,enablePreview:!1},on:{changeImage:t.$_changeImage},model:{value:t.dataSourceCopy.images,callback:function(e){t.$set(t.dataSourceCopy,"images",e)},expression:"dataSourceCopy.images"}}),n("mapgis-ui-group-tab",{staticStyle:{"padding-left":"8px"},attrs:{title:"标绘工具"}}),t.dataSourceCopy?n("mapgis-3d-graphic-single-layer",{ref:"graphicLayer",attrs:{"data-source":t.graphics,containerStyle:t.graphicContainerStyle,iconsPanelStyle:t.iconsPanelStyle,enableOneMap:t.enableOneMap,enableMapStory:!0,models:t.models,vueIndex:t.dataSourceCopy.mapStoryUUID,vueKey:t.dataSourceCopy.mapStoryUUID},on:{addFeature:t.$_addGraphic,saveCamera:t.$_setCamera,delete:t.$_deleteGraphic}}):t._e(),n("mapgis-ui-group-tab",{staticStyle:{"padding-left":"8px"},attrs:{title:"富文本编辑"}}),n("mapgis-ui-row",{staticStyle:{width:"100%","padding-left":"8px","padding-right":"9px"}},[t.editor?n("div",{staticClass:"editor-menu-bar-head"},[n("editor-menu-bar",{attrs:{editor:t.editor},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.commands;return[n("div",{staticClass:"editor-menu-bar-content"},[n("span",{on:{click:r.bold}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"粗体",type:"border"}})],1),n("span",{on:{click:function(e){return t.showImagePrompt(r.image)}}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.pictureStyle,title:"图片",type:"picture"}})],1),n("span",{on:{click:r.italic}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"斜体",type:"italic"}})],1),n("span",{on:{click:r.strike}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"删除线",type:"strike"}})],1),n("span",{on:{click:r.underline}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"下划线",type:"underline"}})],1),n("span",{on:{click:r.bullet_list}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"无序列表",type:"ul"}})],1),n("span",{on:{click:r.ordered_list}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"有序列表",type:"ol"}})],1),n("span",{on:{click:r.blockquote}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"引用",type:"quote"}})],1),n("span",{on:{click:r.code}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"代码",type:"code"}})],1)])]}}],null,!1,2024380830)}),n("editor-content",{staticClass:"mapgis-3d-map-story-edit-container",attrs:{editor:t.editor}})],1):t._e()])],1):t._e(),t.dataSourceCopy?n("mapgis-ui-project-bottom-panel",{staticClass:"mapgis-ui-feature-edit-bottom",attrs:{enableSave:!1},on:{save:t.$_save,preview:t.$_preview}}):t._e()],1)])},I_t=[];function D_t(t){this.content=t}D_t.prototype={constructor:D_t,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return-1==i?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new D_t(o)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new D_t(n)},addToStart:function(t,e){return new D_t([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new D_t(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(-1==o?i.length:o,0,e,n),new D_t(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=D_t.from(t),t.size?new D_t(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=D_t.from(t),t.size?new D_t(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=D_t.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach((function(e,n){t[e]=n})),t},get size(){return this.content.length>>1}},D_t.from=function(t){if(t instanceof D_t)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new D_t(e)};var N_t=D_t;function F_t(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let t=0;i.text[t]==o.text[t];t++)n++;return n}if(i.content.size||o.content.size){let t=F_t(i.content,o.content,n+1);if(null!=t)return t}n+=i.nodeSize}else n+=i.nodeSize}}function j_t(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let a=t.child(--i),s=e.child(--o),c=a.nodeSize;if(a!=s){if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let t=0,e=Math.min(a.text.length,s.text.length);while(t<e&&a.text[a.text.length-t-1]==s.text[s.text.length-t-1])t++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let t=j_t(a.content,s.content,n-1,r-1);if(t)return t}n-=c,r-=c}else n-=c,r-=c}}class R_t{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let n=0;n<t.length;n++)this.size+=t[n].nodeSize}nodesBetween(t,e,n,r=0,i){for(let o=0,a=0;a<e;o++){let s=this.content[o],c=a+s.nodeSize;if(c>t&&!1!==n(s,r+a,i||null,o)&&s.content.size){let i=a+1;s.nodesBetween(Math.max(0,t-i),Math.min(s.content.size,e-i),n,r+i)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",o=!0;return this.nodesBetween(t,e,(a,s)=>{let c=a.isText?a.text.slice(Math.max(t,s)-s,e-s):a.isLeaf?r?"function"===typeof r?r(a):r:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&n&&(o?o=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),i=1);i<t.content.length;i++)r.push(t.content[i]);return new R_t(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let i=0,o=0;o<e;i++){let a=this.content[i],s=o+a.nodeSize;s>t&&((o<t||s>e)&&(a=a.isText?a.cut(Math.max(0,t-o),Math.min(a.text.length,e-o)):a.cut(Math.max(0,t-o-1),Math.min(a.content.size,e-o-1))),n.push(a),r+=a.nodeSize),o=s}return new R_t(n,r)}cutByIndex(t,e){return t==e?R_t.empty:0==t&&e==this.content.length?this:new R_t(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),i=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new R_t(r,i)}addToStart(t){return new R_t([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new R_t(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return F_t(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return j_t(this,t,e,n)}findIndex(t,e=-1){if(0==t)return z_t(0,t);if(t==this.size)return z_t(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=t)return o==t||e>0?z_t(n+1,o):z_t(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return R_t.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new R_t(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return R_t.empty;let e,n=0;for(let r=0;r<t.length;r++){let i=t[r];n+=i.nodeSize,r&&i.isText&&t[r-1].sameMarkup(i)?(e||(e=t.slice(0,r)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new R_t(e||t,n)}static from(t){if(!t)return R_t.empty;if(t instanceof R_t)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new R_t([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}R_t.empty=new R_t([],0);const H_t={index:0,offset:0};function z_t(t,e){return H_t.index=t,H_t.offset=e,H_t}function U_t(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!U_t(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!U_t(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class V_t{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&U_t(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);let r=n.create(e.attrs);return n.checkAttrs(r.attrs),r}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return V_t.none;if(t instanceof V_t)return[t];let e=t.slice();return e.sort((t,e)=>t.type.rank-e.type.rank),e}}V_t.none=[];class Y_t extends Error{}class G_t{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=W_t(this.content,t+this.openStart,e);return n&&new G_t(n,this.openStart,this.openEnd)}removeBetween(t,e){return new G_t(Q_t(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return G_t.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new G_t(R_t.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let i=t.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new G_t(t,n,r)}}function Q_t(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:a,offset:s}=t.findIndex(n);if(i==e||o.isText){if(s!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Q_t(o.content,e-i-1,n-i-1)))}function W_t(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),a=t.maybeChild(i);if(o==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let s=W_t(a.content,e-o-1,n);return s&&t.replaceChild(i,a.copy(s))}function K_t(t,e,n){if(n.openStart>t.depth)throw new Y_t("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Y_t("Inconsistent open depths");return q_t(t,e,n,0)}function q_t(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let a=q_t(t,e,n,r+1);return o.copy(o.content.replaceChild(i,a))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){let{start:i,end:a}=rxt(n,t);return txt(o,ext(t,i,a,e,r))}{let r=t.parent,i=r.content;return txt(r,i.cut(0,t.parentOffset).append(n.content).append(i.cut(e.parentOffset)))}}return txt(o,nxt(t,e,r))}function X_t(t,e){if(!e.type.compatibleContent(t.type))throw new Y_t("Cannot join "+e.type.name+" onto "+t.type.name)}function $_t(t,e,n){let r=t.node(n);return X_t(r,e.node(n)),r}function J_t(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Z_t(t,e,n,r){let i=(e||t).node(n),o=0,a=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(J_t(t.nodeAfter,r),o++));for(let s=o;s<a;s++)J_t(i.child(s),r);e&&e.depth==n&&e.textOffset&&J_t(e.nodeBefore,r)}function txt(t,e){return t.type.checkContent(e),t.copy(e)}function ext(t,e,n,r,i){let o=t.depth>i&&$_t(t,e,i+1),a=r.depth>i&&$_t(n,r,i+1),s=[];return Z_t(null,t,i,s),o&&a&&e.index(i)==n.index(i)?(X_t(o,a),J_t(txt(o,ext(t,e,n,r,i+1)),s)):(o&&J_t(txt(o,nxt(t,e,i+1)),s),Z_t(e,n,i,s),a&&J_t(txt(a,nxt(n,r,i+1)),s)),Z_t(r,null,i,s),new R_t(s)}function nxt(t,e,n){let r=[];if(Z_t(null,t,n,r),t.depth>n){let i=$_t(t,e,n+1);J_t(txt(i,nxt(t,e,n+1)),r)}return Z_t(e,null,n,r),new R_t(r)}function rxt(t,e){let n=e.depth-t.openStart,r=e.node(n),i=r.copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(R_t.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}G_t.empty=new G_t(R_t.empty,0,0);class ixt{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return t=this.resolveDepth(t),0==t?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let i=0;i<t;i++)r+=n.child(i).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return V_t.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new cxt(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let o=t;;){let{index:t,offset:e}=o.content.findIndex(i),a=i-e;if(n.push(o,t,r+e),!a)break;if(o=o.child(t),o.isText)break;i=a-1,r+=e+1}return new ixt(e,n,i)}static resolveCached(t,e){let n=sxt.get(t);if(n)for(let i=0;i<n.elts.length;i++){let t=n.elts[i];if(t.pos==e)return t}else sxt.set(t,n=new oxt);let r=n.elts[n.i]=ixt.resolve(t,e);return n.i=(n.i+1)%axt,r}}class oxt{constructor(){this.elts=[],this.i=0}}const axt=12,sxt=new WeakMap;class cxt{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const uxt=Object.create(null);class lxt{constructor(t,e,n,r=V_t.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||R_t.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&U_t(this.attrs,e||t.defaultAttrs||uxt)&&V_t.sameSet(this.marks,n||V_t.none)}copy(t=null){return t==this.content?this:new lxt(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new lxt(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return G_t.empty;let r=this.resolve(t),i=this.resolve(e),o=n?0:r.sharedDepth(e),a=r.start(o),s=r.node(o),c=s.content.cut(r.pos-a,i.pos-a);return new G_t(c,r.depth-o,i.depth-o)}replace(t,e,n){return K_t(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(e=e.maybeChild(n),!e)return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return ixt.resolveCached(this,t)}resolveNoCache(t){return ixt.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,t=>(n.isInSet(t.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),dxt(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=R_t.empty,r=0,i=n.childCount){let o=this.contentMatchAt(t).matchFragment(n,r,i),a=o&&o.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(let s=r;s<i;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(t).matchType(n),o=i&&i.matchFragment(this.content,e);return!!o&&o.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=V_t.none;for(let e=0;e<this.marks.length;e++){let n=this.marks[e];n.type.checkAttrs(n.attrs),t=n.addToSet(t)}if(!V_t.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=void 0;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=R_t.fromJSON(t,e.content),i=t.nodeType(e.type).create(e.attrs,r,n);return i.type.checkAttrs(i.attrs),i}}lxt.prototype.text=void 0;class hxt extends lxt{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):dxt(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new hxt(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new hxt(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function dxt(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class fxt{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new pxt(t,e);if(null==n.next)return fxt.empty;let r=mxt(n);n.next&&n.err("Unexpected trailing text");let i=Cxt(_xt(r));return Mxt(i,n),i}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let i=e;r&&i<n;i++)r=r.matchType(t.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];function i(o,a){let s=o.matchFragment(t,n);if(s&&(!e||s.validEnd))return R_t.from(a.map(t=>t.createAndFill()));for(let t=0;t<o.next.length;t++){let{type:e,next:n}=o.next[t];if(!e.isText&&!e.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let t=i(n,a.concat(e));if(t)return t}}return null}return i(this,[])}findWrapping(t){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==t)return this.wrapCache[n+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];while(n.length){let r=n.shift(),i=r.match;if(i.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<i.next.length;t++){let{type:o,next:a}=i.next[t];o.isLeaf||o.hasRequiredAttrs()||o.name in e||r.type&&!a.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),e[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}return e(this),t.map((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let i=0;i<e.next.length;i++)r+=(i?", ":"")+e.next[i].type.name+"->"+t.indexOf(e.next[i].next);return r}).join("\n")}}fxt.empty=new fxt(!0);class pxt{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function mxt(t){let e=[];do{e.push(gxt(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function gxt(t){let e=[];do{e.push(Axt(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function Axt(t){let e=wxt(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=yxt(t,e)}return e}function vxt(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function yxt(t,e){let n=vxt(t),r=n;return t.eat(",")&&(r="}"!=t.next?vxt(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function bxt(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let t=n[o];t.isInGroup(e)&&i.push(t)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i}function wxt(t){if(t.eat("(")){let e=mxt(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=bxt(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}function _xt(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach(t=>t.to=e)}function o(t,e){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(o(n,e)),[]);if("seq"!=t.type){if("star"==t.type){let a=n();return r(e,a),i(o(t.expr,a),a),[r(a)]}if("plus"==t.type){let a=n();return i(o(t.expr,e),a),i(o(t.expr,a),a),[r(a)]}if("opt"==t.type)return[r(e)].concat(o(t.expr,e));if("range"==t.type){let a=e;for(let e=0;e<t.min;e++){let e=n();i(o(t.expr,a),e),a=e}if(-1==t.max)i(o(t.expr,a),a);else for(let e=t.min;e<t.max;e++){let e=n();r(a,e),i(o(t.expr,a),e),a=e}return[r(a)]}if("name"==t.type)return[r(e,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let a=o(t.exprs[r],e);if(r==t.exprs.length-1)return a;i(a,e=n())}}}function xxt(t,e){return e-t}function Sxt(t,e){let n=[];return r(e),n.sort(xxt);function r(e){let i=t[e];if(1==i.length&&!i[0].term)return r(i[0].to);n.push(e);for(let t=0;t<i.length;t++){let{term:e,to:o}=i[t];e||-1!=n.indexOf(o)||r(o)}}}function Cxt(t){let e=Object.create(null);return n(Sxt(t,0));function n(r){let i=[];r.forEach(e=>{t[e].forEach(({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t<i.length;t++)i[t][0]==e&&(r=i[t][1]);Sxt(t,n).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})})});let o=e[r.join(",")]=new fxt(r.indexOf(t.length-1)>-1);for(let t=0;t<i.length;t++){let r=i[t][1].sort(xxt);o.next.push({type:i[t][0],next:e[r.join(",")]||n(r)})}return o}}function Mxt(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],i=!t.validEnd,o=[];for(let e=0;e<t.next.length;e++){let{type:n,next:a}=t.next[e];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(a)&&r.push(a)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Lxt(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Txt(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(void 0===i){let e=t[r];if(!e.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=e.default}n[r]=i}return n}function kxt(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let n=t[i];n.validate&&n.validate(e[i])}}function Ext(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Bxt(t,r,e[r]);return n}class Oxt{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Ext(t,n.attrs),this.defaultAttrs=Lxt(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==fxt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:Txt(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new lxt(this,this.computeAttrs(t),R_t.from(e),V_t.setFrom(n))}createChecked(t=null,e,n){return e=R_t.from(e),this.checkContent(e),new lxt(this,this.computeAttrs(t),e,V_t.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),e=R_t.from(e),e.size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),i=r&&r.fillBefore(R_t.empty,!0);return i?new lxt(this,t,e.append(i),V_t.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){kxt(this.attrs,t,"node",this.name)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:V_t.none:t}static compile(t,e){let n=Object.create(null);t.forEach((t,r)=>n[t]=new Oxt(t,e,r));let r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}function Pxt(t,e,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class Bxt{constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?Pxt(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Ixt{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=Ext(t,r.attrs),this.excluded=null;let i=Lxt(this.attrs);this.instance=i?new V_t(this,i):null}create(t=null){return!t&&this.instance?this.instance:new V_t(this,Txt(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach((t,i)=>n[t]=new Ixt(t,r++,e,i)),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}checkAttrs(t){kxt(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class Dxt{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let r in t)e[r]=t[r];e.nodes=N_t.from(t.nodes),e.marks=N_t.from(t.marks||{}),this.nodes=Oxt.compile(this.spec.nodes,this),this.marks=Ixt.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let t=this.nodes[r],e=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=n[e]||(n[e]=fxt.parse(e,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==i?null:i?Nxt(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let r in this.marks){let t=this.marks[r],e=t.spec.excludes;t.excluded=null==e?[t]:""==e?[]:Nxt(this,e.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof Oxt))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new hxt(n,n.defaultAttrs,t,V_t.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return lxt.fromJSON(this,t)}markFromJSON(t){return V_t.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function Nxt(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],a=o;if(o)n.push(o);else for(let e in t.marks){let r=t.marks[e];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=r)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Fxt(t){return null!=t.tag}function jxt(t){return null!=t.style}class Rxt{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let n=this.matchedStyles=[];e.forEach(t=>{if(Fxt(t))this.tags.push(t);else if(jxt(t)){let e=/[^=]*/.exec(t.style)[0];n.indexOf(e)<0&&n.push(e),this.styles.push(t)}}),this.normalizeLists=!this.tags.some(e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)})}parse(t,e={}){let n=new Kxt(this,e,!1);return n.addAll(t,V_t.none,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new Kxt(this,e,!0);return n.addAll(t,V_t.none,e.from,e.to),G_t.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Xxt(t,n.tag)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(t)||r.context&&!n.matchesContext(r.context)||o.length>t.length&&(61!=o.charCodeAt(t.length)||o.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r],i=null==t.priority?50:t.priority;if(i<n)break}e.splice(r,0,t)}for(let r in t.marks){let e=t.marks[r].spec.parseDOM;e&&e.forEach(t=>{n(t=$xt(t)),t.mark||t.ignore||t.clearMark||(t.mark=r)})}for(let r in t.nodes){let e=t.nodes[r].spec.parseDOM;e&&e.forEach(t=>{n(t=$xt(t)),t.node||t.ignore||t.mark||(t.node=r)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Rxt(t,Rxt.schemaRules(t)))}}const Hxt={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},zxt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Uxt={ol:!0,ul:!0},Vxt=1,Yxt=2,Gxt=4;function Qxt(t,e,n){return null!=e?(e?Vxt:0)|("full"===e?Yxt:0):t&&"pre"==t.whitespace?Vxt|Yxt:n&~Gxt}class Wxt{constructor(t,e,n,r,i,o){this.type=t,this.attrs=e,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=V_t.none,this.match=i||(o&Gxt?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(R_t.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Vxt)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=R_t.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(R_t.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Hxt.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Kxt{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r,i=e.topNode,o=Qxt(null,e.preserveWhitespace,0)|(n?Gxt:0);r=i?new Wxt(i.type,i.attrs,V_t.none,!0,e.topMatch||i.type.contentMatch,o):new Wxt(n?null:t.schema.topNodeType,null,V_t.none,!0,null,o),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,r=this.top,i=r.options&Yxt?"full":this.localPreserveWS||(r.options&Vxt)>0;if("full"===i||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(i)n="full"!==i?n.replace(/\r?\n|\r/g," "):n.replace(/\r\n?/g,"\n");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let e=r.content[r.content.length-1],i=t.previousSibling;(!e||i&&"BR"==i.nodeName||e.isText&&/[ \t\r\n\u000c]$/.test(e.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),e),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let r=this.localPreserveWS,i=this.top;("PRE"==t.tagName||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let o,a=t.nodeName.toLowerCase();Uxt.hasOwnProperty(a)&&this.parser.normalizeLists&&qxt(t);let s=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(o=this.parser.matchTag(t,this,n));t:if(s?s.ignore:zxt.hasOwnProperty(a))this.findInside(t),this.ignoreFallback(t,e);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(t=s.skip);let n,r=this.needsBlock;if(Hxt.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,e);break t}let o=s&&s.skip?e:this.readStyles(t,e);o&&this.addAll(t,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(t,e);n&&this.addElementByRule(t,s,n,!1===s.consuming?o:void 0)}this.localPreserveWS=r}leafFallback(t,e){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"),e)}ignoreFallback(t,e){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),e)}readStyles(t,e){let n=t.style;if(n&&n.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let t=this.parser.matchedStyles[r],i=n.getPropertyValue(t);if(i)for(let n=void 0;;){let r=this.parser.matchStyle(t,i,this,n);if(!r)break;if(r.ignore)return null;if(e=r.clearMark?e.filter(t=>!r.clearMark(t)):e.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming)break;n=r}}return e}addElementByRule(t,e,n,r){let i,o;if(e.node)if(o=this.parser.schema.nodes[e.node],o.isLeaf)this.insertNode(o.create(e.attrs),n)||this.leafFallback(t,n);else{let t=this.enter(o,e.attrs||null,n,e.preserveWhitespace);t&&(i=!0,n=t)}else{let t=this.parser.schema.marks[e.mark];n=n.concat(t.create(e.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t,n));else{let r=t;"string"==typeof e.contentElement?r=t.querySelector(e.contentElement):"function"==typeof e.contentElement?r=e.contentElement(t):e.contentElement&&(r=e.contentElement),this.findAround(t,r,!0),this.addAll(r,n),this.findAround(t,r,!1)}i&&this.sync(a)&&this.open--}addAll(t,e,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,a=null==r?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o,e);this.findAtPoint(t,i)}findPlace(t,e){let n,r;for(let i=this.open;i>=0;i--){let e=this.nodes[i],o=e.findWrapping(t);if(o&&(!n||n.length>o.length)&&(n=o,r=e,!o.length))break;if(e.solid)break}if(!n)return null;this.sync(r);for(let i=0;i<n.length;i++)e=this.enterInner(n[i],null,e,!1);return e}insertNode(t,e){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&(e=this.enterInner(t,null,e))}let n=this.findPlace(t,e);if(n){this.closeExtra();let e=this.top;e.match&&(e.match=e.match.matchType(t.type));let r=V_t.none;for(let i of n.concat(t.marks))(e.type?e.type.allowsMarkType(i.type):Jxt(i.type,t.type))&&(r=i.addToSet(r));return e.content.push(t.mark(r)),!0}return!1}enter(t,e,n,r){let i=this.findPlace(t.create(e),n);return i&&(i=this.enterInner(t,e,n,!0,r)),i}enterInner(t,e,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(t);let a=Qxt(t,i,o.options);o.options&Gxt&&0==o.content.length&&(a|=Gxt);let s=V_t.none;return n=n.filter(e=>!(o.type?o.type.allowsMarkType(e.type):Jxt(e.type,t))||(s=e.addToSet(s),!1)),this.nodes.push(new Wxt(t,e,s,r,null,a)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=Vxt)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)){let t=e.compareDocumentPosition(this.find[r].node);t&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(t,a)=>{for(;t>=0;t--){let s=e[t];if(""==s){if(t==e.length-1||0==t)continue;for(;a>=i;a--)if(o(t-1,a))return!0;return!1}{let t=a>0||0==a&&r?this.nodes[a].type:n&&a>=i?n.node(a-i).type:null;if(!t||t.name!=s&&!t.isInGroup(s))return!1;a--}}return!0};return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function qxt(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&Uxt.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}function Xxt(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function $xt(t){let e={};for(let n in t)e[n]=t[n];return e}function Jxt(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],a=t=>{o.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:i}=t.edge(n);if(r==e)return!0;if(o.indexOf(i)<0&&a(i))return!0}};if(a(i.contentMatch))return!0}}class Zxt{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=eSt(e).createDocumentFragment());let r=n,i=[];return t.forEach(t=>{if(i.length||t.marks.length){let n=0,o=0;while(n<i.length&&o<t.marks.length){let e=t.marks[o];if(this.marks[e.type.name]){if(!e.eq(i[n][0])||!1===e.type.spec.spanning)break;n++,o++}else o++}while(n<i.length)r=i.pop()[1];while(o<t.marks.length){let n=t.marks[o++],a=this.serializeMark(n,t.isInline,e);a&&(i.push([n,r]),r.appendChild(a.dom),r=a.contentDOM||a.dom)}}r.appendChild(this.serializeNodeInner(t,e))}),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=oSt(eSt(e),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&oSt(eSt(n),r(t,e),null,t.attrs)}static renderSpec(t,e,n=null,r){return oSt(t,e,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Zxt(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=tSt(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return tSt(t.marks)}}function tSt(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function eSt(t){return t.document||window.document}const nSt=new WeakMap;function rSt(t){let e=nSt.get(t);return void 0===e&&nSt.set(t,e=iSt(t)),e}function iSt(t){let e=null;function n(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])e||(e=[]),e.push(t);else for(let e=0;e<t.length;e++)n(t[e]);else for(let e in t)n(t[e])}return n(t),e}function oSt(t,e,n,r){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let i,o=e[0];if("string"!=typeof o)throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=rSt(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a,s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let c=n?t.createElementNS(n,o):t.createElement(o),u=e[1],l=1;if(u&&"object"==typeof u&&null==u.nodeType&&!Array.isArray(u)){l=2;for(let t in u)if(null!=u[t]){let e=t.indexOf(" ");e>0?c.setAttributeNS(t.slice(0,e),t.slice(e+1),u[t]):c.setAttribute(t,u[t])}}for(let h=l;h<e.length;h++){let i=e[h];if(0===i){if(h<e.length-1||h>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:e,contentDOM:o}=oSt(t,i,n,r);if(c.appendChild(e),o){if(a)throw new RangeError("Multiple content holes");a=o}}}return{dom:c,contentDOM:a}}const aSt=65535,sSt=Math.pow(2,16);function cSt(t,e){return t+e*sSt}function uSt(t){return t&aSt}function lSt(t){return(t-(t&aSt))/sSt}const hSt=1,dSt=2,fSt=4,pSt=8;class mSt{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(this.delInfo&pSt)>0}get deletedBefore(){return(this.delInfo&(hSt|fSt))>0}get deletedAfter(){return(this.delInfo&(dSt|fSt))>0}get deletedAcross(){return(this.delInfo&fSt)>0}}class gSt{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&gSt.empty)return gSt.empty}recover(t){let e=0,n=uSt(t);if(!this.inverted)for(let r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+lSt(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let s=this.ranges[a]-(this.inverted?r:0);if(s>t)break;let c=this.ranges[a+i],u=this.ranges[a+o],l=s+c;if(t<=l){let i=c?t==s?-1:t==l?1:e:e,o=s+r+(i<0?0:u);if(n)return o;let h=t==(e<0?s:l)?null:cSt(a/3,t-s),d=t==s?dSt:t==l?hSt:fSt;return(e<0?t!=s:t!=l)&&(d|=pSt),new mSt(o,d,h)}r+=u-c}return n?t+r:new mSt(t+r,0,null)}touches(t,e){let n=0,r=uSt(e),i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let e=this.ranges[a]-(this.inverted?n:0);if(e>t)break;let s=this.ranges[a+i],c=e+s;if(t<=c&&a==3*r)return!0;n+=this.ranges[a+o]-s}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],a=o-(this.inverted?i:0),s=o+(this.inverted?0:i),c=this.ranges[r+e],u=this.ranges[r+n];t(a,a+c,s,s+u),i+=u-c}}invert(){return new gSt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?gSt.empty:new gSt(t<0?[0,-t,0]:[0,0,t])}}gSt.empty=new gSt([]);class ASt{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new ASt(this.maps,this.mirror,t,e)}copy(){return new ASt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror)for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new ASt;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let i=this.from;i<this.to;i++){let n=this.maps[i],o=n.mapResult(t,e);if(null!=o.recover){let e=this.getMirror(i);if(null!=e&&e>i&&e<this.to){i=e,t=this.maps[e].recover(o.recover);continue}}r|=o.delInfo,t=o.pos}return n?t:new mSt(t,r,null)}}const vSt=Object.create(null);class ySt{getMap(){return gSt.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=vSt[e.stepType];if(!n)throw new RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in vSt)throw new RangeError("Duplicate use of step JSON ID "+t);return vSt[t]=e,e.prototype.jsonID=t,e}}class bSt{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new bSt(t,null)}static fail(t){return new bSt(null,t)}static fromReplace(t,e,n,r){try{return bSt.ok(t.replace(e,n,r))}catch(i){if(i instanceof Y_t)return bSt.fail(i.message);throw i}}}function wSt(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(wSt(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return R_t.fromArray(r)}class _St extends ySt{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new G_t(wSt(e.content,(t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,r),e.openStart,e.openEnd);return bSt.fromReplace(t,this.from,this.to,i)}invert(){return new xSt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new _St(e.pos,n.pos,this.mark)}merge(t){return t instanceof _St&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new _St(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new _St(e.from,e.to,t.markFromJSON(e.mark))}}ySt.jsonID("addMark",_St);class xSt extends ySt{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new G_t(wSt(e.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),e.openStart,e.openEnd);return bSt.fromReplace(t,this.from,this.to,n)}invert(){return new _St(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new xSt(e.pos,n.pos,this.mark)}merge(t){return t instanceof xSt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new xSt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new xSt(e.from,e.to,t.markFromJSON(e.mark))}}ySt.jsonID("removeMark",xSt);class SSt extends ySt{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return bSt.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return bSt.fromReplace(t,this.pos,this.pos+1,new G_t(R_t.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new SSt(this.pos,e.marks[n]);return new SSt(this.pos,this.mark)}}return new CSt(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new SSt(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new SSt(e.pos,t.markFromJSON(e.mark))}}ySt.jsonID("addNodeMark",SSt);class CSt extends ySt{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return bSt.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return bSt.fromReplace(t,this.pos,this.pos+1,new G_t(R_t.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new SSt(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new CSt(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new CSt(e.pos,t.markFromJSON(e.mark))}}ySt.jsonID("removeNodeMark",CSt);class MSt extends ySt{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&TSt(t,this.from,this.to)?bSt.fail("Structure replace would overwrite content"):bSt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new gSt([this.from,this.to-this.from,this.slice.size])}invert(t){return new MSt(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new MSt(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof MSt)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?G_t.empty:new G_t(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new MSt(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?G_t.empty:new G_t(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new MSt(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new MSt(e.from,e.to,G_t.fromJSON(t,e.slice),!!e.structure)}}ySt.jsonID("replace",MSt);class LSt extends ySt{constructor(t,e,n,r,i,o,a=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=a}apply(t){if(this.structure&&(TSt(t,this.from,this.gapFrom)||TSt(t,this.gapTo,this.to)))return bSt.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return bSt.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?bSt.fromReplace(t,this.from,this.to,n):bSt.fail("Content does not fit in gap")}getMap(){return new gSt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new LSt(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||i>n.pos?null:new LSt(e.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new LSt(e.from,e.to,e.gapFrom,e.gapTo,G_t.fromJSON(t,e.slice),e.insert,!!e.structure)}}function TSt(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;while(i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount)o--,i--;if(i>0){let t=r.node(o).maybeChild(r.indexAfter(o));while(i>0){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function kSt(t,e,n,r){let i,o,a=[],s=[];t.doc.nodesBetween(e,n,(t,c,u)=>{if(!t.isInline)return;let l=t.marks;if(!r.isInSet(l)&&u.type.allowsMarkType(r.type)){let u=Math.max(c,e),h=Math.min(c+t.nodeSize,n),d=r.addToSet(l);for(let t=0;t<l.length;t++)l[t].isInSet(d)||(i&&i.to==u&&i.mark.eq(l[t])?i.to=h:a.push(i=new xSt(u,h,l[t])));o&&o.to==u?o.to=h:s.push(o=new _St(u,h,r))}}),a.forEach(e=>t.step(e)),s.forEach(e=>t.step(e))}function ESt(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(t,a)=>{if(!t.isInline)return;o++;let s=null;if(r instanceof Ixt){let e,n=t.marks;while(e=r.isInSet(n))(s||(s=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(s=[r]):s=t.marks;if(s&&s.length){let r=Math.min(a+t.nodeSize,n);for(let t=0;t<s.length;t++){let n,c=s[t];for(let t=0;t<i.length;t++){let e=i[t];e.step==o-1&&c.eq(i[t].style)&&(n=e)}n?(n.to=r,n.step=o):i.push({style:c,from:Math.max(a,e),to:r,step:o})}}}),i.forEach(e=>t.step(new xSt(e.from,e.to,e.style)))}function OSt(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),a=[],s=e+1;for(let c=0;c<o.childCount;c++){let e=o.child(c),u=s+e.nodeSize,l=r.matchType(e.type);if(l){r=l;for(let r=0;r<e.marks.length;r++)n.allowsMarkType(e.marks[r].type)||t.step(new xSt(s,u,e.marks[r]));if(i&&e.isText&&"pre"!=n.whitespace){let t,r,i=/\r?\n|\r/g;while(t=i.exec(e.text))r||(r=new G_t(R_t.from(n.schema.text(" ",n.allowedMarks(e.marks))),0,0)),a.push(new MSt(s+t.index,s+t.index+t[0].length,r))}}else a.push(new MSt(s,u,G_t.empty));s=u}if(!r.validEnd){let e=r.fillBefore(R_t.empty,!0);t.replace(s,s,new G_t(e,0,0))}for(let c=a.length-1;c>=0;c--)t.step(a[c])}function PSt(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function BSt(t){let e=t.parent,n=e.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let e=t.$from.node(r),i=t.$from.index(r),o=t.$to.indexAfter(r);if(r<t.depth&&e.canReplace(i,o,n))return r;if(0==r||e.type.spec.isolating||!PSt(e,i,o))break}return null}function ISt(t,e,n){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),s=i.after(o+1),c=a,u=s,l=R_t.empty,h=0;for(let p=o,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,l=R_t.from(r.node(p).copy(l)),h++):c--;let d=R_t.empty,f=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)<i.end(p)?(m=!0,d=R_t.from(i.node(p).copy(d)),f++):u++;t.step(new LSt(c,u,a,s,new G_t(l.append(d),h,f),l.size-h,!0))}function DSt(t,e,n=null,r=t){let i=FSt(t,e),o=i&&jSt(r,e);return o?i.map(NSt).concat({type:e,attrs:n}).concat(o.map(NSt)):null}function NSt(t){return{type:t,attrs:null}}function FSt(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return n.canReplaceWith(r,i,a)?o:null}function jSt(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let s=a.length?a[a.length-1]:e,c=s.contentMatch;for(let u=r;c&&u<i;u++)c=c.matchType(n.child(u).type);return c&&c.validEnd?a:null}function RSt(t,e,n){let r=R_t.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let t=n[a].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=R_t.from(n[a].type.create(n[a].attrs,r))}let i=e.start,o=e.end;t.step(new LSt(i,o,i,o,new G_t(r,0,0),n.length,!0))}function HSt(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(e,n)=>{let a="function"==typeof i?i(e):i;if(e.isTextblock&&!e.hasMarkup(r,a)&&VSt(t.doc,t.mapping.slice(o).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let t="pre"==r.whitespace,e=!!r.contentMatch.matchType(r.schema.linebreakReplacement);t&&!e?i=!1:!t&&e&&(i=!0)}!1===i&&USt(t,e,n,o),OSt(t,t.mapping.slice(o).map(n,1),r,void 0,null===i);let s=t.mapping.slice(o),c=s.map(n,1),u=s.map(n+e.nodeSize,1);return t.step(new LSt(c,u,c+1,u-1,new G_t(R_t.from(r.create(a,null,e.marks)),0,0),1,!0)),!0===i&&zSt(t,e,n,o),!1}})}function zSt(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let a,s=/\r?\n|\r/g;while(a=s.exec(i.text)){let i=t.mapping.slice(r).map(n+1+o+a.index);t.replaceWith(i,i+1,e.type.schema.linebreakReplacement.create())}}})}function USt(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+o);t.replaceWith(i,i+1,e.type.schema.text("\n"))}})}function VSt(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function YSt(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let a=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new LSt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new G_t(R_t.from(a),0,0),1,!0))}function GSt(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,l=n-2;u>o;u--,l--){let t=i.node(u),e=i.index(u);if(t.type.spec.isolating)return!1;let n=t.content.cutByIndex(e,t.childCount),o=r&&r[l+1];o&&(n=n.replaceChild(0,o.type.create(o.attrs)));let a=r&&r[l]||t;if(!t.canReplace(e+1,t.childCount)||!a.type.validContent(n))return!1}let s=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(s,s,c?c.type:i.node(o+1).type)}function QSt(t,e,n=1,r){let i=t.doc.resolve(e),o=R_t.empty,a=R_t.empty;for(let s=i.depth,c=i.depth-n,u=n-1;s>c;s--,u--){o=R_t.from(i.node(s).copy(o));let t=r&&r[u];a=R_t.from(t?t.type.create(t.attrs,a):i.node(s).copy(a))}t.step(new MSt(e,e,new G_t(o.append(a),n,n),!0))}function WSt(t,e){let n=t.resolve(e),r=n.index();return qSt(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function KSt(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),a=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(a),!n)return!1;if(!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function qSt(t,e){return!(!t||!e||t.isLeaf||!KSt(t,e))}function XSt(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),a=o.node().type;if(i&&a.inlineContent){let t="pre"==a.whitespace,e=!!a.contentMatch.matchType(i);t&&!e?r=!1:!t&&e&&(r=!0)}let s=t.steps.length;if(!1===r){let r=t.doc.resolve(e+n);USt(t,r.node(),r.before(),s)}a.inlineContent&&OSt(t,e+n-1,a,o.node().contentMatchAt(o.index()),null==r);let c=t.mapping.slice(s),u=c.map(e-n);if(t.step(new MSt(u,c.map(e+n,-1),G_t.empty,!0)),!0===r){let e=t.doc.resolve(u);zSt(t,e.node(),e.before(),t.steps.length)}return t}function $St(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let t=r.index(i);if(r.node(i).canReplaceWith(t,t,n))return r.before(i+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let t=r.indexAfter(i);if(r.node(i).canReplaceWith(t,t,n))return r.after(i+1);if(t<r.node(i).childCount)return null}return null}function JSt(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(0==n.openStart&&n.size?2:1);o++)for(let t=r.depth;t>=0;t--){let e=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,n=r.index(t)+(e>0?1:0),a=r.node(t),s=!1;if(1==o)s=a.canReplace(n,n,i);else{let t=a.contentMatchAt(n).findWrapping(i.firstChild.type);s=t&&a.canReplaceWith(n,n,t[0])}if(s)return 0==e?r.pos:e<0?r.before(t+1):r.after(t+1)}return null}function ZSt(t,e,n=e,r=G_t.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return tCt(i,o,r)?new MSt(e,n,r):new eCt(i,o,r).fit()}function tCt(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}ySt.jsonID("replaceAround",LSt);class eCt{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=R_t.empty;for(let r=0;r<=t.depth;r++){let e=t.node(r);this.frontier.push({type:e.type,match:e.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=R_t.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){while(this.unplaced.size){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let i=this.placed,o=n.depth,a=r.depth;while(o&&a&&1==i.childCount)i=i.firstChild.content,o--,a--;let s=new G_t(i,o,a);return t>-1?new LSt(n.pos,t,this.$to.pos,this.$to.end(),s,e):s.size||n.pos!=this.$to.pos?new MSt(n.pos,r.pos,s):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){let i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t,r=null;n?(r=iCt(this.unplaced.content,n-1).firstChild,t=r.content):t=this.unplaced.content;let i=t.firstChild;for(let o=this.depth;o>=0;o--){let t,{type:a,match:s}=this.frontier[o],c=null;if(1==e&&(i?s.matchType(i.type)||(c=s.fillBefore(R_t.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:o,parent:r,inject:c};if(2==e&&i&&(t=s.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:r,wrap:t};if(r&&s.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=iCt(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new G_t(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=iCt(t,e);if(r.childCount<=1&&e>0){let i=t.size-e<=e+r.size;this.unplaced=new G_t(nCt(t,e-1,1),e-1,i?e-1:n)}else this.unplaced=new G_t(nCt(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:i}){while(this.depth>e)this.closeFrontierNode();if(i)for(let p=0;p<i.length;p++)this.openFrontierNode(i[p]);let o=this.unplaced,a=n?n.content:o.content,s=o.openStart-t,c=0,u=[],{match:l,type:h}=this.frontier[e];if(r){for(let t=0;t<r.childCount;t++)u.push(r.child(t));l=l.matchFragment(r)}let d=a.size+t-(o.content.size-o.openEnd);while(c<a.childCount){let t=a.child(c),e=l.matchType(t.type);if(!e)break;c++,(c>1||0==s||t.content.size)&&(l=e,u.push(oCt(t.mark(h.allowedMarks(t.marks)),1==c?s:0,c==a.childCount?d:-1)))}let f=c==a.childCount;f||(d=-1),this.placed=rCt(this.placed,e,R_t.from(u)),this.frontier[e].match=l,f&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let p=0,m=a;p<d;p++){let t=m.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),m=t.content}this.unplaced=f?0==t?G_t.empty:new G_t(nCt(o.content,t-1,1),t-1,d<0?o.openEnd:t-1):new G_t(nCt(o.content,t,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t,e=this.frontier[this.depth];if(!e.type.isTextblock||!aCt(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);while(n>1&&r==this.$to.end(--n))++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),o=aCt(t,e,r,n,i);if(o){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],i=aCt(t,n,r,e,!0);if(!i||i.childCount)continue t}return{depth:e,fit:o,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;while(this.depth>e.depth)this.closeFrontierNode();e.fit.childCount&&(this.placed=rCt(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=rCt(this.placed,this.depth,R_t.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop(),e=t.match.fillBefore(R_t.empty,!0);e.childCount&&(this.placed=rCt(this.placed,this.frontier.length,e))}}function nCt(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(nCt(t.firstChild.content,e-1,n)))}function rCt(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(rCt(t.lastChild.content,e-1,n)))}function iCt(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function oCt(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,oCt(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(R_t.empty,!0)))),t.copy(r)}function aCt(t,e,n,r,i){let o=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let s=r.fillBefore(o.content,!0,a);return s&&!sCt(n,o.content,a)?s:null}function sCt(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function cCt(t){return t.spec.defining||t.spec.definingForContent}function uCt(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(tCt(i,o,r))return t.step(new MSt(e,n,r));let a=fCt(i,t.doc.resolve(n));0==a[a.length-1]&&a.pop();let s=-(i.depth+1);a.unshift(s);for(let d=i.depth,f=i.pos-1;d>0;d--,f--){let t=i.node(d).type.spec;if(t.defining||t.definingAsContext||t.isolating)break;a.indexOf(d)>-1?s=d:i.before(d)==f&&a.splice(1,0,-d)}let c=a.indexOf(s),u=[],l=r.openStart;for(let d=r.content,f=0;;f++){let t=d.firstChild;if(u.push(t),f==r.openStart)break;d=t.content}for(let d=l-1;d>=0;d--){let t=u[d],e=cCt(t.type);if(e&&!t.sameMarkup(i.node(Math.abs(s)-1)))l=d;else if(e||!t.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let e=(d+l+1)%(r.openStart+1),s=u[e];if(s)for(let u=0;u<a.length;u++){let l=a[(u+c)%a.length],h=!0;l<0&&(h=!1,l=-l);let d=i.node(l-1),f=i.index(l-1);if(d.canReplaceWith(f,f,s.type,s.marks))return t.replace(i.before(l),h?o.after(l):n,new G_t(lCt(r.content,0,r.openStart,e),e,r.openEnd))}}let h=t.steps.length;for(let d=a.length-1;d>=0;d--){if(t.replace(e,n,r),t.steps.length>h)break;let s=a[d];s<0||(e=i.before(s),n=o.after(s))}}function lCt(t,e,n,r,i){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(lCt(i.content,e+1,n,r,i)))}if(e>r){let e=i.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(R_t.empty,!0))}return t}function hCt(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=$St(t.doc,e,r.type);null!=i&&(e=n=i)}t.replaceRange(e,n,new G_t(R_t.from(r),0,0))}function dCt(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=fCt(r,i);for(let a=0;a<o.length;a++){let e=o[a],n=a==o.length-1;if(n&&0==e||r.node(e).type.contentMatch.validEnd)return t.delete(r.start(e),i.end(e));if(e>0&&(n||r.node(e-1).canReplace(r.index(e-1),i.indexAfter(e-1))))return t.delete(r.before(e),i.after(e))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return t.delete(r.before(a),n);t.delete(e,n)}function fCt(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let r=t.start(i);if(r<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(r==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==r-1)&&n.push(i)}return n}class pCt extends ySt{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return bSt.fail("No node at attribute step's position");let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,null,e.marks);return bSt.fromReplace(t,this.pos,this.pos+1,new G_t(R_t.from(r),0,e.isLeaf?0:1))}getMap(){return gSt.empty}invert(t){return new pCt(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new pCt(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new pCt(e.pos,e.attr,e.value)}}ySt.jsonID("attr",pCt);class mCt extends ySt{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let r in t.attrs)e[r]=t.attrs[r];e[this.attr]=this.value;let n=t.type.create(e,t.content,t.marks);return bSt.ok(n)}getMap(){return gSt.empty}invert(t){return new mCt(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new mCt(e.attr,e.value)}}ySt.jsonID("docAttr",mCt);let gCt=class extends Error{};gCt=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},gCt.prototype=Object.create(Error.prototype),gCt.prototype.constructor=gCt,gCt.prototype.name="TransformError";class ACt{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ASt}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new gCt(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=G_t.empty){let r=ZSt(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new G_t(R_t.from(n),0,0))}delete(t,e){return this.replace(t,e,G_t.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return uCt(this,t,e,n),this}replaceRangeWith(t,e,n){return hCt(this,t,e,n),this}deleteRange(t,e){return dCt(this,t,e),this}lift(t,e){return ISt(this,t,e),this}join(t,e=1){return XSt(this,t,e),this}wrap(t,e){return RSt(this,t,e),this}setBlockType(t,e=t,n,r=null){return HSt(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r){return YSt(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new pCt(t,e,n)),this}setDocAttribute(t,e){return this.step(new mCt(t,e)),this}addNodeMark(t,e){return this.step(new SSt(t,e)),this}removeNodeMark(t,e){if(!(e instanceof V_t)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(e=e.isInSet(n.marks),!e)return this}return this.step(new CSt(t,e)),this}split(t,e=1,n){return QSt(this,t,e,n),this}addMark(t,e,n){return kSt(this,t,e,n),this}removeMark(t,e,n){return ESt(this,t,e,n),this}clearIncompatible(t,e,n){return OSt(this,t,e,n),this}}const vCt=Object.create(null);class yCt{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new bCt(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=G_t.empty){let n=e.content.lastChild,r=null;for(let a=0;a<e.openEnd;a++)r=n,n=n.lastChild;let i=t.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:s,$to:c}=o[a],u=t.mapping.slice(i);t.replaceRange(u.map(s.pos),u.map(c.pos),a?G_t.empty:e),0==a&&ECt(t,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:a}=r[i],s=t.mapping.slice(n),c=s.map(o.pos),u=s.map(a.pos);i?t.deleteRange(c,u):(t.replaceRangeWith(c,u,e),ECt(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new xCt(t):kCt(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let i=t.depth-1;i>=0;i--){let r=e<0?kCt(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):kCt(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(r)return r}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new LCt(t.node(0))}static atStart(t){return kCt(t,t,0,0,1)||new LCt(t)}static atEnd(t){return kCt(t,t,t.content.size,t.childCount,-1)||new LCt(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=vCt[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in vCt)throw new RangeError("Duplicate use of selection JSON ID "+t);return vCt[t]=e,e.prototype.jsonID=t,e}getBookmark(){return xCt.between(this.$anchor,this.$head).getBookmark()}}yCt.prototype.visible=!0;class bCt{constructor(t,e){this.$from=t,this.$to=e}}let wCt=!1;function _Ct(t){wCt||t.parent.inlineContent||(wCt=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class xCt extends yCt{constructor(t,e=t){_Ct(t),_Ct(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return yCt.near(n);let r=t.resolve(e.map(this.anchor));return new xCt(r.parent.inlineContent?r:n,n)}replace(t,e=G_t.empty){if(super.replace(t,e),e==G_t.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof xCt&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new SCt(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new xCt(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=yCt.findFrom(e,n,!0)||yCt.findFrom(e,-n,!0);if(!t)return yCt.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r?t=e:(t=(yCt.findFrom(t,-n,!0)||yCt.findFrom(t,n,!0)).$anchor,t.pos<e.pos!=r<0&&(t=e))),new xCt(t,e)}}yCt.jsonID("text",xCt);class SCt{constructor(t,e){this.anchor=t,this.head=e}map(t){return new SCt(t.map(this.anchor),t.map(this.head))}resolve(t){return xCt.between(t.resolve(this.anchor),t.resolve(this.head))}}class CCt extends yCt{constructor(t){let e=t.nodeAfter,n=t.node(0).resolve(t.pos+e.nodeSize);super(t,n),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),i=t.resolve(r);return n?yCt.near(i):new CCt(i)}content(){return new G_t(R_t.from(this.node),0,0)}eq(t){return t instanceof CCt&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new MCt(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new CCt(t.resolve(e.anchor))}static create(t,e){return new CCt(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}CCt.prototype.visible=!1,yCt.jsonID("node",CCt);class MCt{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new SCt(n,n):new MCt(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&CCt.isSelectable(n)?new CCt(e):yCt.near(e)}}class LCt extends yCt{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=G_t.empty){if(e==G_t.empty){t.delete(0,t.doc.content.size);let e=yCt.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new LCt(t)}map(t){return new LCt(t)}eq(t){return t instanceof LCt}getBookmark(){return TCt}}yCt.jsonID("all",LCt);const TCt={map(){return this},resolve(t){return new LCt(t)}};function kCt(t,e,n,r,i,o=!1){if(e.inlineContent)return xCt.create(t,n);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let r=e.child(a);if(r.isAtom){if(!o&&CCt.isSelectable(r))return CCt.create(t,n-(i<0?r.nodeSize:0))}else{let e=kCt(t,r,n+i,i<0?r.childCount:0,i,o);if(e)return e}n+=r.nodeSize*i}return null}function ECt(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof MSt||i instanceof LSt))return;let o,a=t.mapping.maps[r];a.forEach((t,e,n,r)=>{null==o&&(o=r)}),t.setSelection(yCt.near(t.doc.resolve(o),n))}const OCt=1,PCt=2,BCt=4;class ICt extends ACt{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|OCt)&~PCt,this.storedMarks=null,this}get selectionSet(){return(this.updated&OCt)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=PCt,this}ensureMarks(t){return V_t.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&PCt)>0}addStep(t,e){super.addStep(t,e),this.updated=this.updated&~PCt,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||V_t.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(yCt.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=BCt,this}get scrolledIntoView(){return(this.updated&BCt)>0}}function DCt(t,e){return e&&t?t.bind(e):t}class NCt{constructor(t,e,n){this.name=t,this.init=DCt(e.init,n),this.apply=DCt(e.apply,n)}}const FCt=[new NCt("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new NCt("selection",{init(t,e){return t.selection||yCt.atStart(e.doc)},apply(t){return t.selection}}),new NCt("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new NCt("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class jCt{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=FCt.slice(),e&&e.forEach(t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new NCt(t.key,t.spec.state,t))})}}class RCt{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=e){let e=this.config.plugins[n];if(e.spec.filterTransaction&&!e.spec.filterTransaction.call(e,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],n=this.applyInner(t),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let s=r?r[o].n:0,c=r?r[o].state:this,u=s<e.length&&a.spec.appendTransaction.call(a,s?e.slice(s):e,c,n);if(u&&n.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",t),!r){r=[];for(let t=0;t<this.config.plugins.length;t++)r.push(t<o?{state:n,n:e.length}:{state:this,n:0})}e.push(u),n=n.applyInner(u),i=!0}r&&(r[o]={state:n,n:e.length})}}if(!i)return{state:n,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let e=new RCt(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];e[i.name]=i.apply(t,this[i.name],this,e)}return e}get tr(){return new ICt(this)}static create(t){let e=new jCt(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new RCt(e);for(let r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n}reconfigure(t){let e=new jCt(this.schema,t.plugins),n=e.fields,r=new RCt(e);for(let i=0;i<n.length;i++){let e=n[i].name;r[e]=this.hasOwnProperty(e)?this[e]:n[i].init(t,r)}return r}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(t=>t.toJSON())),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new jCt(t.schema,t.plugins),i=new RCt(r);return r.fields.forEach(r=>{if("doc"==r.name)i.doc=lxt.fromJSON(t.schema,e.doc);else if("selection"==r.name)i.selection=yCt.fromJSON(i.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(i.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let o in n){let a=n[o],s=a.spec.state;if(a.key==r.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(e,o))return void(i[r.name]=s.fromJSON.call(a,t,e[o],i))}i[r.name]=r.init(t,i)}}),i}}function HCt(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):"handleDOMEvents"==r&&(i=HCt(i,e,{})),n[r]=i}return n}class zCt{constructor(t){this.spec=t,this.props={},t.props&&HCt(t.props,this,this.props),this.key=t.key?t.key.key:VCt("plugin")}getState(t){return t[this.key]}}const UCt=Object.create(null);function VCt(t){return t in UCt?t+"$"+ ++UCt[t]:(UCt[t]=0,t+"$")}class YCt{constructor(t="key"){this.key=VCt(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const GCt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},QCt=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let WCt=null;const KCt=function(t,e,n){let r=WCt||(WCt=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},qCt=function(){WCt=null},XCt=function(t,e,n,r){return n&&(JCt(t,e,n,r,-1)||JCt(t,e,n,r,1))},$Ct=/^(img|br|input|textarea|hr)$/i;function JCt(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:ZCt(t))){let n=t.parentNode;if(!n||1!=n.nodeType||rMt(t)||$Ct.test(t.nodeName)||"false"==t.contentEditable)return!1;e=GCt(t)+(i<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if(t=t.childNodes[e+(i<0?-1:0)],"false"==t.contentEditable)return!1;e=i<0?ZCt(t):0}}}function ZCt(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function tMt(t,e){for(;;){if(3==t.nodeType&&e)return t;if(1==t.nodeType&&e>0){if("false"==t.contentEditable)return null;t=t.childNodes[e-1],e=ZCt(t)}else{if(!t.parentNode||rMt(t))return null;e=GCt(t),t=t.parentNode}}}function eMt(t,e){for(;;){if(3==t.nodeType&&e<t.nodeValue.length)return t;if(1==t.nodeType&&e<t.childNodes.length){if("false"==t.contentEditable)return null;t=t.childNodes[e],e=0}else{if(!t.parentNode||rMt(t))return null;e=GCt(t)+1,t=t.parentNode}}}function nMt(t,e,n){for(let r=0==e,i=e==ZCt(t);r||i;){if(t==n)return!0;let e=GCt(t);if(t=t.parentNode,!t)return!1;r=r&&0==e,i=i&&e==ZCt(t)}}function rMt(t){let e;for(let n=t;n;n=n.parentNode)if(e=n.pmViewDesc)break;return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const iMt=function(t){return t.focusNode&&XCt(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function oMt(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function aMt(t){let e=t.activeElement;while(e&&e.shadowRoot)e=e.shadowRoot.activeElement;return e}function sMt(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(ZCt(r.offsetNode),r.offset)}}catch(r){}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(ZCt(r.startContainer),r.startOffset)}}}const cMt="undefined"!=typeof navigator?navigator:null,uMt="undefined"!=typeof document?document:null,lMt=cMt&&cMt.userAgent||"",hMt=/Edge\/(\d+)/.exec(lMt),dMt=/MSIE \d/.exec(lMt),fMt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(lMt),pMt=!!(dMt||fMt||hMt),mMt=dMt?document.documentMode:fMt?+fMt[1]:hMt?+hMt[1]:0,gMt=!pMt&&/gecko\/(\d+)/i.test(lMt);gMt&&(/Firefox\/(\d+)/.exec(lMt)||[0,0])[1];const AMt=!pMt&&/Chrome\/(\d+)/.exec(lMt),vMt=!!AMt,yMt=AMt?+AMt[1]:0,bMt=!pMt&&!!cMt&&/Apple Computer/.test(cMt.vendor),wMt=bMt&&(/Mobile\/\w+/.test(lMt)||!!cMt&&cMt.maxTouchPoints>2),_Mt=wMt||!!cMt&&/Mac/.test(cMt.platform),xMt=!!cMt&&/Win/.test(cMt.platform),SMt=/Android \d/.test(lMt),CMt=!!uMt&&"webkitFontSmoothing"in uMt.documentElement.style,MMt=CMt?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function LMt(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function TMt(t,e){return"number"==typeof t?t:t[e]}function kMt(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function EMt(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let a=n||t.dom;;a=QCt(a)){if(!a)break;if(1!=a.nodeType)continue;let t=a,n=t==o.body,s=n?LMt(o):kMt(t),c=0,u=0;if(e.top<s.top+TMt(r,"top")?u=-(s.top-e.top+TMt(i,"top")):e.bottom>s.bottom-TMt(r,"bottom")&&(u=e.bottom-e.top>s.bottom-s.top?e.top+TMt(i,"top")-s.top:e.bottom-s.bottom+TMt(i,"bottom")),e.left<s.left+TMt(r,"left")?c=-(s.left-e.left+TMt(i,"left")):e.right>s.right-TMt(r,"right")&&(c=e.right-s.right+TMt(i,"right")),c||u)if(n)o.defaultView.scrollBy(c,u);else{let n=t.scrollLeft,r=t.scrollTop;u&&(t.scrollTop+=u),c&&(t.scrollLeft+=c);let i=t.scrollLeft-n,o=t.scrollTop-r;e={left:e.left-i,top:e.top-o,right:e.right-i,bottom:e.bottom-o}}if(n||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function OMt(t){let e,n,r=t.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,a=i+1;a<Math.min(innerHeight,r.bottom);a+=5){let r=t.root.elementFromPoint(o,a);if(!r||r==t.dom||!t.dom.contains(r))continue;let s=r.getBoundingClientRect();if(s.top>=i-20){e=r,n=s.top;break}}return{refDOM:e,refTop:n,stack:PMt(t.dom)}}function PMt(t){let e=[],n=t.ownerDocument;for(let r=t;r;r=QCt(r))if(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t==n)break;return e}function BMt({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;IMt(n,0==r?0:r-e)}function IMt(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let DMt=null;function NMt(t){if(t.setActive)return t.setActive();if(DMt)return t.focus(DMt);let e=PMt(t);t.focus(null==DMt?{get preventScroll(){return DMt={preventScroll:!0},!0}}:void 0),DMt||(DMt=!1,IMt(e,0))}function FMt(t,e){let n,r,i,o,a=2e8,s=0,c=e.top,u=e.top;for(let l=t.firstChild,h=0;l;l=l.nextSibling,h++){let t;if(1==l.nodeType)t=l.getClientRects();else{if(3!=l.nodeType)continue;t=KCt(l).getClientRects()}for(let d=0;d<t.length;d++){let f=t[d];if(f.top<=c&&f.bottom>=u){c=Math.max(f.bottom,c),u=Math.min(f.top,u);let t=f.left>e.left?f.left-e.left:f.right<e.left?e.left-f.right:0;if(t<a){n=l,a=t,r=t&&3==n.nodeType?{left:f.right<e.left?f.right:f.left,top:e.top}:e,1==l.nodeType&&t&&(s=h+(e.left>=(f.left+f.right)/2?1:0));continue}}else f.top>e.top&&!i&&f.left<=e.left&&f.right>=e.left&&(i=l,o={left:Math.max(f.left,Math.min(f.right,e.left)),top:f.top});!n&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(s=h+1)}}return!n&&i&&(n=i,r=o,a=0),n&&3==n.nodeType?jMt(n,r):!n||a&&1==n.nodeType?{node:t,offset:s}:FMt(n,r)}function jMt(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let n=QMt(r,1);if(n.top!=n.bottom&&RMt(e,n))return{node:t,offset:i+(e.left>=(n.left+n.right)/2?1:0)}}return{node:t,offset:0}}function RMt(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function HMt(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function zMt(t,e,n){let{node:r,offset:i}=FMt(e,n),o=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();o=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function UMt(t,e,n,r){let i=-1;for(let o=e,a=!1;;){if(o==t.dom)break;let e,n=t.docView.nearestDesc(o,!0);if(!n)return null;if(1==n.dom.nodeType&&(n.node.isBlock&&n.parent||!n.contentDOM)&&((e=n.dom.getBoundingClientRect()).width||e.height)&&(n.node.isBlock&&n.parent&&(!a&&e.left>r.left||e.top>r.top?i=n.posBefore:(!a&&e.right<r.left||e.bottom<r.top)&&(i=n.posAfter),a=!0),!n.contentDOM&&i<0&&!n.node.isText)){let t=n.node.isBlock?r.top<(e.top+e.bottom)/2:r.left<(e.left+e.right)/2;return t?n.posBefore:n.posAfter}o=n.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function VMt(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=t.childNodes[o];if(1==n.nodeType){let t=n.getClientRects();for(let r=0;r<t.length;r++){let i=t[r];if(RMt(e,i))return VMt(n,e,i)}}if((o=(o+1)%r)==i)break}return t}function YMt(t,e){let n,r=t.dom.ownerDocument,i=0,o=sMt(r,e.left,e.top);o&&({node:n,offset:i}=o);let a,s=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top);if(!s||!t.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=t.dom.getBoundingClientRect();if(!RMt(e,n))return null;if(s=VMt(t.dom,e,n),!s)return null}if(bMt)for(let u=s;n&&u;u=QCt(u))u.draggable&&(n=void 0);if(s=HMt(s,e),n){if(gMt&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let t,r=n.childNodes[i];"IMG"==r.nodeName&&(t=r.getBoundingClientRect()).right<=e.left&&t.bottom>e.top&&i++}let r;CMt&&i&&1==n.nodeType&&1==(r=n.childNodes[i-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=e.top&&i--,n==t.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(a=UMt(t,n,i,e))}null==a&&(a=zMt(t,s,e));let c=t.docView.nearestDesc(s,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function GMt(t){return t.top<t.bottom||t.left<t.right}function QMt(t,e){let n=t.getClientRects();if(n.length){let t=n[e<0?0:n.length-1];if(GMt(t))return t}return Array.prototype.find.call(n,GMt)||t.getBoundingClientRect()}const WMt=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function KMt(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),a=CMt||gMt;if(3==r.nodeType){if(!a||!WMt.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let t=i,e=i,o=n<0?1:-1;return n<0&&!i?(e++,o=-1):n>=0&&i==r.nodeValue.length?(t--,o=1):n<0?t--:e++,qMt(QMt(KCt(r,t,e),o),o<0)}{let t=QMt(KCt(r,i,i),n);if(gMt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let e=QMt(KCt(r,i-1,i-1),-1);if(e.top==t.top){let n=QMt(KCt(r,i,i+1),-1);if(n.top!=t.top)return qMt(n,n.left<e.left)}}return t}}let s=t.state.doc.resolve(e-(o||0));if(!s.parent.inlineContent){if(null==o&&i&&(n<0||i==ZCt(r))){let t=r.childNodes[i-1];if(1==t.nodeType)return XMt(t.getBoundingClientRect(),!1)}if(null==o&&i<ZCt(r)){let t=r.childNodes[i];if(1==t.nodeType)return XMt(t.getBoundingClientRect(),!0)}return XMt(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==ZCt(r))){let t=r.childNodes[i-1],e=3==t.nodeType?KCt(t,ZCt(t)-(a?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return qMt(QMt(e,1),!1)}if(null==o&&i<ZCt(r)){let t=r.childNodes[i];while(t.pmViewDesc&&t.pmViewDesc.ignoreForCoords)t=t.nextSibling;let e=t?3==t.nodeType?KCt(t,0,a?0:1):1==t.nodeType?t:null:null;if(e)return qMt(QMt(e,-1),!0)}return qMt(QMt(3==r.nodeType?KCt(r):r,-n),n>=0)}function qMt(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function XMt(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function $Mt(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function JMt(t,e,n){let r=e.selection,i="up"==n?r.$from:r.$to;return $Mt(t,e,()=>{let{node:e}=t.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.contentDOM||n.dom;break}e=n.dom.parentNode}let r=KMt(t,i.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=KCt(t,0,t.nodeValue.length).getClientRects()}for(let t=0;t<e.length;t++){let i=e[t];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0})}const ZMt=/[\u0590-\u08ac]/;function tLt(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,s=t.domSelection();return s?ZMt.test(r.parent.textContent)&&s.modify?$Mt(t,e,()=>{let{focusNode:e,focusOffset:i,anchorNode:o,anchorOffset:a}=t.domSelectionRange(),c=s.caretBidiLevel;s.modify("move",n,"character");let u=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:l,focusOffset:h}=t.domSelectionRange(),d=l&&!u.contains(1==l.nodeType?l:l.parentNode)||e==l&&i==h;try{s.collapse(o,a),e&&(e!=o||i!=a)&&s.extend&&s.extend(e,i)}catch(f){}return null!=c&&(s.caretBidiLevel=c),d}):"left"==n||"backward"==n?o:a:r.pos==r.start()||r.pos==r.end()}let eLt=null,nLt=null,rLt=!1;function iLt(t,e,n){return eLt==e&&nLt==n?rLt:(eLt=e,nLt=n,rLt="up"==n||"down"==n?JMt(t,e,n):tLt(t,e,n))}const oLt=0,aLt=1,sLt=2,cLt=3;class uLt{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=oLt,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;e<this.children.length;e++)t+=this.children[e].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let e=0,n=this.posAtStart;;e++){let r=this.children[e];if(r==t)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){let n,r;if(t==this.contentDOM)n=t.childNodes[e-1];else{while(t.parentNode!=this.contentDOM)t=t.parentNode;n=t.previousSibling}while(n&&(!(r=n.pmViewDesc)||r.parent!=this))n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(t==this.contentDOM)n=t.childNodes[e];else{while(t.parentNode!=this.contentDOM)t=t.parentNode;n=t.nextSibling}while(n&&(!(r=n.pmViewDesc)||r.parent!=this))n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(t==this.dom&&this.contentDOM)r=e>GCt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,r=t;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!e||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==t.nodeType?t:t.parentNode):i==t))return o;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let n=e;n;n=n.parent)if(n==this)return e}posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;e<this.children.length;e++){let r=this.children[e],i=n+r.size;if(n==t&&i!=n){while(!r.border&&r.children.length)r=r.children[0];return r}if(t<i)return r.descAt(t-n-r.border);n=i}}domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let n,r=0,i=0;for(let o=0;r<this.children.length;r++){let e=this.children[r],n=o+e.size;if(n>t||e instanceof gLt){i=t-o;break}o=n}if(i)return this.children[r].domFromPos(i-this.children[r].border,e);for(;r&&!(n=this.children[r-1]).size&&n instanceof lLt&&n.side>=0;r--);if(e<=0){let t,n=!0;for(;;r--,n=!1)if(t=r?this.children[r-1]:null,!t||t.dom.parentNode==this.contentDOM)break;return t&&e&&n&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?GCt(t.dom)+1:0}}{let t,n=!0;for(;;r++,n=!1)if(t=r<this.children.length?this.children[r]:null,!t||t.dom.parentNode==this.contentDOM)break;return t&&n&&!t.border&&!t.domAtom?t.domFromPos(0,e):{node:this.contentDOM,offset:t?GCt(t.dom):this.contentDOM.childNodes.length}}}parseRange(t,e,n=0){if(0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,a=0;;a++){let n=this.children[a],s=o+n.size;if(-1==r&&t<=s){let i=o+n.border;if(t>=i&&e<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,i);t=o;for(let e=a;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=GCt(n.dom)+1;break}t-=n.size}-1==r&&(r=0)}if(r>-1&&(s>e||a==this.children.length-1)){e=s;for(let t=a+1;t<this.children.length;t++){let n=this.children[t];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=GCt(n.dom);break}e+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=s}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:i}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)}domAfterPos(t){let{node:e,offset:n}=this.domFromPos(t,0);if(1!=e.nodeType||n==e.childNodes.length)throw new RangeError("No node after pos "+t);return e.childNodes[n]}setSelection(t,e,n,r=!1){let i=Math.min(t,e),o=Math.max(t,e);for(let f=0,p=0;f<this.children.length;f++){let a=this.children[f],s=p+a.size;if(i>p&&o<s)return a.setSelection(t-p-a.border,e-p-a.border,n,r);p=s}let a=this.domFromPos(t,t?-1:1),s=e==t?a:this.domFromPos(e,e?-1:1),c=n.root.getSelection(),u=n.domSelectionRange(),l=!1;if((gMt||bMt)&&t==e){let{node:t,offset:e}=a;if(3==t.nodeType){if(l=!(!e||"\n"!=t.nodeValue[e-1]),l&&e==t.nodeValue.length)for(let n,r=t;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(a=s={node:n.parentNode,offset:GCt(n)+1});break}let t=r.pmViewDesc;if(t&&t.node&&t.node.isBlock)break}}else{let n=t.childNodes[e-1];l=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(gMt&&u.focusNode&&u.focusNode!=s.node&&1==u.focusNode.nodeType){let t=u.focusNode.childNodes[u.focusOffset];t&&"false"==t.contentEditable&&(r=!0)}if(!(r||l&&bMt)&&XCt(a.node,a.offset,u.anchorNode,u.anchorOffset)&&XCt(s.node,s.offset,u.focusNode,u.focusOffset))return;let h=!1;if((c.extend||t==e)&&!l){c.collapse(a.node,a.offset);try{t!=e&&c.extend(s.node,s.offset),h=!0}catch(d){}}if(!h){if(t>e){let t=a;a=s,s=t}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?t<=o&&e>=n:t<o&&e>n){let r=n+i.border,a=o-i.border;if(t>=r&&e<=a)return this.dirty=t==n||e==o?sLt:aLt,void(t!=r||e!=a||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(t-r,e-r):i.dirty=cLt);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?cLt:sLt}n=o}this.dirty=sLt}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?sLt:aLt;e.dirty<n&&(e.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(t){return!1}}class lLt extends uLt{constructor(t,e,n,r){let i,o=e.type.toDOM;if("function"==typeof o&&(o=o(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r)),!e.type.spec.raw){if(1!=o.nodeType){let t=document.createElement("span");t.appendChild(o),o=t}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(t,[],o,null),this.widget=e,this.widget=e,i=this}matchesWidget(t){return this.dirty==oLt&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class hLt extends uLt{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class dLt extends uLt{constructor(t,e,n,r,i){super(t,[],n,r),this.mark=e,this.spec=i}static create(t,e,n,r){let i=r.nodeViews[e.type.name],o=i&&i(e,r,n);return o&&o.dom||(o=Zxt.renderSpec(document,e.type.spec.toDOM(e,n),null,e.attrs)),new dLt(t,e,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&cLt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=cLt&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),this.dirty!=oLt){let t=this.parent;while(!t.node)t=t.parent;t.dirty<this.dirty&&(t.dirty=this.dirty),this.dirty=oLt}}slice(t,e,n){let r=dLt.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;e<o&&(i=BLt(i,e,o,n)),t>0&&(i=BLt(i,0,t,n));for(let a=0;a<i.length;a++)i[a].parent=r;return r.children=i,r}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class fLt extends uLt{constructor(t,e,n,r,i,o,a,s,c){super(t,[],i,o),this.node=e,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=a}static create(t,e,n,r,i,o){let a,s=i.nodeViews[e.type.name],c=s&&s(e,i,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:o,n,r),u=c&&c.dom,l=c&&c.contentDOM;if(e.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(e.text);else if(!u){let t=Zxt.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs);({dom:u,contentDOM:l}=t)}l||e.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),e.type.spec.draggable&&(u.draggable=!0));let h=u;return u=SLt(u,n,e),c?a=new ALt(t,e,n,r,u,l||null,h,c,i,o+1):e.isText?new mLt(t,e,n,r,u,h,i):new fLt(t,e,n,r,u,l||null,h,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>R_t.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return this.dirty==oLt&&t.eq(this.node)&&CLt(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,r=e,i=t.composing?this.localCompositionInfo(t,e):null,o=i&&i.pos>-1?i:null,a=i&&i.pos<0,s=new LLt(this,o&&o.node,t);ELt(this.node,this.innerDeco,(e,i,o)=>{e.spec.marks?s.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!o&&s.syncToMarks(i==this.node.childCount?V_t.none:this.node.child(i).marks,n,t),s.placeWidget(e,t,r)},(e,o,c,u)=>{let l;s.syncToMarks(e.marks,n,t),s.findNodeMatch(e,o,c,u)||a&&t.state.selection.from>r&&t.state.selection.to<r+e.nodeSize&&(l=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(e,o,c,l,t)||s.updateNextNode(e,o,c,t,u,r)||s.addNode(e,o,c,t,r),r+=e.nodeSize}),s.syncToMarks([],n,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==sLt)&&(o&&this.protectLocalComposition(t,o),vLt(this.contentDOM,this.children,t),wMt&&OLt(this.dom))}localCompositionInfo(t,e){let{from:n,to:r}=t.state.selection;if(!(t.state.selection instanceof xCt)||n<e||r>e+this.node.content.size)return null;let i=t.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let t=i.nodeValue,o=PLt(this.node.content,t,n-e,r-e);return o<0?null:{node:i,pos:o,text:t}}return{node:i,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:r}){if(this.getDesc(e))return;let i=e;for(;;i=i.parentNode){if(i.parentNode==this.contentDOM)break;while(i.previousSibling)i.parentNode.removeChild(i.previousSibling);while(i.nextSibling)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new hLt(this,i,e,r);t.input.compositionNodes.push(o),this.children=BLt(this.children,n,n+r.length,t,o)}update(t,e,n,r){return!(this.dirty==cLt||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)}updateInner(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=oLt}updateOuterDeco(t){if(CLt(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=_Lt(this.dom,this.nodeDOM,wLt(this.outerDeco,this.node,e),wLt(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function pLt(t,e,n,r,i){SLt(r,e,t);let o=new fLt(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class mLt extends fLt{constructor(t,e,n,r,i,o,a){super(t,e,n,r,i,null,o,a,0)}parseRule(){let t=this.nodeDOM.parentNode;while(t&&t!=this.dom&&!t.pmIsDeco)t=t.parentNode;return{skip:t||!0}}update(t,e,n,r){return!(this.dirty==cLt||this.dirty!=oLt&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),this.dirty==oLt&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=oLt,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let r=this.node.cut(t,e),i=document.createTextNode(r.text);return new mLt(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=cLt)}get domAtom(){return!1}isText(t){return this.node.text==t}}class gLt extends uLt{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==oLt&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ALt extends fLt{constructor(t,e,n,r,i,o,a,s,c,u){super(t,e,n,r,i,o,a,c,u),this.spec=s}update(t,e,n,r){if(this.dirty==cLt)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let i=this.spec.update(t,e,n);return i&&this.updateInner(t,e,n,r),i}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n.root):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function vLt(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let a=e[o],s=a.dom;if(s.parentNode==t){while(s!=r)r=MLt(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(s,r);if(a instanceof dLt){let e=r?r.previousSibling:t.lastChild;vLt(a.contentDOM,a.children,n),r=e?e.nextSibling:t.firstChild}}while(r)r=MLt(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const yLt=function(t){t&&(this.nodeName=t)};yLt.prototype=Object.create(null);const bLt=[new yLt];function wLt(t,e,n){if(0==t.length)return bLt;let r=n?bLt[0]:new yLt,i=[r];for(let o=0;o<t.length;o++){let a=t[o].type.attrs;if(a){a.nodeName&&i.push(r=new yLt(a.nodeName));for(let t in a){let o=a[t];null!=o&&(n&&1==i.length&&i.push(r=new yLt(e.isInline?"span":"div")),"class"==t?r.class=(r.class?r.class+" ":"")+o:"style"==t?r.style=(r.style?r.style+";":"")+o:"nodeName"!=t&&(r[t]=o))}}}return i}function _Lt(t,e,n,r){if(n==bLt&&r==bLt)return e;let i=e;for(let o=0;o<r.length;o++){let e=r[o],a=n[o];if(o){let n;a&&a.nodeName==e.nodeName&&i!=t&&(n=i.parentNode)&&n.nodeName.toLowerCase()==e.nodeName||(n=document.createElement(e.nodeName),n.pmIsDeco=!0,n.appendChild(i),a=bLt[0]),i=n}xLt(i,a||bLt[0],e)}return i}function xLt(t,e,n){for(let r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let e=0;e<r.length;e++)-1==i.indexOf(r[e])&&t.classList.remove(r[e]);for(let e=0;e<i.length;e++)-1==r.indexOf(i[e])&&t.classList.add(i[e]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;while(n=r.exec(e.style))t.style.removeProperty(n[1])}n.style&&(t.style.cssText+=n.style)}}function SLt(t,e,n){return _Lt(t,t,bLt,wLt(e,n,1!=t.nodeType))}function CLt(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function MLt(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class LLt{constructor(t,e,n){this.lock=e,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=TLt(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,e,n){let r=0,i=this.stack.length>>1,o=Math.min(i,t.length);while(r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&!1!==t[r].type.spec.spanning)r++;while(r<i)this.destroyRest(),this.top.dirty=oLt,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;while(i<t.length){this.stack.push(this.top,this.index+1);let r=-1;for(let e=this.index;e<Math.min(this.index+3,this.top.children.length);e++){let n=this.top.children[e];if(n.matchesMark(t[i])&&!this.isLocked(n.dom)){r=e;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=dLt.create(this.top,t[i],e,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(t,e,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(t,e,n))o=this.top.children.indexOf(i,this.index);else for(let a=this.index,s=Math.min(this.top.children.length,a+5);a<s;a++){let r=this.top.children[a];if(r.matchesNode(t,e,n)&&!this.preMatch.matched.has(r)){o=a;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,e,n,r,i){let o=this.top.children[r];return o.dirty==cLt&&o.dom==o.contentDOM&&(o.dirty=sLt),!!o.update(t,e,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(t){for(;;){let e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let e=t.pmViewDesc;if(e)for(let t=this.index;t<this.top.children.length;t++)if(this.top.children[t]==e)return t;return-1}t=e}}updateNextNode(t,e,n,r,i,o){for(let a=this.index;a<this.top.children.length;a++){let s=this.top.children[a];if(s instanceof fLt){let c=this.preMatch.matched.get(s);if(null!=c&&c!=i)return!1;let u,l=s.dom,h=this.isLocked(l)&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&s.dirty!=cLt&&CLt(e,s.outerDeco));if(!h&&s.update(t,e,n,r))return this.destroyBetween(this.index,a),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!h&&(u=this.recreateWrapper(s,t,e,n,r,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=sLt,u.updateChildren(r,o+1),u.dirty=oLt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,e,n,r,i,o){if(t.dirty||e.isAtom||!t.children.length||!t.node.content.eq(e.content)||!CLt(n,t.outerDeco)||!r.eq(t.innerDeco))return null;let a=fLt.create(this.top,e,n,r,i,o);if(a.contentDOM){a.children=t.children,t.children=[];for(let t of a.children)t.parent=a}return t.destroy(),a}addNode(t,e,n,r,i){let o=fLt.create(this.top,t,e,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(t,e,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){let r=new lLt(this.top,t,e,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let t=this.top.children[this.index-1],e=this.top;while(t instanceof dLt)e=t,t=e.children[e.children.length-1];(!t||!(t instanceof mLt)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((bMt||vMt)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{let n=document.createElement(t);"IMG"==t&&(n.className="ProseMirror-separator",n.alt=""),"BR"==t&&(n.className="ProseMirror-trailingBreak");let r=new gLt(this.top,[],n,null);e!=this.top?e.children.push(r):e.children.splice(this.index++,0,r),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||1==t.nodeType&&t.contains(this.lock.parentNode))}}function TLt(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,a=[];t:while(i>0){let s;for(;;)if(r){let t=n.children[r-1];if(!(t instanceof dLt)){s=t,r--;break}n=t,r=t.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let c=s.node;if(c){if(c!=t.child(i-1))break;--i,o.set(s,i),a.push(s)}}return{index:i,matched:o,matches:a.reverse()}}function kLt(t,e){return t.type.side-e.type.side}function ELt(t,e,n,r){let i=e.locals(t),o=0;if(0==i.length){for(let n=0;n<t.childCount;n++){let a=t.child(n);r(a,i,e.forChild(o,a),n),o+=a.nodeSize}return}let a=0,s=[],c=null;for(let u=0;;){let l,h,d,f;while(a<i.length&&i[a].to==o){let t=i[a++];t.widget&&(l?(h||(h=[l])).push(t):l=t)}if(l)if(h){h.sort(kLt);for(let t=0;t<h.length;t++)n(h[t],u,!!c)}else n(l,u,!!c);if(c)f=-1,d=c,c=null;else{if(!(u<t.childCount))break;f=u,d=t.child(u++)}for(let t=0;t<s.length;t++)s[t].to<=o&&s.splice(t--,1);while(a<i.length&&i[a].from<=o&&i[a].to>o)s.push(i[a++]);let p=o+d.nodeSize;if(d.isText){let t=p;a<i.length&&i[a].from<t&&(t=i[a].from);for(let e=0;e<s.length;e++)s[e].to<t&&(t=s[e].to);t<p&&(c=d.cut(t-o),d=d.cut(0,t-o),p=t,f=-1)}else while(a<i.length&&i[a].to<p)a++;let m=d.isInline&&!d.isLeaf?s.filter(t=>!t.inline):s.slice();r(d,m,e.forChild(o,d),f),o=p}}function OLt(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function PLt(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let a=t.child(i++),s=o;if(o+=a.nodeSize,!a.isText)continue;let c=a.text;while(i<t.childCount){let e=t.child(i++);if(o+=e.nodeSize,!e.isText)break;c+=e.text}if(o>=n){if(o>=r&&c.slice(r-e.length-s,r-s)==e)return r-e.length;let t=s<r?c.lastIndexOf(e,r-s-1):-1;if(t>=0&&t+e.length+s>=n)return s+t;if(n==r&&c.length>=r+e.length-s&&c.slice(r-s,r-s+e.length)==e)return r}}return-1}function BLt(t,e,n,r,i){let o=[];for(let a=0,s=0;a<t.length;a++){let c=t[a],u=s,l=s+=c.size;u>=n||l<=e?o.push(c):(u<e&&o.push(c.slice(0,e-u,r)),i&&(o.push(i),i=void 0),l>n&&o.push(c.slice(n-u,c.size,r)))}return o}function ILt(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&0==i.size,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let s,c,u=r.resolve(a);if(iMt(n)){s=a;while(i&&!i.node)i=i.parent;let t=i.node;if(i&&t.isAtom&&CCt.isSelectable(t)&&i.parent&&(!t.isInline||!nMt(n.focusNode,n.focusOffset,i.dom))){let t=i.posBefore;c=new CCt(a==t?u:r.resolve(t))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let e=a,i=a;for(let r=0;r<n.rangeCount;r++){let o=n.getRangeAt(r);e=Math.min(e,t.docView.posFromDOM(o.startContainer,o.startOffset,1)),i=Math.max(i,t.docView.posFromDOM(o.endContainer,o.endOffset,-1))}if(e<0)return null;[s,a]=i==t.state.selection.anchor?[i,e]:[e,i],u=r.resolve(a)}else s=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(s<0)return null}let l=r.resolve(s);if(!c){let n="pointer"==e||t.state.selection.head<u.pos&&!o?1:-1;c=GLt(t,l,u,n)}return c}function DLt(t){return t.editable?t.hasFocus():WLt(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function NLt(t,e=!1){let n=t.state.selection;if(VLt(t,n),DLt(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&vMt){let e=t.domSelectionRange(),n=t.domObserver.currentSelection;if(e.anchorNode&&n.anchorNode&&XCt(e.anchorNode,e.anchorOffset,n.anchorNode,n.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)ULt(t);else{let r,i,{anchor:o,head:a}=n;!FLt||n instanceof xCt||(n.$from.parent.inlineContent||(r=jLt(t,n.from)),n.empty||n.$from.parent.inlineContent||(i=jLt(t,n.to))),t.docView.setSelection(o,a,t,e),FLt&&(r&&HLt(r),i&&HLt(i)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&zLt(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const FLt=bMt||vMt&&yMt<63;function jLt(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(bMt&&i&&"false"==i.contentEditable)return RLt(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return RLt(i);if(o)return RLt(o)}}function RLt(t){return t.contentEditable="true",bMt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function HLt(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function zLt(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{DLt(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")},20))})}function ULt(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setStart(r.parentNode,GCt(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&pMt&&mMt<=11&&(r.disabled=!0,r.disabled=!1)}function VLt(t,e){if(e instanceof CCt){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(YLt(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else YLt(t)}function YLt(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function GLt(t,e,n,r){return t.someProp("createSelectionBetween",r=>r(t,e,n))||xCt.between(e,n,r)}function QLt(t){return!(t.editable&&!t.hasFocus())&&WLt(t)}function WLt(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(n){return!1}}function KLt(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return XCt(e.node,e.offset,n.anchorNode,n.anchorOffset)}function qLt(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&yCt.findFrom(o,e)}function XLt(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function $Lt(t,e,n){let r=t.state.selection;if(!(r instanceof xCt)){if(r instanceof CCt&&r.node.isInline)return XLt(t,new xCt(e>0?r.$to:r.$from));{let n=qLt(t.state,e);return!!n&&XLt(t,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:e<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=t.state.doc.resolve(n.pos+i.nodeSize*(e<0?-1:1));return XLt(t,new xCt(r.$anchor,o))}if(!r.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let n=qLt(t.state,e);return!!(n&&n instanceof CCt)&&XLt(t,n)}if(!(_Mt&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=t.docView.descAt(a))&&!n.contentDOM)&&(CCt.isSelectable(o)?XLt(t,new CCt(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):!!CMt&&XLt(t,new xCt(t.state.doc.resolve(e<0?a:a+o.nodeSize))))}}function JLt(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function ZLt(t,e){let n=t.pmViewDesc;return n&&0==n.size&&(e<0||t.nextSibling||"BR"!=t.nodeName)}function tTt(t,e){return e<0?eTt(t):nTt(t)}function eTt(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,a=!1;for(gMt&&1==n.nodeType&&r<JLt(n)&&ZLt(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(ZLt(t,-1))i=n,o=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(rTt(n))break;{let e=n.previousSibling;while(e&&ZLt(e,-1))i=n.parentNode,o=GCt(e),e=e.previousSibling;if(e)n=e,r=JLt(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?aTt(t,n,r):i&&aTt(t,i,o)}function nTt(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,a=JLt(n);for(;;)if(r<a){if(1!=n.nodeType)break;let t=n.childNodes[r];if(!ZLt(t,1))break;i=n,o=++r}else{if(rTt(n))break;{let e=n.nextSibling;while(e&&ZLt(e,1))i=e.parentNode,o=GCt(e)+1,e=e.nextSibling;if(e)n=e,r=0,a=JLt(n);else{if(n=n.parentNode,n==t.dom)break;r=a=0}}}i&&aTt(t,i,o)}function rTt(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function iTt(t,e){while(t&&e==t.childNodes.length&&!rMt(t))e=GCt(t)+1,t=t.parentNode;while(t&&e<t.childNodes.length){let n=t.childNodes[e];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=n,e=0}}function oTt(t,e){while(t&&!e&&!rMt(t))e=GCt(t),t=t.parentNode;while(t&&e){let n=t.childNodes[e-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=n,e=t.childNodes.length}}function aTt(t,e,n){if(3!=e.nodeType){let t,r;(r=iTt(e,n))?(e=r,n=0):(t=oTt(e,n))&&(e=t,n=t.nodeValue.length)}let r=t.domSelection();if(!r)return;if(iMt(r)){let t=document.createRange();t.setEnd(e,n),t.setStart(e,n),r.removeAllRanges(),r.addRange(t)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&NLt(t)},50)}function sTt(t,e){let n=t.state.doc.resolve(e);if(!vMt&&!xMt&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let n=t.coordsAtPos(e-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(e<n.end()){let n=t.coordsAtPos(e+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}let r=getComputedStyle(t.dom).direction;return"rtl"==r?"rtl":"ltr"}function cTt(t,e,n){let r=t.state.selection;if(r instanceof xCt&&!r.empty||n.indexOf("s")>-1)return!1;if(_Mt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=qLt(t.state,e);if(n&&n instanceof CCt)return XLt(t,n)}if(!i.parent.inlineContent){let n=e<0?i:o,a=r instanceof LCt?yCt.near(n,e):yCt.findFrom(n,e);return!!a&&XLt(t,a)}return!1}function uTt(t,e){if(!(t.state.selection instanceof xCt))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=t.state.tr;return e<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),t.dispatch(r),!0}return!1}function lTt(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function hTt(t){if(!bMt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;lTt(t,n,"true"),setTimeout(()=>lTt(t,n,"false"),20)}return!1}function dTt(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function fTt(t,e){let n=e.keyCode,r=dTt(e);if(8==n||_Mt&&72==n&&"c"==r)return uTt(t,-1)||tTt(t,-1);if(46==n&&!e.shiftKey||_Mt&&68==n&&"c"==r)return uTt(t,1)||tTt(t,1);if(13==n||27==n)return!0;if(37==n||_Mt&&66==n&&"c"==r){let e=37==n?"ltr"==sTt(t,t.state.selection.from)?-1:1:-1;return $Lt(t,e,r)||tTt(t,e)}if(39==n||_Mt&&70==n&&"c"==r){let e=39==n?"ltr"==sTt(t,t.state.selection.from)?1:-1:1;return $Lt(t,e,r)||tTt(t,e)}return 38==n||_Mt&&80==n&&"c"==r?cTt(t,-1,r)||tTt(t,-1):40==n||_Mt&&78==n&&"c"==r?hTt(t)||cTt(t,1,r)||tTt(t,1):r==(_Mt?"m":"c")&&(66==n||73==n||89==n||90==n)}function pTt(t,e){t.someProp("transformCopied",n=>{e=n(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;while(i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount){i--,o--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let a=t.someProp("clipboardSerializer")||Zxt.fromSchema(t.state.schema),s=CTt(),c=s.createElement("div");c.appendChild(a.serializeFragment(r,{document:s}));let u,l=c.firstChild,h=0;while(l&&1==l.nodeType&&(u=xTt[l.nodeName.toLowerCase()])){for(let t=u.length-1;t>=0;t--){let e=s.createElement(u[t]);while(c.firstChild)e.appendChild(c.firstChild);c.appendChild(e),h++}l=c.firstChild}l&&1==l.nodeType&&l.setAttribute("data-pm-slice",`${i} ${o}${h?" -"+h:""} ${JSON.stringify(n)}`);let d=t.someProp("clipboardTextSerializer",n=>n(e,t))||e.content.textBetween(0,e.content.size,"\n\n");return{dom:c,text:d,slice:e}}function mTt(t,e,n,r,i){let o,a,s=i.parent.type.spec.code;if(!n&&!e)return null;let c=e&&(r||s||!n);if(c){if(t.someProp("transformPastedText",n=>{e=n(e,s||r,t)}),s)return e?new G_t(R_t.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):G_t.empty;let n=t.someProp("clipboardTextParser",n=>n(e,i,r,t));if(n)a=n;else{let n=i.marks(),{schema:r}=t.state,a=Zxt.fromSchema(r);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(t=>{let e=o.appendChild(document.createElement("p"));t&&e.appendChild(a.serializeNode(r.text(t,n)))})}}else t.someProp("transformPastedHTML",e=>{n=e(n,t)}),o=TTt(n),CMt&&kTt(o);let u=o&&o.querySelector("[data-pm-slice]"),l=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let h=+l[3];h>0;h--){let t=o.firstChild;while(t&&1!=t.nodeType)t=t.nextSibling;if(!t)break;o=t}if(!a){let e=t.someProp("clipboardParser")||t.someProp("domParser")||Rxt.fromSchema(t.state.schema);a=e.parseSlice(o,{preserveWhitespace:!(!c&&!l),context:i,ruleFromNode(t){return"BR"!=t.nodeName||t.nextSibling||!t.parentNode||gTt.test(t.parentNode.nodeName)?null:{ignore:!0}}})}if(l)a=ETt(_Tt(a,+l[1],+l[2]),l[4]);else if(a=G_t.maxOpen(ATt(a.content,i),!0),a.openStart||a.openEnd){let t=0,e=0;for(let n=a.content.firstChild;t<a.openStart&&!n.type.spec.isolating;t++,n=n.firstChild);for(let n=a.content.lastChild;e<a.openEnd&&!n.type.spec.isolating;e++,n=n.lastChild);a=_Tt(a,t,e)}return t.someProp("transformPasted",e=>{a=e(a,t)}),a}const gTt=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function ATt(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,i=e.node(n),o=i.contentMatchAt(e.index(n)),a=[];if(t.forEach(t=>{if(!a)return;let e,n=o.findWrapping(t.type);if(!n)return a=null;if(e=a.length&&r.length&&yTt(n,r,t,a[a.length-1],0))a[a.length-1]=e;else{a.length&&(a[a.length-1]=bTt(a[a.length-1],r.length));let e=vTt(t,n);a.push(e),o=o.matchType(e.type),r=n}}),a)return R_t.from(a)}return t}function vTt(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,R_t.from(t));return t}function yTt(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=yTt(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));let a=r.contentMatchAt(r.childCount);if(a.matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(R_t.from(vTt(n,t,i+1))))}}function bTt(t,e){if(0==e)return t;let n=t.content.replaceChild(t.childCount-1,bTt(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(R_t.empty,!0);return t.copy(n.append(r))}function wTt(t,e,n,r,i,o){let a=e<0?t.firstChild:t.lastChild,s=a.content;return t.childCount>1&&(o=0),i<r-1&&(s=wTt(s,e,n,r,i+1,o)),i>=n&&(s=e<0?a.contentMatchAt(0).fillBefore(s,o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(R_t.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(s))}function _Tt(t,e,n){return e<t.openStart&&(t=new G_t(wTt(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new G_t(wTt(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const xTt={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let STt=null;function CTt(){return STt||(STt=document.implementation.createHTMLDocument("title"))}let MTt=null;function LTt(t){let e=window.trustedTypes;return e?(MTt||(MTt=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),MTt.createHTML(t)):t}function TTt(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=CTt().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t);if((n=i&&xTt[i[1].toLowerCase()])&&(t=n.map(t=>"<"+t+">").join("")+t+n.map(t=>"</"+t+">").reverse().join("")),r.innerHTML=LTt(t),n)for(let o=0;o<n.length;o++)r=r.querySelector(n[o])||r;return r}function kTt(t){let e=t.querySelectorAll(vMt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function ETt(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(s){return t}let{content:i,openStart:o,openEnd:a}=t;for(let c=n.length-2;c>=0;c-=2){let t=r.nodes[n[c]];if(!t||t.hasRequiredAttrs())break;i=R_t.from(t.create(n[c+1],i)),o++,a++}return new G_t(i,o,a)}const OTt={},PTt={},BTt={touchstart:!0,touchmove:!0};class ITt{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function DTt(t){for(let e in OTt){let n=OTt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!HTt(t,e)||RTt(t,e)||!t.editable&&e.type in PTt||n(t,e)},BTt[e]?{passive:!0}:void 0)}bMt&&t.dom.addEventListener("input",()=>null),jTt(t)}function NTt(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function FTt(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function jTt(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>RTt(t,e))})}function RTt(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)})}function HTt(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function zTt(t,e){RTt(t,e)||!OTt[e.type]||!t.editable&&e.type in PTt||OTt[e.type](t,e)}function UTt(t){return{left:t.clientX,top:t.clientY}}function VTt(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function YTt(t,e,n,r,i){if(-1==r)return!1;let o=t.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(t.someProp(e,e=>a>o.depth?e(t,n,o.nodeAfter,o.before(a),i,!0):e(t,n,o.node(a),o.before(a),i,!1)))return!0;return!1}function GTt(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function QTt(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&CCt.isSelectable(r))&&(GTt(t,new CCt(n),"pointer"),!0)}function WTt(t,e){if(-1==e)return!1;let n,r,i=t.state.selection;i instanceof CCt&&(n=i.node);let o=t.state.doc.resolve(e);for(let a=o.depth+1;a>0;a--){let t=a>o.depth?o.nodeAfter:o.node(a);if(CCt.isSelectable(t)){r=n&&i.$from.depth>0&&a>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(a);break}}return null!=r&&(GTt(t,CCt.create(t.state.doc,r),"pointer"),!0)}function KTt(t,e,n,r,i){return YTt(t,"handleClickOn",e,n,r)||t.someProp("handleClick",n=>n(t,e,r))||(i?WTt(t,n):QTt(t,n))}function qTt(t,e,n,r){return YTt(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",n=>n(t,e,r))}function XTt(t,e,n,r){return YTt(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",n=>n(t,e,r))||$Tt(t,n,r)}function $Tt(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(GTt(t,xCt.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let e=o>i.depth?i.nodeAfter:i.node(o),n=i.before(o);if(e.inlineContent)GTt(t,xCt.create(r,n+1,n+1+e.content.size),"pointer");else{if(!CCt.isSelectable(e))continue;GTt(t,CCt.create(r,n),"pointer")}return!0}}function JTt(t){return skt(t)}PTt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!ekt(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!SMt||!vMt||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!wMt||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",e=>e(t,n))||fTt(t,n)?n.preventDefault():NTt(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",e=>e(t,oMt(13,"Enter"))),t.input.lastIOSEnter=0)},200)}},PTt.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},PTt.keypress=(t,e)=>{let n=e;if(ekt(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||_Mt&&n.metaKey)return;if(t.someProp("handleKeyPress",e=>e(t,n)))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof xCt)||!r.$from.sameParent(r.$to)){let e=String.fromCharCode(n.charCode);/[\r\n]/.test(e)||t.someProp("handleTextInput",n=>n(t,r.$from.pos,r.$to.pos,e))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const ZTt=_Mt?"metaKey":"ctrlKey";OTt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=JTt(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&VTt(n,t.input.lastClick)&&!n[ZTt]&&("singleClick"==t.input.lastClick.type?o="doubleClick":"doubleClick"==t.input.lastClick.type&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let a=t.posAtCoords(UTt(n));a&&("singleClick"==o?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new tkt(t,a,n,!!r)):("doubleClick"==o?qTt:XTt)(t,a.pos,a.inside,n)?n.preventDefault():NTt(t,"pointer"))};class tkt{constructor(t,e,n,r){let i,o;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[ZTt],this.allowDefault=n.shiftKey,e.inside>-1)i=t.state.doc.nodeAt(e.inside),o=e.inside;else{let n=t.state.doc.resolve(e.pos);i=n.parent,o=n.depth?n.before():0}const a=r?null:n.target,s=a?t.docView.nearestDesc(a,!0):null;this.target=s&&1==s.dom.nodeType?s.dom:null;let{selection:c}=t.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||c instanceof CCt&&c.from<=o&&c.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!gMt||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),NTt(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>NLt(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(UTt(t))),this.updateAllowDefault(t),this.allowDefault||!e?NTt(this.view,"pointer"):KTt(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||bMt&&this.mightDrag&&!this.mightDrag.node.isAtom||vMt&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(GTt(this.view,yCt.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):NTt(this.view,"pointer")}move(t){this.updateAllowDefault(t),NTt(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function ekt(t,e){return!!t.composing||!!(bMt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}OTt.touchstart=t=>{t.input.lastTouch=Date.now(),JTt(t),NTt(t,"pointer")},OTt.touchmove=t=>{t.input.lastTouch=Date.now(),NTt(t,"pointer")},OTt.contextmenu=t=>JTt(t);const nkt=SMt?5e3:-1;function rkt(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>skt(t),e))}function ikt(t){t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=akt());while(t.input.compositionNodes.length>0)t.input.compositionNodes.pop().markParentsDirty()}function okt(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=tMt(e.focusNode,e.focusOffset),r=eMt(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let e=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!e||!e.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let t=n.pmViewDesc;if(t&&t.isText(n.nodeValue))return r}}return n||r}function akt(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function skt(t,e=!1){if(!(SMt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),ikt(t),e||t.docView&&t.docView.dirty){let n=ILt(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):!t.markCursor&&!e||t.state.selection.empty?t.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0}return!1}}function ckt(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}PTt.compositionstart=PTt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof xCt&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(t=>!1===t.type.spec.inclusive)))t.markCursor=t.state.storedMarks||n.marks(),skt(t,!0),t.markCursor=null;else if(skt(t,!e.selection.empty),gMt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){let n=t.domSelection();n&&n.collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}rkt(t,nkt)},PTt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,rkt(t,20))};const ukt=pMt&&mMt<15||wMt&&MMt<604;function lkt(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}function hkt(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?dkt(t,r.value,null,i,e):dkt(t,r.textContent,r.innerHTML,i,e)},50)}function dkt(t,e,n,r,i){let o=mTt(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",e=>e(t,i,o||G_t.empty)))return!0;if(!o)return!1;let a=lkt(o),s=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function fkt(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}OTt.copy=PTt.cut=(t,e)=>{let n=e,r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=ukt?null:n.clipboardData,a=r.content(),{dom:s,text:c}=pTt(t,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",c)):ckt(t,s),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},PTt.paste=(t,e)=>{let n=e;if(t.composing&&!SMt)return;let r=ukt?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&dkt(t,fkt(r),r.getData("text/html"),i,n)?n.preventDefault():hkt(t,n)};class pkt{constructor(t,e,n){this.slice=t,this.move=e,this.node=n}}const mkt=_Mt?"altKey":"ctrlKey";OTt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i,o=t.state.selection,a=o.empty?null:t.posAtCoords(UTt(n));if(a&&a.pos>=o.from&&a.pos<=(o instanceof CCt?o.to-1:o.to));else if(r&&r.mightDrag)i=CCt.create(t.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&(i=CCt.create(t.state.doc,e.posBefore))}let s=(i||t.state.selection).content(),{dom:c,text:u,slice:l}=pTt(t,s);(!n.dataTransfer.files.length||!vMt||yMt>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ukt?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",ukt||n.dataTransfer.setData("text/plain",u),t.dragging=new pkt(l,!n[mkt],i)},OTt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},PTt.dragover=PTt.dragenter=(t,e)=>e.preventDefault(),PTt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(UTt(n));if(!i)return;let o=t.state.doc.resolve(i.pos),a=r&&r.slice;a?t.someProp("transformPasted",e=>{a=e(a,t)}):a=mTt(t,fkt(n.dataTransfer),ukt?null:n.dataTransfer.getData("text/html"),!1,o);let s=!(!r||n[mkt]);if(t.someProp("handleDrop",e=>e(t,n,a||G_t.empty,s)))return void n.preventDefault();if(!a)return;n.preventDefault();let c=a?JSt(t.state.doc,o.pos,a):o.pos;null==c&&(c=o.pos);let u=t.state.tr;if(s){let{node:t}=r;t?t.replace(u):u.deleteSelection()}let l=u.mapping.map(c),h=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,d=u.doc;if(h?u.replaceRangeWith(l,l,a.content.firstChild):u.replaceRange(l,l,a),u.doc.eq(d))return;let f=u.doc.resolve(l);if(h&&CCt.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))u.setSelection(new CCt(f));else{let e=u.mapping.map(c);u.mapping.maps[u.mapping.maps.length-1].forEach((t,n,r,i)=>e=i),u.setSelection(GLt(t,f,u.doc.resolve(e)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))},OTt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&NLt(t)},20))},OTt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},OTt.beforeinput=(t,e)=>{let n=e;if(vMt&&SMt&&"deleteContentBackward"==n.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",e=>e(t,oMt(8,"Backspace"))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let os in PTt)OTt[os]=PTt[os];function gkt(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Akt{constructor(t,e){this.toDOM=t,this.spec=e||_kt,this.side=this.spec.side||0}map(t,e,n,r){let{pos:i,deleted:o}=t.mapResult(e.from+r,this.side<0?-1:1);return o?null:new bkt(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Akt&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&gkt(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class vkt{constructor(t,e){this.attrs=t,this.spec=e||_kt}map(t,e,n,r){let i=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,o=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new bkt(i,o,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof vkt&&gkt(this.attrs,t.attrs)&&gkt(this.spec,t.spec)}static is(t){return t.type instanceof vkt}destroy(){}}class ykt{constructor(t,e){this.attrs=t,this.spec=e||_kt}map(t,e,n,r){let i=t.mapResult(e.from+r,1);if(i.deleted)return null;let o=t.mapResult(e.to+r,-1);return o.deleted||o.pos<=i.pos?null:new bkt(i.pos-n,o.pos-n,this)}valid(t,e){let n,{index:r,offset:i}=t.content.findIndex(e.from);return i==e.from&&!(n=t.child(r)).isText&&i+n.nodeSize==e.to}eq(t){return this==t||t instanceof ykt&&gkt(this.attrs,t.attrs)&&gkt(this.spec,t.spec)}destroy(){}}class bkt{constructor(t,e,n){this.from=t,this.to=e,this.type=n}copy(t,e){return new bkt(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,n){return this.type.map(t,this,e,n)}static widget(t,e,n){return new bkt(t,t,new Akt(e,n))}static inline(t,e,n,r){return new bkt(t,e,new vkt(n,r))}static node(t,e,n,r){return new bkt(t,e,new ykt(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof vkt}get widget(){return this.type instanceof Akt}}const wkt=[],_kt={};class xkt{constructor(t,e){this.local=t.length?t:wkt,this.children=e.length?e:wkt}static create(t,e){return e.length?Okt(e,t,0,_kt):Skt}find(t,e,n){let r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r}findInner(t,e,n,r,i){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=e&&a.to>=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<e&&this.children[o+1]>t){let a=this.children[o]+1;this.children[o+2].findInner(t-a,e-a,n,r+a,i)}}map(t,e,n){return this==Skt||0==t.maps.length?this:this.mapInner(t,e,0,0,n||_kt)}mapInner(t,e,n,r,i){let o;for(let a=0;a<this.local.length;a++){let s=this.local[a].map(t,n,r);s&&s.type.valid(e,s)?(o||(o=[])).push(s):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?Mkt(this.children,o||[],t,e,n,r,i):o?new xkt(o.sort(Pkt),wkt):Skt}add(t,e){return e.length?this==Skt?xkt.create(t,e):this.addInner(t,e,0):this}addInner(t,e,n){let r,i=0;t.forEach((t,o)=>{let a,s=o+n;if(a=kkt(e,t,s)){r||(r=this.children.slice());while(i<r.length&&r[i]<o)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(t,a,s+1):r.splice(i,0,o,o+t.nodeSize,Okt(a,t,s+1,_kt)),i+=3}});let o=Lkt(i?Ekt(e):e,-n);for(let a=0;a<o.length;a++)o[a].type.valid(t,o[a])||o.splice(a--,1);return new xkt(o.length?this.local.concat(o).sort(Pkt):this.local,r||this.children)}remove(t){return 0==t.length||this==Skt?this:this.removeInner(t,0)}removeInner(t,e){let n=this.children,r=this.local;for(let i=0;i<n.length;i+=3){let r,o=n[i]+e,a=n[i+1]+e;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>o&&e.to<a&&(t[n]=null,(r||(r=[])).push(e));if(!r)continue;n==this.children&&(n=this.children.slice());let s=n[i+2].removeInner(r,o+1);s!=Skt?n[i+2]=s:(n.splice(i,3),i-=3)}if(r.length)for(let i,o=0;o<t.length;o++)if(i=t[o])for(let t=0;t<r.length;t++)r[t].eq(i,e)&&(r==this.local&&(r=this.local.slice()),r.splice(t--,1));return n==this.children&&r==this.local?this:r.length||n.length?new xkt(r,n):Skt}forChild(t,e){if(this==Skt)return this;if(e.isLeaf)return xkt.empty;let n,r;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=t){this.children[a]==t&&(n=this.children[a+2]);break}let i=t+1,o=i+e.content.size;for(let a=0;a<this.local.length;a++){let t=this.local[a];if(t.from<o&&t.to>i&&t.type instanceof vkt){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let t=new xkt(r.sort(Pkt),wkt);return n?new Ckt([t,n]):t}return n||Skt}eq(t){if(this==t)return!0;if(!(t instanceof xkt)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return Bkt(this.localsInner(t))}localsInner(t){if(this==Skt)return wkt;if(t.inlineContent||!this.local.some(vkt.is))return this.local;let e=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof vkt||e.push(this.local[n]);return e}forEachSet(t){t(this)}}xkt.empty=new xkt([],[]),xkt.removeOverlap=Bkt;const Skt=xkt.empty;class Ckt{constructor(t){this.members=t}map(t,e){const n=this.members.map(n=>n.map(t,e,_kt));return Ckt.from(n)}forChild(t,e){if(e.isLeaf)return xkt.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(t,e);i!=Skt&&(i instanceof Ckt?n=n.concat(i.members):n.push(i))}return Ckt.from(n)}eq(t){if(!(t instanceof Ckt)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(t);if(i.length)if(e){n&&(e=e.slice(),n=!1);for(let t=0;t<i.length;t++)e.push(i[t])}else e=i}return e?Bkt(n?e:e.sort(Pkt)):wkt}static from(t){switch(t.length){case 0:return Skt;case 1:return t[0];default:return new Ckt(t.every(t=>t instanceof xkt)?t:t.reduce((t,e)=>t.concat(e instanceof xkt?e:e.members),[]))}}forEachSet(t){for(let e=0;e<this.members.length;e++)this.members[e].forEachSet(t)}}function Mkt(t,e,n,r,i,o,a){let s=t.slice();for(let u=0,l=o;u<n.maps.length;u++){let t=0;n.maps[u].forEach((e,n,r,i)=>{let o=i-r-(n-e);for(let a=0;a<s.length;a+=3){let r=s[a+1];if(r<0||e>r+l-t)continue;let i=s[a]+l-t;n>=i?s[a+1]=e<=i?-2:-1:e>=l&&o&&(s[a]+=o,s[a+1]+=o)}t+=o}),l=n.maps[u].map(l,-1)}let c=!1;for(let u=0;u<s.length;u+=3)if(s[u+1]<0){if(-2==s[u+1]){c=!0,s[u+1]=-1;continue}let e=n.map(t[u]+o),l=e-i;if(l<0||l>=r.content.size){c=!0;continue}let h=n.map(t[u+1]+o,-1),d=h-i,{index:f,offset:p}=r.content.findIndex(l),m=r.maybeChild(f);if(m&&p==l&&p+m.nodeSize==d){let r=s[u+2].mapInner(n,m,e+1,t[u]+o+1,a);r!=Skt?(s[u]=l,s[u+1]=d,s[u+2]=r):(s[u+1]=-2,c=!0)}else c=!0}if(c){let c=Tkt(s,t,e,n,i,o,a),u=Okt(c,r,0,a);e=u.local;for(let t=0;t<s.length;t+=3)s[t+1]<0&&(s.splice(t,3),t-=3);for(let t=0,e=0;t<u.children.length;t+=3){let n=u.children[t];while(e<s.length&&s[e]<n)e+=3;s.splice(e,0,u.children[t],u.children[t+1],u.children[t+2])}}return new xkt(e.sort(Pkt),s)}function Lkt(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new bkt(i.from+e,i.to+e,i.type))}return n}function Tkt(t,e,n,r,i,o,a){function s(t,e){for(let o=0;o<t.local.length;o++){let s=t.local[o].map(r,i,e);s?n.push(s):a.onRemove&&a.onRemove(t.local[o].spec)}for(let n=0;n<t.children.length;n+=3)s(t.children[n+2],t.children[n]+e+1)}for(let c=0;c<t.length;c+=3)-1==t[c+1]&&s(t[c+2],e[c]+o+1);return n}function kkt(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o,a=0;a<t.length;a++)(o=t[a])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),t[a]=null);return i}function Ekt(t){let e=[];for(let n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Okt(t,e,n,r){let i=[],o=!1;e.forEach((e,a)=>{let s=kkt(t,e,a+n);if(s){o=!0;let t=Okt(s,e,n+a+1,r);t!=Skt&&i.push(a,a+e.nodeSize,t)}});let a=Lkt(o?Ekt(t):t,-n).sort(Pkt);for(let s=0;s<a.length;s++)a[s].type.valid(e,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||i.length?new xkt(a,i):Skt}function Pkt(t,e){return t.from-e.from||t.to-e.to}function Bkt(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from!=r.from){o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),Ikt(e,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),Ikt(e,i+1,o.copy(r.to,o.to)))}}return e}function Ikt(t,e,n){while(e<t.length&&Pkt(n,t[e])>0)e++;t.splice(e,0,n)}function Dkt(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Skt&&e.push(r)}),t.cursorWrapper&&e.push(xkt.create(t.state.doc,[t.cursorWrapper.deco])),Ckt.from(e)}const Nkt={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Fkt=pMt&&mMt<=11;class jkt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class Rkt{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new jkt,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);pMt&&mMt<=11&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),Fkt&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Nkt)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;e<t.length;e++)this.queue.push(t[e]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(QLt(this.view)){if(this.suppressingSelectionUpdates)return NLt(this.view);if(pMt&&mMt<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&XCt(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e,n=new Set;for(let i=t.focusNode;i;i=QCt(i))n.add(i);for(let i=t.anchorNode;i;i=QCt(i))if(n.has(i)){e=i;break}let r=e&&this.view.docView.nearestDesc(e);return r&&r.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let n=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&QLt(t)&&!this.ignoreSelectionChange(n),i=-1,o=-1,a=!1,s=[];if(t.editable)for(let u=0;u<e.length;u++){let t=this.registerMutation(e[u],s);t&&(i=i<0?t.from:Math.min(t.from,i),o=o<0?t.to:Math.max(t.to,o),t.typeOver&&(a=!0))}if(gMt&&s.length){let e=s.filter(t=>"BR"==t.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;!e||"LI"!=e.nodeName||n&&Gkt(t,n)==e||r.remove()}}}let c=null;i<0&&r&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&iMt(n)&&(c=ILt(t))&&c.eq(yCt.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,NLt(t),this.currentSelection.set(n),t.scrollToSelection()):(i>-1||r)&&(i>-1&&(t.docView.markDirty(i,o),Ukt(t)),this.handleDOMChange(i,o,a,s),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||NLt(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;n<t.addedNodes.length;n++){let r=t.addedNodes[n];e.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};let r=t.previousSibling,i=t.nextSibling;if(pMt&&mMt<=11&&t.addedNodes.length)for(let e=0;e<t.addedNodes.length;e++){let{previousSibling:n,nextSibling:o}=t.addedNodes[e];(!n||Array.prototype.indexOf.call(t.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(t.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==t.target?GCt(r)+1:0,a=n.localPosFromDOM(t.target,o,-1),s=i&&i.parentNode==t.target?GCt(i):t.target.childNodes.length,c=n.localPosFromDOM(t.target,s,1);return{from:a,to:c}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=t.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let Hkt=new WeakMap,zkt=!1;function Ukt(t){if(!Hkt.has(t)&&(Hkt.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))){if(t.requiresGeckoHackNode=gMt,zkt)return;console["warn"]("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),zkt=!0}}function Vkt(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return XCt(a.node,a.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function Ykt(t,e){if(e.getComposedRanges){let n=e.getComposedRanges(t.root)[0];if(n)return Vkt(t,n)}let n;function r(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Vkt(t,n):null}function Gkt(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let e=t.docView.nearestDesc(n,!0);if(e&&e.node.isBlock)return n}return null}function Qkt(t,e,n){let r,{node:i,fromOffset:o,toOffset:a,from:s,to:c}=t.docView.parseRange(e,n),u=t.domSelectionRange(),l=u.anchorNode;if(l&&t.dom.contains(1==l.nodeType?l:l.parentNode)&&(r=[{node:l,offset:u.anchorOffset}],iMt(u)||r.push({node:u.focusNode,offset:u.focusOffset})),vMt&&8===t.input.lastKeyCode)for(let g=a;g>o;g--){let t=i.childNodes[g-1],e=t.pmViewDesc;if("BR"==t.nodeName&&!e){a=g;break}if(!e||e.size)break}let h=t.state.doc,d=t.someProp("domParser")||Rxt.fromSchema(t.state.schema),f=h.resolve(s),p=null,m=d.parse(i,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:a,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Wkt,context:f});if(r&&null!=r[0].pos){let t=r[0].pos,e=r[1]&&r[1].pos;null==e&&(e=t),p={anchor:t+s,head:e+s}}return{doc:m,sel:p,from:s,to:c}}function Wkt(t){let e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(bMt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}if(t.parentNode.lastChild==t||bMt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Kkt=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function qkt(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let e=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,n=ILt(t,e);if(n&&!t.state.selection.eq(n)){if(vMt&&SMt&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",e=>e(t,oMt(13,"Enter"))))return;let r=t.state.tr.setSelection(n);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),o&&r.setMeta("composition",o),t.dispatch(r)}return}let a=t.state.doc.resolve(e),s=a.sharedDepth(n);e=a.before(s+1),n=t.state.doc.resolve(n).after(s+1);let c,u,l=t.state.selection,h=Qkt(t,e,n),d=t.state.doc,f=d.slice(h.from,h.to);8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(c=t.state.selection.to,u="end"):(c=t.state.selection.from,u="start"),t.input.lastKeyCode=null;let p=tEt(f.content,h.doc.content,h.from,c,u);if(p&&t.input.domChangeCount++,(wMt&&t.input.lastIOSEnter>Date.now()-225||SMt)&&i.some(t=>1==t.nodeType&&!Kkt.test(t.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",e=>e(t,oMt(13,"Enter"))))return void(t.input.lastIOSEnter=0);if(!p){if(!(r&&l instanceof xCt&&!l.empty&&l.$head.sameParent(l.$anchor))||t.composing||h.sel&&h.sel.anchor!=h.sel.head){if(h.sel){let e=Xkt(t,t.state.doc,h.sel);if(e&&!e.eq(t.state.selection)){let n=t.state.tr.setSelection(e);o&&n.setMeta("composition",o),t.dispatch(n)}}return}p={start:l.from,endA:l.to,endB:l.to}}t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof xCt&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=h.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=h.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),pMt&&mMt<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>h.from&&"  "==h.doc.textBetween(p.start-h.from-1,p.start-h.from+1)&&(p.start--,p.endA--,p.endB--);let m,g=h.doc.resolveNoCache(p.start-h.from),A=h.doc.resolveNoCache(p.endB-h.from),v=d.resolve(p.start),y=g.sameParent(A)&&g.parent.inlineContent&&v.end()>=p.endA;if((wMt&&t.input.lastIOSEnter>Date.now()-225&&(!y||i.some(t=>"DIV"==t.nodeName||"P"==t.nodeName))||!y&&g.pos<h.doc.content.size&&!g.sameParent(A)&&(m=yCt.findFrom(h.doc.resolve(g.pos+1),1,!0))&&m.head==A.pos)&&t.someProp("handleKeyDown",e=>e(t,oMt(13,"Enter"))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>p.start&&Jkt(d,p.start,p.endA,g,A)&&t.someProp("handleKeyDown",e=>e(t,oMt(8,"Backspace"))))return void(SMt&&vMt&&t.domObserver.suppressSelectionUpdates());vMt&&p.endB==p.start&&(t.input.lastChromeDelete=Date.now()),SMt&&!y&&g.start()!=A.start()&&0==A.parentOffset&&g.depth==A.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==p.endA&&(p.endB-=2,A=h.doc.resolveNoCache(p.endB-h.from),setTimeout(()=>{t.someProp("handleKeyDown",(function(e){return e(t,oMt(13,"Enter"))}))},20));let b,w,_,x=p.start,S=p.endA;if(y)if(g.pos==A.pos)pMt&&mMt<=11&&0==g.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>NLt(t),20)),b=t.state.tr.delete(x,S),w=d.resolve(p.start).marksAcross(d.resolve(p.endA));else if(p.endA==p.endB&&(_=$kt(g.parent.content.cut(g.parentOffset,A.parentOffset),v.parent.content.cut(v.parentOffset,p.endA-v.start()))))b=t.state.tr,"add"==_.type?b.addMark(x,S,_.mark):b.removeMark(x,S,_.mark);else if(g.parent.child(g.index()).isText&&g.index()==A.index()-(A.textOffset?0:1)){let e=g.parent.textBetween(g.parentOffset,A.parentOffset);if(t.someProp("handleTextInput",n=>n(t,x,S,e)))return;b=t.state.tr.insertText(e,x,S)}if(b||(b=t.state.tr.replace(x,S,h.doc.slice(p.start-h.from,p.endB-h.from))),h.sel){let e=Xkt(t,b.doc,h.sel);e&&!(vMt&&t.composing&&e.empty&&(p.start!=p.endB||t.input.lastChromeDelete<Date.now()-100)&&(e.head==x||e.head==b.mapping.map(S)-1)||pMt&&e.empty&&e.head==x)&&b.setSelection(e)}w&&b.ensureMarks(w),o&&b.setMeta("composition",o),t.dispatch(b.scrollIntoView())}function Xkt(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:GLt(t,e.resolve(n.anchor),e.resolve(n.head))}function $kt(t,e){let n,r,i,o=t.firstChild.marks,a=e.firstChild.marks,s=o,c=a;for(let l=0;l<a.length;l++)s=a[l].removeFromSet(s);for(let l=0;l<o.length;l++)c=o[l].removeFromSet(c);if(1==s.length&&0==c.length)r=s[0],n="add",i=t=>t.mark(r.addToSet(t.marks));else{if(0!=s.length||1!=c.length)return null;r=c[0],n="remove",i=t=>t.mark(r.removeFromSet(t.marks))}let u=[];for(let l=0;l<e.childCount;l++)u.push(i(e.child(l)));if(R_t.from(u).eq(t))return{mark:r,type:n}}function Jkt(t,e,n,r,i){if(n-e<=i.pos-r.pos||Zkt(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let t=o.nodeAfter;return null!=t&&n==e+t.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let a=t.resolve(Zkt(o,!0,!0));return!(!a.parent.isTextblock||a.pos>n||Zkt(a,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function Zkt(t,e,n){let r=t.depth,i=e?t.end():t.pos;while(r>0&&(e||t.indexAfter(r)==t.node(r).childCount))r--,i++,e=!1;if(n){let e=t.node(r).maybeChild(t.indexAfter(r));while(e&&!e.isLeaf)e=e.firstChild,i++}return i}function tEt(t,e,n,r,i){let o=t.findDiffStart(e,n);if(null==o)return null;let{a:a,b:s}=t.findDiffEnd(e,n+t.size,n+e.size);if("end"==i){let t=Math.max(0,o-Math.min(a,s));r-=a+t-o}if(a<o&&t.size<e.size){let t=r<=o&&r>=a?o-r:0;o-=t,o&&o<e.size&&eEt(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-a),a=o}else if(s<o){let e=r<=o&&r>=s?o-r:0;o-=e,o&&o<t.size&&eEt(t.textBetween(o-1,o+1))&&(o+=e?1:-1),a=o+(a-s),s=o}return{start:o,endA:a,endB:s}}function eEt(t){if(2!=t.length)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class nEt{constructor(t,e){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ITt,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(uEt),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=oEt(this),iEt(this),this.nodeViews=sEt(this),this.docView=pLt(this.state.doc,rEt(this),Dkt(this),this.dom,this),this.domObserver=new Rkt(this,(t,e,n,r)=>qkt(this,t,e,n,r)),this.domObserver.start(),DTt(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&jTt(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(uEt),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let n in this._props)e[n]=this._props[n];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){var n;let r=this.state,i=!1,o=!1;t.storedMarks&&this.composing&&(ikt(this),o=!0),this.state=t;let a=r.plugins!=t.plugins||this._props.plugins!=e.plugins;if(a||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=sEt(this);cEt(t,this.nodeViews)&&(this.nodeViews=t,i=!0)}(a||e.handleDOMEvents!=this._props.handleDOMEvents)&&jTt(this),this.editable=oEt(this),iEt(this);let s=Dkt(this),c=rEt(this),u=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",l=i||!this.docView.matchesNode(t.doc,c,s);!l&&t.selection.eq(r.selection)||(o=!0);let h="preserve"==u&&o&&null==this.dom.style.overflowAnchor&&OMt(this);if(o){this.domObserver.stop();let e=l&&(pMt||vMt)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&aEt(r.selection,t.selection);if(l){let n=vMt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=okt(this)),!i&&this.docView.update(t.doc,c,s,this)||(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=pLt(t.doc,c,s,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&KLt(this))?NLt(this,e):(VLt(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==u?this.dom.scrollTop=0:"to selection"==u?this.scrollToSelection():h&&BMt(h)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",t=>t(this)));else if(this.state.selection instanceof CCt){let e=this.docView.domAfterPos(this.state.selection.from);1==e.nodeType&&EMt(this,e.getBoundingClientRect(),t)}else EMt(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;while(t=this.pluginViews.pop())t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;e<this.pluginViews.length;e++){let n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let e=this.directPlugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let e=this.state.plugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}}}updateDraggedNode(t,e){let n=t.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let t=n.from+(this.state.doc.content.size-e.doc.content.size),i=t>0&&this.state.doc.nodeAt(t);i==n.node&&(r=t)}this.dragging=new pkt(t.slice,t.move,r<0?void 0:CCt.create(this.state.doc,r))}someProp(t,e){let n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;for(let o=0;o<this.directPlugins.length;o++){let r=this.directPlugins[o].props[t];if(null!=r&&(n=e?e(r):r))return n}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let r=i[o].props[t];if(null!=r&&(n=e?e(r):r))return n}}hasFocus(){if(pMt){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;while(t&&this.dom!=t&&this.dom.contains(t)){if("false"==t.contentEditable)return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&NMt(this.dom),NLt(this),this.domObserver.start()}get root(){let t=this._root;if(null==t)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return t||document}updateRoot(){this._root=null}posAtCoords(t){return YMt(this,t)}coordsAtPos(t,e=1){return KMt(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return iLt(this,e||this.state,t)}pasteHTML(t,e){return dkt(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return dkt(this,t,null,!0,e||new ClipboardEvent("paste"))}destroy(){this.docView&&(FTt(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Dkt(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,qCt())}get isDestroyed(){return null==this.docView}dispatchEvent(t){return zTt(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){let t=this.domSelection();return t?bMt&&11===this.root.nodeType&&aMt(this.dom.ownerDocument)==this.dom&&Ykt(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function rEt(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t?e.class+=" "+n[t]:"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))}),e.translate||(e.translate="no"),[bkt.node(0,t.state.doc.content.size,e)]}function iEt(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:bkt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function oEt(t){return!t.someProp("editable",e=>!1===e(t.state))}function aEt(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function sEt(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function cEt(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function uEt(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}function lEt(t={}){return new zCt({view(e){return new hEt(e,t)}})}class hEt{constructor(t,e){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=e.width)&&void 0!==n?n:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map(e=>{let n=t=>{this[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}})}destroy(){this.handlers.forEach(({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e))}update(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent;if(n){let n=e.nodeBefore,r=e.nodeAfter;if(n||r){let e=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(e){let i=e.getBoundingClientRect(),o=n?i.bottom:i.top;n&&r&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:i.left,right:i.right,top:o-this.width/2,bottom:o+this.width/2}}}}if(!t){let e=this.editorView.coordsAtPos(this.cursorPos);t={left:e.left-this.width/2,right:e.left+this.width/2,top:e.top,bottom:e.bottom}}let r,i,o=this.editorView.dom.offsetParent;if(this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!o||o==document.body&&"static"==getComputedStyle(o).position)r=-pageXOffset,i=-pageYOffset;else{let t=o.getBoundingClientRect();r=t.left-o.scrollLeft,i=t.top-o.scrollTop}this.element.style.left=t.left-r+"px",this.element.style.top=t.top-i+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,e,t):r;if(e&&!i){let t=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=JSt(this.editorView.state.doc,t,this.editorView.dragging.slice);null!=e&&(t=e)}this.setCursor(t),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}for(var dEt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},fEt={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},pEt="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),mEt="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),gEt=0;gEt<10;gEt++)dEt[48+gEt]=dEt[96+gEt]=String(gEt);for(gEt=1;gEt<=24;gEt++)dEt[gEt+111]="F"+gEt;for(gEt=65;gEt<=90;gEt++)dEt[gEt]=String.fromCharCode(gEt+32),fEt[gEt]=String.fromCharCode(gEt);for(var AEt in dEt)fEt.hasOwnProperty(AEt)||(fEt[AEt]=dEt[AEt]);function vEt(t){var e=pEt&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||mEt&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key,n=!e&&t.key||(t.shiftKey?fEt:dEt)[t.keyCode]||t.key||"Unidentified";return"Esc"==n&&(n="Escape"),"Del"==n&&(n="Delete"),"Left"==n&&(n="ArrowLeft"),"Up"==n&&(n="ArrowUp"),"Right"==n&&(n="ArrowRight"),"Down"==n&&(n="ArrowDown"),n}const yEt="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function bEt(t){let e,n,r,i,o=t.split(/-(?!$)/),a=o[o.length-1];"Space"==a&&(a=" ");for(let s=0;s<o.length-1;s++){let t=o[s];if(/^(cmd|meta|m)$/i.test(t))i=!0;else if(/^a(lt)?$/i.test(t))e=!0;else if(/^(c|ctrl|control)$/i.test(t))n=!0;else if(/^s(hift)?$/i.test(t))r=!0;else{if(!/^mod$/i.test(t))throw new Error("Unrecognized modifier name: "+t);yEt?i=!0:n=!0}}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function wEt(t){let e=Object.create(null);for(let n in t)e[bEt(n)]=t[n];return e}function _Et(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function xEt(t){return new zCt({props:{handleKeyDown:SEt(t)}})}function SEt(t){let e=wEt(t);return function(t,n){let r,i=vEt(n),o=e[_Et(i,n)];if(o&&o(t.state,t.dispatch,t))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=e[_Et(i,n,!1)];if(r&&r(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=dEt[n.keyCode])&&r!=i){let i=e[_Et(r,n)];if(i&&i(t.state,t.dispatch,t))return!0}}return!1}}class CEt extends yCt{constructor(t){super(t,t)}map(t,e){let n=t.resolve(e.map(this.head));return CEt.valid(n)?new CEt(n):yCt.near(n)}content(){return G_t.empty}eq(t){return t instanceof CEt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new CEt(t.resolve(e.pos))}getBookmark(){return new MEt(this.anchor)}static valid(t){let e=t.parent;if(e.isTextblock||!LEt(t)||!TEt(t))return!1;let n=e.type.spec.allowGapCursor;if(null!=n)return n;let r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,e,n=!1){t:for(;;){if(!n&&CEt.valid(t))return t;let r=t.pos,i=null;for(let n=t.depth;;n--){let o=t.node(n);if(e>0?t.indexAfter(n)<o.childCount:t.index(n)>0){i=o.child(e>0?t.indexAfter(n):t.index(n)-1);break}if(0==n)return null;r+=e;let a=t.doc.resolve(r);if(CEt.valid(a))return a}for(;;){let o=e>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!CCt.isSelectable(i)){t=t.doc.resolve(r+i.nodeSize*e),n=!1;continue t}break}i=o,r+=e;let a=t.doc.resolve(r);if(CEt.valid(a))return a}return null}}}CEt.prototype.visible=!1,CEt.findFrom=CEt.findGapCursorFrom,yCt.jsonID("gapcursor",CEt);class MEt{constructor(t){this.pos=t}map(t){return new MEt(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return CEt.valid(e)?new CEt(e):yCt.near(e)}}function LEt(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(0!=n)for(let t=r.child(n-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}function TEt(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(let t=r.child(n);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}function kEt(){return new zCt({props:{decorations:IEt,createSelectionBetween(t,e,n){return e.pos==n.pos&&CEt.valid(n)?new CEt(n):null},handleClick:PEt,handleKeyDown:EEt,handleDOMEvents:{beforeinput:BEt}}})}const EEt=SEt({ArrowLeft:OEt("horiz",-1),ArrowRight:OEt("horiz",1),ArrowUp:OEt("vert",-1),ArrowDown:OEt("vert",1)});function OEt(t,e){const n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,i){let o=t.selection,a=e>0?o.$to:o.$from,s=o.empty;if(o instanceof xCt){if(!i.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=t.doc.resolve(e>0?a.after():a.before())}let c=CEt.findGapCursorFrom(a,e,s);return!!c&&(r&&r(t.tr.setSelection(new CEt(c))),!0)}}function PEt(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!CEt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&CCt.isSelectable(t.state.doc.nodeAt(i.inside)))&&(t.dispatch(t.state.tr.setSelection(new CEt(r))),!0)}function BEt(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof CEt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=R_t.empty;for(let a=r.length-1;a>=0;a--)i=R_t.from(r[a].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new G_t(i,0,0));return o.setSelection(xCt.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function IEt(t){if(!(t.selection instanceof CEt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",xkt.create(t.doc,[bkt.widget(t.selection.head,e,{key:"gapcursor"})])}const DEt=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function NEt(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const FEt=(t,e,n)=>{let r=NEt(t,n);if(!r)return!1;let i=HEt(r);if(!i){let n=r.blockRange(),i=n&&BSt(n);return null!=i&&(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(eOt(t,i,e,-1))return!0;if(0==r.parent.content.size&&(jEt(o,"end")||CCt.isSelectable(o)))for(let a=r.depth;;a--){let n=ZSt(t.doc,r.before(a),r.after(a),G_t.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(jEt(o,"end")?yCt.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):CCt.create(r.doc,i.pos-o.nodeSize)),e(r.scrollIntoView())}return!0}if(1==a||r.node(a-1).childCount>1)break}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)};function jEt(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}const REt=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=HEt(r)}let a=o&&o.nodeBefore;return!(!a||!CCt.isSelectable(a))&&(e&&e(t.tr.setSelection(CCt.create(t.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function HEt(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function zEt(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const UEt=(t,e,n)=>{let r=zEt(t,n);if(!r)return!1;let i=YEt(r);if(!i)return!1;let o=i.nodeAfter;if(eOt(t,i,e,1))return!0;if(0==r.parent.content.size&&(jEt(o,"start")||CCt.isSelectable(o))){let n=ZSt(t.doc,r.before(),r.after(),G_t.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(jEt(o,"start")?yCt.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):CCt.create(r.doc,r.mapping.map(i.pos))),e(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},VEt=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=YEt(r)}let a=o&&o.nodeAfter;return!(!a||!CCt.isSelectable(a))&&(e&&e(t.tr.setSelection(CCt.create(t.doc,o.pos)).scrollIntoView()),!0)};function YEt(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const GEt=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&BSt(i);return null!=o&&(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},QEt=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)};function WEt(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const KEt=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),a=WEt(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(e){let r=n.after(),i=t.tr.replaceWith(r,r,a.createAndFill());i.setSelection(yCt.near(i.doc.resolve(r),1)),e(i.scrollIntoView())}return!0},qEt=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof LCt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=WEt(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(n,o.createAndFill());a.setSelection(xCt.create(a.doc,n+1)),e(a.scrollIntoView())}return!0},XEt=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(GSt(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&BSt(r);return null!=i&&(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function $Et(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof CCt&&e.selection.node.isBlock)return!(!r.parentOffset||!GSt(e.doc,r.pos))&&(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o,a,s=[],c=!1,u=!1;for(let f=r.depth;;f--){let e=r.node(f);if(e.isBlock){c=r.end(f)==r.pos+(r.depth-f),u=r.start(f)==r.pos-(r.depth-f),a=WEt(r.node(f-1).contentMatchAt(r.indexAfter(f-1)));let e=t&&t(i.parent,c,r);s.unshift(e||(c&&a?{type:a}:null)),o=f;break}if(1==f)return!1;s.unshift(null)}let l=e.tr;(e.selection instanceof xCt||e.selection instanceof LCt)&&l.deleteSelection();let h=l.mapping.map(r.pos),d=GSt(l.doc,h,s.length,s);if(d||(s[0]=a?{type:a}:null,d=GSt(l.doc,h,s.length,s)),l.split(h,s.length,s),!c&&u&&r.node(o).type!=a){let t=l.mapping.map(r.before(o)),e=l.doc.resolve(t);a&&r.node(o-1).canReplaceWith(e.index(),e.index()+1,a)&&l.setNodeMarkup(l.mapping.map(r.before(o)),a)}return n&&n(l.scrollIntoView()),!0}}const JEt=$Et(),ZEt=(t,e)=>(e&&e(t.tr.setSelection(new LCt(t.doc))),!0);function tOt(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!!(r&&i&&r.type.compatibleContent(i.type))&&(!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!(!e.parent.canReplace(o,o+1)||!i.isTextblock&&!WSt(t.doc,e.pos))&&(n&&n(t.tr.join(e.pos).scrollIntoView()),!0))}function eOt(t,e,n,r){let i,o,a=e.nodeBefore,s=e.nodeAfter,c=a.type.spec.isolating||s.type.spec.isolating;if(!c&&tOt(t,e,n))return!0;let u=!c&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(i=(o=a.contentMatchAt(a.childCount)).findWrapping(s.type))&&o.matchType(i[0]||s.type).validEnd){if(n){let r=e.pos+s.nodeSize,o=R_t.empty;for(let t=i.length-1;t>=0;t--)o=R_t.from(i[t].create(null,o));o=R_t.from(a.copy(o));let c=t.tr.step(new LSt(e.pos-1,r,e.pos,r,new G_t(o,1,0),i.length,!0)),u=c.doc.resolve(r+2*i.length);u.nodeAfter&&u.nodeAfter.type==a.type&&WSt(c.doc,u.pos)&&c.join(u.pos),n(c.scrollIntoView())}return!0}let l=s.type.spec.isolating||r>0&&c?null:yCt.findFrom(e,1),h=l&&l.$from.blockRange(l.$to),d=h&&BSt(h);if(null!=d&&d>=e.depth)return n&&n(t.tr.lift(h,d).scrollIntoView()),!0;if(u&&jEt(s,"start",!0)&&jEt(a,"end")){let r=a,i=[];for(;;){if(i.push(r),r.isTextblock)break;r=r.lastChild}let o=s,c=1;for(;!o.isTextblock;o=o.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,o.content)){if(n){let r=R_t.empty;for(let t=i.length-1;t>=0;t--)r=R_t.from(i[t].copy(r));let o=t.tr.step(new LSt(e.pos-i.length,e.pos+s.nodeSize,e.pos+c,e.pos+s.nodeSize-c,new G_t(r,i.length,0),0,!0));n(o.scrollIntoView())}return!0}}return!1}function nOt(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;while(i.node(o).isInline){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(e.tr.setSelection(xCt.create(e.doc,t<0?i.start(o):i.end(o)))),!0)}}const rOt=nOt(-1),iOt=nOt(1);function oOt(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),s=a&&DSt(a,t,e);return!!s&&(r&&r(n.tr.wrap(a,s).scrollIntoView()),!0)}}function aOt(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:r},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(r,a,(r,o)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)i=!0;else{let e=n.doc.resolve(o),r=e.index();i=e.parent.canReplaceWith(r,r+1,t)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[r];i.setBlockType(o,a,t,e)}r(i.scrollIntoView())}return!0}}function sOt(t,e,n,r){for(let i=0;i<e.length;i++){let{$from:o,$to:a}=e[i],s=0==o.depth&&(t.inlineContent&&t.type.allowsMarkType(n));if(t.nodesBetween(o.pos,a.pos,(t,e)=>{if(s||!r&&t.isAtom&&t.isInline&&e>=o.pos&&e+t.nodeSize<=a.pos)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)}),s)return!0}return!1}function cOt(t){let e=[];for(let n=0;n<t.length;n++){let{$from:r,$to:i}=t[n];r.doc.nodesBetween(r.pos,i.pos,(t,n)=>{if(t.isAtom&&t.content.size&&t.isInline&&n>=r.pos&&n+t.nodeSize<=i.pos)return n+1>r.pos&&e.push(new bCt(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+t.content.size),!1}),r.pos<i.pos&&e.push(new bCt(r,i))}return e}function uOt(t,e=null,n){let r=!1!==(n&&n.removeWhenPresent),i=!1!==(n&&n.enterInlineAtoms);return function(n,o){let{empty:a,$cursor:s,ranges:c}=n.selection;if(a&&!s||!sOt(n.doc,c,t,i))return!1;if(o)if(s)t.isInSet(n.storedMarks||s.marks())?o(n.tr.removeStoredMark(t)):o(n.tr.addStoredMark(t.create(e)));else{let a,s=n.tr;i||(c=cOt(c)),a=r?!c.some(e=>n.doc.rangeHasMark(e.$from.pos,e.$to.pos,t)):!c.every(e=>{let n=!1;return s.doc.nodesBetween(e.$from.pos,e.$to.pos,(r,i,o)=>{if(n)return!1;n=!t.isInSet(r.marks)&&!!o&&o.type.allowsMarkType(t)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,e.$from.pos-i),Math.min(r.nodeSize,e.$to.pos-i))))}),!n});for(let n=0;n<c.length;n++){let{$from:r,$to:i}=c[n];if(a){let n=r.pos,o=i.pos,a=r.nodeAfter,c=i.nodeBefore,u=a&&a.isText?/^\s*/.exec(a.text)[0].length:0,l=c&&c.isText?/\s*$/.exec(c.text)[0].length:0;n+u<o&&(n+=u,o-=l),s.addMark(n,o,t.create(e))}else s.removeMark(r.pos,i.pos,t)}o(s.scrollIntoView())}return!0}}function lOt(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let hOt=lOt(DEt,FEt,REt),dOt=lOt(DEt,UEt,VEt);const fOt={Enter:lOt(QEt,qEt,XEt,JEt),"Mod-Enter":KEt,Backspace:hOt,"Mod-Backspace":hOt,"Shift-Backspace":hOt,Delete:dOt,"Mod-Delete":dOt,"Mod-a":ZEt},pOt={"Ctrl-h":fOt["Backspace"],"Alt-Backspace":fOt["Mod-Backspace"],"Ctrl-d":fOt["Delete"],"Ctrl-Alt-Backspace":fOt["Mod-Delete"],"Alt-Delete":fOt["Mod-Delete"],"Alt-d":fOt["Mod-Delete"],"Ctrl-a":rOt,"Ctrl-e":iOt};for(let os in fOt)pOt[os]=fOt[os];const mOt="undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform(),gOt=mOt?pOt:fOt;class AOt{constructor(t,e,n={}){this.match=t,this.match=t,this.handler="string"==typeof e?vOt(e):e,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1}}function vOt(t){return function(e,n,r,i){let o=t;if(n[1]){let t=n[0].lastIndexOf(n[1]);o+=n[0].slice(t+n[1].length),r+=t;let e=r-i;e>0&&(o=n[0].slice(t-e,t)+o,r=i)}return e.tr.insertText(o,r,i)}}const yOt=500;function bOt({rules:t}){let e=new zCt({state:{init(){return null},apply(t,e){let n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput(n,r,i,o){return wOt(n,r,i,o,t,e)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&wOt(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}function wOt(t,e,n,r,i,o){if(t.composing)return!1;let a=t.state,s=a.doc.resolve(e),c=s.parent.textBetween(Math.max(0,s.parentOffset-yOt),s.parentOffset,null,"")+r;for(let u=0;u<i.length;u++){let l=i[u];if(s.parent.type.spec.code){if(!l.inCode)continue}else if("only"===l.inCode)continue;let h=l.match.exec(c),d=h&&l.handler(a,h,e-(h[0].length-r.length),n);if(d)return l.undoable&&d.setMeta(o,{transform:d,from:e,to:n,text:r}),t.dispatch(d),!0}return!1}const _Ot=(t,e)=>{let n=t.plugins;for(let r=0;r<n.length;r++){let i,o=n[r];if(o.spec.isInputRules&&(i=o.getState(t))){if(e){let n=t.tr,r=i.transform;for(let t=r.steps.length-1;t>=0;t--)n.step(r.steps[t].invert(r.docs[t]));if(i.text){let e=n.doc.resolve(i.from).marks();n.replaceWith(i.from,i.to,t.schema.text(i.text,e))}else n.delete(i.from,i.to);e(n)}return!0}}return!1};new AOt(/--$/,"—"),new AOt(/\.\.\.$/,"…"),new AOt(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new AOt(/"$/,"”"),new AOt(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new AOt(/'$/,"’");function xOt(t,e,n=null,r){return new AOt(t,(t,i,o,a)=>{let s=n instanceof Function?n(i):n,c=t.tr.delete(o,a),u=c.doc.resolve(o),l=u.blockRange(),h=l&&DSt(l,e,s);if(!h)return null;c.wrap(l,h);let d=c.doc.resolve(o-1).nodeBefore;return d&&d.type==e&&WSt(c.doc,o-1)&&(!r||r(i,d))&&c.join(o-1),c})}function SOt(t,e,n=null){return new AOt(t,(t,r,i,o)=>{let a=t.doc.resolve(i),s=n instanceof Function?n(r):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),e)?t.tr.delete(i,o).setBlockType(i,i,e,s):null})}
1123
+ function _At(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="cssVars(): ",n=Wgt({},pAt,t);function r(t,r,i,o){!n.silent&&window.console&&console.error("".concat(e).concat(t,"\n"),r),n.onError(t,r,i,o)}function i(t){!n.silent&&window.console&&console.warn("".concat(e).concat(t)),n.onWarning(t)}function o(t){n.onFinally(Boolean(t),dAt,kAt()-n.__benchmark)}if(hAt){if(n.watch)return n.watch=pAt.watch,xAt(n),void _At(n);if(!1===n.watch&&vAt&&(vAt.disconnect(),vAt=null),!n.__benchmark){if(AAt===n.rootElement)return void SAt(t);var a=[].slice.call(n.rootElement.querySelectorAll('[data-cssvars]:not([data-cssvars="out"])'));if(n.__benchmark=kAt(),n.exclude=[vAt?'[data-cssvars]:not([data-cssvars=""])':'[data-cssvars="out"]',"link[disabled]:not([data-cssvars])",n.exclude].filter((function(t){return t})).join(","),n.variables=LAt(n.variables),a.forEach((function(t){var e="style"===t.nodeName.toLowerCase()&&t.__cssVars.text,n=e&&t.textContent!==t.__cssVars.text;e&&n&&(t.sheet&&(t.sheet.disabled=!1),t.setAttribute("data-cssvars",""))})),!vAt){var s=[].slice.call(n.rootElement.querySelectorAll('[data-cssvars="out"]'));s.forEach((function(t){var e=t.getAttribute("data-cssvars-group"),r=e?n.rootElement.querySelector('[data-cssvars="src"][data-cssvars-group="'.concat(e,'"]')):null;r||t.parentNode.removeChild(t)})),yAt&&a.length<yAt&&(yAt=a.length,gAt.dom={})}}if("loading"!==document.readyState)if(dAt&&n.onlyLegacy){var c=!1;if(n.updateDOM){var u=n.rootElement.host||(n.rootElement===document?document.documentElement:n.rootElement);Object.keys(n.variables).forEach((function(t){var e=n.variables[t];c=c||e!==getComputedStyle(u).getPropertyValue(t),u.style.setProperty(t,e)}))}o(c)}else!wAt&&(n.shadowDOM||n.rootElement.shadowRoot||n.rootElement.host)?qgt({rootElement:pAt.rootElement,include:pAt.include,exclude:n.exclude,skipDisabled:!1,onSuccess:function(t,e,n){var r=(e.sheet||{}).disabled&&!e.__cssVars;return!r&&(t=t.replace(mAt.cssComments,"").replace(mAt.cssMediaQueries,""),t=(t.match(mAt.cssVarDeclRules)||[]).join(""),t||!1)},onComplete:function(t,e,r){rAt(t,{store:gAt.dom,onWarning:i}),wAt=!0,_At(n)}}):(AAt=n.rootElement,qgt({rootElement:n.rootElement,include:n.include,exclude:n.exclude,skipDisabled:!1,onBeforeSend:n.onBeforeSend,onError:function(t,e,n){var i=t.responseURL||TAt(n,location.href),o=t.statusText?"(".concat(t.statusText,")"):"Unspecified Error"+(0===t.status?" (possibly CORS related)":""),a="CSS XHR Error: ".concat(i," ").concat(t.status," ").concat(o);r(a,e,t,i)},onSuccess:function(t,e,r){var i=(e.sheet||{}).disabled&&!e.__cssVars;if(i)return!1;var o="link"===e.nodeName.toLowerCase(),a="style"===e.nodeName.toLowerCase()&&t!==e.textContent,s=n.onSuccess(t,e,r);return t=void 0!==s&&!1===Boolean(s)?"":s||t,n.updateURLs&&(o||a)&&(t=MAt(t,r)),t},onComplete:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=Wgt({},gAt.dom,gAt.user),c=!1;if(gAt.job={},a.forEach((function(t,o){var a=e[o];if(t.__cssVars=t.__cssVars||{},t.__cssVars.text=a,mAt.cssVars.test(a))try{var s=nAt(a,{preserveStatic:n.preserveStatic,removeComments:!0});rAt(s,{parseHost:Boolean(n.rootElement.host),store:gAt.dom,onWarning:i}),t.__cssVars.tree=s}catch(c){r(c.message,t)}})),Wgt(gAt.job,gAt.dom),n.updateDOM?(Wgt(gAt.user,n.variables),Wgt(gAt.job,gAt.user)):(Wgt(gAt.job,gAt.user,n.variables),Wgt(s,n.variables)),c=fAt.job>0&&Boolean(Object.keys(gAt.job).length>Object.keys(s).length||Boolean(Object.keys(s).length&&Object.keys(gAt.job).some((function(t){return gAt.job[t]!==s[t]})))),c)EAt(n.rootElement),_At(n);else{var u=[],l=[],h=!1;if(n.updateDOM&&fAt.job++,a.forEach((function(t,o){var a=!t.__cssVars.tree;if(t.__cssVars.tree)try{cAt(t.__cssVars.tree,Wgt({},n,{variables:gAt.job,onWarning:i}));var s=iAt(t.__cssVars.tree);if(n.updateDOM){var c=e[o],d=mAt.cssVarFunc.test(c);if(t.getAttribute("data-cssvars")||t.setAttribute("data-cssvars","src"),s.length&&d){var f=t.getAttribute("data-cssvars-group")||++fAt.group,p=s.replace(/\s/g,""),m=n.rootElement.querySelector('[data-cssvars="out"][data-cssvars-group="'.concat(f,'"]'))||document.createElement("style");h=h||mAt.cssKeyframes.test(s),n.preserveStatic&&t.sheet&&(t.sheet.disabled=!0),m.hasAttribute("data-cssvars")||m.setAttribute("data-cssvars","out"),p===t.textContent.replace(/\s/g,"")?(a=!0,m&&m.parentNode&&(t.removeAttribute("data-cssvars-group"),m.parentNode.removeChild(m))):p!==m.textContent.replace(/\s/g,"")&&([t,m].forEach((function(t){t.setAttribute("data-cssvars-job",fAt.job),t.setAttribute("data-cssvars-group",f)})),m.textContent=s,u.push(s),l.push(m),m.parentNode||t.parentNode.insertBefore(m,t.nextSibling))}}else t.textContent.replace(/\s/g,"")!==s&&u.push(s)}catch(g){r(g.message,t)}a&&t.setAttribute("data-cssvars","skip"),t.hasAttribute("data-cssvars-job")||t.setAttribute("data-cssvars-job",fAt.job)})),yAt=n.rootElement.querySelectorAll('[data-cssvars]:not([data-cssvars="out"])').length,n.shadowDOM)for(var d,f=[].concat(n.rootElement).concat([].slice.call(n.rootElement.querySelectorAll("*"))),p=0;d=f[p];++p)if(d.shadowRoot&&d.shadowRoot.querySelector("style")){var m=Wgt({},n,{rootElement:d.shadowRoot});_At(m)}n.updateDOM&&h&&CAt(n.rootElement),AAt=!1,n.onComplete(u.join(""),l,JSON.parse(JSON.stringify(gAt.job)),kAt()-n.__benchmark),o(l.length)}}}));else document.addEventListener("DOMContentLoaded",(function e(n){_At(t),document.removeEventListener("DOMContentLoaded",e)}))}}function xAt(t){function e(t){var e=n(t)&&t.hasAttribute("disabled"),r=(t.sheet||{}).disabled;return e||r}function n(t){var e="link"===t.nodeName.toLowerCase()&&-1!==(t.getAttribute("rel")||"").indexOf("stylesheet");return e}function r(t){return"style"===t.nodeName.toLowerCase()}function i(r){var i=!1;if("attributes"===r.type&&n(r.target)&&!e(r.target)){var o="disabled"===r.attributeName,a="href"===r.attributeName,s="skip"===r.target.getAttribute("data-cssvars"),c="src"===r.target.getAttribute("data-cssvars");o?i=!s&&!c:a&&(s?r.target.setAttribute("data-cssvars",""):c&&EAt(t.rootElement,!0),i=!0)}return i}function o(t){var e=!1;if("childList"===t.type){var n=r(t.target),i="out"===t.target.getAttribute("data-cssvars");e=n&&!i}return e}function a(t){var i=!1;return"childList"===t.type&&(i=[].slice.call(t.addedNodes).some((function(t){var i=1===t.nodeType,o=i&&t.hasAttribute("data-cssvars"),a=r(t)&&mAt.cssVars.test(t.textContent),s=!o&&(n(t)||a);return s&&!e(t)}))),i}function s(e){var n=!1;return"childList"===e.type&&(n=[].slice.call(e.removedNodes).some((function(e){var n=1===e.nodeType,r=n&&"out"===e.getAttribute("data-cssvars"),i=n&&"src"===e.getAttribute("data-cssvars"),o=i;if(i||r){var a=e.getAttribute("data-cssvars-group"),s=t.rootElement.querySelector('[data-cssvars-group="'.concat(a,'"]'));i&&EAt(t.rootElement,!0),s&&s.parentNode.removeChild(s)}return o}))),n}window.MutationObserver&&(vAt&&(vAt.disconnect(),vAt=null),vAt=new MutationObserver((function(e){var n=e.some((function(t){return i(t)||o(t)||a(t)||s(t)}));n&&_At(t)})),vAt.observe(document.documentElement,{attributes:!0,attributeFilter:["disabled","href"],childList:!0,subtree:!0}))}function SAt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;clearTimeout(bAt),bAt=setTimeout((function(){t.__benchmark=null,_At(t)}),e)}function CAt(t){var e=["animation-name","-moz-animation-name","-webkit-animation-name"].filter((function(t){return getComputedStyle(document.body)[t]}))[0];if(e){for(var n=[].slice.call(t.querySelectorAll("*")),r=[],i="__CSSVARSPONYFILL-KEYFRAMES__",o=0,a=n.length;o<a;o++){var s=n[o],c=getComputedStyle(s)[e];"none"!==c&&(s.style[e]+=i,r.push(s))}document.body.offsetHeight;for(var u=0,l=r.length;u<l;u++){var h=r[u].style;h[e]=h[e].replace(i,"")}}}function MAt(t,e){var n=t.replace(mAt.cssComments,"").match(mAt.cssUrls)||[];return n.forEach((function(n){var r=n.replace(mAt.cssUrls,"$1"),i=TAt(r,e);t=t.replace(n,n.replace(r,i))})),t}function LAt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=/^-{2}/;return Object.keys(t).reduce((function(n,r){var i=e.test(r)?r:"--".concat(r.replace(/^-+/,""));return n[i]=t[r],n}),{})}function TAt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.href,n=document.implementation.createHTMLDocument(""),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),r.href=e,i.href=t,i.href}function kAt(){return hAt&&(window.performance||{}).now?window.performance.now():(new Date).getTime()}function EAt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[].slice.call(t.querySelectorAll('[data-cssvars="skip"],[data-cssvars="src"]'));n.forEach((function(t){return t.setAttribute("data-cssvars","")})),e&&(gAt.dom={})}_At.reset=function(){for(var t in fAt.job=0,fAt.group=0,AAt=!1,vAt&&(vAt.disconnect(),vAt=null),yAt=0,bAt=null,wAt=!1,gAt)gAt[t]={}};Ugt&&Ugt[1],Qgt&&Qgt[0];var OAt="undefined"!==typeof window;OAt&&window.CSS&&window.CSS.supports&&window.CSS.supports("(--a: 0)");function PAt(t,e){if(!t)return t;var n=.65,r=Ggt()(t),i=r.getAlpha();r.setAlpha(i*e/n);var o=r.toRgbString();return o}var BAt,IAt,DAt={name:"Theme",props:{background:String,textColor:String,colorGroup:Array},data:function(){return{backgroundData:"",textColorsData:"",collapseCardBackgroundData:"",collapseCardHeaderBgData:"",tablePopupBgData:"",colorGroupsData:[]}},created:function(){this.initThemeData(),this.registerPropListener()},mounted:function(){var t=this;Vgt.$on("change-theme",(function(e){var n=t.getSelfProps();n.forEach((function(n){var r=t.getDataNameOfProp(n);t[r]=e[n]})),t.collapseCardHeaderBgData=e["collapseCardHeaderBg"],t.collapseCardBackgroundData=e["collapseCardBackground"],t.tablePopupBgData=e["messageBackground"],t.$emit("themeStyleChanged")}))},methods:{getBackgroundStyle:function(){return{background:this.backgroundData}},collapseCardBackgroundStyle:function(){return{background:this.collapseCardBackgroundData}},collapseCardHeaderBgStyle:function(){return{background:this.collapseCardHeaderBgData}},tablePopupBgStyle:function(){return{background:this.tablePopupBgData}},getTextColorStyle:function(){return{color:this.textColorsData}},headingTextColorStyle:function(){return{color:PAt(this.textColorsData,.85)}},secondaryTextColorStyle:function(){return{color:PAt(this.textColorsData,.45)}},disabledTextColorStyle:function(){return{color:PAt(this.textColorsData,.25)}},getBackground:function(){return this.backgroundData},getTextColor:function(){return this.textColorsData},getColorStyle:function(){return function(t){return{color:this.colorGroupsData[t]}}},getColor:function(){return function(t){return this.colorGroupsData[t]}},initThemeData:function(){var t=this,e=Vgt.$options.theme||{},n=this.getSelfProps();n.forEach((function(n){var r=t.getDataNameOfProp(n);t[r]=t[n]||e[n]})),this.collapseCardHeaderBgData=this.background||e["collapseCardHeaderBg"],this.collapseCardBackgroundData=this.background||e["collapseCardBackground"],this.tablePopupBgData=this.background||e["messageBackground"]},registerPropListener:function(){var t=this,e=Vgt.$options.theme||{},n=this,r=this.getSelfProps();r.forEach((function(r){t.$watch(r,(function(t){var i=this.getDataNameOfProp(r);n[i]=t,"background"===r&&(n.collapseCardBackgroundData=t||e["collapseCardBackground"],n.collapseCardHeaderBgData=t||e["collapseCardHeaderBg"],n.tablePopupBgData=t||e["messageBackground"])}))}))},getSelfProps:function(){return Object.keys(this.$props)},getDataNameOfProp:function(t){switch(t){case"textColor":return"textColorsData";case"colorGroup":return"colorGroupsData";default:return"".concat(t,"Data")}}}},NAt={closable:kgt.bool.def(!0),destroyOnClose:kgt.bool,getContainer:kgt.any,maskClosable:kgt.bool.def(!0),mask:kgt.bool.def(!0),maskStyle:kgt.object,wrapStyle:kgt.object,bodyStyle:kgt.object,headerStyle:kgt.object,drawerStyle:kgt.object,title:kgt.any,visible:kgt.bool,width:kgt.oneOfType([kgt.string,kgt.number]).def(256),height:kgt.oneOfType([kgt.string,kgt.number]).def(256),zIndex:kgt.number,prefixCls:kgt.string,placement:kgt.oneOf(["top","right","bottom","left"]).def("right"),level:kgt.any.def(null),wrapClassName:kgt.string,handle:kgt.any,afterVisibleChange:kgt.func,keyboard:kgt.bool.def(!0)},FAt={name:"mapgis-ui-drawer",wrapperUI:lgt,mixins:[zgt,DAt],inheritAttrs:!1,props:NAt,methods:{}},jAt=FAt,RAt=je(jAt,BAt,IAt,!1,null,null,null);RAt.exports;function HAt(t){return HAt="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},HAt(t)}function zAt(t){return GAt(t)||YAt(t)||VAt(t)||UAt()}function UAt(){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 VAt(t,e){if(t){if("string"==typeof t)return QAt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?QAt(t,e):void 0}}function YAt(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function GAt(t){if(Array.isArray(t))return QAt(t)}function QAt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function WAt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */WAt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof A?e:A,a=Object.create(o.prototype),s=new E(r||[]);return i(a,"_invoke",{value:M(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function A(){}function v(){}function y(){}var b={};u(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(O([])));_&&_!==n&&r.call(_,a)&&(b=_);var x=y.prototype=A.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(i,o,a,s){var c=h(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==HAt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function M(e,n,r){var i=d;return function(o,a){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var u=h(e,n,r);if("normal"===u.type){if(i=r.done?m:f,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(HAt(e)+" is not iterable")}return v.prototype=y,i(x,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(C.prototype),u(C.prototype,s,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new C(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),u(x,c,"Generator"),u(x,a,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function KAt(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function qAt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){KAt(o,r,i,a,s,"next",t)}function s(t){KAt(o,r,i,a,s,"throw",t)}a(void 0)}))}}function XAt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $At(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?XAt(Object(n),!0).forEach((function(e){JAt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):XAt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function JAt(t,e,n){return(e=ZAt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ZAt(t){var e=tvt(t,"string");return"symbol"==HAt(e)?e:e+""}function tvt(t,e){if("object"!=HAt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=HAt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var evt={type:"FeatureCollection",dataCount:2,features:[{type:"Feature",properties:{oid:1,AREA:0}},{type:"Feature",properties:{oid:2,AREA:1}}]},nvt={name:"mapgis-3d-explosion-analysis",inject:["Cesium","vueCesium","viewer"],mixins:[Tr],props:$At($At({},ln),{},{layout:{type:String,default:"vertical"},models:{type:Array,default:function(){return[]}},setting:{type:Object,default:function(){return{groupType:"MapgisUiExplosionUnique",explosionField:"oid",distance:1}}}}),computed:{rangeFormOptions:function(){return[{id:this.vueIndex,type:this.settingCopy.groupType,props:{size:"small",field:this.settingCopy.explosionField,dataSource:this.dataSource||evt,segments:this.segments},customProps:{showBorder:!1}}]}},data:function(){return{settingCopy:{groupType:"MapgisUiExplosionUnique",explosionField:"oid",distance:1e3},groupTypes:[{label:"单值",value:"MapgisUiExplosionUnique"},{label:"分段",value:"MapgisUiExplosionRange"}],currentModelId:void 0,explosionFields:[],dataSource:void 0,openAdvancedSetting:!1,disableGroupTypeChange:!1,segments:5,info:"爆炸距离默认值为模型包围盒高度/2。爆炸方向默认为垂直方向。要素平移距离默认值=(要素中心点高程-索引号最小的要素中心点高程)*爆炸距离。"}},watch:{models:{handler:function(t){this.currentModelId=void 0},deep:!0},setting:{handler:function(t){this.settingCopy=JSON.parse(JSON.stringify(t))},deep:!0,immediate:!0}},created:function(){},mounted:function(){this.mount()},destroyed:function(){this.unmount()},methods:{createCesiumObject:function(){var t=qAt(WAt().mark((function t(){return WAt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.baseUrl,this.options,t.abrupt("return",new Promise((function(t){t()}),(function(t){})));case 2:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),mount:function(){this.Cesium,this.viewer;var t=this.vueCesium,e=this.vueKey,n=this.vueIndex,r=this,i=this.createCesiumObject();i.then((function(i){r.$emit("load",r),t.ExplosionManager.addSource(e,n,i,{modelExplosionTool:void 0,m3dSet:void 0})}))},unmount:function(){this.removeExplosion();var t=this.vueCesium,e=this.vueKey,n=this.vueIndex;t.ExplosionManager.findSource(e,n);t.ExplosionManager.deleteSource(e,n),this.$emit("unload",this)},_m3dIsReady:function(){var t=this,e=this.vueKey,n=this.currentModelId;return new Promise((function(r,i){n.length>0?t.$_getAll3DTileSetArray((function(t){t&&t.length>0?r(t):i(null)}),e,n):i(null)}))},onExplosionFieldChange:function(t){if(this.explosionFields){var e=this.explosionFields.find((function(e){return e.name===t})),n=e.type;this.dataSource.dataCount<3||"string"===n.toLowerCase()?this.disableGroupTypeChange=!0:this.disableGroupTypeChange=!1}},onSelectedModelChange:function(t){var e=this,n=this.Cesium,r=this.vueCesium,i=this.vueKey,o=this.vueIndex;this.removeExplosion(),r.ExplosionManager.changeOptions(i,o,"modelExplosionTool",void 0),r.ExplosionManager.changeOptions(i,o,"m3dSet",void 0),this.currentModelId=t;var a=this.models.find((function(e){return e.id===t})),s=a.url,c=a.searchParams;if(c&&c.searchName){var u=new URL(s),l=u.origin;this.getFields({domain:l,searchParams:c})}this._m3dIsReady().then((function(t){if(t&&t.length>0){var a=new n.ModelExplosion(viewer);r.ExplosionManager.changeOptions(i,o,"modelExplosionTool",a),r.ExplosionManager.changeOptions(i,o,"m3dSet",t);var s=t[0],c=s._root.boundingVolume.minimumHeight,u=s._root.boundingVolume.maximumHeight;e.settingCopy.distance=Math.ceil((u-c)/2),e.getDataSource()}}))},getM3DFeatures:function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(r.children&&r.children.length>0){var i=this.getM3DFeatures(r.children);e=[].concat(zAt(e),zAt(i))}else for(var o=r.content._attMap._obj,a=r._boundingVolume.minimumHeight,s=r._boundingVolume.maximumHeight,c=Object.keys(o),u=0;u<c.length;u++){var l={type:"Feature",id:c[u],centerHeight:(a+s)/2,properties:o[c[u]]};e.push(l)}}return e},getFields:function(){var t=qAt(WAt().mark((function t(e){var n,r,i,o,a;return WAt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.domain,r=e.searchParams,i=r.searchName,r.searchServiceType,o={domain:n,url:i,pageCount:99999,page:0,returnGeometry:!0},t.next=6,Kf.igsQueryResourceServer(o);case 6:return this.geoJSONData=t.sent,a=this.geoJSONData.fields,this.explosionFields=a,this.settingCopy.explosionField=a[0].name,this.getDataSource(),this.onExplosionFieldChange(a[0].name),t.abrupt("return",a);case 13:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),getDataSource:function(){var t,e=this,n=this.vueCesium,r=this.vueKey,i=this.vueIndex,o=n.ExplosionManager.findSource(r,i);o&&o.options&&(t=o.options.m3dSet);var a=this.models.find((function(t){return t.id===e.currentModelId})),s=a.searchParams;if((!s||!s.searchName)&&t&&t.length>0){var c=t[0],u=this.getM3DFeatures(c._root.children);u.sort((function(t,e){return t.id-e.id}));for(var l=0,h=[],d=[],f=0;f<u.length;f++){var p=u[f],m=void 0;if(0===f){l=p.centerHeight,m="0, 0, 0";for(var g=p.properties,A=Object.keys(g),v=0;v<A.length;v++){var y={type:HAt(g[A[v]]),name:A[v]};d.push(y)}}else m="0,0,".concat((p.centerHeight-l)*this.settingCopy.distance);h.push({type:p.type,properties:p.properties,direction:m,id:p.id})}this.dataSource={type:"FeatureCollection",dataCount:h.length,features:h},JSON.stringify(this.explosionFields)!==JSON.stringify(d)&&(this.explosionFields=d,this.settingCopy.explosionField=d[0].name,this.onExplosionFieldChange(this.explosionFields[0].name))}else if(this.geoJSONData){var b=this.geoJSONData.features,w=[],_=0;b[0].attributes&&b[0].attributes.FID&&b.sort((function(t,e){return t.attributes.FID-e.attributes.FID}));for(var x=0;x<b.length;x++){var S=b[x],C=S.attributes,M=S.bound,L=M.zmin,T=M.zmax,k=void 0,E=(L+T)/2;if(0===x)_=E,k="0, 0, 0";else{var O=Number((E-_).toFixed(2));0===O&&(O=.1),k="0,0,".concat(O*this.settingCopy.distance)}w.push({type:"Feature",properties:C,bound:M,direction:k,id:void 0!==C.FID?C.FID:x})}this.dataSource={type:"FeatureCollection",dataCount:b.length,features:w}}},explosion:function(){var t,e,n=this,r=(this.Cesium,this.vueCesium),i=this.vueKey,o=this.vueIndex,a=this.settingCopy,s=(a.groupType,a.explosionField,r.ExplosionManager.findSource(i,o));if(s&&s.options&&(t=s.options.modelExplosionTool,e=s.options.m3dSet),e&&e.length>0){var c=n.getValueGroups();t.explosionByField(e,{valueGroups:c,type:"unique",field:"oid",singleDirection:!1,enableFrameFunction:!0})}},getValueGroups:function(){var t=[],e=this.$refs.rangeForm.$_getForm(),n=e[this.vueIndex],r=this.settingCopy.explosionField,i=[];if("MapgisUiExplosionRange"===this.settingCopy.groupType){for(var o=this.dataSource.features,a=0;a<o.length;a++)if(""!==o[a].properties[r]&&null!==o[a].properties[r]&&void 0!==o[a].properties[r]){var s={};s[r]=o[a].properties[r],s.direction=o[a].direction,s.id=o[a].id,i.push(s)}i.sort((function(t,e){return t[r]-e[r]}))}for(var c=0;c<n.length;c+=1){var u=n[c].direction,l=u.split(",");switch(u=new Cesium.Cartesian3(Number(l[0]),Number(l[1]),Number(l[2])),this.settingCopy.groupType){case"MapgisUiExplosionUnique":var h=Number(n[c].id);t.push({value:h,direction:u});break;case"MapgisUiExplosionRange":for(var d=n[c],f=d.start,p=d.end,m=0;m<i.length;m++)if(i[m][r]>=f&&i[m][r]<=p){var g=i[m].id;t.push({value:g,direction:u})}break;default:break}}return t},removeExplosion:function(){var t,e=this.vueCesium,n=this.vueKey,r=this.vueIndex,i=e.ExplosionManager.findSource(n,r);i&&i.options&&i.options.modelExplosionTool&&(t=i.options.modelExplosionTool,t._fieldM3DSets&&t._fieldM3DSets.length>0&&t._fieldM3DSets[0].ready&&t.resetExplosionByField())}}},rvt=nvt,ivt=(n("1e63"),je(rvt,xft,Sft,!1,null,"013f7460",null)),ovt=ivt.exports,avt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._t("default",(function(){return[n("div",{staticClass:"mapgis-widget-excavate-analysis"},[n("mapgis-ui-row",{staticClass:"model"},[t.checkboxOptions.length>0?n("mapgis-ui-checkbox-group",{model:{value:t.checked,callback:function(e){t.checked=e},expression:"checked"}},t._l(t.checkboxOptions,(function(e,r){return n("mapgis-ui-row",{key:"model-"+r},[n("mapgis-ui-checkbox",{staticStyle:{"line-height":"32px"},attrs:{value:e.value}},[t._v("\n "+t._s(e.label)+"\n ")])],1)})),1):n("div",[t._v("暂无数据!")])],1),n("mapgis-ui-form-item",{attrs:{label:"剖面纹理"}},[n("mapgis-ui-select",{staticClass:"mapgis-3d-fill-image mapgis-3d-select",attrs:{autoWidth:!0,size:"default",placeholder:"请选择纹理"},model:{value:t.selectTerrainWall,callback:function(e){t.selectTerrainWall=e},expression:"selectTerrainWall"}},t._l(t.terrainWallFillImages,(function(e,r){return n("mapgis-ui-select-option",{key:r,attrs:{value:e.value}},[t._v(t._s(e.label))])})),1)],1),n("mapgis-ui-form-item",{attrs:{label:"底面纹理"}},[n("mapgis-ui-select",{staticClass:"mapgis-3d-fill-image mapgis-3d-select",attrs:{autoWidth:!0,size:"default",placeholder:"请选择纹理"},model:{value:t.selectTerrainGround,callback:function(e){t.selectTerrainGround=e},expression:"selectTerrainGround"}},t._l(t.terrainGroundFillImages,(function(e,r){return n("mapgis-ui-select-option",{key:r,attrs:{value:e.value}},[t._v(t._s(e.label))])})),1)],1),n("mapgis-ui-input-number-panel",{staticClass:"mapgis-excavate-form",attrs:{size:"large",label:"开挖深度(米)",range:[0,2e3]},model:{value:t.excavateDepth,callback:function(e){t.excavateDepth=e},expression:"excavateDepth"}}),n("mapgis-ui-input-number-panel",{staticClass:"mapgis-excavate-form",attrs:{size:"large",label:"开挖精度",range:[1,100]},model:{value:t.samplePrecision,callback:function(e){t.samplePrecision=e},expression:"samplePrecision"}}),n("mapgis-ui-switch-panel",{attrs:{label:"开启模型封边",size:"default"},model:{value:t.useModelFill,callback:function(e){t.useModelFill=e},expression:"useModelFill"}}),n("mapgis-ui-setting-footer",[n("mapgis-ui-button",{attrs:{type:"primary"},on:{click:t.analysis}},[t._v("分析")]),n("mapgis-ui-button",{on:{click:t.removeCuttingPlane}},[t._v("清除")])],1)],1)]})),n("mapgis-ui-mask",{attrs:{parentDivClass:"cesium-map-wrapper",loading:t.maskShow,text:t.maskText,showSvg:!0}})],2)},svt=[];function cvt(t){return cvt="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},cvt(t)}function uvt(t){return fvt(t)||dvt(t)||hvt(t)||lvt()}function lvt(){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 hvt(t,e){if(t){if("string"==typeof t)return pvt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pvt(t,e):void 0}}function dvt(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function fvt(t){if(Array.isArray(t))return pvt(t)}function pvt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function mvt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */mvt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof A?e:A,a=Object.create(o.prototype),s=new E(r||[]);return i(a,"_invoke",{value:M(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function A(){}function v(){}function y(){}var b={};u(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(O([])));_&&_!==n&&r.call(_,a)&&(b=_);var x=y.prototype=A.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(i,o,a,s){var c=h(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==cvt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function M(e,n,r){var i=d;return function(o,a){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var u=h(e,n,r);if("normal"===u.type){if(i=r.done?m:f,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(cvt(e)+" is not iterable")}return v.prototype=y,i(x,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(C.prototype),u(C.prototype,s,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new C(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),u(x,c,"Generator"),u(x,a,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function gvt(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Avt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){gvt(o,r,i,a,s,"next",t)}function s(t){gvt(o,r,i,a,s,"throw",t)}a(void 0)}))}}function vvt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yvt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vvt(Object(n),!0).forEach((function(e){bvt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vvt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function bvt(t,e,n){return(e=wvt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wvt(t){var e=_vt(t,"string");return"symbol"==cvt(e)?e:e+""}function _vt(t,e){if("object"!=cvt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=cvt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var xvt={name:"mapgis-3d-excavate-analysis",inject:["Cesium","vueCesium","viewer"],mixins:[Tr],props:yvt(yvt({},ln),{},{models:{type:Array,default:function(){return[]}},terrainGroundFillImages:{type:Array,default:function(){return[]}},terrainWallFillImages:{type:Array,default:function(){return[]}},modelFillImage:{type:String,default:""}}),watch:{models:{handler:function(t){var e=this;if(this.checkboxOptions=[],this.vueIndexs=[],this.layerIndexs=[],t.length>0){var n=t[t.length-1];this.checkboxOptions.find((function(t){return t.value===n.vueIndex}))||this.checked.includes(n.vueIndex)||this.checked.push(n.vueIndex),t.forEach((function(t){var n=t.title,r=t.vueIndex,i={label:n,value:r};e.checkboxOptions.push(i)}))}},deep:!0,immediate:!0}},data:function(){return{useModelFill:!0,maskText:"正在分析中, 请稍等...",maskShow:!1,samplePrecision:10,excavateDepth:100,checkboxOptions:[],checked:[],pnts:[],selectTerrainGround:"",selectTerrainWall:"",isDepthTestAgainstTerrainEnable:void 0}},computed:{samplePrecisionComputed:function(){var t=50;return t/this.samplePrecision}},mounted:function(){this.mount()},destroyed:function(){this.unmount()},methods:{m3dIsReady:function(){var t=this,e=this.vueKey,n=this.checked;return new Promise((function(r,i){n.length>0?t.$_getAll3DTileSetArray((function(t){t&&t.length>0?r(t):i(null)}),e,n):i(null)}))},_restoreCesiumSetting:function(){void 0!==this.isDepthTestAgainstTerrainEnable&&this.isDepthTestAgainstTerrainEnable!==I(this.viewer)&&D(this.isDepthTestAgainstTerrainEnable,this.viewer)},mount:function(){this.viewer;var t=this.vueCesium,e=this.vueKey,n=this.vueIndex;this.isDepthTestAgainstTerrainEnable=I(this.viewer),this.isDepthTestAgainstTerrainEnable||D(!0,this.viewer);var r=this,i=Promise.resolve();i.then((function(i){r.$emit("load",r),t.ExcavateAnalysisManager.addSource(e,n,i,{drawElement:null,cutTool:null})}))},unmount:function(){this.removeCuttingPlane(),this._restoreCesiumSetting()},getCutLayers:function(){var t=Avt(mvt().mark((function t(){var e;return mvt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,!this.models||!this.models.length){t.next=6;break}return t.next=4,this.m3dIsReady();case 4:return e=t.sent,t.abrupt("return",e);case 6:return t.abrupt("return",[]);case 9:return t.prev=9,t.t0=t["catch"](0),t.abrupt("return",[]);case 12:case"end":return t.stop()}}),t,this,[[0,9]])})));function e(){return t.apply(this,arguments)}return e}(),analysis:function(){var t=Avt(mvt().mark((function t(){var e,n,r,i,o,a,s,c,u,l,h;return mvt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=this.vueCesium,n=this.vueKey,r=this.vueIndex,i=this.Cesium,o=this.viewer,a=e.ExcavateAnalysisManager.findSource(n,r),s=a||{},c=s.options,u=c||{},l=u.cutTool,h=u.drawElement,h=h||new i.DrawElement(o),e.ExcavateAnalysisManager.changeOptions(n,r,"drawElement",h),this.removeCuttingPlane(),t.next=9,this.getCutLayers();case 9:this.m3dLayers=t.sent,l=new i.CuttingTool(o,uvt(this.m3dLayers),{isCuttingTerrain:!0,onErrorCallback:function(t,e){console.warn("错误信息:"+t+":"+e)}}),this.drawTerrainPolygon(h,l),e.ExcavateAnalysisManager.changeOptions(n,r,"cutTool",l);case 13:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),drawPolygonCallBack:function(){var t=Avt(mvt().mark((function t(e,n,r){var i,o,a,s,c,u,l,h,d;return mvt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:for(t.prev=0,i=this.Cesium,o=e.positions,this.pnts=[],a=[],s=0;s<o.length;s++)c=o[s],u=i.Cartographic.fromCartesian(c),a.push(u),l=new i.Cartesian3(i.Math.toDegrees(u.longitude),i.Math.toDegrees(u.latitude),u.height),this.pnts.push(l);if(h=this.prepareWell(uvt(o),this.samplePrecisionComputed),this.m3dLayers&&this.m3dLayers.length&&this.useModelFill&&(this.sampledPositions=this.getModelSampleHeight(h)),d=0,!viewer.terrainProvider._layers){t.next=13;break}return t.next=12,this.getTerrainSampleHeight(a);case 12:d=t.sent;case 13:this.createTerrainCuttingVolume(r,d),n.stopDrawing(),this.maskShow=!1,t.next=21;break;case 18:t.prev=18,t.t0=t["catch"](0),console.warn(t.t0);case 21:case"end":return t.stop()}}),t,this,[[0,18]])})));function e(e,n,r){return t.apply(this,arguments)}return e}(),drawTerrainPolygon:function(t,e){var n=this;t.startDrawingPolygon({callback:function(r){n.maskShow=!0,requestAnimationFrame((function(){requestAnimationFrame((function(){return n.drawPolygonCallBack(r,t,e)}))}))}})},removeCuttingPlane:function(){var t=this.vueCesium,e=this.vueKey,n=this.vueIndex,r=this.viewer,i=t.ExcavateAnalysisManager.findSource(e,n),o=i||{},a=o.options,s=a||{},c=s.cutTool,u=s.drawElement;r.scene.primitives.remove(this.wallSpace),c&&c.removeAll(),u&&u.stopDrawing()},createTerrainCuttingVolume:function(t,e){if(!t)return!1;var n=-1*(this.excavateDepth-e),r={unionClippingRegions:!0,showCuttingPlane:!1,getCoordinates:this.getCoordinates,samplePrecision:this.samplePrecisionComputed};this.selectTerrainWall&&(r.terrainWallFillImage=this.selectTerrainWall),this.selectTerrainGround&&(r.terrainGroundFillImage=this.selectTerrainGround);var i=5e3;t.createModelCuttingVolume(this.pnts,n,i,r)},prepareWell:function(t,e){var n=this.Cesium,r=t.length;if(r>0){for(var i=[],o=0;o<r;o++){var a=o==r-1?0:o+1,s=n.Cartographic.fromCartesian(t[o]),c=n.Cartographic.fromCartesian(t[a]),u=[s.longitude,s.latitude],l=[c.longitude,c.latitude];0==o&&i.push(n.Cartesian3.fromRadians(u[0],u[1],0));for(var h=n.Cartesian3.distance(t[o],t[a]),d=Math.ceil(h/e),f=1;f<=d;f++){var p=n.Math.lerp(u[0],l[0],f/d),m=n.Math.lerp(u[1],l[1],f/d);o==r-1&&f==d||i.push(n.Cartesian3.fromRadians(p,m,0))}}return i}},getTerrainSampleHeight:function(){var t=Avt(mvt().mark((function t(e){var n,r,i,o;return mvt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=this.Cesium,r=this.viewer,t.next=3,n.sampleTerrainMostDetailed(r.terrainProvider,e);case 3:return i=t.sent,o=i.reduce((function(t,e){return t+e.height}),0),t.abrupt("return",o/i.length);case 6:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),getModelSampleHeight:function(t){for(var e=this.Cesium,n=this.viewer,r=t.map((function(t){var n=e.Cartographic.fromCartesian(t);return n})),i=[],o=0;o<r.length;o++)r[o].height=n.scene.sampleHeight(r[o]),i.push(r[o].clone());return i},getCoordinates:function(t){this.m3dLayers&&this.m3dLayers.length&&this.useModelFill&&this.createWellWall(t,this.sampledPositions)},createWellWall:function(t,e){if(t.length){for(var n=this.Cesium,r=this.viewer,i=[],o=[],a=[],s=0;s<e.length;s++){var c=e[s];if(c.height){var u=n.Cartesian3.fromRadians(c.longitude,c.latitude,c.height),l=n.Cartographic.fromCartesian(t[s]);a.push(u),i.push(c.height),o.push(l.height)}}var h=new n.WallGeometry({positions:a,maximumHeights:i,minimumHeights:o}),d=n.WallGeometry.createGeometry(h),f=new n.Material({fabric:{materials:{diffuseMaterial:{type:"DiffuseMap",uniforms:{image:this.modelFillImage}}},components:{diffuse:"diffuseMaterial.diffuse"}}}),p=new n.MaterialAppearance({translucent:!1,flat:!0,material:f,faceForward:!0,closed:!1}),m=new n.Primitive({geometryInstances:new n.GeometryInstance({geometry:d,attributes:{color:n.ColorGeometryInstanceAttribute.fromColor(n.Color.GREY)}}),appearance:p,asynchronous:!1});this.wallSpace=r.scene.primitives.add(m)}}}},Svt=xvt,Cvt=(n("33ab"),je(Svt,avt,svt,!1,null,"6b26a23e",null)),Mvt=Cvt.exports,Lvt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span")},Tvt=[],kvt={inject:["Cesium","vueCesium","viewer"],props:{vueKey:{type:String,default:"default"},vueIndex:{type:Number,default:function(){return Number((1e8*Math.random()).toFixed(0))}}},data:function(){return{waitManagerName:void 0}},methods:{$_init:function(t){var e=this,n=setInterval((function(){var r=e.$_getObject();r&&(clearInterval(n),t&&t())}),50)},$_getObject:function(t,e){var n,r=this.waitManagerName;if(t&&(r=t),"GlobesManager"===r){var i=this.viewer;if("default"===this.vueKey)n=i;else{var o=window.vueCesium.GlobesManager;o[this.vueKey]&&(n=o[this.vueKey][0].source)}}else n=window.vueCesium[r].findSource(this.vueKey,this.vueIndex);return e&&e(n),n},$_deleteManger:function(t,e){var n=this.vueKey,r=this.vueIndex,i=window.vueCesium[t].findSource(n,r);i&&(e(i),window.vueCesium[t].deleteSource(n,r))}}},Evt={name:"mapgis-3d-component-mix",inject:["Cesium","vueCesium","viewer"],mixins:[kvt],props:{geoJson:{type:Object},vueKey:{type:String,default:"default"},vueIndex:{type:[String,Number],default:function(){return(1e8*Math.random()).toFixed(0)}},url:{type:[String,Object],required:!0},options:{type:Object},layerStyle:{type:Object},ruleJson:{type:Object},activeTitle:{type:Array},highLight:{},activeCircle:{type:Boolean,default:!1}},data:function(){return{waitManagerName:"M3DIgsManager",legend:"",position:{longitude:0,latitude:0,height:0},current:{feature:void 0,originalColor:new Cesium.Color},handlerAction:void 0}},created:function(){},mounted:function(){var t=this;this.$_init(t.mount)},destroyed:function(){this.unmount()},watch:{activeTitle:function(t){t&&this.changeColor(t)},highLight:function(t){t&&this.highlightColor(t)}},methods:{createCesiumObject:function(){var t=this.url;return new Cesium.GeoJsonDataSource.load(t)},findSource:function(){var t=this.vueKey,e=this.vueIndex,n=-1,r=window.CesiumZondy.GeojsonManager[t].find((function(t,r){var i=!1;return!t||t.key!==e&&t.key!=="".concat(e)||(n=r,i=!0),i})),i=r?r.source:void 0;return{index:n,source:i}},mount:function(){var t=this,e=this.viewer,n=(this.options,this.layerStyle,this.ruleJson),r=(this.url,this.vueKey),i=this.vueIndex,o=this.activeCircle,a=e.dataSources,s=(e.scene,this.createCesiumObject());s.then((function(e){if(o){var s=t.intersect(e),c=new Cesium.GeoJsonDataSource.load(s);c.then((function(t){a.add(t).then((function(){window.CesiumZondy.GeojsonManager.addSource(r,i,t.entities.values,{outline:void 0,rule:n})}))}))}else a.add(e).then((function(){window.CesiumZondy.GeojsonManager.addSource(r,i,e.entities.values,{outline:void 0,rule:n})}))})),t.pickModel()},unmount:function(){var t=this.viewer,e=this.vueKey,n=this.vueIndex;console.log("vueKey",e,n);var r=t.dataSources,i=(t.scene,window.CesiumZondy.GeojsonManager.findSource(e,n));i&&r&&(r.remove(i.source,!0),t.entities.remove(i.options.outline)),window.CesiumZondy.GeojsonManager.deleteSource(e,n),this.$emit("unload",this.layer)},initColor:function(){var t=this.findSource();if(t&&t.source)for(var e=t.source,n=this.options,r=this.ruleJson,i=this.layerStyle,o=n.type,a=(n.clampToGround,i.width,i.alpha),s=function(){var t=e[c];if(!o)return 1;if("Polygon"===o){var n=t.properties.地类名称._value;t.name=n;for(var i=0;i<r.rule.length;i++){var s=r.rule[i].color,u=r.rule[i].rule,l=u.find((function(t){return t.name===n}));if(l){var h=new Cesium.Color.fromCssColorString(s).withAlpha(a);t.polygon.material=h}}}},c=0;c<e.length;c++)s()},changeColor:function(t){var e=this.findSource();if(e&&e.source){e.options&&e.options.popup&&this.viewer.entities.remove(e.options.popup);for(var n=e.source,r=this.options,i=(this.ruleJson,this.layerStyle),o=(r.outlineColor,r.type),a=(r.glowPower,r.taperPower,r.clampToGround),s=(i.width,i.alpha),c=0;c<n.length;c++){var u=n[c];if(o)if("LineString"===o);else if("Polygon"===o){u.polygon.height=void 0;for(var l=u.properties.地类名称._value,h=!1,d=0;d<t.length;d++)if(t[d].name===l){h=!0,u.name=l;var f=t[d].color;if(f){var p=new Cesium.Color.fromCssColorString(f).withAlpha(s);u.polygon.material=p,u.polygon.outlineColor=p}a&&(u.polygon.clampToGround=a,u.polygon.classificationType=Cesium.ClassificationType.BOTH);break}if(!h){var m="#000000";u.polygon.material=new Cesium.Color.fromCssColorString(m).withAlpha(0)}}}}},pickModel:function(){var t=this,e=this.viewer;this.handlerAction=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.handlerAction.setInputAction((function(e){t.highlightPicking}),Cesium.ScreenSpaceEventType.LEFT_CLICK),new CesiumZondy.Manager.AnalysisManager({viewer:e})},highlightPicking:function(t){var e=this,n=this.viewer,r=this.vueKey,i=this.vueIndex,o=n.scene.pick(t.position);if(Cesium.defined(e.current.feature)&&e.current.feature!==o){var a=window.CesiumZondy.GeojsonManager.findSource(r,i);if(n.entities.remove(a.options.popup),a.options.id&&a.options.originColor)for(var s=a.source,c=0;c<s.length;c++){var u=s[c];u.id===a.options.id&&a.options.name===u.properties.地类名称._value&&(u.polygon.material.color=a.options.originColor)}e.current.feature=void 0}if(Cesium.defined(o)&&e.current.feature!==o){var l;e.current.feature=o,l=[e.current.feature.id];var h,d=l[0].name,f=l[0].id,p=window.CesiumZondy.GeojsonManager.findSource(r,i);if(p&&p.source)for(var m=p.source,g=0;g<m.length;g++){var A=m[g],v=A.properties.地类名称._value;if(v===d&&f===A.id){h=A.polygon.material.color;var y=new Cesium.Color(1,0,0,.8);A.polygon.material=y;for(var b=A.polygon.hierarchy._value.positions,w=[],_=0;_<b.length;_++){var x=[],S=Cesium.Cartographic.fromCartesian(b[_]),C=Cesium.Math.toDegrees(S.longitude),M=Cesium.Math.toDegrees(S.latitude);x.push(C),x.push(M),w.push(x)}w=Yn["polygon"]([w]);var L=Yn["area"](w),T=Yn["center"](w),k=T.geometry.coordinates;e.position.longitude=k[0],e.position.latitude=k[1],e.position.height=L<1e5?4*Math.log(L):20*Math.log(L);var E=parseInt(L).toString(),O=E.length;if(O>3){var P=O%3;E=P>0?E.slice(0,P)+","+E.slice(P,O).match(/\d{3}/g).join(","):E.slice(P,O).match(/\d{3}/g).join(",")}console.log("viewer.entities",n.entities);var B=n.entities.add({position:Cesium.Cartesian3.fromDegrees(e.position.longitude,e.position.latitude,e.position.height),label:{text:"地块名称:"+v+"\r\n地块面积:"+E+"m²",showBackground:!0,font:"16px bold 微软雅黑",backgroundColor:Cesium.Color.GREY.withAlpha(.7),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,show:!0},polyline:{positions:[Cesium.Cartesian3.fromDegrees(e.position.longitude,e.position.latitude,0),Cesium.Cartesian3.fromDegrees(e.position.longitude,e.position.latitude,e.position.height)],material:Cesium.PolylineGlowMaterialProperty({color:Cesium.Color.GREY,dashLength:32})}});window.CesiumZondy.GeojsonManager.deleteSource(r,i),window.CesiumZondy.GeojsonManager.addSource(r,i,m,{popup:B,originColor:h,id:f,name:v})}}}},intersect:function(t){var e=this,n=e.$_getObject(e.waitManagerName),r=n.source[0].boundingSphere.center,i=[],o=Cesium.Cartographic.fromCartesian(r);i.push(Cesium.Math.toDegrees(o.longitude)),i.push(Cesium.Math.toDegrees(o.latitude));for(var a=1,s={steps:64,units:"kilometers"},c=Yn["circle"](i,a,s),u=t.entities.values,l={type:"FeatureCollection",features:[]},h=[],d=0;d<u.length;d++){for(var f=u[d].polygon.hierarchy._value.positions,p=[],m=0;m<f.length;m++){var g=[],A=Cesium.Cartographic.fromCartesian(f[m]),v=Cesium.Math.toDegrees(A.longitude),y=Cesium.Math.toDegrees(A.latitude);g.push(v),g.push(y),p.push(g)}var b=Yn["polygon"]([p]);if(Yn["intersect"](c,b)){var w=Yn["intersect"](c,b);w.properties=u[d].properties,l.features.push(w),"Polygon"===w.geometry.type||w.geometry.type}h.push(p)}return l}}},Ovt=Evt,Pvt=(n("00cf"),je(Ovt,Lvt,Tvt,!1,null,"532f842c",null)),Bvt=Pvt.exports,Ivt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{directives:[{name:"show",rawName:"v-show",value:!0===t.viewInfo,expression:"viewInfo === true"}],staticClass:"chart-legend-wrapper"},[n("div",{staticClass:"header"},[n("div",{staticClass:"buttons"},[t._v("图例信息")]),n("mapgis-ui-icon",{staticClass:"header-close",attrs:{type:"close"},on:{click:t.handleClose}})],1),n("div",{staticClass:"area-count"},[t._v("面积:"+t._s(t.allAreaString)+" ㎡")]),t.showtab?n("div",{staticClass:"legend-tabs-wrapper"},[n("span",{staticClass:"legend-tabs-scoll",on:{mousedown:function(e){return t.scrollTab("left")}}},[t._v(t._s(t.lefttab))]),n("div",{ref:"scrolltab",staticClass:"legend-tabs-content"},t._l([{name:"全部"}].concat(t.echartdata.series),(function(e,r){return n("div",{key:e.name,staticClass:"area-tab"},[n("div",{class:{"area-tab-name":!0,active:r-1===t.curindex},on:{click:function(e){t.curindex=r-1}}},[t._v("\n "+t._s(e.name)+"\n ")])])})),0),n("span",{staticClass:"legend-tabs-scoll",on:{mousedown:function(e){return t.scrollTab("right")}}},[t._v(t._s(t.righttab))])]):t._e(),n("div",{staticClass:"legend-check-groups"},[n("div",{staticClass:"legend-check-group-header"},[n("input",{staticClass:"legend-item-checkbox",attrs:{type:"checkbox"},domProps:{checked:t.curcheck.length===t.curlegend.length},on:{change:t.onAllChange}}),n("div",{staticClass:"legend-item-text"},[t._v("全选")]),n("div",{staticClass:"legend-item-count"},[t._v("面积(m²)")]),n("div",{staticClass:"legend-item-percent"},[t._v("占比")])]),t._l(t.curlegend,(function(e){return n("div",{key:e.name,staticClass:"legend-check-group"},[n("input",{staticClass:"legend-item-checkbox",attrs:{name:"group",type:"checkbox"},domProps:{checked:t.curcheck.indexOf(e.name)>=0,value:e.name},on:{change:t.onSingleChange}}),n("div",{staticClass:"legend-item-color",style:{background:e.color}}),n("div",{staticClass:"legend-item-text",on:{click:t.onLengendItemClick}},[t._v("\n "+t._s(e.name)+"\n ")]),n("div",{staticClass:"legend-item-count-text"},[t._v("\n "+t._s(t.areaString(e.count.toFixed(2)))+"\n ")]),n("div",{staticClass:"legend-item-percent-text"},[t._v("\n "+t._s((100*e.percent).toFixed(2))+"\n ")])])}))],2)])])},Dvt=[];function Nvt(t){return Nvt="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},Nvt(t)}function Fvt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function jvt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Fvt(Object(n),!0).forEach((function(e){Rvt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fvt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Rvt(t,e,n){return(e=Hvt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hvt(t){var e=zvt(t,"string");return"symbol"==Nvt(e)?e:e+""}function zvt(t,e){if("object"!=Nvt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Nvt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Uvt={name:"mapgis-3d-component-legend",props:{ruleJson:{type:Object},geoJson:{type:Object},vueKey:{type:String,default:"default"},vueIndex:{type:[String,Number],default:function(){return(1e8*Math.random()).toFixed(0)}}},inject:["Cesium","vueCesium","viewer"],mixins:[kvt],data:function(){return{waitManagerName:"GeojsonManager",curcheck:[],curlegend:[],echartdata:{series:[]},curData:[],showtab:!0,lefttab:"〈",righttab:"〉",allArea:0,curindex:-1,viewInfo:!0,rules:"",innerActive:[],activeMode:""}},computed:{allAreaString:function(){var t=String(this.allArea.toFixed(0)),e=t.indexOf(".")>-1?/(\d)(?=(\d{3})+\.)/g:/(\d)(?=(?:\d{3})+$)/g;return t.replace(e,"$1,")}},watch:{curcheck:function(t){"tabChange"!==this.activeMode&&this.checkChange(t)},curindex:function(t){this.activeMode="tabChange",this.parseCheck(t),-1===t?this.changeLegendColors(!1,-1):this.changeLegendColors(!0,t)}},mounted:function(){var t=this;t.getManager()},methods:{getManager:function(){var t=this.initData.bind(this);this.$_init(t)},areaString:function(t){var e=String(t),n=e.indexOf(".")>-1?/(\d)(?=(\d{3})+\.)/g:/(\d)(?=(?:\d{3})+$)/g;return e.replace(n,"$1,")},initData:function(){var t=this,e=t.geoJson,n=t.ruleJson;t.rules=n,t.curcheck=t.rules.rule.map((function(t){return t.title}))||[];for(var r,i=[],o=(t.rules.rule.map((function(t){return t.title})),function(){var t=Yn["polygon"](e.features[a].geometry.coordinates),n=Yn["area"](t),r=e.features[a].properties.地类名称,o=i.find((function(t){return t&&t.name===r}));o?o.value+=n:i.push({value:n,name:r})}),a=0;a<e.features.length;a++)o();t.rules.rule.forEach((function(t){r=[],i.forEach((function(e){for(var n=0;n<t.rule.length;n++)if(e.name===t.rule[n].name){r.push(e);break}})),t.series=r})),t.rules.series=t.rules.rule.map((function(t){var e=0;return t.series.forEach((function(t){return e+=Number(t.value)})),{name:t.title,value:Number(e.toFixed(2)),color:t.color}})),t.echartdata=t.rules,t.showtab=!!t.echartdata.hasSecond,t.allArea=0,t.echartdata.series.forEach((function(e){e&&e.value&&(t.allArea+=e.value)})),t.curdata=t.rules.series,t.curlegend=t.rules.series.map((function(e){var n=t.curdata.find((function(t){return t.name===e.name}));return n?(e.count=n.value,e.percent=n.value/t.allArea,e.color=n.color):(e.count=0,e.percent=0),e})),t.curlegend=t.curlegend.filter((function(t){return t.count>0})),t.onInitIndex()},onInitIndex:function(){this.curindex=-1},scrollTab:function(t){switch(t){case"left":this.$refs.scrolltab.scrollLeft-=150;break;case"right":this.$refs.scrolltab.scrollLeft+=150;break}},handleClose:function(){vm.viewInfo=!1},onAllChange:function(t){var e=this;e.activeMode="checkboxChange";var n=t.target.checked;e.curcheck=n?e.curlegend.map((function(t){return t.name})):[]},onSingleChange:function(t){var e=this;e.activeMode="checkboxChange";var n=t.target.value,r=t.target.checked;r?e.curcheck.indexOf(n)<0&&(e.curcheck=e.curcheck.concat([n])):e.curcheck=e.curcheck.filter((function(t){return t!==n}))},parseCheck:function(t){var e=this.echartdata,n=this;if(n.showtab=!!e.hasSecond,-1===t)n.allArea=0,e.series.forEach((function(t){t&&t.value&&(n.allArea+=t.value)})),n.curdata=e.series,n.curlegend=e.series.map((function(t){var e=n.curdata.find((function(e){return e.name===t.name}));return e?(t.count=e.value,t.percent=e.value/n.allArea,t.color=e.color):(t.count=0,t.percent=0),t})),n.curlegend=n.curlegend.filter((function(t){return t.count>0})),n.curcheck=e.rule.map((function(t){return t.title}));else{var r=e.rule[t].title;e.rule.forEach((function(t){r===t.title&&(n.allArea=0,t.series.forEach((function(t){t&&t.value&&(n.allArea+=t.value)})),n.curdata=t.series,n.curlegend=t.series.map((function(e){var r=n.curdata.find((function(t){return t.name===e.name}));r?(e.count=r.value,e.percent=r.value/n.allArea,e.color=r.color):(e.count=0,e.percent=0);var i=t.rule.find((function(t){return t.name===e.name}));return i&&(e.color=i.color),e})),n.curlegend=n.curlegend.filter((function(t){return t.count>0})),n.curcheck=t.series.map((function(t){return t.name})))}))}},checkChange:function(t){var e=this,n=this.echartdata,r=JSON.parse(JSON.stringify(n)),i=[],o=[];t&&t.length>=0&&r.rule.forEach((function(n){if(t.indexOf(n.title)>=0&&(n.rule.forEach((function(t){return t.color=n.color})),i=i.concat(n.rule)),t.indexOf(n.title)<0)for(var r=function(n){o=e.curlegend.filter((function(e){return e.name==t[n]})),i=i.concat(o)},a=0;a<t.length;a++)r(a)})),this.innerActive=i,this.$emit("colorChange",this.innerActive)},changeLegendColors:function(t,e){var n=this,r=this.echartdata,i=[];t?i=n.curlegend:r.rule.forEach((function(t,e){i=i.concat(t.rule.map((function(t){var n=jvt({},t);return n.color=r.rule[e].color,n})))})),this.innerActive=i,this.$emit("colorChange",this.innerActive)},onLengendItemClick:function(t){var e=this,n=this.echartdata,r=this,i=!1;r.showtab=!!n.hasSecond,n.rule.forEach((function(n,o){t.currentTarget.innerText===n.title&&(i=!0,n.rule&&n.rule.length>0?(r.allArea=0,n.series.forEach((function(t){t&&t.value&&(r.allArea+="string"===typeof t.value?parseFloat(t.value):t.value)})),r.curdata=n.series,r.curlegend=n.series.map((function(t){var e=r.curdata.find((function(e){return e.name===t.name}));return e?(t.count=e.value,t.percent=e.value/r.allArea):(t.count=0,t.percent=0),t})),r.curlegend=r.curlegend.filter((function(t){return t.count>0})),r.curindex=o,r.changeLegendColors(!0,o)):n.rule&&0===n.rule.length&&e.$store.commit("SET_LEGEND_HIGHTLIGHTS",{index:e.index,highlights:[n.title]}))})),i||this.$emit("highlight",[t.currentTarget.innerText])}}},Vvt=Uvt,Yvt=(n("4f5b"),je(Vvt,Ivt,Dvt,!1,null,"e22dbc94",null)),Gvt=Yvt.exports,Qvt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mapgis-3d-scene-setting"},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],staticClass:"setting-control",style:t.panelStyle},[n("mapgis-ui-tabs",{attrs:{animated:!1,tabBarStyle:t.tabBarStyle,"default-active-key":"1"}},[n("mapgis-ui-tab-pane",{key:"1",staticClass:"control-content",attrs:{tab:"基本设置"}},[n("basic-setting",{ref:"attr",attrs:{initBasicSetting:t.initBasicSetting,initialDepthTest:t.depthTest,"initial-scene-mode":t.sceneMode,stuffWidth:t.stuffWidth},on:{updateSpin:t.changeSpinning,updateBasicSetting:t.updateBasicSetting}})],1),n("mapgis-ui-tab-pane",{key:"2",staticClass:"control-content",attrs:{"force-render":"",tab:"相机"}},[n("camera-setting",{ref:"cameraSetting",attrs:{initCameraSetting:t.initCameraSetting,boundingSphereRadius:t.boundingSphereRadius,baseLayerIds:t.baseLayerIds},on:{updateCameraSetting:t.updateCameraSetting,updateSpin:t.changeSpinning}})],1),n("mapgis-ui-tab-pane",{key:"3",staticClass:"control-content",attrs:{"force-render":"",tab:"光照"}},[n("light-setting",{ref:"effect",attrs:{initLightSetting:t.initLightSetting},on:{updateLightSetting:t.updateLightSetting,updateSpin:t.changeSpinning}})],1),n("mapgis-ui-tab-pane",{key:"4",staticClass:"control-content",attrs:{"force-render":"",tab:"天气"}},[n("weather-setting",{ref:"effect",attrs:{initWeatherSetting:t.initWeatherSetting,isFavorites:t.isFavorites},on:{updateWeatherSetting:t.updateWeatherSetting,updateSpin:t.changeSpinning}})],1),n("mapgis-ui-tab-pane",{key:"5",staticClass:"control-content",attrs:{"force-render":"",tab:"特效"}},[n("effect-setting",{ref:"effect",attrs:{initEffectSetting:t.initEffectSetting},on:{updateEffectSetting:t.updateEffectSetting,updateSpin:t.changeSpinning}})],1),n("mapgis-ui-tab-pane",{key:"6",staticClass:"control-content",attrs:{"force-render":"",tab:"漫游操控"}},[n("autonomous-roaming-setting",{attrs:{publicPath:t.publicPath,isWidgetOpen:t.isWidgetOpen}})],1)],1)],1),n("mapgis-ui-spin",{staticStyle:{top:"50%",left:"50%"},attrs:{spinning:t.spinning,size:"large"}})],1)},Wvt=[],Kvt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"basic-setting"},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"地球",checked:t.basicSetting.earth},on:{changeChecked:t.enableEarth}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"大气层",checked:t.basicSetting.skyAtmosphere},on:{changeChecked:t.enableSkyAtmosphere}})],1)],1),n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"阴影效果",checked:t.basicSetting.shadow},on:{changeChecked:t.enableShadow}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"深度检测",checked:t.basicSetting.depthTest},on:{changeChecked:t.enableDepthTest}})],1)],1),n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"显示帧率",checked:t.basicSetting.FPS},on:{changeChecked:t.enableFPS}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"时间轴",checked:t.basicSetting.timeline},on:{changeChecked:t.enableTimeline}})],1)],1),n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"状态栏",checked:t.basicSetting.statebar},on:{changeChecked:t.handleChangeStatebar}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"平面模式",checked:t.basicSetting.sceneMode},on:{changeChecked:t.handleChangeSceneMode}})],1)],1),n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"罗盘控件",checked:t.basicSetting.compass},on:{changeChecked:t.enableCompass}})],1)],1),n("compass-position-setting",{directives:[{name:"show",rawName:"v-show",value:t.basicSetting.compass,expression:"basicSetting.compass"}],attrs:{position:t.compassPosition},on:{updateCompassPosition:t.updateCompassPosition}}),n("mapgis-ui-switch-panel",{staticClass:"odd",attrs:{size:"small",label:"颜色校正",checked:t.basicSetting.colorCorrection},on:{changeChecked:t.enableColorCorrection}}),t.showColorCorrectionSetting?n("div",[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"亮度",value:t.basicSetting.brightness,range:t.ColorCorrectionRange,step:.1},on:{change:t.brtChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"对比度",value:t.basicSetting.contrast,range:t.contrastRange,step:.1},on:{change:t.ctrstChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"色相",value:t.basicSetting.hue,range:t.ColorCorrectionRange,step:.1},on:{change:t.hueChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"饱和度",value:t.basicSetting.saturation,range:t.ColorCorrectionRange,step:.1},on:{change:t.saturationChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"曝光度",value:t.basicSetting.exposure,range:t.ColorCorrectionRange,step:.1},on:{change:t.exposureChange}})],1):t._e(),t.basicSetting.statebar?n("mapgis-3d-statebar",{attrs:{frame:60,bottomMap:!0}}):t._e()],1)},qvt=[],Xvt=(n("4015"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.compassPosition?n("mapgis-ui-form",{ref:"form",attrs:{model:t.compassPosition,labelCol:{lg:{span:8},sm:{span:8}},wrapperCol:{lg:{span:16},sm:{span:16}}}},[n("mapgis-ui-form-item",{staticClass:"form-item",attrs:{label:"罗盘位置",prop:"anchor"}},[n("mapgis-ui-select",{attrs:{placeholder:"请选择"},on:{change:t.changePosition},model:{value:t.compassPosition.anchor,callback:function(e){t.$set(t.compassPosition,"anchor",e)},expression:"compassPosition.anchor"}},[n("mapgis-ui-select-option",{attrs:{value:"top-left"}},[t._v("左上")]),n("mapgis-ui-select-option",{attrs:{value:"top-right"}},[t._v("右上")]),n("mapgis-ui-select-option",{attrs:{value:"bottom-left"}},[t._v("左下")]),n("mapgis-ui-select-option",{attrs:{value:"bottom-right"}},[t._v("右下")])],1)],1),"top-left"===t.compassPosition.anchor||"bottom-left"===t.compassPosition.anchor?n("mapgis-ui-form-item",{staticClass:"form-item",attrs:{prop:"horizontalOffset",label:"左边框距离"}},[n("mapgis-ui-input-number-addon",{attrs:{"addon-after":"px",min:0,step:1},on:{change:t.changePosition},model:{value:t.compassPosition.horizontalOffset,callback:function(e){t.$set(t.compassPosition,"horizontalOffset",t._n(e))},expression:"compassPosition.horizontalOffset"}})],1):t._e(),"top-right"===t.compassPosition.anchor||"bottom-right"===t.compassPosition.anchor?n("mapgis-ui-form-item",{staticClass:"form-item",attrs:{prop:"horizontalOffset",label:"右边框距离"}},[n("mapgis-ui-input-number-addon",{attrs:{"addon-after":"px",min:0,step:1},on:{change:t.changePosition},model:{value:t.compassPosition.horizontalOffset,callback:function(e){t.$set(t.compassPosition,"horizontalOffset",e)},expression:"compassPosition.horizontalOffset"}})],1):t._e(),"top-left"===t.compassPosition.anchor||"top-right"===t.compassPosition.anchor?n("mapgis-ui-form-item",{staticClass:"form-item",attrs:{prop:"verticalOffset",label:"上边框距离"}},[n("mapgis-ui-input-number-addon",{attrs:{"addon-after":"px",min:0,step:1},on:{change:t.changePosition},model:{value:t.compassPosition.verticalOffset,callback:function(e){t.$set(t.compassPosition,"verticalOffset",e)},expression:"compassPosition.verticalOffset"}})],1):t._e(),"bottom-left"===t.compassPosition.anchor||"bottom-right"===t.compassPosition.anchor?n("mapgis-ui-form-item",{staticClass:"form-item",attrs:{prop:"verticalOffset",label:"下边框距离"}},[n("mapgis-ui-input-number-addon",{attrs:{"addon-after":"px",min:0,step:1},on:{change:t.changePosition},model:{value:t.compassPosition.verticalOffset,callback:function(e){t.$set(t.compassPosition,"verticalOffset",e)},expression:"compassPosition.verticalOffset"}})],1):t._e()],1):t._e()}),$vt=[],Jvt={name:"CompassPositionSetting",props:{position:{type:Object,default:function(){return{anchor:"top-left",horizontalOffset:10,verticalOffset:36}}}},watch:{position:{handler:function(t){this.compassPosition=this.position,this.changePosition()},deep:!0,immediate:!0}},data:function(){return{rules:{},compassPosition:{anchor:"top-left",horizontalOffset:10,verticalOffset:36}}},methods:{changePosition:function(){var t=document.querySelector(".compass");if(t){var e=this.compassPosition,n=e.anchor,r=e.horizontalOffset,i=e.verticalOffset;switch(n){case"top-left":t.style.left="".concat(r,"px"),t.style.top="".concat(i,"px"),t.style.right="unset",t.style.bottom="unset";break;case"top-right":t.style.left="unset",t.style.top="".concat(i,"px"),t.style.right="".concat(r,"px"),t.style.bottom="unset";break;case"bottom-left":t.style.left="".concat(r,"px"),t.style.top="unset",t.style.right="unset",t.style.bottom="".concat(i,"px");break;case"bottom-right":t.style.left="unset",t.style.top="unset",t.style.right="".concat(r,"px"),t.style.bottom="".concat(i,"px");break}this.$emit("updateCompassPosition",this.compassPosition)}}}},Zvt=Jvt,tyt=(n("d4d8"),je(Zvt,Xvt,$vt,!1,null,"85bbac22",null)),eyt=tyt.exports,nyt=void 0,ryt={name:"BasicSetting",components:{CompassPositionSetting:eyt},mixins:[Ve,_n],props:{initialStatebar:{type:Boolean,default:!1},initialDepthTest:{type:Boolean,default:!1},initialSceneMode:{type:Boolean,default:!1},initBasicSetting:{type:Object,default:function(){return nyt.basicSetting}},stuffWidth:{type:Number}},data:function(){return{contrastRange:[0,2],ColorCorrectionRange:[-1,1],compassPosition:void 0,basicSetting:{earth:!0,skyAtmosphere:!0,shadow:!1,depthTest:!1,FPS:!1,timeline:!1,compass:!1,compassPosition:void 0,zoom:!1,statebar:!0,sceneMode:!1,colorCorrection:!1,brightness:0,contrast:1,hue:0,saturation:0,exposure:0},showColorCorrectionSetting:!1}},mounted:function(){var t=this.vueKey,e=this.vueIndex,n=window.vueCesium["SettingToolManager"].findSource(t,e);n||window.vueCesium.SettingToolManager.addSource(t,e,null,{timeline:null}),this.basicSetting=this.defaultParams(),this.init()},watch:{initialDepthTest:{handler:function(t){this.basicSetting.depthTest=t},deep:!0,immediate:!0},initBasicSetting:{handler:function(t){this.basicSetting=JSON.parse(JSON.stringify(this.initBasicSetting)),this.init()},deep:!0,immediate:!0},basicSetting:{handler:function(t){this.$emit("updateBasicSetting",this.basicSetting)},deep:!0},stuffWidth:{handler:function(t){this.basicSetting.compassPosition?"top-left"!==this.basicSetting.compassPosition.anchor&&"bottom-left"!==this.basicSetting.compassPosition.anchor||(this.basicSetting.compassPosition.horizontalOffset=this.stuffWidth):this.basicSetting.compassPosition={anchor:"top-left",horizontalOffset:this.stuffWidth,verticalOffset:400},this.compassPosition=this.basicSetting.compassPosition},deep:!0,immediate:!0}},methods:{defaultParams:function(){var t=!0,e=!0,n=!1,r=!1,i=!1,o=!1,a=this.viewer;return a&&(t=a.scene.globe.show,e=a.scene.globe.showGroundAtmosphere,r=a.scene.globe.depthTestAgainstTerrain,n=a.shadows,i=a.scene.debugShowFramesPerSecond,o=a.scene.colorCorrection.enabled),{earth:t,skyAtmosphere:e,shadow:n,depthTest:r,FPS:i,timeline:!1,compass:!1,compassPosition:void 0,zoom:!1,statebar:!0,sceneMode:!1,colorCorrection:o,brightness:a.scene.brightness||0,contrast:a.scene.contrast||1,hue:a.scene.hue||0,saturation:a.scene.saturation||0,exposure:a.scene.exposure||0}},init:function(){if(this.basicSetting){var t=this.vueKey,e=this.vueIndex,n=window.vueCesium["SettingToolManager"].findSource(t,e);n||window.vueCesium.SettingToolManager.addSource(t,e,null,{timeline:null});var r=this.basicSetting,i=r.earth,o=r.skyAtmosphere,a=r.shadow,s=r.depthTest,c=r.FPS,u=r.timeline,l=r.compass,h=r.zoom,d=r.statebar,f=r.sceneMode,p=r.colorCorrection,m=r.brightness,g=r.contrast,A=r.hue,v=r.saturation,y=r.exposure;this.showColorCorrectionSetting=p,this.enableEarth(i),this.enableSkyAtmosphere(o),this.enableShadow(a),this.enableDepthTest(s),this.enableFPS(c),this.enableTimeline(u),this.enableCompass(l),this.enableZoom(h),this.brtChange(m),this.ctrstChange(g),this.hueChange(A),this.saturationChange(v),this.exposureChange(y),this.handleChangeStatebar(d),this.handleChangeSceneMode(f)}},enableEarth:function(t){var e=this.viewer;this.basicSetting.earth=t,this.basicSetting.earth?e.scene.skyAtmosphere.show=this.basicSetting.skyAtmosphere:e.scene.skyAtmosphere.show=!1,e.scene.globe.show=this.basicSetting.earth},enableSkyAtmosphere:function(t){var e=this.viewer;this.basicSetting.skyAtmosphere=t,e.scene.skyAtmosphere.show=this.basicSetting.skyAtmosphere},enableShadow:function(t){var e=this.viewer;this.Cesium;this.basicSetting.shadow=t,e.shadows=this.basicSetting.shadow},enableDepthTest:function(t){var e=this.viewer;this.basicSetting.depthTest=t,e.scene.globe.depthTestAgainstTerrain=this.basicSetting.depthTest},enableFPS:function(t){var e=this.viewer;this.basicSetting.FPS=t,e.scene.debugShowFramesPerSecond=this.basicSetting.FPS},enableTimeline:function(t){var e=this.viewer,n=this.Cesium,r=this.vueKey,i=this.vueIndex;this.basicSetting.timeline=t;var o=this;if(o.basicSetting.timeline){var a=document.getElementsByClassName("cesium-viewer-timelineContainer");a.length>0&&a[0].parentNode.removeChild(a[0]);var s=e.container,c=document.createElement("div");c.className="cesium-viewer-timelineContainer",c.style="left:0px;right:0px",o.basicSetting.statebar&&o.$nextTick((function(){var t=document.getElementsByClassName("mapgis-3d-statebar"),e=window.getComputedStyle(t[0]);"0px"===e.bottom&&(c.style.bottom="30px")})),s.appendChild(c);var u=new n.Timeline(c,e.clock);u.addEventListener("settime",o.onTimelineScrubfunction,!1),u.zoomTo(e.clock.startTime,e.clock.stopTime),window.vueCesium["SettingToolManager"].changeOptions(r,i,"timeline",u)}else{var l=this.vueKey,h=this.vueIndex,d=window.vueCesium["SettingToolManager"].findSource(l,h);d&&d.options&&d.options.timeline&&(d.options.timeline.destroy(),window.vueCesium["SettingToolManager"].changeOptions(l,h,"timeline",null));var f=document.getElementsByClassName("cesium-viewer-timelineContainer");f.length>0&&f[0].parentNode.removeChild(f[0])}},onTimelineScrubfunction:function(t){var e=t.clock;e.currentTime=t.timeJulian,e.shouldAnimate=!1},enableCompass:function(t){var e=this.viewer;this.basicSetting.compass=t,e.cesiumNavigation&&e.cesiumNavigation.destroy();var n={};n.enableCompass=this.basicSetting.compass,n.enableZoomControls=this.basicSetting.zoom||!1,e.createNavigationTool(n);var r=this;this.$nextTick((function(){r.basicSetting.compassPosition||(r.basicSetting.compassPosition={anchor:"top-left",horizontalOffset:r.stuffWidth,verticalOffset:400}),r.compassPosition=r.basicSetting.compassPosition}))},updateCompassPosition:function(t){this.basicSetting.compassPosition=t,this.compassPosition=this.basicSetting.compassPosition},enableZoom:function(t){var e=this.viewer;this.basicSetting.zoom=t,e.cesiumNavigation&&e.cesiumNavigation.destroy();var n={};n.enableCompass=this.basicSetting.compass,n.enableZoomControls=this.basicSetting.zoom||!1,e.createNavigationTool(n);var r=this;this.$nextTick((function(){r.basicSetting.compassPosition||(r.basicSetting.compassPosition={anchor:"top-left",horizontalOffset:r.stuffWidth,verticalOffset:400}),r.compassPosition=r.basicSetting.compassPosition}))},enableColorCorrection:function(t){this.basicSetting.colorCorrection=t,this.showColorCorrectionSetting=t,viewer.scene.colorCorrection.enabled=t},brtChange:function(t){this.basicSetting.brightness=t,this.basicSetting.colorCorrection&&(viewer.scene.brightness=t)},ctrstChange:function(t){this.basicSetting.contrast=t,this.basicSetting.colorCorrection&&(viewer.scene.contrast=t)},hueChange:function(t){this.basicSetting.hue=t,this.basicSetting.colorCorrection&&(viewer.scene.hue=t)},saturationChange:function(t){this.basicSetting.saturation=t,this.basicSetting.colorCorrection&&(viewer.scene.saturation=t)},exposureChange:function(t){this.basicSetting.exposure=t,this.basicSetting.colorCorrection&&(viewer.scene.exposure=t)},handleChangeStatebar:function(t){var e=this.viewer;this.basicSetting.statebar=t;var n=this;e.statebar=this.basicSetting.statebar;var r=document.getElementsByClassName("mapgis-3d-statebar");r&&r.length>0&&(e.statebar?r[0].style.display="block":r[0].style.display="none"),n.basicSetting.timeline?n.$nextTick((function(){var t=document.getElementsByClassName("cesium-viewer-timelineContainer"),e=window.getComputedStyle(t[0]);if("0px"===e.bottom&&n.basicSetting.statebar){var r=document.getElementsByClassName("mapgis-3d-statebar"),i=r[0];i.style.bottom="24px"}})):n.$nextTick((function(){var t=document.getElementsByClassName("mapgis-3d-statebar"),e=t[0];e&&(e.style.bottom="0px")}))},handleChangeSceneMode:function(t){this.basicSetting.sceneMode=t;var e=this;if(t)e.viewer.scene.mode=1;else{e.viewer.scene.mode=3;var n=e.viewer.camera.computeViewRectangle();if(!n){var r=Cesium.Camera.DEFAULT_VIEW_RECTANGLE,i=r.north,o=r.south,a=r.east,s=r.west,c=Cesium.Math.toDegrees((a+s)/2),u=Cesium.Math.toDegrees((i+o)/2),l=16846164;e.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(c,u,l)})}}}}},iyt=ryt,oyt=(n("f0d1"),je(iyt,Kvt,qvt,!1,null,"2c058e40",null)),ayt=oyt.exports,syt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"camera-setting"},[n("mapgis-ui-switch-panel",{ref:"selfAdaption",attrs:{size:"default",label:"地表自适应透明",checked:t.cameraSetting.selfAdaption},on:{changeChecked:t.enableSelfAdaption}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"阈值",value:t.cameraSetting.selfAdaptionParams.maxHeigh,range:[0,1e6],step:100},on:{change:t.setSelfAdaption}})],1),n("mapgis-ui-switch-panel",{ref:"Undgrd",attrs:{size:"default",label:"地下模式",checked:t.cameraSetting.undgrd},on:{changeChecked:t.enableUndgrd}},[n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"影像透明度独立控制",checked:t.cameraSetting.undgrdParams.enableIndependentTranslucency},on:{changeChecked:t.enableIndependentTranslucency}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"地表透明度",value:t.cameraSetting.undgrdParams.groundAlpha,range:t.range,step:.1},on:{change:t.setGlobeBackFaceAlpha}})],1),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"FOV设置",value:t.cameraSetting.fov,range:t.fovRange,step:15},on:{change:t.setFOV}})],1)},cyt=[],uyt=void 0,lyt={name:"CameraSetting",mixins:[Ve],props:{initCameraSetting:{type:Object,default:function(){return uyt.cameraSetting}},boundingSphereRadius:{type:Number,default:0}},data:function(){return{range:[0,1],fovRange:[0,180],cameraSetting:{selfAdaption:!1,selfAdaptionParams:{maxHeigh:4e5},undgrd:!1,undgrdParams:{groundAlpha:.5,enableIndependentTranslucency:!1},fov:60}}},watch:{initCameraSetting:{handler:function(t){this.cameraSetting=JSON.parse(JSON.stringify(this.initCameraSetting)),this.init()},deep:!0,immediate:!0},cameraSetting:{handler:function(t){this.$emit("updateCameraSetting",this.cameraSetting)},deep:!0},boundingSphereRadius:{handler:function(t){this.boundingSphereRadius=t,this.boundingSphereRadius>0&&(this._setSelfAdaption(),this.openSelfAdaptionPanel())},deep:!0}},methods:{init:function(){var t=this;if(this.cameraSetting){void 0==this.cameraSetting.selfAdaption&&(this.cameraSetting.selfAdaption=!1),this.cameraSetting.selfAdaptionParams&&this.cameraSetting.selfAdaptionParams.maxHeigh||(this.cameraSetting.selfAdaptionParams={maxHeigh:4e5});var e=this.cameraSetting,n=e.selfAdaption,r=e.fov,i=e.undgrd;this.initImageLayersTranslucencyManager(),setTimeout((function(){t.boundingSphereRadius>0&&t._enableSelfAdaption(n),t._setFOV(r),t._enableUndgrd(i)}),1e3)}},enableIndependentTranslucency:function(t){this.cameraSetting.undgrdParams.enableIndependentTranslucency=t,this._enableIndependentTranslucency(this.cameraSetting.undgrdParams.enableIndependentTranslucency)},_enableIndependentTranslucency:function(t){var e=this.getImageLayersTranslucencyManager();if(e){var n=[];if(this.cameraSetting.undgrd)if(t){for(var r=1;r<viewer.imageryLayers._layers.length;r++)n.push(viewer.imageryLayers._layers[r]);e.imageryLayers=n,n.length>0?e.globeFaceAlpha=this.cameraSetting.undgrdParams.groundAlpha:(e.frontFaceAlpha=this.cameraSetting.undgrdParams.groundAlpha,e.backFaceAlpha=this.cameraSetting.undgrdParams.groundAlpha)}else e.imageryLayers=n,e.frontFaceAlpha=this.cameraSetting.undgrdParams.groundAlpha,e.backFaceAlpha=this.cameraSetting.undgrdParams.groundAlpha}},updateIndependentTranslucency:function(){this.cameraSetting.undgrd&&this._enableIndependentTranslucency(this.cameraSetting.undgrdParams.enableIndependentTranslucency)},enableUndgrd:function(t){this.cameraSetting.undgrd=t,this._enableUndgrd(this.cameraSetting.undgrd)},_enableUndgrd:function(t){var e=this.viewer;e.scene.screenSpaceCameraController.enableCollisionDetection=!this.cameraSetting.undgrd,this.cameraSetting.undgrd?(this._setGlobeBackFaceAlpha(this.cameraSetting.undgrdParams.groundAlpha),this.initEnableIndependentTranslucency()):(this._setGlobeBackFaceAlpha(1),this.initDisableEnableIndependentTranslucency())},initEnableIndependentTranslucency:function(){var t=this.getImageLayersTranslucencyManager();t&&(t.enabled=!0),this._enableIndependentTranslucency(this.cameraSetting.undgrdParams.enableIndependentTranslucency)},initDisableEnableIndependentTranslucency:function(){var t=this.getImageLayersTranslucencyManager();t&&(t.enabled=!1)},enableSelfAdaption:function(t){this.cameraSetting.selfAdaption=t,this._enableSelfAdaption(this.cameraSetting.selfAdaption)},_enableSelfAdaption:function(t){if(this.boundingSphereRadius<=0)return this.closeSelfAdaptionPanel(),void this.$message.warning("场景中未添加符合要求的模型数据!");var e=this.getImageLayersTranslucencyManager();e&&(t?this._setSelfAdaption():this.closeSelfAdaption())},setGlobeBackFaceAlpha:function(t){this.cameraSetting.undgrdParams.groundAlpha=t,this._setGlobeBackFaceAlpha(this.cameraSetting.undgrdParams.groundAlpha)},_setGlobeBackFaceAlpha:function(t){var e=this.getImageLayersTranslucencyManager();if(e){var n=[];if(this.cameraSetting.undgrdParams.enableIndependentTranslucency){for(var r=1;r<viewer.imageryLayers._layers.length;r++)n.push(viewer.imageryLayers._layers[r]);e.imageryLayers=n,n.length>0?e.globeFaceAlpha=this.cameraSetting.undgrdParams.groundAlpha:(e.frontFaceAlpha=this.cameraSetting.undgrdParams.groundAlpha,e.backFaceAlpha=this.cameraSetting.undgrdParams.groundAlpha)}else this.cameraSetting.undgrd?(e.imageryLayers=n,e.frontFaceAlpha=this.cameraSetting.undgrdParams.groundAlpha,e.backFaceAlpha=this.cameraSetting.undgrdParams.groundAlpha):e.globeFaceAlpha=t}},setFOV:function(t){this.cameraSetting.fov=t,this._setFOV(this.cameraSetting.fov)},_setFOV:function(t){var e=this.viewer,n=this.Cesium;e.scene.camera.frustum.fov=n.Math.toRadians(this.cameraSetting.fov)},setSelfAdaption:function(t){this.cameraSetting.selfAdaptionParams.maxHeigh=t,this._setSelfAdaption()},_setSelfAdaption:function(){var t=this._getStepHeight(),e=this.getImageLayersTranslucencyManager();if(e){var n=e.imageryLayers;n.length>0?e.globeFaceAlphaByDistance=new Cesium.NearFarScalar(t,0,5*t,1):e.frontFaceAlphaByDistance=new Cesium.NearFarScalar(t,0,5*t,1)}},closeSelfAdaptionPanel:function(){this.cameraSetting.selfAdaption=!1,this.$refs.selfAdaption&&(this.$refs.selfAdaption.innerChecked=!1,this.$refs.selfAdaption.maxHeight="0px")},openSelfAdaptionPanel:function(){this.cameraSetting.selfAdaption=!0,this.$refs.selfAdaption&&(this.$refs.selfAdaption.innerChecked=!0,this.$refs.selfAdaption.maxHeight="fit-content")},closeSelfAdaption:function(){var t=this.getImageLayersTranslucencyManager();t&&(t.globeFaceAlphaByDistance=new Cesium.NearFarScalar(0,1,1,1),t.frontFaceAlphaByDistance=new Cesium.NearFarScalar(0,1,1,1),t.backFaceAlphaByDistance=new Cesium.NearFarScalar(0,1,1,1))},getImageLayersTranslucencyManager:function(){var t=this.vueCesium,e=this.vueIndex,n=this.vueKey,r=t.ImageLayersTranslucencyManager.findSource(n,e);if(r&&r.source)return r.source},initImageLayersTranslucencyManager:function(){var t=this.Cesium,e=this.vueCesium,n=this.vueKey,r=this.vueIndex,i=e.ImageLayersTranslucencyManager.findSource(n,r);return i||(i=new t.GlobeIndependentTranslucency(viewer),i.enabled=!0,e.ImageLayersTranslucencyManager.addSource(n,r,i)),i},_getStepHeight:function(){var t=this.boundingSphereRadius||0,e=this.cameraSetting.selfAdaptionParams.maxHeigh||4e5;return Math.min(e,t)}}},hyt=lyt,dyt=je(hyt,syt,cyt,!1,null,"26af3c98",null),fyt=dyt.exports,pyt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"light-setting"},[n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"光照",checked:t.lightSetting.sunlight},on:{changeChecked:t.enableSunlight}},[n("mapgis-ui-form",{attrs:{layout:"vertical"}},[n("mapgis-ui-form-item",{attrs:{label:"光照类型"}},[n("mapgis-ui-select",{model:{value:t.lightingModes[0].key,callback:function(e){t.$set(t.lightingModes[0],"key",e)},expression:"lightingModes[0].key"}},[n("mapgis-ui-select-option",{attrs:{value:"DAYNIGHT_SHADING"}},[t._v("\n 太阳光照\n ")]),n("mapgis-ui-select-option",{attrs:{value:"VERTEX_LIGHTING"}},[t._v("\n 顶点光照\n ")])],1)],1)],1),n("mapgis-ui-color-pick-panel",{attrs:{label:"光照颜色",color:t.lightSetting.sunlightParams.lightColor,disableAlpha:!1,labelCol:24,wrapperCol:24},on:{input:t.lightColorChange}})],1),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"模型亮度",range:[1,200]},on:{change:t.lightIntensityChange},model:{value:t.lightSetting.lightIntensity,callback:function(e){t.$set(t.lightSetting,"lightIntensity",e)},expression:"lightSetting.lightIntensity"}})],1)},myt=[],gyt=void 0,Ayt={name:"SceneEffect",mixins:[Ve],props:{initLightSetting:{type:Object,default:function(){return gyt.lightSetting}}},computed:{lightingMode:{get:function(){return this.lightSetting.sunlightParams.lightingMode},set:function(t){var e=this.viewer,n=this.Cesium;this.lightSetting.sunlightParams.lightingMode=t,e.scene.globe.lightingMode=n.LightingMode[t]}}},data:function(){return{lightingModes:[{key:"DAYNIGHT_SHADING",value:"太阳光照"},{key:"VERTEX_LIGHTING",value:"顶点光照"}],lightSetting:{sunlight:!1,sunlightParams:{lightingMode:"DAYNIGHT_SHADING",lightColor:"rgba(255,255,255,255)"},lightIntensity:10}}},watch:{initLightSetting:{handler:function(t){this.lightSetting=JSON.parse(JSON.stringify(this.initLightSetting)),this.init()},deep:!0,immediate:!0},lightSetting:{handler:function(t){this.$emit("updateLightSetting",this.lightSetting)},deep:!0}},methods:{init:function(){if(this.lightSetting){var t=this.lightSetting,e=t.sunlight,n=t.sunlightParams,r=t.lightIntensity,i=n.lightColor,o=n.lightingMode;if(this.enableSunlight(e),e){var a=this.Cesium,s=this.viewer,c=a.Color.fromCssColorString(i);s.scene.light.color=c,s.scene.globe.lightingMode=a.LightingMode[o]}this.lightIntensityChange(r)}},enableSunlight:function(t){var e=this.viewer;this.lightSetting.sunlight=t,this.$emit("updateSpin",!0);var n=this;setTimeout((function(){e.scene.globe.enableLighting=n.lightSetting.sunlight,n.$emit("updateSpin",!1)}),400)},lightColorChange:function(t){this.lightSetting.sunlightParams.lightColor="rgba(".concat(t.rgba.r,", ").concat(t.rgba.g,", ").concat(t.rgba.b,", ").concat(t.rgba.a,")");var e=this.Cesium,n=this.viewer,r=e.Color.fromCssColorString(this.lightSetting.sunlightParams.lightColor);n.scene.light.color=r},lightIntensityChange:function(t){var e=this.viewer;this.lightSetting.lightIntensity=t,e.scene.light.intensity=this.lightSetting.lightIntensity}}},vyt=Ayt,yyt=(n("4ab5"),je(vyt,pyt,myt,!1,null,"508f31b5",null)),byt=yyt.exports,wyt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"weather-setting"},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"太阳",checked:t.weatherSetting.sun},on:{changeChecked:t.enableSun}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"月亮",checked:t.weatherSetting.moon},on:{changeChecked:t.enableMoon}})],1)],1),n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"星空",checked:t.weatherSetting.sceneSkybox},on:{changeChecked:t.enableSceneSkybox}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"天空盒",checked:t.weatherSetting.skybox},on:{changeChecked:t.$_enableSkyBox}})],1)],1),n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"云层",checked:t.weatherSetting.clouds},on:{changeChecked:t.$_enableClouds}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"周期/秒",value:t.weatherSetting.cloudsParams.cloudsduration,range:t.cloudsRange},on:{change:t.cloudsDurationChange}})],1),n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"雨",checked:t.weatherSetting.rain},on:{changeChecked:t.$_enableRain}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雨速度",value:t.weatherSetting.rainParams.speed,range:t.speedRange},on:{change:t.speedChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雨透明度",value:t.weatherSetting.rainParams.rainOpacity,range:t.rainOpacityRange,step:.1},on:{change:t.rainOpacityChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雨角度",value:t.weatherSetting.rainParams.angle,range:t.angleRange,step:5},on:{change:t.angleChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雨丝长度",value:t.weatherSetting.rainParams.length,range:t.lengthRange,step:1},on:{change:t.lengthChange}})],1),n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"雪",checked:t.weatherSetting.snow},on:{changeChecked:t.$_enableSnow}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雪粒大小",value:t.weatherSetting.snowParams.size,range:t.sizeRange,step:5},on:{change:t.szChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雪密度",value:t.weatherSetting.snowParams.density,range:t.densityRange,step:5},on:{change:t.dstChange}})],1),n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"雾",checked:t.weatherSetting.fog},on:{changeChecked:t.$_enableFog}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"雾透明度",value:t.weatherSetting.fogParams.fogOpacity,range:t.fogOpacityRange,step:.1},on:{change:t.fogOpacityChange}})],1),n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"雾化效果",checked:t.weatherSetting.surficialFog},on:{changeChecked:t.enableSurficialFog}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"密度",value:t.weatherSetting.surfFogParams.surfFogDst,range:t.surfFogDstRange,step:2e-4},on:{change:t.enableSurficialFog}})],1)],1)},_yt=[],xyt=void 0,Syt={name:"WeatherSetting",mixins:[Ve],props:{initWeatherSetting:{type:Object,default:function(){return xyt.weatherSetting}},isFavorites:{type:Boolean,default:!1}},data:function(){return{cloudsRange:[1,10],speedRange:[1,20],rainOpacityRange:[0,1],angleRange:[-30,30],lengthRange:[0,10],sizeRange:[5,20],densityRange:[5,20],fogOpacityRange:[0,1],surfFogDstRange:[2e-4,.002],weatherSetting:{sun:!0,moon:!0,sceneSkybox:!0,skybox:!1,clouds:!1,cloudsParams:{cloudsduration:5},rain:!1,rainParams:{speed:18,rainOpacity:.6,angle:-30,length:1},snow:!1,snowParams:{size:5,density:5},fog:!1,fogParams:{fogOpacity:.5,color:"#FFFFFF"},surficialFog:!0,surfFogParams:{surfFogDst:2e-4}}}},watch:{initWeatherSetting:{handler:function(t){this.weatherSetting=JSON.parse(JSON.stringify(this.initWeatherSetting)),this.init()},deep:!0,immediate:!0},weatherSetting:{handler:function(t){this.$emit("updateWeatherSetting",this.weatherSetting)},deep:!0}},mounted:function(){var t=this.vueKey,e=this.vueIndex;window.vueCesium.SettingToolManager.addSource(t,e,{},{GlobeCloud:null,SkyBox:null,Rain:null,Fog:null,Snow:null})},methods:{init:function(){var t=this.weatherSetting,e=t.sun,n=t.moon,r=t.sceneSkybox,i=t.skybox,o=t.clouds,a=t.cloudsParams,s=t.rain,c=(t.rainParams,t.snow),u=t.snowParams,l=t.fog,h=t.fogParams,d=t.surficialFog,f=t.surfFogParams;if(this.enableSun(e,!0),this.enableMoon(n,!0),this.enableSceneSkybox(r),this.$_enableSkyBox(i),this.$_enableClouds(o),o&&this.cloudsDurationChange(a.cloudsduration),this.$_enableRain(s),s){var p=this.rainParams,m=p.speed,g=p.rainOpacity,A=p.angle,v=p.length;this.speedChange(m),this.rainOpacityChange(g),this.angleChange(A),this.lengthChange(v)}if(this.$_enableSnow(c),c){var y=u.size,b=u.density;this.szChange(y),this.dstChange(b)}if(this.$_enableFog(l),l){var w=h.fogOpacity;h.color;this.fogOpacityChange(w)}if(this.enableSurficialFog(d),d){var _=f.surfFogDst;this.enableSurficialFog(_)}},enableSun:function(t,e){var n=this.viewer;if(this.weatherSetting.sun=t,!(n.scene.sun.show===this.weatherSetting.sun||this.isFavorites&&e))if(n.scene.sun.show=this.weatherSetting.sun,this.weatherSetting.sun){var r=n.scene.sun._boundingVolume.center;0!==r.x&&0!==r.y&&0!==r?n.camera.flyTo({destination:new Cesium.Cartesian3(-r.x/2e3,-r.y/2e3,-r.z/4e3),orientation:{heading:Cesium.Math.toRadians(90),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(-20)},duration:.5}):n.camera.flyHome(.5)}else n.camera.flyHome(.5)},enableMoon:function(t,e){var n=this.viewer;if(this.weatherSetting.moon=t,!(n.scene.moon.show===this.weatherSetting.moon||this.isFavorites&&e))if(n.scene.moon.show=this.weatherSetting.moon,this.weatherSetting.moon){var r=n.scene.moon._ellipsoidPrimitive._boundingSphere.center;0!==r.x&&0!==r.y&&0!==r?n.camera.flyTo({destination:new Cesium.Cartesian3(r.x/1.2,r.y/1.2,r.z/1.2),orientation:{heading:0,pitch:Cesium.Math.toRadians(90),roll:0},duration:.5}):n.camera.flyHome(.5)}else n.camera.flyHome(.5)},enableSceneSkybox:function(t){var e=this.viewer;this.weatherSetting.sceneSkybox=t,e.scene.skyBox.show=this.weatherSetting.sceneSkybox},$_enableSkyBox:function(t){this.weatherSetting.skybox=t;var e=this;e.weatherSetting.skybox?e.enableSkyBox():e.removeSkyBox()},enableSkyBox:function(){var t=this.vueKey,e=this.vueIndex,n=this.viewer,r=this.Cesium,i=new r.GlobeEffect(n,{cloudsDuration:1e5});i.addDefaultSkyBox("SkyBox3"),window.vueCesium.SettingToolManager.changeOptions(t,e,"SkyBox",i)},removeSkyBox:function(){var t=this.vueKey,e=this.vueIndex,n=(this.viewer,this.Cesium,window.vueCesium["SettingToolManager"].findSource(t,e));n&&n.options&&n.options.SkyBox&&(n.options.SkyBox.removeSkyBox(),window.vueCesium["SettingToolManager"].changeOptions(t,e,"SkyBox",null))},$_enableClouds:function(t){this.$emit("updateSpin",!0),this.weatherSetting.clouds=t;var e=this;setTimeout((function(){e.weatherSetting.clouds?e.enableClouds():e.removeClouds(),e.$emit("updateSpin",!1)}),400)},cloudsDurationChange:function(t){var e=this;this.weatherSetting.cloudsParams.cloudsduration=t,this.weatherSetting.clouds&&(e.removeClouds(),e.enableClouds())},enableClouds:function(){var t=this.vueKey,e=this.vueIndex,n=this.viewer,r=this.Cesium,i=1e3*this.weatherSetting.cloudsParams.cloudsduration,o=new r.GlobeEffect(n,{cloudsDuration:i,cloudsImgSource:r.buildModuleUrl("Assets/Images/clouds.png")});o.addGlobeClouds(),window.vueCesium["SettingToolManager"].changeOptions(t,e,"GlobeCloud",o)},removeClouds:function(){var t=this.vueKey,e=this.vueIndex,n=(this.viewer,this.Cesium,window.vueCesium["SettingToolManager"].findSource(t,e));n&&n.options&&n.options.GlobeCloud&&(n.options.GlobeCloud.removeGlobeClouds(),window.vueCesium["SettingToolManager"].changeOptions(t,e,"GlobeCloud",null))},$_enableRain:function(t){this.$emit("updateSpin",!0),this.weatherSetting.rain=t;var e=this;setTimeout((function(){e.weatherSetting.rain?e.enableRain():e.removeWeather("Rain"),e.$emit("updateSpin",!1)}),400)},speedChange:function(t){var e=this;this.weatherSetting.rainParams.speed=t,this.weatherSetting.rain&&e.enableRain()},rainOpacityChange:function(t){var e=this;this.weatherSetting.rainParams.rainOpacity=t,this.weatherSetting.rain&&e.enableRain()},angleChange:function(t){var e=this;this.weatherSetting.rainParams.angle=t,this.weatherSetting.rain&&e.enableRain()},lengthChange:function(t){var e=this;this.weatherSetting.rainParams.length=t,this.weatherSetting.rain&&e.enableRain()},$_enableSnow:function(t){this.$emit("updateSpin",!0),this.weatherSetting.snow=t;var e=this;setTimeout((function(){e.weatherSetting.snow?e.enableSnow():e.removeWeather("Snow"),e.$emit("updateSpin",!1)}),400)},szChange:function(t){var e=this;this.weatherSetting.snowParams.size=t,this.weatherSetting.snow&&e.enableSnow()},dstChange:function(t){var e=this;this.weatherSetting.snowParams.density=t,this.weatherSetting.snow&&e.enableSnow()},$_enableFog:function(t){this.$emit("updateSpin",!0),this.weatherSetting.fog=t;var e=this;setTimeout((function(){e.weatherSetting.fog?e.enableFog():e.removeWeather("Fog"),e.$emit("updateSpin",!1)}),400)},fogOpacityChange:function(t){var e=this;this.weatherSetting.fogParams.fogOpacity=t,this.weatherSetting.fog&&e.enableFog()},enableRain:function(){var t=this.weatherSetting.rainParams,e=t.speed,n=t.angle,r=t.length,i=t.rainOpacity,o={speed:e,angle:n,rainLength:r,alpha:i};this.$_enableWeather("Rain",o)},enableSnow:function(){var t=this.weatherSetting.snowParams,e=t.density,n=t.size,r={size:e,scale:n};this.$_enableWeather("Snow",r)},enableFog:function(){var t=this.Cesium,e=t.Color.fromCssColorString(this.weatherSetting.fogParams.color),n={fogcolor:e,alpha:this.weatherSetting.fogParams.fogOpacity};this.$_enableWeather("Fog",n)},$_enableWeather:function(t,e){var n=this.vueKey,r=this.vueIndex,i=this.viewer,o=this.Cesium;this.removeWeather(t);var a=new o.WeatherEffect(i);switch(t){case"Rain":a.addRain(e),window.vueCesium["SettingToolManager"].changeOptions(n,r,"Rain",a);break;case"Snow":a.addSnow(e),window.vueCesium["SettingToolManager"].changeOptions(n,r,"Snow",a);break;case"Fog":a.addFog(e),window.vueCesium["SettingToolManager"].changeOptions(n,r,"Fog",a);break;default:a.log("传参错误");break}},removeWeather:function(t){var e=this.vueKey,n=this.vueIndex,r=window.vueCesium["SettingToolManager"].findSource(e,n);r&&r.options&&Object.keys(r.options).forEach((function(i){if(i===t&&r.options[t]){switch(t){case"Rain":r.options.Rain.removeRain();break;case"Snow":r.options.Snow.removeSnow();break;case"Fog":r.options.Fog.removeFog();break}window.vueCesium["SettingToolManager"].changeOptions(e,n,t,null)}}))},enableSurficialFog:function(t){var e=this.viewer,n=this;"boolean"===typeof t?n.weatherSetting.surficialFog=t:n.weatherSetting.surfFogParams.surfFogDst=t,e.scene.fog.density=this.weatherSetting.surfFogParams.surfFogDst,e.scene.fog.enabled=this.weatherSetting.surficialFog}}},Cyt=Syt,Myt=(n("9fbc"),je(Cyt,wyt,_yt,!1,null,"4e8ee64a",null)),Lyt=Myt.exports,Tyt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"effect-setting"},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"黑白照片",checked:t.effectSetting.blckWhite},on:{changeChecked:t.blackAndWhiteChange}})],1),n("mapgis-ui-col",{attrs:{span:12}},[n("mapgis-ui-switch-panel",{attrs:{size:"small",label:"夜视效果",checked:t.effectSetting.ntVision},on:{changeChecked:t.nightVision}})],1)],1),n("mapgis-ui-switch-panel",{attrs:{size:"default",label:"场景泛光",checked:t.effectSetting.bloom},on:{changeChecked:t.enableBloom}},[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"亮度",value:t.effectSetting.bloomParams.bloomBrt,range:t.bloomBrtRange,step:.05},on:{change:t.bloomBrtChange}}),n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"对比度",value:t.effectSetting.bloomParams.bloomCtrst,range:t.bloomCtrstRange,step:10},on:{change:t.bloomCtrstChange}})],1)],1)},kyt=[],Eyt=void 0,Oyt={name:"EffectSetting",mixins:[Ve],props:{initEffectSetting:{type:Object,default:function(){return Eyt.effectSetting}}},data:function(){return{bloomBrtRange:[-.6,.2],bloomCtrstRange:[-255,255],effectSetting:{blckWhite:!1,ntVision:!1,bloom:!1,bloomParams:{bloomBrt:-.3,bloomCtrst:128}}}},watch:{initEffectSetting:{handler:function(t){this.effectSetting=JSON.parse(JSON.stringify(this.initEffectSetting)),this.init()},deep:!0,immediate:!0},effectSetting:{handler:function(t){this.$emit("updateEffectSetting",this.effectSetting)},deep:!0}},methods:{init:function(){if(this.effectSetting){var t=this.effectSetting,e=t.blckWhite,n=t.ntVision,r=t.bloom,i=t.bloomParams,o=i.bloomBrt,a=i.bloomCtrst;this.enableBloom(r),r&&(this.bloomBrtRange(o),this.bloomCtrstRange(a)),this.blackAndWhiteChange(e),this.nightVision(n)}},enableBloom:function(t){var e=this.viewer;this.effectSetting.bloom=t,this.$emit("updateSpin",!0);var n=this;setTimeout((function(){e.scene.postProcessStages.bloom.enabled=n.effectSetting.bloom,n.$emit("updateSpin",!1)}),400)},bloomBrtChange:function(t){var e=this.viewer;this.effectSetting.bloomParams.bloomBrt=t,e.scene.postProcessStages.bloom.uniforms.brightness=this.effectSetting.bloomParams.bloomBrt},bloomCtrstChange:function(t){var e=this.viewer;this.effectSetting.bloomParams.bloomCtrst=t,e.scene.postProcessStages.bloom.uniforms.contrast=this.effectSetting.bloomParams.bloomCtrst},blackAndWhiteChange:function(t){var e=this.viewer,n=this.Cesium;this.effectSetting.blckWhite=t;var r=this;if(r.effectSetting.blckWhite){r.removeOtherStages();var i=e.scene.postProcessStages.add(n.PostProcessStageLibrary.createBlackAndWhiteStage());i.uniforms.gradations=5}else r.removeOtherStages()},nightVision:function(t){var e=this.viewer,n=this.Cesium;this.effectSetting.ntVision=t;var r=this;r.effectSetting.ntVision?(r.removeOtherStages(),e.scene.postProcessStages.add(n.PostProcessStageLibrary.createNightVisionStage())):r.removeOtherStages()},removeOtherStages:function(){var t=this.viewer,e=t.scene.postProcessStages._activeStages.length;e>0&&t.scene.postProcessStages.removeAll()}}},Pyt=Oyt,Byt=(n("2290"),je(Pyt,Tyt,kyt,!1,null,"cb87d5fa",null)),Iyt=Byt.exports,Dyt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.isWidgetOpen?n("autonomous-roaming",{staticClass:"mapgis-3d-autonomous-roaming",attrs:{isRunning:t.isRunning},on:{load:t.load,unload:t.unload}},[n("div",{staticClass:"footer",attrs:{slot:""},slot:"default"},[n("mapgis-ui-collapse",{attrs:{"expand-icon-position":"right"}},[n("mapgis-ui-collapse-panel",{key:"1",attrs:{header:"查看操作说明"}},[n("img",{staticStyle:{width:"100%"},attrs:{src:t.imgSrc}})])],1),n("div",{staticClass:"footer-operate"},[n("mapgis-ui-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.fullScreenRoaming(!0)}}},[t._v("全屏漫游")]),n("mapgis-ui-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.fullScreenRoaming(!1)}}},[t._v("非全屏漫游")]),n("mapgis-ui-button",{attrs:{type:"primary",size:"small"},on:{click:t.stopRoaming}},[t._v("停止漫游")])],1)],1)]):t._e()},Nyt=[],Fyt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"autonomous-roaming"},[n("mapgis-ui-switch-row-left",{attrs:{title:"鼠标控制模式",disabled:t.isRunning},on:{change:t.enableEnableMouseLook},model:{value:t.roamingSettings.enableMouseLook,callback:function(e){t.$set(t.roamingSettings,"enableMouseLook",e)},expression:"roamingSettings.enableMouseLook"}}),n("mapgis-ui-switch-row-left",{attrs:{title:"碰撞检测"},on:{change:t.enableCollisionDetectionChange},model:{value:t.roamingSettings.enableCollisionDetection,callback:function(e){t.$set(t.roamingSettings,"enableCollisionDetection",e)},expression:"roamingSettings.enableCollisionDetection"}}),n("mapgis-ui-input-number-panel",{staticStyle:{"padding-left":"10px"},attrs:{size:"large",label:"移动步长",range:[0,10]},on:{change:t.moveStepChange},model:{value:t.roamingSettings.moveStep,callback:function(e){t.$set(t.roamingSettings,"moveStep",e)},expression:"roamingSettings.moveStep"}}),t._t("default")],2)},jyt=[],Ryt={name:"AutonomousRoaming",inject:["Cesium","vueCesium","viewer"],props:{isRunning:{type:Boolean,default:!1}},data:function(){return{roamingSettings:{enableCollisionDetection:!1,enableMouseLook:!1,moveStep:1}}},mounted:function(){this.mount()},destroyed:function(){this.unmount()},methods:{mount:function(){var t=this.roamingSettings,e=t.enableCollisionDetection,n=t.enableMouseLook,r=t.moveStep;this.roamingTool=new Cesium.KeyboardCameraController(viewer,{enableMouseLook:n,mouseSensitivity:6,enableDynamicMoveStep:!1,moveStep:r,rotateStep:1,enableCollisionDetection:e}),this.$emit("load",this.roamingTool)},unmount:function(){this.roamingTool&&(this.roamingTool=null),this.$emit("unload",this.roamingTool)},enableCollisionDetectionChange:function(t){this.roamingTool.enableCollisionDetection=t},moveStepChange:function(t){this.roamingTool.moveStep=t},enableEnableMouseLook:function(t){this.roamingTool.enableMouseLook=t}}},Hyt=Ryt,zyt=(n("167d"),je(Hyt,Fyt,jyt,!1,null,"3f5191c5",null)),Uyt=zyt.exports,Vyt={name:"AutonomousRoamingSetting",components:{AutonomousRoaming:Uyt},props:{publicPath:{type:String},isWidgetOpen:{type:Boolean,default:!1}},data:function(){return{isRunning:!1}},computed:{imgSrc:function(){return"".concat(this.publicPath,"autonomousRoaming/autonomous-roaming-keyboard-demo.png")}},mounted:function(){},methods:{load:function(t){this.roamingTool=t},fullScreenRoaming:function(t){this.isRunning=!0,this.roamingTool.enableMouseLook=t,this.roamingTool.start()},stopRoaming:function(){this.isRunning=!1,this.roamingTool.stop()},unload:function(t){this.stopRoaming(),this.roamingTool=t}}},Yyt=Vyt,Gyt=(n("38dd"),n("221a"),je(Yyt,Dyt,Nyt,!1,null,"dcc8c176",null)),Qyt=Gyt.exports,Wyt={name:"mapgis-3d-scene-setting",components:{BasicSetting:ayt,CameraSetting:fyt,LightSetting:byt,WeatherSetting:Lyt,EffectSetting:Iyt,AutonomousRoamingSetting:Qyt},mixins:[Ve],props:{panelStyle:{type:Object},initParams:{type:Object,default:function(){return{}}},initFavoritesParams:{type:Object,default:function(){return{}}},boundingSphereRadius:{type:Number,default:0},baseLayerIds:{type:Array,default:function(){return[]}},publicPath:{type:String,default:"/"},isWidgetOpen:{type:Boolean,default:!1},stuffWidth:{type:Number}},computed:{initBasicSetting:function(){return this.initFavoritesBasicSetting?this.initFavoritesBasicSetting:this.initParams.basicSetting||{earth:!0,skyAtmosphere:!0,shadow:!1,depthTest:!1,FPS:!1,timeline:!1,compass:!1,zoom:!1,statebar:!0,sceneMode:!1,layerbrightness:1,layercontrast:1,layerhue:0,layersaturation:1}},initFavoritesBasicSetting:function(){return this.initFavoritesParams.basicSetting},initCameraSetting:function(){return this.initFavoritesCameraSetting?this.initFavoritesCameraSetting:this.initParams.cameraSetting||{selfAdaption:!1,selfAdaptionParams:{maxHeigh:4e5},undgrd:!1,undgrdParams:{groundAlpha:.5,enableIndependentTranslucency:!1},fov:60}},initFavoritesCameraSetting:function(){return this.initFavoritesParams.cameraSetting},initLightSetting:function(){return this.initFavoritesLightSetting?this.initFavoritesLightSetting:this.initParams.lightSetting||{sunlight:!1,sunlightParams:{lightingMode:"DAYNIGHT_SHADING",lightColor:"rgba(255,255,255,255)"},lightIntensity:10}},initFavoritesLightSetting:function(){return this.initFavoritesParams.lightSetting},initWeatherSetting:function(){return this.initFavoritesWeatherSetting?(this.isFavorites=!0,this.initFavoritesWeatherSetting):(this.isFavorites=!1,this.initParams.weatherSetting||{sun:!0,moon:!0,sceneSkybox:!0,skybox:!1,clouds:!1,cloudsParams:{cloudsduration:5},rain:!1,rainParams:{speed:18,rainOpacity:.6,angle:-30,length:1},snow:!1,snowParams:{size:5,density:5},fog:!1,fogParams:{fogOpacity:.5,color:"#FFFFFF"},surficialFog:!0,surfFogParams:{surfFogDst:2e-4}})},initFavoritesWeatherSetting:function(){return this.initFavoritesParams.weatherSetting},initEffectSetting:function(){return this.initFavoritesEffectSetting?this.initFavoritesEffectSetting:this.initParams.effectSetting||{blckWhite:!1,ntVision:!1,bloom:!1,bloomParams:{bloomBrt:-.3,bloomCtrst:128}}},initFavoritesEffectSetting:function(){return this.initFavoritesParams.effectSetting}},data:function(){return{modelBloom:!1,transform:void 0,tabBarStyle:{margin:"0px",textAlign:"center"},show:!0,hover:!1,spinning:!1,depthTest:void 0,sceneMode:void 0,basicSetting:void 0,cameraSetting:void 0,LightSetting:void 0,weatherSetting:void 0,effectSetting:void 0,isFavorites:!1}},mounted:function(){this.mount()},destroyed:function(){this.unmount()},methods:{mount:function(){var t=this.viewer;this.depthTest=I(t),this.sceneMode=3!==t.scene.mode,this.$emit("loaded",this)},unmount:function(){this.$_deleteManger("SettingToolManager",(function(t){console.log("destroyed")})),this.$emit("unload")},togglePanel:function(){this.show=!this.show},closePanel:function(){this.show=!1},changeSpinning:function(t){this.spinning=t},updateBasicSetting:function(t){this.basicSetting=t},getBasicSetting:function(t){return this.basicSetting||this.initBasicSetting},updateCameraSetting:function(t){this.cameraSetting=t},getCameraSetting:function(t){return this.cameraSetting||this.initCameraSetting},updateLightSetting:function(t){this.lightSetting=t},getLightSetting:function(t){return this.lightSetting||this.initLightSetting},updateWeatherSetting:function(t){this.weatherSetting=t},getWeatherSetting:function(t){return this.weatherSetting||this.initWeatherSetting},updateEffectSetting:function(t){this.effectSetting=t},getEffectSetting:function(t){return this.effectSetting||this.initEffectSetting},updateIndependentTranslucency:function(){this.$refs.cameraSetting.updateIndependentTranslucency()}}},Kyt=Wyt,qyt=(n("e24d"),je(Kyt,Qvt,Wvt,!1,null,"4af2b6c7",null)),Xyt=qyt.exports,$yt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._t("default",(function(){return[n("div",{staticClass:"mapgis-widget-scene-roaming"},[t.roaming?n("div",[n("mapgis-ui-group-tab",[n("div",{staticClass:"header",attrs:{slot:"title"},on:{click:t.onGotoHome},slot:"title"},[n("div",[n("mapgis-ui-iconfont",{staticClass:"return",attrs:{type:"mapgis-left"}})],1),n("div",{staticClass:"name"},[t._v(t._s(t.roamingPath.name))])])]),n("path-roaming",{ref:"refPathRoaming",attrs:{positions:t.roamingPath.path,models:t.models,setting:t.roamingPath.para},on:{"update-setting":t.updateSetting,"remove-road":t.removeRoad,"show-road":t.showRoad,"toggle-road":t.toggleRoad}})],1):n("div",[t.interactiveAdding?n("div",{staticClass:"path-container"},[n("mapgis-ui-group-tab",{attrs:{title:"基本信息"}}),n("mapgis-ui-setting-form",{staticClass:"mapgis-ui-setting-form",attrs:{layout:t.layout,size:"default"}},[n("mapgis-ui-form-item",{attrs:{label:"名称"}},[n("mapgis-ui-input",{staticClass:"full-width",attrs:{allowClear:""},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}})],1)],1),n("mapgis-ui-group-tab",{attrs:{title:"路线坐标"}}),t.positions&&t.positions.length>0?n("mapgis-ui-table",{staticClass:"path-list position-list",attrs:{size:"small",columns:t.addedPositionsColumns,"data-source":t.positions,rowKey:function(t){return t.number}},scopedSlots:t._u([t._l(["x","y","z"],(function(e){return{key:e,fn:function(r,i){return[i.editable?n("mapgis-ui-input",{key:e,attrs:{value:r},on:{change:function(n){return t.handleChange(n.target.value,i.number,e)}}}):n("div",{key:e,staticClass:"path-position",attrs:{title:r}},[t._v("\n "+t._s(r)+"\n ")])]}}})),{key:"operation",fn:function(e,r){return[r.editable?n("span",[n("a",{on:{click:function(e){return t.savePosition(r.number)}}},[t._v("保存")])]):n("span",[n("a",{on:{click:function(e){return t.editPosition(r.number)}}},[t._v("编辑")])])]}}],null,!0)}):n("mapgis-ui-empty",{attrs:{image:t.emptyImage,description:t.emptyDescription}})],1):n("div",{staticClass:"path-container"},[n("mapgis-ui-group-tab",{attrs:{title:t.pathTotal}},[n("mapgis-ui-toolbar",{attrs:{slot:"handle",bordered:!1},slot:"handle"},t._l(t.toolbarList,(function(t,e){return n("mapgis-ui-toolbar-command",{key:e,attrs:{icon:t.icon,title:t.title},on:{click:t.click}})})),1)],1),n("div",{staticClass:"path-list"},t._l(t.pathsCopy,(function(e,r){return n("path-item",{key:r,attrs:{path:e},on:{"goto-path":function(n){return t.onGotoPath(e)},"delete-path":function(n){return t.onDeletePath(e)},"change-path-name":function(n){t.onChangePathName(n,e.id)}}})})),1)],1),n("mapgis-ui-setting-footer",[t.interactiveAdding?n("div",[n("mapgis-ui-button",{on:{click:t.onAddPathCancel}},[t._v("\n 取消\n ")]),n("mapgis-ui-button",{attrs:{type:"primary",disabled:t.addedPositions.length<2},on:{click:t.onAddPathComplete}},[t._v("\n 完成\n ")])],1):n("div",{staticClass:"full-width"},[n("mapgis-ui-button",{staticClass:"full-width",attrs:{type:"primary"},on:{click:t.onAddPathStart}},[t._v("\n 添加路线\n ")])],1)])],1)]),t.pathImportModalVisible?n("path-import",{attrs:{visible:t.pathImportModalVisible,importModalType:t.importModalType},on:{"close-path-import-modal":t.closePathImportModal,"update-paths":t.updatePaths,"update-wl":t.updateWl}}):t._e()]}))],2)},Jyt=[],Zyt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("mapgis-ui-card",{staticClass:"path-item",attrs:{type:"inner"}},[n("div",{staticClass:"path-content"},[t.editable?[t.editable?n("mapgis-ui-input",{staticClass:"name-input",attrs:{value:t.name},on:{change:function(e){return t._onNameChange(e.target.value)}}}):t._e(),n("a",{on:{click:t.onSavePathName}},[t._v("保存")]),n("mapgis-ui-divider",{staticClass:"name-action-divider",attrs:{type:"vertical"}}),n("a",{on:{click:t.onCancelRenamePath}},[t._v("取消")])]:[n("div",{staticClass:"name",on:{click:function(e){return t.$emit("goto-path")}}},[t._v("\n "+t._s(t.name)+"\n ")]),n("div",{class:["actions",t.actionMenuVisible?"actions-visible":""]},[n("mapgis-ui-iconfont",{attrs:{type:"mapgis-info",title:t.path.path.join()}}),n("mapgis-ui-popover",{attrs:{placement:"bottomLeft","arrow-point-at-center":"",trigger:"click",overlayClassName:"scene-roaming-path-item-popover",getPopupContainer:function(t){return t.parentNode}},model:{value:t.actionMenuVisible,callback:function(e){t.actionMenuVisible=e},expression:"actionMenuVisible"}},[n("mapgis-ui-list",{attrs:{slot:"content",gutter:10},slot:"content"},[n("mapgis-ui-list-item",{on:{click:t.onRenamePath}},[t._v("\n 重命名\n ")]),n("mapgis-ui-list-item",{on:{click:t.onDeletePath}},[t._v("\n 删除\n ")])],1),n("mapgis-ui-iconfont",{attrs:{type:"mapgis-more"}})],1)],1)]],2)])},tbt=[],ebt={name:"path-item",props:{path:{type:Object,required:!0,default:function(){}}},watch:{"path.name":{handler:function(){this.name=this.path.name},immediate:!0}},data:function(){return{name:"",actionMenuVisible:!1,editable:!1}},methods:{onRenamePath:function(){this.actionMenuVisible=!1,this.editable=!0},_onNameChange:function(t){this.name=t},onSavePathName:function(){this.editable=!1,this.$emit("change-path-name",this.name)},onCancelRenamePath:function(){this.editable=!1,this.name=this.path.name},onDeletePath:function(){this.actionMenuVisible=!1,this.$emit("delete-path")}}},nbt=ebt,rbt=(n("a7ad"),je(nbt,Zyt,tbt,!1,null,"7f160102",null)),ibt=rbt.exports,obt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._t("default",(function(){return[n("div",{staticClass:"mapgis-path-roaming"},[n("mapgis-ui-setting-form",{attrs:{layout:t.layout,size:"default"}},[n("mapgis-ui-form-item",{attrs:{label:"移动速度"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-input-number-addon",{attrs:{min:1,"addon-after":"公里/小时",disabled:!!t.isStart},model:{value:t.settingCopy.speed,callback:function(e){t.$set(t.settingCopy,"speed",t._n(e))},expression:"settingCopy.speed"}})],1)],1)],1),n("mapgis-ui-form-item",{attrs:{label:"高程类型"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-radio-group",{model:{value:t.settingCopy.elevationType,callback:function(e){t.$set(t.settingCopy,"elevationType",e)},expression:"settingCopy.elevationType"}},[n("mapgis-ui-radio",{attrs:{value:"addition"}},[t._v("\n 附加高程\n ")]),n("mapgis-ui-radio",{attrs:{value:"absolute"}},[t._v("\n 绝对高程\n ")])],1)],1)],1)],1),n("mapgis-ui-form-item",{attrs:{label:"高程"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-input-number-addon",{attrs:{min:0,"addon-after":"米",disabled:!!t.isStart},model:{value:t.settingCopy.exHeight,callback:function(e){t.$set(t.settingCopy,"exHeight",t._n(e))},expression:"settingCopy.exHeight"}})],1)],1)],1),n("mapgis-ui-input-number-panel",{directives:[{name:"show",rawName:"v-show",value:1!==t.settingCopy.animationType,expression:"settingCopy.animationType !== 1"}],attrs:{size:"large",label:"方位角",range:[-180,180],disabled:1===t.settingCopy.animationType},on:{change:function(e){return t.onEffectsChange(e,"heading")}},model:{value:t.settingCopy.heading,callback:function(e){t.$set(t.settingCopy,"heading",e)},expression:"settingCopy.heading"}}),n("mapgis-ui-input-number-panel",{directives:[{name:"show",rawName:"v-show",value:2===t.settingCopy.animationType,expression:"settingCopy.animationType === 2"}],attrs:{size:"large",label:"俯仰角",range:[-180,180],disabled:2!==t.settingCopy.animationType},on:{change:function(e){return t.onEffectsChange(e,"pitch")}},model:{value:t.settingCopy.pitch,callback:function(e){t.$set(t.settingCopy,"pitch",e)},expression:"settingCopy.pitch"}}),n("mapgis-ui-input-number-panel",{directives:[{name:"show",rawName:"v-show",value:t.showDistanceSlider(),expression:"showDistanceSlider()"}],attrs:{size:"large",label:"距离",range:[1,200],disabled:1===t.settingCopy.animationType},on:{change:function(e){return t.changeRange(e)}},model:{value:t.settingCopy.range,callback:function(e){t.$set(t.settingCopy,"range",e)},expression:"settingCopy.range"}}),n("mapgis-ui-form-item",{attrs:{label:"视角"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-select",{on:{change:t.onTypeChange},model:{value:t.settingCopy.animationType,callback:function(e){t.$set(t.settingCopy,"animationType",e)},expression:"settingCopy.animationType"}},t._l(t.perspectiveOptions,(function(e){return n("mapgis-ui-select-option",{key:e.value},[t._v("\n "+t._s(e.label)+"\n ")])})),1)],1)],1)],1),n("mapgis-ui-form-item",{attrs:{label:"插值"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-select",{attrs:{disabled:!!t.isStart},model:{value:t.settingCopy.interpolationAlgorithm,callback:function(e){t.$set(t.settingCopy,"interpolationAlgorithm",e)},expression:"settingCopy.interpolationAlgorithm"}},t._l(t.interpolationOptions,(function(e){return n("mapgis-ui-select-option",{key:e.value},[t._v("\n "+t._s(e.label)+"\n ")])})),1)],1)],1)],1),n("mapgis-ui-form-item",{attrs:{label:"模型"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-select",{attrs:{disabled:t.isStart},on:{change:t.onModelChange},model:{value:t.modelUrl,callback:function(e){t.modelUrl=e},expression:"modelUrl"}},t._l(t.models,(function(e){return n("mapgis-ui-select-option",{key:e.value},[t._v("\n "+t._s(e.label)+"\n ")])})),1)],1)],1)],1),t.modelUrl?n("mapgis-ui-form-item",{attrs:{label:"模型缩放比例"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{attrs:{span:24}},[n("mapgis-ui-input-number-addon",{attrs:{min:0,step:.1,disabled:!!t.isStart},model:{value:t.settingCopy.modelScale,callback:function(e){t.$set(t.settingCopy,"modelScale",t._n(e))},expression:"settingCopy.modelScale"}})],1)],1)],1):t._e(),t.modelUrl?n("mapgis-ui-form-item",[n("mapgis-ui-input-number-panel",{attrs:{size:"large",label:"模型方位角",range:[-180,180]},on:{change:function(e){return t.modelHeadingChange(e)}},model:{value:t.settingCopy.modelHeading,callback:function(e){t.$set(t.settingCopy,"modelHeading",e)},expression:"settingCopy.modelHeading"}})],1):t._e()],1),n("div",[n("mapgis-ui-checkbox",{staticStyle:{"line-height":"32px"},attrs:{checked:t.settingCopy.isLoop},on:{change:function(e){return t.onCheckBoxChange(e.target.checked,"isLoop")}}},[t._v("\n 循环\n ")]),n("mapgis-ui-checkbox",{staticStyle:{"line-height":"32px"},attrs:{checked:t.settingCopy.showPath},on:{change:function(e){return t.onCheckBoxChange(e.target.checked,"showPath")}}},[t._v("\n 显示路径\n ")]),n("mapgis-ui-checkbox",{staticStyle:{"line-height":"32px"},attrs:{checked:t.settingCopy.showInfo},on:{change:function(e){return t.onCheckBoxChange(e.target.checked,"showInfo")}}},[t._v("\n 显示提示信息\n ")])],1)],1),n("mapgis-ui-setting-footer",[n("mapgis-ui-button",{attrs:{type:"primary",title:t.playTitle},on:{click:t.onClickStartOrPauseOrResume}},[t._v(t._s(t.playTitle))]),n("mapgis-ui-button",{attrs:{type:"primary",disabled:!t.isStart},on:{click:function(e){return t.onClickStop(!1)}}},[t._v("停止")])],1)]}))],2)},abt=[];function sbt(t){return sbt="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},sbt(t)}function cbt(t){return dbt(t)||hbt(t)||lbt(t)||ubt()}function ubt(){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 lbt(t,e){if(t){if("string"==typeof t)return fbt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fbt(t,e):void 0}}function hbt(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function dbt(t){if(Array.isArray(t))return fbt(t)}function fbt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function pbt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */pbt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof A?e:A,a=Object.create(o.prototype),s=new E(r||[]);return i(a,"_invoke",{value:M(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function A(){}function v(){}function y(){}var b={};u(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(O([])));_&&_!==n&&r.call(_,a)&&(b=_);var x=y.prototype=A.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(i,o,a,s){var c=h(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==sbt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function M(e,n,r){var i=d;return function(o,a){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var u=h(e,n,r);if("normal"===u.type){if(i=r.done?m:f,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(sbt(e)+" is not iterable")}return v.prototype=y,i(x,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(C.prototype),u(C.prototype,s,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new C(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),u(x,c,"Generator"),u(x,a,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function mbt(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function gbt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){mbt(o,r,i,a,s,"next",t)}function s(t){mbt(o,r,i,a,s,"throw",t)}a(void 0)}))}}function Abt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function vbt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Abt(Object(n),!0).forEach((function(e){ybt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Abt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ybt(t,e,n){return(e=bbt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bbt(t){var e=wbt(t,"string");return"symbol"==sbt(e)?e:e+""}function wbt(t,e){if("object"!=sbt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=sbt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var _bt={name:"mapgis-3d-path-roaming",inject:["Cesium","vueCesium","viewer"],props:vbt(vbt({},ln),{},{layout:{type:String,default:"vertical"},setting:{type:Object,default:function(){return{speed:10,elevationType:"addition",exHeight:1,heading:90,pitch:0,range:1,animationType:1,interpolationAlgorithm:"LagrangePolynomialApproximation",isLoop:!0,showPath:!0,showInfo:!0,modelUrl:"",modelScale:1,modelHeading:0}}},positions:{type:Array,required:!0,default:function(){return[]}},models:{type:Array,required:!0,default:function(){return[]}}}),computed:{playTitle:function(){return this.isStart?this.isPause?"继续":"暂停":"开始"}},watch:{models:{handler:function(){this.models.length>0&&this.models[0].value?""!==this.modelUrl&&this.models.includes(this.modelUrl)||(this.modelUrl=this.models[0].value):this.modelUrl=""},deep:!0,immediate:!0},setting:{handler:function(){this.settingCopy=JSON.parse(JSON.stringify(this.setting)),this.modelUrl=this.settingCopy.modelUrl&&""!==this.settingCopy.modelUrl?this.settingCopy.modelUrl:"",this.settingCopy.elevationType||(this.settingCopy.elevationType="addition"),"number"!==typeof this.settingCopy.modelScale&&this.$set(this.settingCopy,"modelScale",1),"number"!==typeof this.settingCopy.modelHeading&&this.$set(this.settingCopy,"modelHeading",0)},immediate:!0}},data:function(){return{settingCopy:{speed:10,exHeight:1,heading:90,pitch:0,range:1,animationType:1,interpolationAlgorithm:"LagrangePolynomialApproximation",isLoop:!0,showPath:!0,showInfo:!0,modelScale:1},isStart:!1,isPause:!1,perspectiveOptions:[{label:"跟随",value:1},{label:"锁定第一视角",value:2},{label:"上帝视角",value:3}],interpolationOptions:[{label:"拉格朗日插值",value:"LagrangePolynomialApproximation"},{label:"线性近似",value:"LinearApproximation"},{label:"埃尔米特插值",value:"HermitePolynomialApproximation"}],modelUrl:"",showPathBack:!0,showInfoBack:!0}},created:function(){},mounted:function(){this.mount()},destroyed:function(){this.unmount()},methods:{createCesiumObject:function(){var t=gbt(pbt().mark((function t(){return pbt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){t()}),(function(t){})));case 1:case"end":return t.stop()}}),t)})));function e(){return t.apply(this,arguments)}return e}(),mount:function(){window.SceneWanderManager={animation:null},window.SceneWanderManager.animation=new this.Cesium.AnimationTool(this.viewer,{modelUrl:this.modelUrl,model:{scale:this.settingCopy.modelScale},onPositionTag:!0,isSetModelPosture:!0,callback:function(t){}});var t=this,e=this.createCesiumObject();e.then((function(e){t.$emit("load",t)}))},unmount:function(){this.onClickStop(!0),this.$emit("unload",this)},onClickStartOrPauseOrResume:function(){var t,e=this;this.isStart?(this.isPause?window.SceneWanderManager.animation.pause=!1:window.SceneWanderManager.animation.pause=!0,this.isPause=!this.isPause):(this.$emit("remove-road"),this.positions.length>0&&(t=this.positions[0]instanceof Object?JSON.parse(JSON.stringify(this.positions)).flatMap((function(t){return[t.x,t.y,"addition"===e.settingCopy.elevationType?t.z:e.settingCopy.exHeight]})).flat():"addition"===this.settingCopy.elevationType?JSON.parse(JSON.stringify(this.positions)):this.getAbsolutePositions(),window.SceneWanderManager.animation.positions=this.Cesium.Cartesian3.fromDegreesArrayHeights(t),this._setAnimationAttr(),window.SceneWanderManager.animation.start(),this.isStart=!0,this.isPause=!1))},onClickStop:function(t){this.isStart&&window.SceneWanderManager.animation.stop(),this.isStart=!1,this.isPause=!1,t?this.$emit("update-setting",this.settingCopy):this.$emit("show-road")},_setAnimationAttr:function(){var t=this.settingCopy,e=t.speed,n=t.elevationType,r=t.exHeight,i=t.heading,o=t.pitch,a=t.animationType,s=t.interpolationAlgorithm,c=t.isLoop,u=t.showPath,l=t.showInfo,h=t.modelScale,d=t.modelHeading;switch(window.SceneWanderManager.animation.speed=(.28*e).toFixed(2),window.SceneWanderManager.animation.exHeight="addition"===n?r:1,window.SceneWanderManager.animation.heading=Cesium.Math.toRadians(i),window.SceneWanderManager.animation.pitch=Cesium.Math.toRadians(o),window.SceneWanderManager.animation.animationType=a,window.SceneWanderManager.animation.isLoop=c,window.SceneWanderManager.animation.isShowPath=u,window.SceneWanderManager.animation.showInfo=l,window.SceneWanderManager.animation.modelHeading=d,this.modelUrl&&(window.SceneWanderManager.animation._model.scale=h),s){case"LagrangePolynomialApproximation":window.SceneWanderManager.animation.interpolationAlgorithm=this.Cesium.LagrangePolynomialApproximation;break;case"LinearApproximation":window.SceneWanderManager.animation.interpolationAlgorithm=this.Cesium.LinearApproximation;break;case"HermitePolynomialApproximation":window.SceneWanderManager.animation.interpolationAlgorithm=this.Cesium.HermitePolynomialApproximation;break;default:break}3===window.SceneWanderManager.animation.animationType?this.settingCopy.range=200:2===window.SceneWanderManager.animation.animationType?this.settingCopy.range=10:this.settingCopy.range=1,window.SceneWanderManager.animation.range=this.settingCopy.range,2===window.SceneWanderManager.animation.animationType&&(window.SceneWanderManager.animation.isShowPath=!1,window.SceneWanderManager.animation.showInfo=!1,this.settingCopy.showPath=!1,this.settingCopy.showInfo=!1),this.$emit("remove-road")},onCheckBoxChange:function(t,e){this.settingCopy[e]=t,"showPath"===e&&(this.showPathBack=t,this.$emit("toggle-road",{show:t})),"showInfo"===e&&(this.showInfoBack=t),window.SceneWanderManager.animation[e]=t},onEffectsChange:function(t,e){window.SceneWanderManager.animation[e]=this.Cesium.Math.toRadians(parseInt(t))},changeRange:function(t){window.SceneWanderManager.animation.range=parseInt(t)},onTypeChange:function(t){window.SceneWanderManager.animation.animationType=t,3===window.SceneWanderManager.animation.animationType?this.settingCopy.range=200:2===window.SceneWanderManager.animation.animationType?(this.settingCopy.range=10,this.settingCopy.showPath=!1,this.settingCopy.showInfo=!1):this.settingCopy.range=1,window.SceneWanderManager.animation.range=this.settingCopy.range,2!==t&&(this.settingCopy.showPath=this.showPathBack,this.settingCopy.showInfo=this.showInfoBack)},onModelChange:function(t){window.SceneWanderManager.animation._modelUrl=t,this.settingCopy.modelUrl=t},modelHeadingChange:function(t){window.SceneWanderManager.animation.modelHeading=t,this.settingCopy.modelHeading=t},getAbsolutePositions:function(){for(var t=cbt(this.positions),e=2;e<t.length;e+=3)t[e]=this.settingCopy.exHeight;return t},showDistanceSlider:function(){return 1===this.settingCopy.animationType||3===this.settingCopy.animationType}}},xbt=_bt,Sbt=(n("21f1"),je(xbt,obt,abt,!1,null,"31adf0d2",null)),Cbt=Sbt.exports,Mbt=n("3059"),Lbt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("mapgis-ui-modal",{staticClass:"path-import-wrapper",attrs:{visible:t.visible,title:t.title,width:300,mask:!1},on:{cancel:t.onImportCancel,ok:t.onImportOk}},[n("template",{slot:"footer"},[n("mapgis-ui-button",{key:"cancel",on:{click:t.onImportCancel}},[t._v("\n 取消\n ")]),n("mapgis-ui-button",{key:"ok",attrs:{type:"primary",loading:t.loading},on:{click:t.onImportOk}},[t._v("\n 确定\n ")])],1),n("div",{staticClass:"path-import-body"},[n("mapgis-ui-row",[n("input",{attrs:{type:"file",id:"file",accept:"."+t.importModalType},on:{input:t.readOrUploadFile}})])],1)],2)},Tbt=[];function kbt(t){return kbt="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},kbt(t)}function Ebt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ebt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof A?e:A,a=Object.create(o.prototype),s=new E(r||[]);return i(a,"_invoke",{value:M(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function A(){}function v(){}function y(){}var b={};u(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(O([])));_&&_!==n&&r.call(_,a)&&(b=_);var x=y.prototype=A.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(i,o,a,s){var c=h(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==kbt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function M(e,n,r){var i=d;return function(o,a){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var u=h(e,n,r);if("normal"===u.type){if(i=r.done?m:f,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(kbt(e)+" is not iterable")}return v.prototype=y,i(x,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(C.prototype),u(C.prototype,s,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new C(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),u(x,c,"Generator"),u(x,a,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Obt(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Pbt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Obt(o,r,i,a,s,"next",t)}function s(t){Obt(o,r,i,a,s,"throw",t)}a(void 0)}))}}var Bbt={name:"path-import",inject:["ip","port"],props:{visible:{type:Boolean,default:!1},importModalType:{type:String,default:""}},computed:{title:function(){return"json"===this.importModalType?"导入漫游路径":"上传文件"}},data:function(){return{data:null,node:null,loading:!1}},methods:{onImportCancel:function(){this.node=null,this.data=null,this.$emit("close-path-import-modal",!1)},onImportOk:function(){this.$emit("close-path-import-modal",!1),"json"===this.importModalType?this.$emit("update-paths",this.data):this.$emit("update-wl",this.node)},readOrUploadFile:function(t){this.loading=!0,"json"===this.importModalType?this.readImportFile(t):this.uploadFile(t)},uploadFile:function(){var t=Pbt(Ebt().mark((function t(e){var n,r,i,o,a,s;return Ebt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.target.files[0],r=new FormData,r.append("files",n),t.prev=3,t.next=6,this.uploadRequest(r);case 6:if(i=t.sent,!(i&&Object.keys(i).length>0)){t.next=12;break}return t.next=10,this.featureQuery(i.uploadFiles[0].path);case 10:o=t.sent,o&&Object.keys(o).length>0&&(a=o.features[0].geometry.coordinates,s=a.map((function(t){return[t[0],t[1],0]})),this.node={path:s.join(",").split(","),name:o.name.split(".")[0]},this.loading=!1);case 12:t.next=16;break;case 14:t.prev=14,t.t0=t["catch"](3);case 16:case"end":return t.stop()}}),t,this,[[3,14]])})));function e(e){return t.apply(this,arguments)}return e}(),uploadRequest:function(t){var e=this,n=new Promise((function(n,r){qe()({method:"post",url:"".concat(window.location.protocol,"//").concat(e.ip,":").concat(e.port,"/igs/rest/services/system/ResourceServer/files"),headers:{"Content-type":"multipart/form-data"},data:t,timeout:2e4}).then((function(t){t&&t.data?n(t.data):n(null)}))}));return n.then((function(t){return t}))},featureQuery:function(t){var e=this,n=new Promise((function(n,r){qe()({method:"get",url:"".concat(window.location.protocol,"//").concat(e.ip,":").concat(e.port,"/igs/rest/services/system/ResourceServer/tempData/features/query?f=json&url=").concat(t),timeout:2e4}).then((function(t){t&&t.data?n(t.data):n(null)}))}));return n.then((function(t){return t}))},readImportFile:function(t){var e=this,n=t.target.files[0],r=new FileReader;r.readAsText(n),r.onload=function(t){var n=JSON.parse(t.target.result);e.data=n,e.loading=!1}}}},Ibt=Bbt,Dbt=je(Ibt,Lbt,Tbt,!1,null,null,null),Nbt=Dbt.exports;function Fbt(t){return Fbt="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},Fbt(t)}function jbt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */jbt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof A?e:A,a=Object.create(o.prototype),s=new E(r||[]);return i(a,"_invoke",{value:M(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function A(){}function v(){}function y(){}var b={};u(b,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(O([])));_&&_!==n&&r.call(_,a)&&(b=_);var x=y.prototype=A.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(i,o,a,s){var c=h(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Fbt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function M(e,n,r){var i=d;return function(o,a){if(i===p)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=L(s,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var u=h(e,n,r);if("normal"===u.type){if(i=r.done?m:f,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function L(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Fbt(e)+" is not iterable")}return v.prototype=y,i(x,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:v,configurable:!0}),v.displayName=u(y,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(C.prototype),u(C.prototype,s,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new C(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),u(x,c,"Generator"),u(x,a,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Rbt(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Hbt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Rbt(o,r,i,a,s,"next",t)}function s(t){Rbt(o,r,i,a,s,"throw",t)}a(void 0)}))}}function zbt(t){return Gbt(t)||Ybt(t)||Vbt(t)||Ubt()}function Ubt(){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 Vbt(t,e){if(t){if("string"==typeof t)return Qbt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qbt(t,e):void 0}}function Ybt(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function Gbt(t){if(Array.isArray(t))return Qbt(t)}function Qbt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Wbt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Kbt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wbt(Object(n),!0).forEach((function(e){qbt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wbt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function qbt(t,e,n){return(e=Xbt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xbt(t){var e=$bt(t,"string");return"symbol"==Fbt(e)?e:e+""}function $bt(t,e){if("object"!=Fbt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Fbt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Jbt={name:"mapgis-3d-scene-roaming",inject:["Cesium","vueCesium","viewer"],components:{PathItem:ibt,PathRoaming:Cbt,PathImport:Nbt},props:Kbt(Kbt({},ln),{},{layout:{type:String,default:"vertical"},setting:{type:Object,default:function(){return{speed:10,elevationType:"addition",exHeight:1,heading:90,pitch:0,range:1,animationType:1,interpolationAlgorithm:"LagrangePolynomialApproximation",isLoop:!0,showPath:!0,showInfo:!0,modelUrl:""}}},models:{type:Array,required:!0,default:function(){return[]}},paths:{type:Array,required:!0,default:function(){return[]}}}),computed:{pathTotal:function(){return"".concat(this.pathsCopy.length,"条路线")},positions:{get:function(){return this.addedPositions.map((function(t,e){return Kbt({number:e+1},t)}))},set:function(t){this.addedPositions=zbt(t)}}},watch:{paths:{handler:function(){this.pathsCopy=JSON.parse(JSON.stringify(this.paths))},deep:!0,immediate:!0}},data:function(){return{interactiveAdding:!1,roaming:!1,roamingPath:null,name:"",addedPositions:[],addedPositionsColumns:[{title:"序号",dataIndex:"number",align:"center",ellipsis:!0,width:42},{title:"经度",dataIndex:"x",align:"center",ellipsis:!0,scopedSlots:{customRender:"x"}},{title:"纬度",dataIndex:"y",align:"center",ellipsis:!0,scopedSlots:{customRender:"y"}},{title:"高度",dataIndex:"z",align:"center",ellipsis:!0,scopedSlots:{customRender:"z"},width:60},{title:"操作",dataIndex:"operation",align:"center",ellipsis:!0,scopedSlots:{customRender:"operation"}}],pathsCopy:[],emptyImage:Mbt["MapgisUiEmpty"].PRESENTED_IMAGE_SIMPLE,emptyDescription:"暂无数据",lastClickLineId:void 0,toolbarList:[{icon:"mapgis-upload",title:"上传wl文件",click:this._uploadPaths},{icon:"mapgis-Import",title:"导入",click:this._importPaths},{icon:"mapgis-export",title:"导出",click:this._exportPaths},{icon:"mapgis-save",title:"保存",click:this._savePaths}],pathImportModalVisible:!1,importModalType:""}},created:function(){},mounted:function(){this.mount()},destroyed:function(){this.unmount()},methods:{createCesiumObject:function(){var t=Hbt(jbt().mark((function t(){return jbt().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){t()}),(function(t){})));case 1:case"end":return t.stop()}}),t)})));function e(){return t.apply(this,arguments)}return e}(),mount:function(){var t=this,e=this.createCesiumObject();e.then((function(e){t.$emit("load",t)})),this.pointArr=[]},unmount:function(){this.onGotoHome(),this._stopAdded(),this._stopRoaming(),this.$emit("unload",this)},onAddPathStart:function(){this.interactiveAdding=!0;var t=this.getPathId();this.name="路线".concat(t),this.draw=new this.Cesium.DrawElement(this.viewer);var e=this.Cesium.Material.fromType("Color");e.uniforms.color=new this.Cesium.Color(.9,.6,.1,.5),this.linePoints=[];var n=this;this.draw.startDrawingMarker({material:e,addDefaultMark:!1,callback:function(t){var e=n.viewer.scene.globe.ellipsoid,r=e.cartesianToCartographic(t.position),i=n.Cesium.Math.toDegrees(r.longitude),o=n.Cesium.Math.toDegrees(r.latitude),a=r.height;n.addedPositions.push({x:i,y:o,z:a}),n.linePoints.push(i),n.linePoints.push(o),n.linePoints.push(a),n.addedPositions.length>1&&(n.removeRoad(),n.polyline=n.viewer.entities.add({name:"scence-roaming",polyline:{positions:n.Cesium.Cartesian3.fromDegreesArrayHeights(n.linePoints),width:2,material:n.Cesium.Color.RED,clampToGround:!1}})),n.drawPoint(!0)}})},getPathId:function(){var t=1;if(this.pathsCopy.length>0){var e=this.pathsCopy.map((function(t,e){return t.id||e+1})).sort((function(t,e){return t-e}));t=+e[e.length-1]+1}return t},onAddPathComplete:function(){var t=this.getPathId(),e=this.setting,n=e.speed,r=e.elevationType,i=e.exHeight,o=e.heading,a=e.pitch,s=e.range,c=e.animationType,u=e.interpolationAlgorithm,l=e.isLoop,h=e.showPath,d=e.showInfo,f=this.addedPositions.map((function(t){return[t.x,t.y,t.z]})).reduce((function(t,e){return t.concat(e)})),p={name:this.name,id:t,path:f,para:{speed:n,elevationType:r,exHeight:i,heading:o,pitch:a,range:s,animationType:c,interpolationAlgorithm:u,isLoop:l,showPath:h,showInfo:d,modelUrl:""}};this.pathsCopy.push(p),this._stopAdded()},onAddPathCancel:function(){this._stopAdded()},onGotoPath:function(t){this.roamingPath=t;for(var e=0;e<this.roamingPath.path.length;e++)this.roamingPath.path[e]=Number(this.roamingPath.path[e]);this.roaming=!0,this.lastClickLineId=t.id+"",this.showRoad()},onGotoHome:function(){this.$refs.refPathRoaming&&this.$refs.refPathRoaming.onClickStop(!0),this.roaming=!1,this.removeRoad()},onDeletePath:function(t){var e=this.pathsCopy.indexOf(t);e>-1&&this.pathsCopy.splice(e,1)},onChangePathName:function(t,e){var n=zbt(this.pathsCopy),r=n.find((function(t){return t.id===e}));r&&(r.name=t,this.pathsCopy=n)},updateSetting:function(t){var e=this;this.pathsCopy.map((function(n){return n.id==e.roamingPath.id&&(n.para=Kbt({},t)),n}))},removeRoad:function(){this.polyline&&(this.viewer.entities.remove(this.polyline),this.polyline=void 0)},removePoint:function(){var t=this;this.pointArr&&this.pointArr.length>0&&(this.pointArr.forEach((function(e){t.viewer.entities.remove(e)})),this.pointArr=[])},showRoad:function(){this.removeRoad(),this.polyline=this.viewer.entities.add({id:this.roamingPath.id+"",polyline:{positions:this.Cesium.Cartesian3.fromDegreesArrayHeights(this.roamingPath.path),width:2,material:this.Cesium.Color.RED,clampToGround:!1}}),this.viewer.flyTo(this.polyline)},toggleRoad:function(t){this.polyline&&(this.polyline.show=t.show)},drawPoint:function(t){if(t){var e=[this.linePoints[this.linePoints.length-3],this.linePoints[this.linePoints.length-2],this.linePoints[this.linePoints.length-1]],n=this.viewer.entities.add({position:this.Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]),point:{pixelSize:10,color:this.Cesium.Color.RED}});this.pointArr.push(n)}else{this.removePoint();for(var r=0;r<this.linePoints.length-1;r+=3){var i=[this.linePoints[r],this.linePoints[r+1],this.linePoints[r+2]],o=this.viewer.entities.add({position:this.Cesium.Cartesian3.fromDegrees(i[0],i[1],i[2]),point:{pixelSize:10,color:this.Cesium.Color.RED}});this.pointArr.push(o)}}},_stopAdded:function(){this.removeRoad(),this.removePoint(),this.draw&&this.draw.stopDrawing(),this.interactiveAdding=!1,this.addedPositions=[],this.linePoints=[]},_stopRoaming:function(){this.$refs.refPathRoaming&&this.$refs.refPathRoaming.onClickStop(!0)},onGetPathRoaming:function(){return this.$refs.refPathRoaming},_savePaths:function(){this.$emit("save-paths",this.pathsCopy)},_importPaths:function(){this.importModalType="json",this.pathImportModalVisible=!this.pathImportModalVisible},_uploadPaths:function(){this.importModalType="wl",this.pathImportModalVisible=!this.pathImportModalVisible},_exportPaths:function(){if(this.pathsCopy&&this.pathsCopy.length>0){var t={pathData:this.pathsCopy,version:1},e=JSON.stringify(t),n=Date.now(),r=new Blob([e],{type:"application/json;charset=utf-8"});Object(Ec["saveAs"])(r,"pathJson_".concat(n,".json")),this.$message.success("导出成功")}},closePathImportModal:function(t){this.pathImportModalVisible=!1},updateWl:function(t){var e=t.path,n=t.name,r=this.getPathId(),i=this.setting,o=i.speed,a=i.elevationType,s=i.exHeight,c=i.heading,u=i.pitch,l=i.range,h=i.animationType,d=i.interpolationAlgorithm,f=i.isLoop,p=i.showPath,m=i.showInfo,g={name:"".concat(n).concat(r),id:r,path:e,para:{speed:o,elevationType:a,exHeight:s,heading:c,pitch:u,range:l,animationType:h,interpolationAlgorithm:d,isLoop:f,showPath:p,showInfo:m,modelUrl:""}};this.pathsCopy.push(g)},updatePaths:function(t){var e=this;if(!t)return this.$message.error("导入失败,未获取到漫游路径");t.pathData.forEach((function(t){var n=e.pathsCopy.findIndex((function(e){return e.id===t.id}));n>-1?e.pathsCopy.splice(n,1,t):e.pathsCopy.push(t)}))},savePosition:function(t){for(var e=zbt(this.positions),n=0;n<e.length;n++)e[n].x=Number(e[n].x),e[n].y=Number(e[n].y),e[n].z=Number(e[n].z);var r=e.find((function(e){return t===e.number}));r&&(delete r.editable,this.positions=e),this.resizeRoaming()},editPosition:function(t){var e=zbt(this.positions),n=e.find((function(e){return e.number===t}));n.editable=!0,this.positions=e},handleChange:function(t,e,n){var r=zbt(this.positions),i=r.find((function(t){return e===t.number}));i&&(i[n]=t,this.positions=r)},resizeRoaming:function(){var t=this;this.linePoints=[],this.addedPositions.forEach((function(e){t.linePoints.push(e.x),t.linePoints.push(e.y),t.linePoints.push(e.z)})),this.addedPositions.length>1&&(this.removeRoad(),this.polyline=this.viewer.entities.add({name:"scence-roaming",polyline:{positions:this.Cesium.Cartesian3.fromDegreesArrayHeights(this.linePoints),width:2,material:this.Cesium.Color.RED,clampToGround:!1}})),this.drawPoint()}}},Zbt=Jbt,twt=(n("84f1"),je(Zbt,$yt,Jyt,!1,null,"f6b54c84",null)),ewt=twt.exports,nwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("mapgis-ui-comprehensive-query",{attrs:{geoJSONExtent:t.geoJSONExtent,logo:t.logo,districtName:t.districtName,widgetInfo:t.widgetInfo,defaultMarkerIcon:t.defaultMarkerIcon,selectedMarkerIcon:t.selectedMarkerIcon},on:{onClose:t.onClose,onSearch:t.onSearch,"current-result":t.currentResult,"select-markers":t.selectMarkers,"click-item":t.clickItem,"change-cluster":t.changeCluster,"open-attribute-table":t.openAttributeTable,"remove-attribute-table":t.removeAttributeTable,"color-cluster":t.setColorCluster}}),n("place-name-cesium",{attrs:{defaultMarkerIcon:t.defaultMarkerIcon,selectedMarkerIcon:t.selectedMarkerIcon,hoverMarker:t.hoverMarker,cluster:t.cluster,geojson:t.current,colorCluster:t.colorCluster}})],1)},rwt=[],iwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.cluster?t.geojson&&t.geojson.features&&t.geojson.features.length>0&&t.colorCluster?n("mapgis-3d-mapv-layer",{attrs:{geojson:t.geojson,options:t.options,"count-field":"count"}}):t._e():n("mapgis-3d-dynamic-marker-layer",{attrs:{data:t.geojson,selects:t.hoverMarker,highlight:!1,layerStyle:t.layerStyle,highlightStyle:t.highlightStyle,idField:"markerId"}})],1)},owt=[],awt=K["Style"].MarkerStyle,swt=K["Style"].LineStyle,cwt=K["Style"].PointStyle,uwt=K["Style"].FillStyle,lwt={name:"place-name-cesium",inject:["Cesium","vueCesium","viewer"],props:{selectedMarkerIcon:{type:String,default:""},defaultMarkerIcon:{type:String,default:""},cluster:{type:Boolean,default:!1},colorCluster:{type:String,default:""},geojson:{type:Object,default:function(){return{}}},hoverMarker:{type:Array,default:function(){return[]}}},computed:{layerStyle:function(){return new awt({symbol:this.defaultMarkerIcon})},highlightStyle:function(){return{enableHoverMarker:!1,enableHoverFeature:!1,marker:new awt({symbol:this.selectedMarkerIcon}),point:new cwt,line:new swt,polygon:new uwt}},options:function(){return{fillStyle:this.colorCluster,size:50/3/2,minSize:8,maxSize:31,globalAlpha:.8,clusterRadius:150,maxClusterZoom:18,maxZoom:19,minPoints:5,extent:400,label:{show:!0,fillStyle:"white"},gradient:{0:"blue",.5:"yellow",1:"rgb(255,0,0)"},cesium:{postRender:!0,postRenderFrame:0},draw:"cluster",context:"2d"}}}},hwt=lwt,dwt=je(hwt,iwt,owt,!1,null,null,null),fwt=dwt.exports,pwt={name:"mapgis-3d-comprehensive-query",components:{PlaceNameCesium:fwt},inject:["Cesium","vueCesium","viewer"],props:{logo:{type:String,default:""},defaultMarkerIcon:{type:String,default:""},selectedMarkerIcon:{type:String,default:""},districtName:{type:String,default:""},geoJSONExtent:{type:Object,default:function(){return{}}},widgetInfo:{type:Object,default:function(){return{}}}},data:function(){return{cluster:!1,colorCluster:"",current:{type:"FeatureCollection",features:[]},hoverMarker:[],district:null}},methods:{onClose:function(){this.$emit("onClose")},onSearch:function(){this.$emit("onSearch")},setColorCluster:function(t){this.colorCluster=t},currentResult:function(t){this.current=t},clickItem:function(t){var e=wf(t);this.flyTo(e[0],e[1])},flyTo:function(t,e,n,r){var i=this.viewer,o=this.Cesium;if(null===n||""===n||void 0===n){var a=Math.ceil(i.camera.positionCartographic.height);n=a}i.camera.flyTo({destination:o.Cartesian3.fromDegrees(t,e,n),duration:r,orientation:{heading:o.Math.toRadians(0),pitch:o.Math.toRadians(-90),roll:o.Math.toRadians(0)}})},selectMarkers:function(t){this.hoverMarker=t},changeCluster:function(t){this.current={type:"FeatureCollection",features:[]},this.cluster=t},openAttributeTable:function(t){this.$emit("open-attribute-table",t)},removeAttributeTable:function(t){this.$emit("remove-attribute-table",t)}}},mwt=pwt,gwt=je(mwt,nwt,rwt,!1,null,null,null),Awt=gwt.exports,vwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._l(t.popups,(function(e,r){return[t.enablePopup?n("mapgis-3d-popup",{key:r,attrs:{position:{longitude:e.lng,latitude:e.lat,height:e.alt},forceRender:!0,isDataFlow:"",vueIndex:e.vueIndex},on:{change:t.$_toggle},model:{value:e.show,callback:function(n){t.$set(e,"show",n)},expression:"popup.show"}},[n("mapgis-ui-popup-content",{attrs:{feature:e.properties,width:260}},[n("mapgis-3d-popup-iot",{attrs:{properties:e.properties}})],1)],1):t._e()]}))],2)},ywt=[];function bwt(t){return bwt="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},bwt(t)}function wwt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _wt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?wwt(Object(n),!0).forEach((function(e){xwt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wwt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function xwt(t,e,n){return(e=Swt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Swt(t){var e=Cwt(t,"string");return"symbol"==bwt(e)?e:e+""}function Cwt(t,e){if("object"!=bwt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=bwt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Mwt=K["Style"].PointStyle,Lwt=K["Style"].ModelStyle,Twt=K["Style"].MarkerStyle,kwt={name:"mapgis-3d-data-flow-layer",inject:["viewer","Cesium"],props:{baseUrl:{type:String},UUID:{type:String,default:"imei"},updateInterval:{type:Number,default:300},options:{type:Object},layerStyle:{type:Object,default:function(){return{}}},enableFlyTo:{type:Boolean,default:!1},showPosition:{type:Boolean,default:!0},flyToOptions:{type:Object,default:function(){return{}}},vueKey:{type:String,default:"default"},vueIndex:{type:[String,Number],default:function(){return(1e8*Math.random()).toFixed(0)}},enablePopup:{type:Boolean,default:!1},popupOptions:{type:Object,default:function(){return{}}},enableDirect:{type:Boolean,default:!0},publicPath:{type:String,default:"/"}},watch:{layerStyle:{handler:function(){var t,e=this.layerStyle.type||this.defaultStyle.type;t=this.layerStyle[e]&&"{}"!==this.layerStyle[e]?this.layerStyle[e]:this.defaultStyle[e],this.layerStyleCopy=_wt(_wt({type:e,fixNum:10},t),this.layerStyle.layerStyle);var n=window.vueCesium.DataFlowManager.findSource(this.vueKey,this.vueIndex);if(n&&n.source){var r,i,o=n.source,a=this,s=[];if(this.currentType!==this.layerStyleCopy.type){this.websocket.close(),clearInterval(this.interval);for(var c=0;c<o.length;c++){switch(this.viewer.entities.remove(o[c]),this.layerStyleCopy.type){case"point":r=this.getOptions("point");var u=new Mwt(r);i=this.viewer.entities.add({id:this.features[c].properties[this.UUID],position:Cesium.Cartesian3.fromDegrees(this.features[c].geometry.coordinates[0],this.features[c].geometry.coordinates[1],20),point:u.toCesiumStyle(Cesium),properties:this.features[c].properties,keys:Object.keys(this.features[c].properties)});break;case"model":r=this.getOptions("model");var l=new Lwt(r);i=this.viewer.entities.add({id:this.features[c].properties[this.UUID],position:Cesium.Cartesian3.fromDegrees(this.features[c].geometry.coordinates[0],this.features[c].geometry.coordinates[1],20),model:l.toCesiumStyle(Cesium),properties:this.features[c].properties,keys:Object.keys(this.features[c].properties)});break;case"marker":r=this.getOptions("marker");var h=new K["Style"].MarkerStyle;h=h.toCesiumStyle(r,this.features[c],Cesium),i=this.viewer.entities.add({id:this.features[c].properties[this.UUID],position:Cesium.Cartesian3.fromDegrees(this.features[c].geometry.coordinates[0],this.features[c].geometry.coordinates[1],20),billboard:h.billboard,label:h.label,properties:this.features[c].properties,keys:Object.keys(this.features[c].properties)});break}s.push(i)}window.vueCesium.DataFlowManager.deleteSource(this.vueKey,this.vueIndex),window.vueCesium.DataFlowManager.addSource(this.vueKey,this.vueIndex,s),this.currentType=this.layerStyleCopy.type,this.websocket=new WebSocket(this.baseUrl),this.websocket.onmessage=function(t){a.$_webSocketCallBack(t,a)},this.$_setUpdatedEvent()}else switch(this.layerStyleCopy.type){case"point":r=this.getOptions("point");for(var d=0;d<o.length;d++){var f=new K["Style"].PointStyle(r);o[d]["point"]=o[d]["point"]||{},o[d]["point"]=Object.assign(o[d][this.layerStyleCopy.type],f.toCesiumStyle(Cesium))}break;case"marker":r=this.getOptions("marker");for(var p=0;p<o.length;p++){var m=new K["Style"].MarkerStyle;m=m.toCesiumStyle(r,{},Cesium),o[p]["billboard"]=o[p]["billboard"]||{},o[p]["billboard"]=Object.assign(o[p]["billboard"],m.billboard),o[p]["label"]=o[p]["label"]||{text:""},m.label.text=o[p]["label"].text,o[p]["label"]=Object.assign(o[p]["label"],m.label)}break;case"model":r=this.getOptions("model");for(var g=0;g<o.length;g++){var A=new K["Style"].ModelStyle(r);o[g]["model"]=o[g]["model"]||{},o[g]["model"]=Object.assign(o[g][r.type],A.toCesiumStyle(Cesium))}break}}},deep:!0}},data:function(){return{features:[],firstAdd:!0,popups:[],websocket:void 0,currentType:void 0,interval:void 0,layerStyleCopy:{fixNum:10},popupOption:{postRender:!1},defaultStyle:{type:"point",marker:{yOffset:0,xOffset:0,markerUrl:"/file/data/2023/09/22/测试图片_20230922092705A003.png",rotation:0,width:20,imageScale:1,height:20},model:{modelUrl:"/CesiumModels/Cesium_Man.glb",scale:1e3},point:{radius:10,color:"rgb(255,255,102)",outlineColor:"rgb(255,255,102)",outlineWidth:8,outlineOpacity:1}}}},created:function(){var t=this.layerStyle[this.layerStyle.type];if(this.layerStyle.type&&Object.keys(t).length>0)this.layerStyleCopy=_wt(_wt({type:this.layerStyle.type,fixNum:10},this.layerStyle[this.layerStyle.type]),this.layerStyle.layerStyle);else{var e=this.layerStyle.type||this.defaultStyle.type;this.layerStyleCopy=_wt(_wt({type:e,fixNum:10},this.defaultStyle[e]),this.layerStyle.layerStyle)}},mounted:function(){this.$_addEntityLayer()},destroyed:function(){var t=this.vueKey,e=this.vueIndex,n=window.vueCesium.DataFlowManager.findSource(t,e);if(n&&n.source){var r=n.source;this.websocket.close(),this.handler&&this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);for(var i=0;i<r.length;i++)this.viewer.entities.remove(r[i]);for(var o=0;o<this.popups.length;o++){var a,s=window.vueCesium.PopupManager.findSource(this.vueKey,this.popups[o].vueIndex);null===s||void 0===s||null===(a=s.source)||void 0===a||a.remove(),window.vueCesium.PopupManager.deleteSource(this.vueKey,this.popups[o].vueIndex)}this.popups=[],vueCesium.DataFlowManager.deleteSource(t,e)}},methods:{$_toggle:function(t,e){for(var n=0;n<this.popups.length;n++)if(this.popups[n].vueIndex===e){this.popups[n].show=t;break}},setModelDirection:function(t,e,n){var r=Cesium.Cartesian3.fromDegrees(t,e,20),i=Cesium.Math.toRadians(n),o=0,a=0,s=new Cesium.HeadingPitchRoll(i,o,a),c=Cesium.Transforms.headingPitchRollQuaternion(r,s);return c},$_cartesian3ToLongLat:function(t){var e={},n=Cesium.Cartographic.fromCartesian(t);return e.lat=Cesium.Math.toDegrees(n.latitude),e.lng=Cesium.Math.toDegrees(n.longitude),e.alt=n.height,e},$_webSocketCallBack:function(t,e){var n,r,i=e.vueKey,o=e.vueIndex,a=JSON.parse(t.data),s=!0,c=window.vueCesium.DataFlowManager.findSource(i,o);if(e.firstAdd&&e.enableFlyTo){var u={duration:6},l=1400,h=e.flyToOptions.height;(0===h||h)&&(l=Number(h)),u=Object.assign(u,e.flyToOptions),e.viewer.camera.flyTo(_wt({destination:Cesium.Cartesian3.fromDegrees(a.geometry.coordinates[0],a.geometry.coordinates[1],l)},u)),e.firstAdd=!1}if(c&&c.source){r=c.source;for(var d=0;d<r.length;d++)if(r[d].properties[e.UUID].getValue()===a.properties[e.UUID]){s=!1,n=d;break}}if(s){var f,p;r||(r=[],window.vueCesium.DataFlowManager.addSource(i,o,r));var m=Object.keys(a.properties);switch(e.features.push({type:"point",geometry:a.geometry,properties:a.properties}),e.layerStyleCopy.type){case"point":f=this.getOptions("point");var g=new Mwt(f);p=e.viewer.entities.add({id:a.properties[e.UUID],position:Cesium.Cartesian3.fromDegrees(a.geometry.coordinates[0],a.geometry.coordinates[1],20),point:g.toCesiumStyle(Cesium),properties:a.properties,keys:m});break;case"model":f=this.getOptions("model");var A=new Lwt(f),v=new Cesium.HeadingPitchRoll(0,0,0),y=Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(a.geometry.coordinates[0],a.geometry.coordinates[1]),v);p=e.viewer.entities.add({id:a.properties[e.UUID],orientation:y,position:Cesium.Cartesian3.fromDegrees(a.geometry.coordinates[0],a.geometry.coordinates[1],20),model:A.toCesiumStyle(Cesium),properties:a.properties,keys:m});break;case"marker":f=this.getOptions("marker");var b=new Twt;b=b.toCesiumStyle(f,a,Cesium),e.layerStyleCopy&&e.layerStyleCopy.fixNum&&b.label.text&&b.label.text.length>e.layerStyleCopy.fixNum&&(b.label.text=b.label.text.substring(0,e.layerStyleCopy.fixNum)),p=e.viewer.entities.add({id:a.properties[e.UUID],position:Cesium.Cartesian3.fromDegrees(a.geometry.coordinates[0],a.geometry.coordinates[1],20),billboard:b.billboard,label:b.label,properties:a.properties,keys:m});break}r.push(p)}else{for(var w,_,x,S,C,M=0;M<e.features.length;M++)if(e.features[M].properties[e.UUID]===a.properties[e.UUID]){"model"===e.layerStyleCopy.type&&e.enableDirect&&(_=e.features[M].geometry.coordinates[0],S=e.features[M].geometry.coordinates[1],x=a.geometry.coordinates[0],C=a.geometry.coordinates[1],w=Math.atan2(C-S,x-_)),e.features[M].geometry.coordinates=a.geometry.coordinates,e.features[M].properties=a.properties;break}if(r[n].properties=a.properties,r[n].position=Cesium.Cartesian3.fromDegrees(a.geometry.coordinates[0],a.geometry.coordinates[1],20),"model"===e.layerStyleCopy.type&&e.enableDirect){var L=new Cesium.HeadingPitchRoll(-1*w,0,0);r[n].orientation=Cesium.Transforms.headingPitchRollQuaternion(Cesium.Cartesian3.fromDegrees(_,S),L)}for(var T=0;T<e.popups.length;T++)if(e.popups[T].properties[e.UUID]===a.properties[e.UUID]){e.popups[T].lng=a.geometry.coordinates[0],e.popups[T].lat=a.geometry.coordinates[1],e.popups[T].alt=50;break}}},$_setUpdatedEvent:function(){var t=this;this.interval=setInterval((function(){t.$emit("updated",t.features)}),this.updateInterval)},$_addEntityLayer:function(){var t=this;this.currentType=this.layerStyleCopy.type,this.websocket=new WebSocket(this.baseUrl),this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.canvas),this.handler.setInputAction((function(e){var n=t.viewer.scene.pick(e.position);if(Cesium.defined(n)&&t.featureInCurrentLayer(n)){for(var r,i=!1,o=0;o<t.popups.length;o++)if(t.popups[o].properties[t.UUID]===n.id.properties[t.UUID].getValue()){i=!0,r=o;break}for(var a=0;a<t.popups.length;a++)t.popups[a].show=!1;if(i)t.popups[r].show=!0;else{var s=t.$_cartesian3ToLongLat(n.primitive.position||n.primitive.id.position);s.height=50,s.keys=n.id.keys,s.show=!0,s.vueIndex=Math.ceil(1e7*Math.random()),s.properties={};for(var c=0;c<n.id.keys.length;c++){var u=n.id.keys[c];s.properties[u]=n.id.properties[u].getValue()}var l=t.popupOptions.type;l=l||"default";var h={fields:s.keys,style:{containerStyle:{width:"360px"}}};h=Object.assign(h,t.popupOptions),t.showPosition&&(s.keys.push("经度","纬度","高程"),s.properties["经度"]=s.lng,s.properties["纬度"]=s.lat,s.properties["高程"]=s.alt),t.popups.push(s)}}}),Cesium.ScreenSpaceEventType.LEFT_CLICK),this.websocket.onmessage=function(e){t.$_webSocketCallBack(e,t)},t.$emit("updated",t.features),this.$_setUpdatedEvent()},featureInCurrentLayer:function(t){var e=this.vueKey,n=this.vueIndex,r=window.vueCesium.DataFlowManager.findSource(e,n);if(r){var i,o=r.source,a=null===t||void 0===t||null===(i=t.id)||void 0===i?void 0:i.id;return o.find((function(t){return t.id===a}))}return!1},getOptions:function(t){var e;switch(t){case"point":e=_wt({},this.layerStyleCopy);break;case"marker":e=_wt({},this.layerStyleCopy);try{new URL(e.markerUrl);e.url=e.markerUrl}catch(n){e.url=this.publicPath+e.markerUrl,console.log("marker组装地址",e.url,window.location.origin,this.publicPath)}delete e.markerUrl;break;case"model":e=_wt({},this.layerStyleCopy);try{new URL(e.modelUrl);e.url=e.modelUrl}catch(n){e.url=this.publicPath+e.modelUrl,console.log("model组装地址",e.url,window.location.origin,this.publicPath)}delete e.modelUrl;break}return e}}},Ewt=kwt,Owt=je(Ewt,vwt,ywt,!1,null,"73f216d5",null),Pwt=Owt.exports,Bwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"mapgis-track-player"},[n("div",{staticClass:"mapgis-track-player-container",staticStyle:{"padding-top":"20px"}},[n("mapgis-ui-slider",{staticClass:"mapgis-track-player-slider",attrs:{max:t.maxSlider},on:{afterChange:t.$_sliderClick},model:{value:t.currentSlider,callback:function(e){t.currentSlider=e},expression:"currentSlider"}})],1),n("div",{staticClass:"mapgis-track-player-container mapgis-track-player-option"},[n("span",{staticClass:"mapgis-track-player-start"},[t._v(t._s(t.playStartTime))]),n("img",{ref:"back",staticClass:"mapgis-track-player-back",attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNDQ0RUQxMzM4N0MxMUVDQkJGOUYxQjlBODkxNzI1OCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNDQ0RUQxNDM4N0MxMUVDQkJGOUYxQjlBODkxNzI1OCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM0NDRFRDExMzg3QzExRUNCQkY5RjFCOUE4OTE3MjU4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM0NDRFRDEyMzg3QzExRUNCQkY5RjFCOUE4OTE3MjU4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+4zi8vgAAAOlJREFUeNpi/P//PwMlgImBQoBigJ1HxGEQJsUAFmQOMzOLDS6FQIMFgVQXEAcf2rFCCKsBLCwsWDU7+cREAeX6gUwxvC5gYWVDkXQLTFICUtOB4m5EeYGVDWKAT0QWK5AqZmPnqAPSnESHARsbO5gGRu1RIGVKciDCDAACRrJigRVqABMTkxXIC0BM0Aso6YCNnR2M50+q/Q3EHcAw0AHiXUDMgIxxGsAKjAVWpJiY2V16D4jdgV6LBuJXIC8ieZOwATAwuTVvGVBcA4jnAPF73CmRhfUIrgDsa8gAaUyFYjhgHPDcCBBgAIw4LgcxS9SEAAAAAElFTkSuQmCC",alt:"后退"},on:{click:t.back,mouseleave:t.$_backLeave,mouseenter:t.$_backEnter}}),t.shouldAnimate?t._e():n("img",{ref:"play",staticClass:"mapgis-track-player-play",attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowRDg0MzE4RDM4N0MxMUVDOTUzMEM0MEIyNDE1QjZEOCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowRDg0MzE4RTM4N0MxMUVDOTUzMEM0MEIyNDE1QjZEOCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjBEODQzMThCMzg3QzExRUM5NTMwQzQwQjI0MTVCNkQ4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjBEODQzMThDMzg3QzExRUM5NTMwQzQwQjI0MTVCNkQ4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+iIYkxAAAAcFJREFUeNqsls0rBHEYx78zViTaC1LKHok9ulGSkgvFwXtuykVyELm4eSnCQTk4KVoOlD/ALvEfrOLiZXPCRTYRzfr+9KzQzs9vxjz1aWrmme93fm/PM1bFSgaaqCL9pJnUkjLyRm7JDUmQHXLlJmC5GCjhedJN8qAPR0ymSOr3QzvHCx0kSfoMxLMaKvdMrlqDMbJPSuA9iskWGXcz6CHLLqMyDYssidYPAzXnG5Lw37BEq+q7wZwMMahQWgtZgwjp1WWfjwCLLUC4wJOJ2oERW8S1866EB6LAyRDQVW1s8KltyyEyitIiYK0NiHXy08JGrzQrg6jXCW7i8iUGgdF6IF+/56LqcamfVSwMAdMNwEG3Nq3MDmJP/rUQD36EX96B2VOgfVebdh+SGlLpRfyIJW3ykOX08c/UpDJgKlpNhB+egZljYO/C+FvitpRaR5f1+MoqxvrauOlJ/LOMqxFck13daa5Z97X+SvM6u4smSTrAWpQWza8SoTrRMMkEIJ4RrdTvfhCTZuH8U3xCtHJ2tFXCSoMnn9MyKA1H25MPpD7FDEfjSG4d2Tb9q8j126IEyuX+nRzQuOyWSzeBDwEGAGtXX2HVYW0fAAAAAElFTkSuQmCC",alt:"播放"},on:{mouseleave:t.$_playerLeave,mouseenter:t.$_playerEnter,click:t.play}}),t.shouldAnimate?n("img",{ref:"pause",staticClass:"mapgis-track-player-play",attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowRUNEOEJENDM4N0MxMUVDODQ4MEVGMTIzMjhCM0ExOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowRUNEOEJENTM4N0MxMUVDODQ4MEVGMTIzMjhCM0ExOSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjBFQ0Q4QkQyMzg3QzExRUM4NDgwRUYxMjMyOEIzQTE5IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjBFQ0Q4QkQzMzg3QzExRUM4NDgwRUYxMjMyOEIzQTE5Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+0oSpJgAAAYFJREFUeNq0lrFKw1AUhm8S3OpmxSmCo/YJ3PoCgotWcXVxUDoIfQPbQVQoTq5KdRF8AOsDiFPdpNbSSd0Ul9LE/+Af0Jpzibb3wEfg9Pb/c09O7ok3cxgbS4RgHRTBPMiDPuiBJ3ADzsGjJuApBiJcBSsgMPaIaFIB3eEf/ZQ/LIEWWMsgnmjI2nterQY74BJMmr9HDpyCsmawCg6UXWUND+xT64eB1PyEC0YNj1rhd4M9bvFXVBaNedj6utpyKeWqJV00i2tbK01vG08a99Qf4Jbqek7prjkRLdnqHrBoE4E9p3RXyedL5CqKYlBwaFAQgymHBnnfOA4xeHWo/+LzDHEVLTG4dmjQ9HnURtqKAU9zealsOe0YF4MOuNBW1W+N+cCIOb6z51JCNDvJwAn5LHJjKs07WJABlLSpTKJNEI9BPKZWd3geNDgsohHFd6mVOtGOwDJ4+2dZNjhwrDP5iudTI+NuIq6Vmp9l/apI+2wRgWnmn9kUTXZLWxP4FGAAq2FjjeJrfkEAAAAASUVORK5CYII=",alt:"暂停"},on:{mouseleave:t.$_pauseLeave,mouseenter:t.$_pauseEnter,click:t.play}}):t._e(),n("img",{ref:"forward",staticClass:"mapgis-track-player-forward",attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNERBNTNBMDM4N0MxMUVDOTYyNEEwRDg3NEMxQUI2QiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNERBNTNBMTM4N0MxMUVDOTYyNEEwRDg3NEMxQUI2QiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM0REE1MzlFMzg3QzExRUM5NjI0QTBEODc0QzFBQjZCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM0REE1MzlGMzg3QzExRUM5NjI0QTBEODc0QzFBQjZCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Br2+XwAAAONJREFUeNpi/P//PwMlgJGuBth5RBwG0Yd2rLCFibGgKXgHpNYCcRlQ0Xt0A5iZWWzQxZiQOSwsLIJAnALEN5x8YqLQFQPFwRi3AaxsMCwGxEvdApN2ArESujyKHmQOGzsHuqVuQHzFJyKrCUj3srKxYYQLigHsmAaAACcQtwNxECMjI1kGwGMMmyCqARyc2NR8B2KwF/79+/cLrwFYwmAXEGfO7C69B+KkFnfgdwEbGzuM+QqICye35i1DlmdlJRCIQAXvYQmpryEDIyERNACoSQhfKDKzsB5BD0zGAc+NAAEGAOxjOj4Wq8AXAAAAAElFTkSuQmCC",alt:"前进"},on:{click:t.forward,mouseleave:t.$_forwardLeave,mouseenter:t.$_forwardEnter}}),n("span",{staticClass:"mapgis-track-player-end"},[t._v(t._s(t.endTime))])])])])},Iwt=[],Dwt=(K["Style"].PointStyle,K["Style"].ModelStyle),Nwt=(K["Style"].MarkerStyle,K["Style"].TrackStyle),Fwt={name:"mapgis-3d-track-layer",inject:["viewer"],data:function(){return{currentSlider:0,maxSlider:110,interval:void 0,playStartTime:void 0,shouldAnimate:!1}},props:{startTime:{type:String},endTime:{type:String},speed:{type:Number,default:10},trackPointStyle:{type:Object},trackStyle:{type:Object},dataSource:{type:[Object,Array]}},watch:{},mounted:function(){this.viewer.scene.globe.depthTestAgainstTerrain=!0,this.playStartTime=this.$_getPlayStartTime(0),this.$_addTrack()},methods:{$_backLeave:function(){this.$refs.back.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNDQ0RUQxMzM4N0MxMUVDQkJGOUYxQjlBODkxNzI1OCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNDQ0RUQxNDM4N0MxMUVDQkJGOUYxQjlBODkxNzI1OCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM0NDRFRDExMzg3QzExRUNCQkY5RjFCOUE4OTE3MjU4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM0NDRFRDEyMzg3QzExRUNCQkY5RjFCOUE4OTE3MjU4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+4zi8vgAAAOlJREFUeNpi/P//PwMlgImBQoBigJ1HxGEQJsUAFmQOMzOLDS6FQIMFgVQXEAcf2rFCCKsBLCwsWDU7+cREAeX6gUwxvC5gYWVDkXQLTFICUtOB4m5EeYGVDWKAT0QWK5AqZmPnqAPSnESHARsbO5gGRu1RIGVKciDCDAACRrJigRVqABMTkxXIC0BM0Aso6YCNnR2M50+q/Q3EHcAw0AHiXUDMgIxxGsAKjAVWpJiY2V16D4jdgV6LBuJXIC8ieZOwATAwuTVvGVBcA4jnAPF73CmRhfUIrgDsa8gAaUyFYjhgHPDcCBBgAIw4LgcxS9SEAAAAAElFTkSuQmCC"},$_backEnter:function(){this.$refs.back.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNjIxNkRDNjM4N0MxMUVDOUNERDhBNERBODEyOERCRCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNjIxNkRDNzM4N0MxMUVDOUNERDhBNERBODEyOERCRCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM2MjE2REM0Mzg3QzExRUM5Q0REOEE0REE4MTI4REJEIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2MjE2REM1Mzg3QzExRUM5Q0REOEE0REE4MTI4REJEIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+PWvmjAAAANZJREFUeNpi/P//PwMlgImBQoBigOxkhsMgTIoBLMgcZkYGG1wKFaYwCAKpLiAOfpDDIITdABweUp7GEAWU6wcyxfC7AM0AtRkMSkBqOlDcjSgvsDBCaK2ZDKxAqhjIrwPSnESHAQvCBUeB2JTkQEQygJGsaASFARRbAXElEH9HEoNjnAaAXADCpxMZfgNxB5CtA8S7YOIwTNAAGDgez3APiN2BYtFA/IqgAcCEBMbo4HAswzKguAYQzwHi98hyjMiZyXkZOBkz7o3CnSLRAeOA50aAAAMAn1gn18iM2TcAAAAASUVORK5CYII="},$_forwardLeave:function(){this.$refs.forward.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNERBNTNBMDM4N0MxMUVDOTYyNEEwRDg3NEMxQUI2QiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNERBNTNBMTM4N0MxMUVDOTYyNEEwRDg3NEMxQUI2QiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM0REE1MzlFMzg3QzExRUM5NjI0QTBEODc0QzFBQjZCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM0REE1MzlGMzg3QzExRUM5NjI0QTBEODc0QzFBQjZCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Br2+XwAAAONJREFUeNpi/P//PwMlgJGuBth5RBwG0Yd2rLCFibGgKXgHpNYCcRlQ0Xt0A5iZWWzQxZiQOSwsLIJAnALEN5x8YqLQFQPFwRi3AaxsMCwGxEvdApN2ArESujyKHmQOGzsHuqVuQHzFJyKrCUj3srKxYYQLigHsmAaAACcQtwNxECMjI1kGwGMMmyCqARyc2NR8B2KwF/79+/cLrwFYwmAXEGfO7C69B+KkFnfgdwEbGzuM+QqICye35i1DlmdlJRCIQAXvYQmpryEDIyERNACoSQhfKDKzsB5BD0zGAc+NAAEGAOxjOj4Wq8AXAAAAAElFTkSuQmCC"},$_forwardEnter:function(){this.$refs.forward.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNjdENzM5RjM4N0MxMUVDOTQyNUQ0NTdBMTJEMzFERiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNjdENzNBMDM4N0MxMUVDOTQyNUQ0NTdBMTJEMzFERiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM2N0Q3MzlEMzg3QzExRUM5NDI1RDQ1N0ExMkQzMURGIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2N0Q3MzlFMzg3QzExRUM5NDI1RDQ1N0ExMkQzMURGIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+k5y39wAAAM1JREFUeNpi/P//PwMlgJGuBshOZjgMoh/nMtjCxFiQFShMYXgHpNYCcdmDHIb36AYwMzLYoIsxoShgYhAE4hQgvqE8jSEKwwAmCMZnAAyLAfFStRkMO4FYCZ8BKF5gYcTwthsQX9GaydAEpHuxyKMZwIQ17DiBuB2Ig7BJEmMAPMawCeIKA2T8HYgrgdiKcBhgumAXEGcej2e4B+JYLiTeC6+AuPBwLMMyQl5kQUso72EJ6UAM1oSE3wCgJiF8oQj0/xH0wGQc8NwIEGAA3BcwGOe59OgAAAAASUVORK5CYII="},$_pauseLeave:function(){this.$refs.pause.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowRUNEOEJENDM4N0MxMUVDODQ4MEVGMTIzMjhCM0ExOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowRUNEOEJENTM4N0MxMUVDODQ4MEVGMTIzMjhCM0ExOSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjBFQ0Q4QkQyMzg3QzExRUM4NDgwRUYxMjMyOEIzQTE5IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjBFQ0Q4QkQzMzg3QzExRUM4NDgwRUYxMjMyOEIzQTE5Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+0oSpJgAAAYFJREFUeNq0lrFKw1AUhm8S3OpmxSmCo/YJ3PoCgotWcXVxUDoIfQPbQVQoTq5KdRF8AOsDiFPdpNbSSd0Ul9LE/+Af0Jpzibb3wEfg9Pb/c09O7ok3cxgbS4RgHRTBPMiDPuiBJ3ADzsGjJuApBiJcBSsgMPaIaFIB3eEf/ZQ/LIEWWMsgnmjI2nterQY74BJMmr9HDpyCsmawCg6UXWUND+xT64eB1PyEC0YNj1rhd4M9bvFXVBaNedj6utpyKeWqJV00i2tbK01vG08a99Qf4Jbqek7prjkRLdnqHrBoE4E9p3RXyedL5CqKYlBwaFAQgymHBnnfOA4xeHWo/+LzDHEVLTG4dmjQ9HnURtqKAU9zealsOe0YF4MOuNBW1W+N+cCIOb6z51JCNDvJwAn5LHJjKs07WJABlLSpTKJNEI9BPKZWd3geNDgsohHFd6mVOtGOwDJ4+2dZNjhwrDP5iudTI+NuIq6Vmp9l/apI+2wRgWnmn9kUTXZLWxP4FGAAq2FjjeJrfkEAAAAASUVORK5CYII="},$_pauseEnter:function(){this.$refs.pause.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowRTVGREMyQjM4N0MxMUVDQjY2QUUyNDMyM0E2RTYyQyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowRTVGREMyQzM4N0MxMUVDQjY2QUUyNDMyM0E2RTYyQyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjBFNUZEQzI5Mzg3QzExRUNCNjZBRTI0MzIzQTZFNjJDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjBFNUZEQzJBMzg3QzExRUNCNjZBRTI0MzIzQTZFNjJDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+a1B7mgAAAYBJREFUeNq0lr9KA0EQxufWa4TYGctL65/4ECltBAlqFMHKWixE30AtROxtlVMRwQcwPkREK00OK7XTQjDc+Q3OQTxvltNkB34czO59HzvZzJw3EyZkiQAsgxqYBGXwCZ5AB9yAU/CoCXiKAQvvggUwRPaIxWQbRNlFk/PCLGiBpQLiqQbvvZWn1WAdXIIR+nuUwDHY0AwWwYFyqqLhgX3R+mHANT+SDf2GJ1pBr8GOHPFXrE4TXdS/n7ZcTrn2UoMKaGg75yeIhn2i+rg9lxN8AytGxNW6Gymab+w55XY1jPyJXEWNDaoODapsMOrQoGzIcbDBq0P9FyM9xFW02ODaoUHTSKuN1V4s3bwb23NaG2eDNjjTdp3fEX100Rru7bmcYM12OnAC+S1KAyrNO5jiAZReU55EayAZgHgiWlF2HoQyLOI+xTdFK3eiHYI58PbPsqzIwLHO5CvpT2HB08Syl2t+kl30lZciGeBbPZ8tLDAm689yKZpyWx409y8BBgCr2Frzb7D2qQAAAABJRU5ErkJggg=="},$_playerLeave:function(){this.$refs.play.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowRDg0MzE4RDM4N0MxMUVDOTUzMEM0MEIyNDE1QjZEOCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowRDg0MzE4RTM4N0MxMUVDOTUzMEM0MEIyNDE1QjZEOCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjBEODQzMThCMzg3QzExRUM5NTMwQzQwQjI0MTVCNkQ4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjBEODQzMThDMzg3QzExRUM5NTMwQzQwQjI0MTVCNkQ4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+iIYkxAAAAcFJREFUeNqsls0rBHEYx78zViTaC1LKHok9ulGSkgvFwXtuykVyELm4eSnCQTk4KVoOlD/ALvEfrOLiZXPCRTYRzfr+9KzQzs9vxjz1aWrmme93fm/PM1bFSgaaqCL9pJnUkjLyRm7JDUmQHXLlJmC5GCjhedJN8qAPR0ymSOr3QzvHCx0kSfoMxLMaKvdMrlqDMbJPSuA9iskWGXcz6CHLLqMyDYssidYPAzXnG5Lw37BEq+q7wZwMMahQWgtZgwjp1WWfjwCLLUC4wJOJ2oERW8S1866EB6LAyRDQVW1s8KltyyEyitIiYK0NiHXy08JGrzQrg6jXCW7i8iUGgdF6IF+/56LqcamfVSwMAdMNwEG3Nq3MDmJP/rUQD36EX96B2VOgfVebdh+SGlLpRfyIJW3ykOX08c/UpDJgKlpNhB+egZljYO/C+FvitpRaR5f1+MoqxvrauOlJ/LOMqxFck13daa5Z97X+SvM6u4smSTrAWpQWza8SoTrRMMkEIJ4RrdTvfhCTZuH8U3xCtHJ2tFXCSoMnn9MyKA1H25MPpD7FDEfjSG4d2Tb9q8j126IEyuX+nRzQuOyWSzeBDwEGAGtXX2HVYW0fAAAAAElFTkSuQmCC"},$_playerEnter:function(){this.$refs.play.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowREY0RTE1MjM4N0MxMUVDQTRFRUI2MUQzNEI1MTc4MCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowREY0RTE1MzM4N0MxMUVDQTRFRUI2MUQzNEI1MTc4MCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjBERjRFMTUwMzg3QzExRUNBNEVFQjYxRDM0QjUxNzgwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjBERjRFMTUxMzg3QzExRUNBNEVFQjYxRDM0QjUxNzgwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+ZGoY0gAAAc9JREFUeNqsljtLA1EQhWfXJVgoWBgJCAnYqcFCEOw0CGoawSY+sLCxFguNP0B8gCKChYiWhmhhwB9gbCwVhVjYaBIsgloIppCIG8+NE4lh93o32YGPBHZyzu7snZlo4XiRJOEH0yAEuoAXfIInkAEX4Bg82gloNgZCeB1EQAPJw2STZZCtvqhb/GAMpMCUgnhZQ+Te8afUYB4kQDM5jyZwBBbsDCbAts1TqYYGtljrj4Go+QEn1Bsaa/krDdb4Ed0KobVRNgiASVn2yTheTh9+5XFkIk5gQGdxad2F8EgH0X6YaDCgbFDS1rmJlKKlkWipn2hlgMinVtCQMAg6LXCvj2hvFDXoJDLkZy4oLrfW8hY9aMHZHqLNIWmaV3fjTMrCAK+g3alw4YsohuFwei9NezF4hjgyuM4R7V4R5fL/pqaEwTkYVhF++8BRvcGMzijfS9LgUbsq64V8gegSG+Dw9ue7YpTGuDBIi2aVdXMkUdP7F5rp8l1HxY26OIvyrPlbFrGJ5kDRBfEia2Wr90Gcl4VZp/gia1lutB2A2UnvNZZlhheOdCef8XyKKz6NybndIGbVyVaR5QUerfjbIgTa+PozN2iST8uDnfu3AAMAGj9gGBYQ1b0AAAAASUVORK5CYII="},$_sliderClick:function(t){this.viewer.clockViewModel.currentTime=Cesium.JulianDate.fromIso8601(this.$_getPlayStartTime(t)),this.playStartTime=this.$_getPlayStartTime(t)},$_getPlayStartTime:function(t){var e=this.startTime.split("T")[1];e=e.split("Z")[0];var n=Number(e.split(":")[2]),r=Number(e.split(":")[1]),i=Number(e.split(":")[0]),o=t%60;o+=n,o=o<10?"0"+o:o;var a=Math.floor(t/60)%60;a+=r,a=a<10?"0"+a:a;var s=Math.floor(t/3600)%24;s+=i,s=s<10?"0"+s:s;var c=this.startTime.replace(e,s+":"+a+":"+o);return c},$_getCZML:function(){var t;function e(t){var e=!1;if(t instanceof Array)for(var n=0;n<t.length;n++)if(t[n].id&&"document"===t[n].id){e=!0;break}return e}if(e(this.dataSource))t=this.dataSource;else{var n=new Dwt(this.trackPointStyle);n=n.toCesiumStyle(Cesium),n.uri&&(n.gltf=n.uri);var r=new Nwt(this.trackStyle);r=r.toCesiumStyle(Cesium),t=[{id:"document",name:"CZML Path",version:"1.0",clock:{interval:this.startTime+"/"+this.endTime,currentTime:this.startTime,multiplier:this.speed}},{id:"path",name:"path with GPS flight data",description:"<p>Hang gliding flight log data from Daniel H. Friedman.<br>Icon created by Larisa Skosyrska from the Noun Project</p>",availability:this.startTime+"/"+this.endTime,path:r,model:n,position:{interpolationAlgorithm:"LINEAR",forwardExtrapolationType:"HOLD",epoch:this.startTime,cartographicDegrees:this.$_geoJSONToPath()}}]}return t},$_geoJSONToPath:function(){var t=[];if(this.dataSource instanceof Array)"number"===typeof this.dataSource[0]&&(t=this.dataSource,this.maxSlider=this.dataSource[this.dataSource.length-4]);else if(this.dataSource instanceof Object&&this.dataSource.hasOwnProperty("features")){for(var e=this.dataSource.features,n=0;n<e.length;n++){var r=e[n].geometry.coordinates;t.push(Number(e[n].properties.timeStep),Number(r[0]),Number(r[1]),Number(r[2]))}this.maxSlider=t[t.length-4]}return t},$_addTrack:function(){var t=this;window.czml=new Cesium.CzmlDataSource,this.viewer.dataSources.add(window.czml.load(this.$_getCZML())).then((function(e){var n=e.entities.getById("path");t.viewer.trackedEntity=n,n.orientation=new Cesium.VelocityOrientationProperty(n.position)}))},play:function(){var t=this;this.viewer.clockViewModel.shouldAnimate=!this.viewer.clockViewModel.shouldAnimate,this.shouldAnimate=this.viewer.clockViewModel.shouldAnimate,this.viewer.clockViewModel.shouldAnimate?this.interval=setInterval((function(){t.currentSlider+=t.viewer.clockViewModel.multiplier,t.playStartTime=t.$_getPlayStartTime(t.currentSlider),t.currentSlider>=t.maxSlider&&(t.currentSlider=t.maxSlider,t.shouldAnimate=!1,t.playStartTime=t.endTime,clearInterval(t.interval)),t.currentSlider<=0&&(t.currentSlider=0,t.shouldAnimate=!1,t.playStartTime=t.startTime,clearInterval(t.interval))}),1e3):clearInterval(this.interval)},forward:function(){this.viewer.clockViewModel.multiplier<0&&(this.viewer.clockViewModel.multiplier=-1*this.viewer.clockViewModel.multiplier)},back:function(){this.viewer.clockViewModel.multiplier>0&&(this.viewer.clockViewModel.multiplier=-1*this.viewer.clockViewModel.multiplier)},speedUp:function(){var t=this;clearInterval(this.interval),this.viewer.clockViewModel.multiplier+=this.viewer.clockViewModel.multiplier;var e=Math.floor(this.multiplier/this.viewer.clockViewModel.multiplier*1e3);this.interval=setInterval((function(){t.currentSlider+=this.viewer.clockViewModel.multiplier,t.currentSlider>=t.maxSlider&&(t.currentSlider=t.maxSlider,clearInterval(t.interval))}),e)}}},jwt=Fwt,Rwt=(n("6292"),je(jwt,Bwt,Iwt,!1,null,"a2b54b5c",null)),Hwt=Rwt.exports,zwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("panel-one",{ref:"panel",on:{chooseTool:t.$_chooseTool}}),n("edit-panel",{attrs:{show:t.showEditPanel,editOptions:t.toolOptions}})],1)},Uwt=[],Vwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"mapgis-plotting-tool-panel",class:{plottingLayOff:t.layOffTool,plottingLayOut:t.layOutTool}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.showTool,expression:"showTool"}],staticClass:"mapgis-plotting-toolbar"},t._l(t.tools,(function(e,r){return n("div",{key:r,staticClass:"mapgis-plotting-tool"},[n("img",{staticClass:"mapgis-plotting-tool-icon",class:{mapgisPlottingActive:t.activeTool===e},attrs:{src:t.imgs[e+"Image"],title:t.toolTips[r]},on:{click:function(n){return t.$_chooseTool(e)}}}),n("img",{staticClass:"mapgis-plotting-tool-split",attrs:{src:t.imgs.splitImg}})])})),0),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.showTool,expression:"!showTool"}],staticClass:"mapgis-plotting-tool"},[n("img",{staticClass:"mapgis-plotting-tool-icon",attrs:{src:t.layOffImg},on:{click:function(e){return t.$_chooseTool("point")}}})])]),n("div",{staticClass:"mapgis-plotting-tool-lay",class:{plottingLayOff:t.layOffTool,plottingLayOut:t.layOutTool}},[n("img",{directives:[{name:"show",rawName:"v-show",value:t.switchIcon,expression:"switchIcon"}],staticClass:"mapgis-plotting-tool-lay-off",attrs:{src:t.imgs.layOff},on:{click:t.$_layOff}}),n("img",{directives:[{name:"show",rawName:"v-show",value:!t.switchIcon,expression:"!switchIcon"}],staticClass:"mapgis-plotting-tool-lay-off",attrs:{src:t.imgs.layOut},on:{click:t.$_layOut}})])])},Ywt=[],Gwt={name:"panelOne",data:function(){return{imgs:r,layOffTool:!1,layOutTool:!1,showTool:!0,switchIcon:!0,layOffImg:void 0,activeTool:void 0,tools:["point","marker","text","line","curve","polygon","rectangle","circle","cube","polygonCube","cuboid","cylinder","cone","ellipsoid","model"],toolTips:["点","标签","文字","直线","曲线","多边形","矩形","圆","正方体","立体多边形","长方体","圆柱体","圆锥体","球体","模型"]}},methods:{$_layOff:function(){this.layOffTool=!0,this.layOutTool=!1;var t=this;setTimeout((function(){t.switchIcon=!1,t.showTool=!1}),1500)},$_layOut:function(){this.layOffTool=!1,this.layOutTool=!0,this.showTool=!0;var t=this;setTimeout((function(){t.switchIcon=!0}),1500)},$_chooseTool:function(t){this.activeTool=t,this.layOffImg=this.imgs[t+"Image"],this.$emit("chooseTool",t)}}},Qwt=Gwt,Wwt=(n("24c7"),je(Qwt,Vwt,Ywt,!1,null,"61bdcefb",null)),Kwt=Wwt.exports,qwt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.editOptionsCopy?n("div",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],staticClass:"mapgis-plotting-edit-panel"},[n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row mapgis-plotting-edit-tool-row-title"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[n("span",{staticStyle:{"font-size":"16px","margin-left":"17px"}},[t._v("编辑区域")])]),n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",staticStyle:{"padding-left":"5px"},attrs:{span:16}},[n("img",{staticClass:"mapgis-plotting-edit-panel-close",attrs:{src:t.closeImg},on:{click:t.$_closePanel}})])],1),n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v("类型 "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",staticStyle:{"padding-left":"5px"},attrs:{span:16}},[t._v("\n "+t._s(t.editOptionsCopy.type)+"\n ")])],1),t._l(t.editOptionsCopy.options,(function(e,r){return n("div",{key:r},["input"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("mapgis-ui-input",{staticClass:"mapgis-plotting-edit-input",model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}})],1)],1):t._e(),"inputNumber"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("mapgis-ui-input-number",{staticClass:"mapgis-plotting-edit-input",model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}})],1)],1):t._e(),"color"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("div",{staticClass:"mapgis-plotting-edit-tool-material-color"},[n("mapgis-ui-sketch-color-picker",{attrs:{color:e.value},on:{"update:color":function(n){return t.$set(e,"value",n)},input:t.$_changeMaterialColor}})],1)])],1):t._e(),"slider"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:9}},[n("mapgis-ui-slider",{staticClass:"mapgis-plotting-edit-slider",attrs:{min:e.min,max:e.max,step:e.step},model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}})],1),n("mapgis-ui-col",{attrs:{span:7}},[n("mapgis-ui-input-number",{staticClass:"mapgis-plotting-edit-input-slider",model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}})],1)],1):t._e(),"switch"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:10}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:14}},[n("mapgis-ui-switch",{staticClass:"mapgis-plotting-edit-tool-switch",attrs:{"checked-children":"开","un-checked-children":"关"},on:{change:function(n){return t.$_switchChange(e.fields,e.value)}},model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}})],1)],1):t._e(),"collapse"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row",staticStyle:{"margin-bottom":"6px"}},[n("mapgis-ui-row",[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:10}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:14}},[n("mapgis-ui-switch",{staticClass:"mapgis-plotting-edit-tool-switch",attrs:{"checked-children":"开","un-checked-children":"关"},on:{change:function(n){return t.$_switchChange(e.key,e.value,e)}},model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"option.value"}})],1)],1),n("div",{staticClass:"mapgis-plotting-edit-collapse",style:{maxHeight:e.height}},t._l(e.options,(function(e,r){return n("div",{key:r},["inputNumber"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-collapse-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("mapgis-ui-input-number",{staticClass:"mapgis-plotting-edit-input",model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"o.value"}})],1)],1):t._e(),"input"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-collapse-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("mapgis-ui-input",{staticClass:"mapgis-plotting-edit-input",model:{value:e.value,callback:function(n){t.$set(e,"value",n)},expression:"o.value"}})],1)],1):t._e(),"color"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-collapse-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v("\n "+t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("div",{staticClass:"mapgis-plotting-edit-tool-material-color"},[n("mapgis-ui-sketch-color-picker",{attrs:{color:e.value},on:{"update:color":function(n){return t.$set(e,"value",n)},input:t.$_changeMaterialColor}})],1)])],1):t._e()],1)})),0)],1):t._e(),"select"===e.type?n("mapgis-ui-row",{staticClass:"mapgis-plotting-edit-tool-row"},[n("mapgis-ui-col",{staticClass:"mapgis-plotting-edit-tool-title",attrs:{span:8}},[t._v(t._s(e.title)+" "),n("span",{staticStyle:{"font-weight":"bold"}},[t._v(":")])]),n("mapgis-ui-col",{attrs:{span:16}},[n("mapgis-ui-select",{staticClass:"mapgis-plotting-edit-select",model:{value:t.material,callback:function(e){t.material=e},expression:"material"}},t._l(e.value,(function(e,r){return n("mapgis-ui-select-option",{key:r,attrs:{value:e}},[t._v("\n "+t._s(e)+"\n ")])})),1)],1)],1):t._e()],1)}))],2):t._e()},Xwt=[],$wt={name:"EditPanel",props:{editOptions:{type:Object,default:function(){return{}}},show:{type:Boolean,default:!1}},data:function(){return{materials:["纯色"],material:"纯色",materialColor:"rgba(0,0,0,255)",editOptionsCopy:void 0,closeImg:void 0,maxHeight:0}},watch:{editOptions:{handler:function(){this.editOptionsCopy=this.editOptions}}},mounted:function(){this.editOptionsCopy=this.editOptions},methods:{$_closePanel:function(){this.show=!1},$_changeMaterialColor:function(t){var e="rgba(".concat(t.rgba.r,", ").concat(t.rgba.g,", ").concat(t.rgba.b,", ").concat(t.rgba.a,")");this.$emit("change",e)},$_switchOption:function(t,e){for(var n=0;n<t.length;n++)for(var r=0;r<this.editOptionsCopy.options.length;r++)if(this.editOptionsCopy.options[r].title===t[n]){this.editOptionsCopy.options[r].show=e;break}},$_switchChange:function(t,e,n){e?(this.activeTool=t,n.height=n.maxHeight+"px"):(this.activeTool=void 0,n.height="0")}}},Jwt=$wt,Zwt=(n("431a"),je(Jwt,qwt,Xwt,!1,null,"57ac8662",null)),t_t=Zwt.exports;function e_t(t){return o_t(t)||i_t(t)||r_t(t)||n_t()}function n_t(){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 r_t(t,e){if(t){if("string"==typeof t)return a_t(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a_t(t,e):void 0}}function i_t(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function o_t(t){if(Array.isArray(t))return a_t(t)}function a_t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var s_t=[{type:"switch",title:"是否贴地",key:"enableClampToGround",value:!1,fields:[]},{type:"switch",title:"是否启用阴影",key:"enableShadows",value:!1,fields:[]}],c_t=[{type:"select",title:"表面材质",key:"materials",value:["纯色","纯色1"]},{type:"color",title:"颜色",key:"color",value:"#000000"},{type:"slider",title:"透明度",key:"opacity",value:1,min:0,max:1,step:.01},{type:"inputNumber",title:"边线宽度",key:"outlineWidth",value:1},{type:"color",title:"边线颜色",key:"outlineColor",value:"#000000"},{type:"slider",title:"边线透明度",key:"outlineOpacity",value:1,min:0,max:1,step:.01}].concat(s_t),u_t=[{type:"inputNumber",title:"长",key:"length",value:100},{type:"inputNumber",title:"宽",key:"width",value:100},{type:"inputNumber",title:"高",key:"height",value:100}].concat(e_t(c_t)),l_t=[{type:"inputNumber",title:"半径",key:"radius",value:6},{type:"inputNumber",title:"高度",key:"height",value:6},{type:"select",title:"表面材质",key:"materials",value:["纯色","纯色1"]},{type:"color",title:"颜色",key:"color",value:"#000000"},{type:"inputNumber",title:"边线宽度",key:"outlineWidth",value:1},{type:"color",title:"边线颜色",key:"outlineColor",value:"#000000"}].concat(s_t),h_t=([{type:"inputNumber",title:"宽度",key:"width",value:1},{type:"select",title:"表面材质",key:"materials",value:["纯色","纯色1"]},{type:"color",title:"颜色",key:"color",value:"#000000"}].concat(s_t),[{type:"inputNumber",title:"宽度",key:"width",value:1},{type:"select",title:"表面材质",key:"materials",value:["纯色","纯色1"]},{type:"color",title:"颜色",key:"color",value:"#000000"}].concat(s_t),[{type:"inputNumber",title:"高",key:"height",value:100}].concat(e_t(c_t)),[{type:"inputNumber",title:"半径",key:"height",value:100}].concat(e_t(c_t)),[{type:"input",title:"模型资源",key:"url",value:"www.baidu.com"},{type:"inputNumber",title:"模型大小",key:"scale",value:1}].concat(s_t),{Point:"point",Picked:"pick",UnPicked:"unPick",Added:"added"}),d_t=h_t,f_t=K["Style"].PointStyle,p_t=(K["Style"].ModelStyle,K["Style"].MarkerStyle,{inject:["Cesium","viewer"],data:function(){return{drawMode:void 0}},props:{vueKey:{type:String,default:"plottingDraw"},vueIndex:{type:Number,default:function(){return Number((1e8*Math.random()).toFixed(0))}}},methods:{$_draw:function(t,e,n,r,i,o){var a=this,s=window.vueCesium.DrawToolManager.findSource(i,o);if(!s){var c=new Cesium.ScreenSpaceEventHandler(this.viewer.canvas);c.setInputAction((function(c){var u=viewer.camera.pickEllipsoid(c.position,viewer.scene.globe.ellipsoid),l=viewer.scene.pick(c.position);if(Cesium.defined(l))a.drawMode=d_t.Picked;else if(a.drawMode&&a.drawMode!==d_t.UnPicked&&a.drawMode!==d_t.Picked&&a.drawMode!==d_t.Added){var h;switch(a.drawMode){case"point":r&&a.mapgisPlottingeDrawStyle&&(t=a.mapgisPlottingeDrawStyle);var d=new f_t(t);h=a.viewer.entities.add({position:u,point:d.toCesiumStyle(Cesium),extraOptions:n}),a.drawMode=d_t.Added,l=h;break}h&&(s=window.vueCesium.DrawToolManager.findSource(i,o),s.options.push(h))}else a.drawMode=d_t.UnPicked;e&&e(a.drawMode,l)}),Cesium.ScreenSpaceEventType.LEFT_CLICK),window.vueCesium.DrawToolManager.addSource(i,o,c,[])}},drawPoint:function(t,e,n,r,i,o){i=i||this.vueKey,o=o||this.vueIndex,this.drawMode=d_t.Point,this.$_draw(t,e,n,r,i,o)},updateEntityStyle:function(t,e){var n=new f_t(e);n=n.toCesiumStyle(Cesium),t.point=n}}});function m_t(t){return y_t(t)||v_t(t)||A_t(t)||g_t()}function g_t(){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 A_t(t,e){if(t){if("string"==typeof t)return b_t(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b_t(t,e):void 0}}function v_t(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function y_t(t){if(Array.isArray(t))return b_t(t)}function b_t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var w_t={name:"mapgis-3d-plotting-layer",components:{"panel-one":Kwt,"edit-panel":t_t},mixins:[p_t],data:function(){return{editOptions:editOptions,toolOptions:void 0,showEditPanel:!1,mapgisPlottingeDrawStyle:void 0,entityId:void 0}},watch:{toolOptions:{handler:function(){if(this.drawMode&&this.drawMode!==d_t.UnPicked)if(this.drawMode===d_t.Picked||this.drawMode===d_t.Added){for(var t=this.$_getStyleFromOptions(this.toolOptions.options),e=window.vueCesium.DrawToolManager.findSource(this.vueKey,this.vueIndex),n=e.options,r=0;r<n.length;r++)if(this.entityId===n[r].id){console.log("更新数据",t),this.updateEntityStyle(n[r],t);break}}else this.mapgisPlottingeDrawStyle=this.$_getStyleFromOptions(this.toolOptions.options)},deep:!0}},mounted:function(){},methods:{$_getStyleFromOptions:function(t){for(var e={},n=0;n<t.length;n++)e[t[n].key]=t[n].value;return e},$_chooseTool:function(t){var e=this;this.showEditPanel=!0,this.toolOptions=this.editOptions[t];var n=m_t(t);n[0]=n[0].toUpperCase();var r=n.join("");this.mapgisPlottingeDrawStyle=this.$_getStyleFromOptions(this.toolOptions.options),this["draw"+r](this.style,(function(t,n){t===d_t.Added?(e.$refs.panel.activeTool=void 0,e.entityId=n.id):t===d_t.UnPicked?e.showEditPanel=!1:t===d_t.Picked&&(e.showEditPanel=!0,e.toolOptions=n.id.extraOptions,e.entityId=n.id.id)}),this.toolOptions,!0)}}},__t=w_t,x_t=je(__t,zwt,Uwt,!1,null,"504a22fc",null),S_t=x_t.exports,C_t=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mapgis-3d-map-story-container",style:{width:t.containerWidth}},[n("project-panel",{ref:"projectPanel",attrs:{"data-source":t.dataSourceCopy,height:t.height,width:t.width,enableOneMap:t.enableOneMap,models:t.models},on:{changeChapter:t.$_changeChapter,setCamera:t.$_setCamera,save:t.$_save,close:t.$_close,addChapter:t.$_addChapter,copyChapter:t.$_addChapter,deleteChapter:t.$_deleteChapter,addStory:t.$_addStory,deleteStory:t.$_deleteStory,changeStory:t.$_changeStory,storyPreview:t.$_storyPreview,chapterPreview:t.$_chapterPreview}}),n("input",{staticStyle:{display:"none"},attrs:{type:"file",id:t.inputId,accept:".json"}}),t._l(t.optArr,(function(t,e){return n("map-collection",{key:e,attrs:{options:t}})})),t._l(t.projectMaps,(function(t){return n("map-collection",{key:t.vueIndex,attrs:{options:t}})})),t._l(t.popups,(function(e){return[n("mapgis-3d-popup",{key:e.vueIndex,attrs:{position:{longitude:e.lng,latitude:e.lat,height:e.alt},forceRender:!0,vueIndex:e.vueIndex},model:{value:e.show,callback:function(n){t.$set(e,"show",n)},expression:"popup.show"}},[n("div",[n("div",{staticClass:"mapgis-3d-map-story-small-popup-container"},[e.title?n("div",{staticClass:"mapgis-3d-map-story-small-popup-title"},[t._v("\n "+t._s(e.title)+"\n ")]):t._e(),n("mapgis-ui-carousel",{staticClass:"mapgis-3d-map-story-small-popup-carousel",attrs:{autoplay:""}},t._l(e.images,(function(t,e){return n("div",{key:e+1e4,staticClass:"mapgis-3d-map-story-small-popup-img-div"},[n("img",{staticClass:"mapgis-3d-map-story-small-popup-img",attrs:{src:t,alt:""}})])})),0),n("div",{staticClass:"mapgis-3d-map-story-small-popup",domProps:{innerHTML:t._s(e.content)}})],1)])])]})),t.enableOneMap?t._e():n("mapgis-3d-preview-map-story",{directives:[{name:"show",rawName:"v-show",value:t.showPreview,expression:"showPreview"}],ref:"preview",attrs:{height:t.height,width:t.width,dataSource:t.storyDataSource},on:{closePanel:t.$_closePreview}})],2)},M_t=[],L_t=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("project-panel-ui",{directives:[{name:"show",rawName:"v-show",value:t.showProjectPanel,expression:"showProjectPanel"}],ref:"projectP",attrs:{height:t.height,width:t.width,models:t.models,"data-source":t.dataSourceCopy,enableImport:t.enableImport,enableOneMap:t.enableOneMap},on:{addMap:t.$_addChapterMap,addStory:t.$_addStory,deleteStory:t.$_deleteStory,editProject:t.$_editStory,toggleChapterFeatures:t.$_toggleChapterFeatures,addChapter:t.$_addChapter,copyChapter:t.$_copyChapter,deleteChapter:t.$_deleteChapter,changeChapter:t.$_changeChapter,changeStory:t.$_changeStory,storyPreview:t.$_storyPreview,setCamera:t.$_setCamera,selectCamera:t.$_selectCamera,showProject:t.$_showStory,chapterPreview:t.$_chapterPreview,export:t.$_export,import:t.$_import,save:t.$_save,close:t.$_close}})],1)},T_t=[],k_t=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"mapgis-ui-project-panel",style:{height:t.height+"px",width:t.width+"px"},on:{click:t.$_click}},[n("div",{directives:[{name:"show",rawName:"v-show",value:!t.showStoryEdit,expression:"!showStoryEdit"}],staticClass:"mapgis-ui-project-panel-content",style:{height:t.height+"px"}},[t.enableOneMap?t._e():n("mapgis-ui-row",{staticClass:"mapgis-ui-project-panel-back"},[n("span",[t._v("\n 地图故事\n ")]),n("mapgis-ui-svg-icon",{staticStyle:{position:"absolute",right:"-16px",top:"0"},attrs:{iconStyle:{width:"18px"},type:"close"},on:{click:t.$_close}})],1),n("mapgis-ui-project-header",{attrs:{enableImport:t.enableImport},on:{import:t.$_import,search:t.$_search}}),n("mapgis-ui-project-row",{attrs:{projects:t.dataSourceCopy,hideArr:t.hideArr,width:t.width},on:{editProject:t.$_editStory,deleted:t.$_deleteStory,export:t.$_export,import:t.$_import,showProjected:t.$_showProject,marked:t.$_markerStory,storyPreview:t.$_storyPreview}})],1),n("mapgis-ui-row",{directives:[{name:"show",rawName:"v-show",value:!t.showStoryEdit,expression:"!showStoryEdit"}],staticClass:"mapgis-ui-project-add-story-row"},[n("mapgis-ui-col",{attrs:{span:"24"}},[n("mapgis-ui-button",{staticClass:"mapgis-ui-project-add-story",attrs:{type:"primary"},on:{click:t.$_addStory}},[t._v("\n 新建故事\n ")])],1)],1),n("project-edit",{directives:[{name:"show",rawName:"v-show",value:t.showStoryEdit,expression:"showStoryEdit"}],ref:"panelEdit",attrs:{"data-source":t.currentStory,width:t.width,height:t.height,models:t.models,cameras:t.cameras,enableOneMap:t.enableOneMap},on:{changeChapter:t.$_changeChapter,changeStory:t.$_changeStory,addMap:t.$_addMap,setCamera:t.$_setCamera,selectCamera:t.$_selectCamera,toggleChapterFeatures:t.$_toggleChapterFeatures,storyPreview:t.$_storyPreview,chapterPreview:t.$_chapterPreview,addChapter:t.$_addChapter,deleteChapter:t.$_deleteChapter,copyChapter:t.$_copyChapter,export:t.$_export,save:t.$_save,back:t.$_back,close:t.$_close}})],1)])},E_t=[],O_t=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mapgis-ui-project-edit-panel",style:{height:t.height+"px",width:t.width+"px"},attrs:{id:t.id},on:{click:t.$_clickPanel}},[t.enableOneMap?t._e():n("mapgis-ui-row",{staticClass:"mapgis-ui-project-edit-back"},[n("mapgis-ui-svg-icon",{staticStyle:{position:"absolute",left:"5px",top:"0"},attrs:{iconStyle:{width:"18px"},type:"back"},on:{click:t.$_back}}),n("span",{on:{click:t.$_back}},[t._v("\n 返回上一级\n ")]),n("mapgis-ui-svg-icon",{staticStyle:{position:"absolute",right:"-16px",top:"0"},attrs:{iconStyle:{width:"18px"},type:"close"},on:{click:t.$_close}})],1),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.editChapter&&!t.showSetting,expression:"!editChapter && !showSetting"}],style:{height:t.height-38+"px"}},[n("div",{staticClass:"mapgis-ui-project-edit-top-bar"},[n("mapgis-ui-row",{staticClass:"mapgis-ui-project-edit-top-tool"},[n("mapgis-ui-col",{staticClass:"mapgis-ui-project-edit-top-left",attrs:{span:"18"}}),n("mapgis-ui-col",{staticClass:"mapgis-ui-project-edit-top-right",attrs:{span:"6"}})],1),n("mapgis-ui-row",{staticClass:"mapgis-ui-project-edit-title"},[t.dataSourceCopy&&t.dataSourceCopy.title?n("mapgis-ui-col",{attrs:{span:"24"}},[n("span",{directives:[{name:"show",rawName:"v-show",value:!t.editTitle,expression:"!editTitle"}],staticClass:"mapgis-ui-project-edit-title-value"},[t._v(t._s(t.dataSourceCopy.title))]),n("mapgis-ui-svg-icon",{directives:[{name:"show",rawName:"v-show",value:!t.editTitle,expression:"!editTitle"}],staticClass:"mapgis-ui-project-edit-edit-icon mapgis-ui-project-edit-edit-icon-p",attrs:{id:"mpEdit",iconStyle:{color:"white"},type:"edit"},on:{click:t.$_editTitle}}),n("mapgis-ui-input",{directives:[{name:"show",rawName:"v-show",value:t.editTitle,expression:"editTitle"}],staticClass:"mapgis-ui-project-edit-title-edit",attrs:{title:"标题",id:"mpTitle"},on:{change:t.$_titleChange},model:{value:t.dataSourceCopy.title,callback:function(e){t.$set(t.dataSourceCopy,"title",e)},expression:"dataSourceCopy.title"}})],1):t._e()],1)],1),n("mapgis-ui-row",[t.dataSourceCopy&&t.dataSourceCopy.chapters?n("mapgis-ui-feature-row",{attrs:{width:t.width},on:{editChapter:t.$_editChapter,deleteChapter:t.$_deleteChapter},model:{value:t.dataSourceCopy.chapters,callback:function(e){t.$set(t.dataSourceCopy,"chapters",e)},expression:"dataSourceCopy.chapters"}}):t._e()],1)],1),t.dataSourceCopy&&t.dataSourceCopy.map?n("mapgis-ui-map-multi-rows",{directives:[{name:"show",rawName:"v-show",value:t.showSetting,expression:"showSetting"}],attrs:{showTitleIcon:!1,showMoreTitle:"",map:t.dataSourceCopy.map,title:"附加地图"},on:{addMap:t.$_addProjectMap}}):t._e(),n("mapgis-ui-row",{directives:[{name:"show",rawName:"v-show",value:!t.editChapter&&!t.showSetting,expression:"!editChapter && !showSetting"}],staticClass:"mapgis-ui-project-edit-new-feature"},[n("mapgis-ui-col",{attrs:{span:"24"}},[n("mapgis-ui-dropdown",[n("mapgis-ui-menu",{attrs:{slot:"overlay"},slot:"overlay"},[n("mapgis-ui-menu-item",{key:"4",on:{click:t.$_copyChapter}},[t._v("\n 复制上一章节\n ")])],1),n("mapgis-ui-button",{staticClass:"mapgis-ui-project-edit-feature-button",on:{click:t.$_addChapter}},[t._v("\n 新建章节\n ")])],1),n("mapgis-ui-button",{staticClass:"mapgis-ui-project-edit-feature-preview",attrs:{type:"primary"},on:{click:t.$_storyPreview}},[t._v("\n 预览\n ")])],1)],1),n("div",{directives:[{name:"show",rawName:"v-show",value:t.editChapter,expression:"editChapter"}]},[n("feature-edit",{ref:"featureEdit",attrs:{"data-source":t.currentChapter,cameras:t.cameras,height:t.panelHeight,editList:t.editList,enableOneMap:t.enableOneMap,models:t.models},on:{change:t.$_changeChapter,setCamera:t.$_setCamera,selectCamera:t.$_selectCamera,addMap:t.$_addMap,chapterPreview:t.$_chapterPreview,animationTimeChanged:t.$_changeAnimationTime,save:t.$_save}})],1)],1)},P_t=[],B_t=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticStyle:{position:"relative",width:"100%"},style:{height:t.height-40+"px"}},[t.dataSourceCopy?n("div",{staticClass:"mapgis-ui-feature-edit-panel",style:{height:t.height-85+"px"}},[n("mapgis-ui-input-row-left",{attrs:{title:"标题",paddingLeft:"7px",paddingRight:"6px",fontSize:"14px"},model:{value:t.dataSourceCopy.title,callback:function(e){t.$set(t.dataSourceCopy,"title",e)},expression:"dataSourceCopy.title"}}),n("mapgis-ui-map-multi-rows",{directives:[{name:"show",rawName:"v-show",value:t.showMoreMap,expression:"showMoreMap"}],attrs:{showMoreTitle:t.showMoreTitle,map:t.dataSourceCopy.map,title:"附加地图"},on:{showMore:t.$_showAdvance,addMap:t.$_addMap}}),n("mapgis-ui-set-camera-view-select",{attrs:{showTitleIcon:!1,cameras:t.cameras,titleStyle:t.cameraTitleStyle,mainStyle:t.cameraMainStyle},on:{click:t.$_setCamera,showDetail:t.$_showCameraDetail,selectCamera:t.$_selectCamera}}),n("mapgis-ui-set-camera-view",{directives:[{name:"show",rawName:"v-show",value:t.showCameraDetail,expression:"showCameraDetail"}],attrs:{showTitle:!1,showButton:!1,disableInput:!0},model:{value:t.camera,callback:function(e){t.camera=e},expression:"camera"}}),n("mapgis-ui-input-row-left",{attrs:{title:"漫游时间",paddingLeft:"7px",paddingRight:"5px",fontSize:"14px"},on:{change:t.$_setAnimationTime},model:{value:t.dataSourceCopy.animationTime,callback:function(e){t.$set(t.dataSourceCopy,"animationTime",e)},expression:"dataSourceCopy.animationTime"}}),n("mapgis-ui-choose-picture-right",{attrs:{showTitleIcon:!1,useInternetImg:!0,enablePreview:!1},on:{changeImage:t.$_changeImage},model:{value:t.dataSourceCopy.images,callback:function(e){t.$set(t.dataSourceCopy,"images",e)},expression:"dataSourceCopy.images"}}),n("mapgis-ui-group-tab",{staticStyle:{"padding-left":"8px"},attrs:{title:"标绘工具"}}),t.dataSourceCopy?n("mapgis-3d-graphic-single-layer",{ref:"graphicLayer",attrs:{"data-source":t.graphics,containerStyle:t.graphicContainerStyle,iconsPanelStyle:t.iconsPanelStyle,enableOneMap:t.enableOneMap,enableMapStory:!0,models:t.models,vueIndex:t.dataSourceCopy.mapStoryUUID,vueKey:t.dataSourceCopy.mapStoryUUID},on:{addFeature:t.$_addGraphic,saveCamera:t.$_setCamera,delete:t.$_deleteGraphic}}):t._e(),n("mapgis-ui-group-tab",{staticStyle:{"padding-left":"8px"},attrs:{title:"富文本编辑"}}),n("mapgis-ui-row",{staticStyle:{width:"100%","padding-left":"8px","padding-right":"9px"}},[t.editor?n("div",{staticClass:"editor-menu-bar-head"},[n("editor-menu-bar",{attrs:{editor:t.editor},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.commands;return[n("div",{staticClass:"editor-menu-bar-content"},[n("span",{on:{click:r.bold}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"粗体",type:"border"}})],1),n("span",{on:{click:function(e){return t.showImagePrompt(r.image)}}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.pictureStyle,title:"图片",type:"picture"}})],1),n("span",{on:{click:r.italic}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"斜体",type:"italic"}})],1),n("span",{on:{click:r.strike}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"删除线",type:"strike"}})],1),n("span",{on:{click:r.underline}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"下划线",type:"underline"}})],1),n("span",{on:{click:r.bullet_list}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"无序列表",type:"ul"}})],1),n("span",{on:{click:r.ordered_list}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"有序列表",type:"ol"}})],1),n("span",{on:{click:r.blockquote}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"引用",type:"quote"}})],1),n("span",{on:{click:r.code}},[n("mapgis-ui-svg-icon",{attrs:{containerStyle:t.editButtonContainerStyle,iconStyle:t.editButtonStyle,title:"代码",type:"code"}})],1)])]}}],null,!1,2024380830)}),n("editor-content",{staticClass:"mapgis-3d-map-story-edit-container",attrs:{editor:t.editor}})],1):t._e()])],1):t._e(),t.dataSourceCopy?n("mapgis-ui-project-bottom-panel",{staticClass:"mapgis-ui-feature-edit-bottom",attrs:{enableSave:!1},on:{save:t.$_save,preview:t.$_preview}}):t._e()],1)])},I_t=[];function D_t(t){this.content=t}D_t.prototype={constructor:D_t,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return-1==i?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new D_t(o)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new D_t(n)},addToStart:function(t,e){return new D_t([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new D_t(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(-1==o?i.length:o,0,e,n),new D_t(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=D_t.from(t),t.size?new D_t(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=D_t.from(t),t.size?new D_t(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=D_t.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach((function(e,n){t[e]=n})),t},get size(){return this.content.length>>1}},D_t.from=function(t){if(t instanceof D_t)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new D_t(e)};var N_t=D_t;function F_t(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let t=0;i.text[t]==o.text[t];t++)n++;return n}if(i.content.size||o.content.size){let t=F_t(i.content,o.content,n+1);if(null!=t)return t}n+=i.nodeSize}else n+=i.nodeSize}}function j_t(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let a=t.child(--i),s=e.child(--o),c=a.nodeSize;if(a!=s){if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let t=0,e=Math.min(a.text.length,s.text.length);while(t<e&&a.text[a.text.length-t-1]==s.text[s.text.length-t-1])t++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let t=j_t(a.content,s.content,n-1,r-1);if(t)return t}n-=c,r-=c}else n-=c,r-=c}}class R_t{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let n=0;n<t.length;n++)this.size+=t[n].nodeSize}nodesBetween(t,e,n,r=0,i){for(let o=0,a=0;a<e;o++){let s=this.content[o],c=a+s.nodeSize;if(c>t&&!1!==n(s,r+a,i||null,o)&&s.content.size){let i=a+1;s.nodesBetween(Math.max(0,t-i),Math.min(s.content.size,e-i),n,r+i)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",o=!0;return this.nodesBetween(t,e,(a,s)=>{let c=a.isText?a.text.slice(Math.max(t,s)-s,e-s):a.isLeaf?r?"function"===typeof r?r(a):r:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&n&&(o?o=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),i=1);i<t.content.length;i++)r.push(t.content[i]);return new R_t(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let i=0,o=0;o<e;i++){let a=this.content[i],s=o+a.nodeSize;s>t&&((o<t||s>e)&&(a=a.isText?a.cut(Math.max(0,t-o),Math.min(a.text.length,e-o)):a.cut(Math.max(0,t-o-1),Math.min(a.content.size,e-o-1))),n.push(a),r+=a.nodeSize),o=s}return new R_t(n,r)}cutByIndex(t,e){return t==e?R_t.empty:0==t&&e==this.content.length?this:new R_t(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),i=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new R_t(r,i)}addToStart(t){return new R_t([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new R_t(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return F_t(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return j_t(this,t,e,n)}findIndex(t,e=-1){if(0==t)return z_t(0,t);if(t==this.size)return z_t(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=t)return o==t||e>0?z_t(n+1,o):z_t(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return R_t.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new R_t(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return R_t.empty;let e,n=0;for(let r=0;r<t.length;r++){let i=t[r];n+=i.nodeSize,r&&i.isText&&t[r-1].sameMarkup(i)?(e||(e=t.slice(0,r)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new R_t(e||t,n)}static from(t){if(!t)return R_t.empty;if(t instanceof R_t)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new R_t([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}R_t.empty=new R_t([],0);const H_t={index:0,offset:0};function z_t(t,e){return H_t.index=t,H_t.offset=e,H_t}function U_t(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!U_t(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!U_t(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class V_t{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&U_t(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);let r=n.create(e.attrs);return n.checkAttrs(r.attrs),r}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return V_t.none;if(t instanceof V_t)return[t];let e=t.slice();return e.sort((t,e)=>t.type.rank-e.type.rank),e}}V_t.none=[];class Y_t extends Error{}class G_t{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=W_t(this.content,t+this.openStart,e);return n&&new G_t(n,this.openStart,this.openEnd)}removeBetween(t,e){return new G_t(Q_t(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return G_t.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new G_t(R_t.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let i=t.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new G_t(t,n,r)}}function Q_t(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:a,offset:s}=t.findIndex(n);if(i==e||o.isText){if(s!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Q_t(o.content,e-i-1,n-i-1)))}function W_t(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),a=t.maybeChild(i);if(o==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let s=W_t(a.content,e-o-1,n);return s&&t.replaceChild(i,a.copy(s))}function K_t(t,e,n){if(n.openStart>t.depth)throw new Y_t("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Y_t("Inconsistent open depths");return q_t(t,e,n,0)}function q_t(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let a=q_t(t,e,n,r+1);return o.copy(o.content.replaceChild(i,a))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){let{start:i,end:a}=rxt(n,t);return txt(o,ext(t,i,a,e,r))}{let r=t.parent,i=r.content;return txt(r,i.cut(0,t.parentOffset).append(n.content).append(i.cut(e.parentOffset)))}}return txt(o,nxt(t,e,r))}function X_t(t,e){if(!e.type.compatibleContent(t.type))throw new Y_t("Cannot join "+e.type.name+" onto "+t.type.name)}function $_t(t,e,n){let r=t.node(n);return X_t(r,e.node(n)),r}function J_t(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Z_t(t,e,n,r){let i=(e||t).node(n),o=0,a=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(J_t(t.nodeAfter,r),o++));for(let s=o;s<a;s++)J_t(i.child(s),r);e&&e.depth==n&&e.textOffset&&J_t(e.nodeBefore,r)}function txt(t,e){return t.type.checkContent(e),t.copy(e)}function ext(t,e,n,r,i){let o=t.depth>i&&$_t(t,e,i+1),a=r.depth>i&&$_t(n,r,i+1),s=[];return Z_t(null,t,i,s),o&&a&&e.index(i)==n.index(i)?(X_t(o,a),J_t(txt(o,ext(t,e,n,r,i+1)),s)):(o&&J_t(txt(o,nxt(t,e,i+1)),s),Z_t(e,n,i,s),a&&J_t(txt(a,nxt(n,r,i+1)),s)),Z_t(r,null,i,s),new R_t(s)}function nxt(t,e,n){let r=[];if(Z_t(null,t,n,r),t.depth>n){let i=$_t(t,e,n+1);J_t(txt(i,nxt(t,e,n+1)),r)}return Z_t(e,null,n,r),new R_t(r)}function rxt(t,e){let n=e.depth-t.openStart,r=e.node(n),i=r.copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(R_t.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}G_t.empty=new G_t(R_t.empty,0,0);class ixt{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return t=this.resolveDepth(t),0==t?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let i=0;i<t;i++)r+=n.child(i).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return V_t.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new cxt(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let o=t;;){let{index:t,offset:e}=o.content.findIndex(i),a=i-e;if(n.push(o,t,r+e),!a)break;if(o=o.child(t),o.isText)break;i=a-1,r+=e+1}return new ixt(e,n,i)}static resolveCached(t,e){let n=sxt.get(t);if(n)for(let i=0;i<n.elts.length;i++){let t=n.elts[i];if(t.pos==e)return t}else sxt.set(t,n=new oxt);let r=n.elts[n.i]=ixt.resolve(t,e);return n.i=(n.i+1)%axt,r}}class oxt{constructor(){this.elts=[],this.i=0}}const axt=12,sxt=new WeakMap;class cxt{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const uxt=Object.create(null);class lxt{constructor(t,e,n,r=V_t.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||R_t.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&U_t(this.attrs,e||t.defaultAttrs||uxt)&&V_t.sameSet(this.marks,n||V_t.none)}copy(t=null){return t==this.content?this:new lxt(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new lxt(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return G_t.empty;let r=this.resolve(t),i=this.resolve(e),o=n?0:r.sharedDepth(e),a=r.start(o),s=r.node(o),c=s.content.cut(r.pos-a,i.pos-a);return new G_t(c,r.depth-o,i.depth-o)}replace(t,e,n){return K_t(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(e=e.maybeChild(n),!e)return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return ixt.resolveCached(this,t)}resolveNoCache(t){return ixt.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,t=>(n.isInSet(t.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),dxt(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=R_t.empty,r=0,i=n.childCount){let o=this.contentMatchAt(t).matchFragment(n,r,i),a=o&&o.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(let s=r;s<i;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(t).matchType(n),o=i&&i.matchFragment(this.content,e);return!!o&&o.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=V_t.none;for(let e=0;e<this.marks.length;e++){let n=this.marks[e];n.type.checkAttrs(n.attrs),t=n.addToSet(t)}if(!V_t.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n=void 0;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=R_t.fromJSON(t,e.content),i=t.nodeType(e.type).create(e.attrs,r,n);return i.type.checkAttrs(i.attrs),i}}lxt.prototype.text=void 0;class hxt extends lxt{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):dxt(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new hxt(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new hxt(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function dxt(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class fxt{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new pxt(t,e);if(null==n.next)return fxt.empty;let r=mxt(n);n.next&&n.err("Unexpected trailing text");let i=Cxt(_xt(r));return Mxt(i,n),i}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let i=e;r&&i<n;i++)r=r.matchType(t.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];function i(o,a){let s=o.matchFragment(t,n);if(s&&(!e||s.validEnd))return R_t.from(a.map(t=>t.createAndFill()));for(let t=0;t<o.next.length;t++){let{type:e,next:n}=o.next[t];if(!e.isText&&!e.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let t=i(n,a.concat(e));if(t)return t}}return null}return i(this,[])}findWrapping(t){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==t)return this.wrapCache[n+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];while(n.length){let r=n.shift(),i=r.match;if(i.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<i.next.length;t++){let{type:o,next:a}=i.next[t];o.isLeaf||o.hasRequiredAttrs()||o.name in e||r.type&&!a.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),e[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}return e(this),t.map((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let i=0;i<e.next.length;i++)r+=(i?", ":"")+e.next[i].type.name+"->"+t.indexOf(e.next[i].next);return r}).join("\n")}}fxt.empty=new fxt(!0);class pxt{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function mxt(t){let e=[];do{e.push(gxt(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function gxt(t){let e=[];do{e.push(Axt(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function Axt(t){let e=wxt(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=yxt(t,e)}return e}function vxt(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function yxt(t,e){let n=vxt(t),r=n;return t.eat(",")&&(r="}"!=t.next?vxt(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function bxt(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let t=n[o];t.isInGroup(e)&&i.push(t)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i}function wxt(t){if(t.eat("(")){let e=mxt(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=bxt(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}function _xt(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach(t=>t.to=e)}function o(t,e){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(o(n,e)),[]);if("seq"!=t.type){if("star"==t.type){let a=n();return r(e,a),i(o(t.expr,a),a),[r(a)]}if("plus"==t.type){let a=n();return i(o(t.expr,e),a),i(o(t.expr,a),a),[r(a)]}if("opt"==t.type)return[r(e)].concat(o(t.expr,e));if("range"==t.type){let a=e;for(let e=0;e<t.min;e++){let e=n();i(o(t.expr,a),e),a=e}if(-1==t.max)i(o(t.expr,a),a);else for(let e=t.min;e<t.max;e++){let e=n();r(a,e),i(o(t.expr,a),e),a=e}return[r(a)]}if("name"==t.type)return[r(e,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let a=o(t.exprs[r],e);if(r==t.exprs.length-1)return a;i(a,e=n())}}}function xxt(t,e){return e-t}function Sxt(t,e){let n=[];return r(e),n.sort(xxt);function r(e){let i=t[e];if(1==i.length&&!i[0].term)return r(i[0].to);n.push(e);for(let t=0;t<i.length;t++){let{term:e,to:o}=i[t];e||-1!=n.indexOf(o)||r(o)}}}function Cxt(t){let e=Object.create(null);return n(Sxt(t,0));function n(r){let i=[];r.forEach(e=>{t[e].forEach(({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t<i.length;t++)i[t][0]==e&&(r=i[t][1]);Sxt(t,n).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})})});let o=e[r.join(",")]=new fxt(r.indexOf(t.length-1)>-1);for(let t=0;t<i.length;t++){let r=i[t][1].sort(xxt);o.next.push({type:i[t][0],next:e[r.join(",")]||n(r)})}return o}}function Mxt(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],i=!t.validEnd,o=[];for(let e=0;e<t.next.length;e++){let{type:n,next:a}=t.next[e];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(a)&&r.push(a)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Lxt(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Txt(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(void 0===i){let e=t[r];if(!e.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=e.default}n[r]=i}return n}function kxt(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let n=t[i];n.validate&&n.validate(e[i])}}function Ext(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Bxt(t,r,e[r]);return n}class Oxt{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Ext(t,n.attrs),this.defaultAttrs=Lxt(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==fxt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:Txt(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new lxt(this,this.computeAttrs(t),R_t.from(e),V_t.setFrom(n))}createChecked(t=null,e,n){return e=R_t.from(e),this.checkContent(e),new lxt(this,this.computeAttrs(t),e,V_t.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),e=R_t.from(e),e.size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),i=r&&r.fillBefore(R_t.empty,!0);return i?new lxt(this,t,e.append(i),V_t.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){kxt(this.attrs,t,"node",this.name)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:V_t.none:t}static compile(t,e){let n=Object.create(null);t.forEach((t,r)=>n[t]=new Oxt(t,e,r));let r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}function Pxt(t,e,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class Bxt{constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?Pxt(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Ixt{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=Ext(t,r.attrs),this.excluded=null;let i=Lxt(this.attrs);this.instance=i?new V_t(this,i):null}create(t=null){return!t&&this.instance?this.instance:new V_t(this,Txt(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach((t,i)=>n[t]=new Ixt(t,r++,e,i)),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}checkAttrs(t){kxt(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class Dxt{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let r in t)e[r]=t[r];e.nodes=N_t.from(t.nodes),e.marks=N_t.from(t.marks||{}),this.nodes=Oxt.compile(this.spec.nodes,this),this.marks=Ixt.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let t=this.nodes[r],e=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=n[e]||(n[e]=fxt.parse(e,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==i?null:i?Nxt(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let r in this.marks){let t=this.marks[r],e=t.spec.excludes;t.excluded=null==e?[t]:""==e?[]:Nxt(this,e.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof Oxt))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new hxt(n,n.defaultAttrs,t,V_t.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return lxt.fromJSON(this,t)}markFromJSON(t){return V_t.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function Nxt(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],a=o;if(o)n.push(o);else for(let e in t.marks){let r=t.marks[e];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=r)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Fxt(t){return null!=t.tag}function jxt(t){return null!=t.style}class Rxt{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let n=this.matchedStyles=[];e.forEach(t=>{if(Fxt(t))this.tags.push(t);else if(jxt(t)){let e=/[^=]*/.exec(t.style)[0];n.indexOf(e)<0&&n.push(e),this.styles.push(t)}}),this.normalizeLists=!this.tags.some(e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)})}parse(t,e={}){let n=new Kxt(this,e,!1);return n.addAll(t,V_t.none,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new Kxt(this,e,!0);return n.addAll(t,V_t.none,e.from,e.to),G_t.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Xxt(t,n.tag)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(t)||r.context&&!n.matchesContext(r.context)||o.length>t.length&&(61!=o.charCodeAt(t.length)||o.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r],i=null==t.priority?50:t.priority;if(i<n)break}e.splice(r,0,t)}for(let r in t.marks){let e=t.marks[r].spec.parseDOM;e&&e.forEach(t=>{n(t=$xt(t)),t.mark||t.ignore||t.clearMark||(t.mark=r)})}for(let r in t.nodes){let e=t.nodes[r].spec.parseDOM;e&&e.forEach(t=>{n(t=$xt(t)),t.node||t.ignore||t.mark||(t.node=r)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Rxt(t,Rxt.schemaRules(t)))}}const Hxt={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},zxt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Uxt={ol:!0,ul:!0},Vxt=1,Yxt=2,Gxt=4;function Qxt(t,e,n){return null!=e?(e?Vxt:0)|("full"===e?Yxt:0):t&&"pre"==t.whitespace?Vxt|Yxt:n&~Gxt}class Wxt{constructor(t,e,n,r,i,o){this.type=t,this.attrs=e,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=V_t.none,this.match=i||(o&Gxt?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(R_t.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Vxt)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=R_t.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(R_t.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Hxt.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Kxt{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r,i=e.topNode,o=Qxt(null,e.preserveWhitespace,0)|(n?Gxt:0);r=i?new Wxt(i.type,i.attrs,V_t.none,!0,e.topMatch||i.type.contentMatch,o):new Wxt(n?null:t.schema.topNodeType,null,V_t.none,!0,null,o),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,r=this.top,i=r.options&Yxt?"full":this.localPreserveWS||(r.options&Vxt)>0;if("full"===i||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(i)n="full"!==i?n.replace(/\r?\n|\r/g," "):n.replace(/\r\n?/g,"\n");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let e=r.content[r.content.length-1],i=t.previousSibling;(!e||i&&"BR"==i.nodeName||e.isText&&/[ \t\r\n\u000c]$/.test(e.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),e),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let r=this.localPreserveWS,i=this.top;("PRE"==t.tagName||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let o,a=t.nodeName.toLowerCase();Uxt.hasOwnProperty(a)&&this.parser.normalizeLists&&qxt(t);let s=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(o=this.parser.matchTag(t,this,n));t:if(s?s.ignore:zxt.hasOwnProperty(a))this.findInside(t),this.ignoreFallback(t,e);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(t=s.skip);let n,r=this.needsBlock;if(Hxt.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,e);break t}let o=s&&s.skip?e:this.readStyles(t,e);o&&this.addAll(t,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(t,e);n&&this.addElementByRule(t,s,n,!1===s.consuming?o:void 0)}this.localPreserveWS=r}leafFallback(t,e){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"),e)}ignoreFallback(t,e){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),e)}readStyles(t,e){let n=t.style;if(n&&n.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let t=this.parser.matchedStyles[r],i=n.getPropertyValue(t);if(i)for(let n=void 0;;){let r=this.parser.matchStyle(t,i,this,n);if(!r)break;if(r.ignore)return null;if(e=r.clearMark?e.filter(t=>!r.clearMark(t)):e.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming)break;n=r}}return e}addElementByRule(t,e,n,r){let i,o;if(e.node)if(o=this.parser.schema.nodes[e.node],o.isLeaf)this.insertNode(o.create(e.attrs),n)||this.leafFallback(t,n);else{let t=this.enter(o,e.attrs||null,n,e.preserveWhitespace);t&&(i=!0,n=t)}else{let t=this.parser.schema.marks[e.mark];n=n.concat(t.create(e.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t,n));else{let r=t;"string"==typeof e.contentElement?r=t.querySelector(e.contentElement):"function"==typeof e.contentElement?r=e.contentElement(t):e.contentElement&&(r=e.contentElement),this.findAround(t,r,!0),this.addAll(r,n),this.findAround(t,r,!1)}i&&this.sync(a)&&this.open--}addAll(t,e,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,a=null==r?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o,e);this.findAtPoint(t,i)}findPlace(t,e){let n,r;for(let i=this.open;i>=0;i--){let e=this.nodes[i],o=e.findWrapping(t);if(o&&(!n||n.length>o.length)&&(n=o,r=e,!o.length))break;if(e.solid)break}if(!n)return null;this.sync(r);for(let i=0;i<n.length;i++)e=this.enterInner(n[i],null,e,!1);return e}insertNode(t,e){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&(e=this.enterInner(t,null,e))}let n=this.findPlace(t,e);if(n){this.closeExtra();let e=this.top;e.match&&(e.match=e.match.matchType(t.type));let r=V_t.none;for(let i of n.concat(t.marks))(e.type?e.type.allowsMarkType(i.type):Jxt(i.type,t.type))&&(r=i.addToSet(r));return e.content.push(t.mark(r)),!0}return!1}enter(t,e,n,r){let i=this.findPlace(t.create(e),n);return i&&(i=this.enterInner(t,e,n,!0,r)),i}enterInner(t,e,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(t);let a=Qxt(t,i,o.options);o.options&Gxt&&0==o.content.length&&(a|=Gxt);let s=V_t.none;return n=n.filter(e=>!(o.type?o.type.allowsMarkType(e.type):Jxt(e.type,t))||(s=e.addToSet(s),!1)),this.nodes.push(new Wxt(t,e,s,r,null,a)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=Vxt)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)){let t=e.compareDocumentPosition(this.find[r].node);t&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(t,a)=>{for(;t>=0;t--){let s=e[t];if(""==s){if(t==e.length-1||0==t)continue;for(;a>=i;a--)if(o(t-1,a))return!0;return!1}{let t=a>0||0==a&&r?this.nodes[a].type:n&&a>=i?n.node(a-i).type:null;if(!t||t.name!=s&&!t.isInGroup(s))return!1;a--}}return!0};return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function qxt(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&Uxt.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}function Xxt(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function $xt(t){let e={};for(let n in t)e[n]=t[n];return e}function Jxt(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],a=t=>{o.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:i}=t.edge(n);if(r==e)return!0;if(o.indexOf(i)<0&&a(i))return!0}};if(a(i.contentMatch))return!0}}class Zxt{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=eSt(e).createDocumentFragment());let r=n,i=[];return t.forEach(t=>{if(i.length||t.marks.length){let n=0,o=0;while(n<i.length&&o<t.marks.length){let e=t.marks[o];if(this.marks[e.type.name]){if(!e.eq(i[n][0])||!1===e.type.spec.spanning)break;n++,o++}else o++}while(n<i.length)r=i.pop()[1];while(o<t.marks.length){let n=t.marks[o++],a=this.serializeMark(n,t.isInline,e);a&&(i.push([n,r]),r.appendChild(a.dom),r=a.contentDOM||a.dom)}}r.appendChild(this.serializeNodeInner(t,e))}),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=oSt(eSt(e),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&oSt(eSt(n),r(t,e),null,t.attrs)}static renderSpec(t,e,n=null,r){return oSt(t,e,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Zxt(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=tSt(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return tSt(t.marks)}}function tSt(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function eSt(t){return t.document||window.document}const nSt=new WeakMap;function rSt(t){let e=nSt.get(t);return void 0===e&&nSt.set(t,e=iSt(t)),e}function iSt(t){let e=null;function n(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])e||(e=[]),e.push(t);else for(let e=0;e<t.length;e++)n(t[e]);else for(let e in t)n(t[e])}return n(t),e}function oSt(t,e,n,r){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let i,o=e[0];if("string"!=typeof o)throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=rSt(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a,s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let c=n?t.createElementNS(n,o):t.createElement(o),u=e[1],l=1;if(u&&"object"==typeof u&&null==u.nodeType&&!Array.isArray(u)){l=2;for(let t in u)if(null!=u[t]){let e=t.indexOf(" ");e>0?c.setAttributeNS(t.slice(0,e),t.slice(e+1),u[t]):c.setAttribute(t,u[t])}}for(let h=l;h<e.length;h++){let i=e[h];if(0===i){if(h<e.length-1||h>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:e,contentDOM:o}=oSt(t,i,n,r);if(c.appendChild(e),o){if(a)throw new RangeError("Multiple content holes");a=o}}}return{dom:c,contentDOM:a}}const aSt=65535,sSt=Math.pow(2,16);function cSt(t,e){return t+e*sSt}function uSt(t){return t&aSt}function lSt(t){return(t-(t&aSt))/sSt}const hSt=1,dSt=2,fSt=4,pSt=8;class mSt{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(this.delInfo&pSt)>0}get deletedBefore(){return(this.delInfo&(hSt|fSt))>0}get deletedAfter(){return(this.delInfo&(dSt|fSt))>0}get deletedAcross(){return(this.delInfo&fSt)>0}}class gSt{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&gSt.empty)return gSt.empty}recover(t){let e=0,n=uSt(t);if(!this.inverted)for(let r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+lSt(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let s=this.ranges[a]-(this.inverted?r:0);if(s>t)break;let c=this.ranges[a+i],u=this.ranges[a+o],l=s+c;if(t<=l){let i=c?t==s?-1:t==l?1:e:e,o=s+r+(i<0?0:u);if(n)return o;let h=t==(e<0?s:l)?null:cSt(a/3,t-s),d=t==s?dSt:t==l?hSt:fSt;return(e<0?t!=s:t!=l)&&(d|=pSt),new mSt(o,d,h)}r+=u-c}return n?t+r:new mSt(t+r,0,null)}touches(t,e){let n=0,r=uSt(e),i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let e=this.ranges[a]-(this.inverted?n:0);if(e>t)break;let s=this.ranges[a+i],c=e+s;if(t<=c&&a==3*r)return!0;n+=this.ranges[a+o]-s}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],a=o-(this.inverted?i:0),s=o+(this.inverted?0:i),c=this.ranges[r+e],u=this.ranges[r+n];t(a,a+c,s,s+u),i+=u-c}}invert(){return new gSt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?gSt.empty:new gSt(t<0?[0,-t,0]:[0,0,t])}}gSt.empty=new gSt([]);class ASt{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new ASt(this.maps,this.mirror,t,e)}copy(){return new ASt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror)for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new ASt;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let i=this.from;i<this.to;i++){let n=this.maps[i],o=n.mapResult(t,e);if(null!=o.recover){let e=this.getMirror(i);if(null!=e&&e>i&&e<this.to){i=e,t=this.maps[e].recover(o.recover);continue}}r|=o.delInfo,t=o.pos}return n?t:new mSt(t,r,null)}}const vSt=Object.create(null);class ySt{getMap(){return gSt.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=vSt[e.stepType];if(!n)throw new RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in vSt)throw new RangeError("Duplicate use of step JSON ID "+t);return vSt[t]=e,e.prototype.jsonID=t,e}}class bSt{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new bSt(t,null)}static fail(t){return new bSt(null,t)}static fromReplace(t,e,n,r){try{return bSt.ok(t.replace(e,n,r))}catch(i){if(i instanceof Y_t)return bSt.fail(i.message);throw i}}}function wSt(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(wSt(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return R_t.fromArray(r)}class _St extends ySt{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new G_t(wSt(e.content,(t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,r),e.openStart,e.openEnd);return bSt.fromReplace(t,this.from,this.to,i)}invert(){return new xSt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new _St(e.pos,n.pos,this.mark)}merge(t){return t instanceof _St&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new _St(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new _St(e.from,e.to,t.markFromJSON(e.mark))}}ySt.jsonID("addMark",_St);class xSt extends ySt{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new G_t(wSt(e.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),e.openStart,e.openEnd);return bSt.fromReplace(t,this.from,this.to,n)}invert(){return new _St(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new xSt(e.pos,n.pos,this.mark)}merge(t){return t instanceof xSt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new xSt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new xSt(e.from,e.to,t.markFromJSON(e.mark))}}ySt.jsonID("removeMark",xSt);class SSt extends ySt{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return bSt.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return bSt.fromReplace(t,this.pos,this.pos+1,new G_t(R_t.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new SSt(this.pos,e.marks[n]);return new SSt(this.pos,this.mark)}}return new CSt(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new SSt(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new SSt(e.pos,t.markFromJSON(e.mark))}}ySt.jsonID("addNodeMark",SSt);class CSt extends ySt{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return bSt.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return bSt.fromReplace(t,this.pos,this.pos+1,new G_t(R_t.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new SSt(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new CSt(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new CSt(e.pos,t.markFromJSON(e.mark))}}ySt.jsonID("removeNodeMark",CSt);class MSt extends ySt{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&TSt(t,this.from,this.to)?bSt.fail("Structure replace would overwrite content"):bSt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new gSt([this.from,this.to-this.from,this.slice.size])}invert(t){return new MSt(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new MSt(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof MSt)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?G_t.empty:new G_t(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new MSt(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?G_t.empty:new G_t(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new MSt(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new MSt(e.from,e.to,G_t.fromJSON(t,e.slice),!!e.structure)}}ySt.jsonID("replace",MSt);class LSt extends ySt{constructor(t,e,n,r,i,o,a=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=a}apply(t){if(this.structure&&(TSt(t,this.from,this.gapFrom)||TSt(t,this.gapTo,this.to)))return bSt.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return bSt.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?bSt.fromReplace(t,this.from,this.to,n):bSt.fail("Content does not fit in gap")}getMap(){return new gSt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new LSt(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||i>n.pos?null:new LSt(e.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new LSt(e.from,e.to,e.gapFrom,e.gapTo,G_t.fromJSON(t,e.slice),e.insert,!!e.structure)}}function TSt(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;while(i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount)o--,i--;if(i>0){let t=r.node(o).maybeChild(r.indexAfter(o));while(i>0){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function kSt(t,e,n,r){let i,o,a=[],s=[];t.doc.nodesBetween(e,n,(t,c,u)=>{if(!t.isInline)return;let l=t.marks;if(!r.isInSet(l)&&u.type.allowsMarkType(r.type)){let u=Math.max(c,e),h=Math.min(c+t.nodeSize,n),d=r.addToSet(l);for(let t=0;t<l.length;t++)l[t].isInSet(d)||(i&&i.to==u&&i.mark.eq(l[t])?i.to=h:a.push(i=new xSt(u,h,l[t])));o&&o.to==u?o.to=h:s.push(o=new _St(u,h,r))}}),a.forEach(e=>t.step(e)),s.forEach(e=>t.step(e))}function ESt(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(t,a)=>{if(!t.isInline)return;o++;let s=null;if(r instanceof Ixt){let e,n=t.marks;while(e=r.isInSet(n))(s||(s=[])).push(e),n=e.removeFromSet(n)}else r?r.isInSet(t.marks)&&(s=[r]):s=t.marks;if(s&&s.length){let r=Math.min(a+t.nodeSize,n);for(let t=0;t<s.length;t++){let n,c=s[t];for(let t=0;t<i.length;t++){let e=i[t];e.step==o-1&&c.eq(i[t].style)&&(n=e)}n?(n.to=r,n.step=o):i.push({style:c,from:Math.max(a,e),to:r,step:o})}}}),i.forEach(e=>t.step(new xSt(e.from,e.to,e.style)))}function OSt(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),a=[],s=e+1;for(let c=0;c<o.childCount;c++){let e=o.child(c),u=s+e.nodeSize,l=r.matchType(e.type);if(l){r=l;for(let r=0;r<e.marks.length;r++)n.allowsMarkType(e.marks[r].type)||t.step(new xSt(s,u,e.marks[r]));if(i&&e.isText&&"pre"!=n.whitespace){let t,r,i=/\r?\n|\r/g;while(t=i.exec(e.text))r||(r=new G_t(R_t.from(n.schema.text(" ",n.allowedMarks(e.marks))),0,0)),a.push(new MSt(s+t.index,s+t.index+t[0].length,r))}}else a.push(new MSt(s,u,G_t.empty));s=u}if(!r.validEnd){let e=r.fillBefore(R_t.empty,!0);t.replace(s,s,new G_t(e,0,0))}for(let c=a.length-1;c>=0;c--)t.step(a[c])}function PSt(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function BSt(t){let e=t.parent,n=e.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let e=t.$from.node(r),i=t.$from.index(r),o=t.$to.indexAfter(r);if(r<t.depth&&e.canReplace(i,o,n))return r;if(0==r||e.type.spec.isolating||!PSt(e,i,o))break}return null}function ISt(t,e,n){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),s=i.after(o+1),c=a,u=s,l=R_t.empty,h=0;for(let p=o,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,l=R_t.from(r.node(p).copy(l)),h++):c--;let d=R_t.empty,f=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)<i.end(p)?(m=!0,d=R_t.from(i.node(p).copy(d)),f++):u++;t.step(new LSt(c,u,a,s,new G_t(l.append(d),h,f),l.size-h,!0))}function DSt(t,e,n=null,r=t){let i=FSt(t,e),o=i&&jSt(r,e);return o?i.map(NSt).concat({type:e,attrs:n}).concat(o.map(NSt)):null}function NSt(t){return{type:t,attrs:null}}function FSt(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return n.canReplaceWith(r,i,a)?o:null}function jSt(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let s=a.length?a[a.length-1]:e,c=s.contentMatch;for(let u=r;c&&u<i;u++)c=c.matchType(n.child(u).type);return c&&c.validEnd?a:null}function RSt(t,e,n){let r=R_t.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let t=n[a].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=R_t.from(n[a].type.create(n[a].attrs,r))}let i=e.start,o=e.end;t.step(new LSt(i,o,i,o,new G_t(r,0,0),n.length,!0))}function HSt(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(e,n)=>{let a="function"==typeof i?i(e):i;if(e.isTextblock&&!e.hasMarkup(r,a)&&VSt(t.doc,t.mapping.slice(o).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let t="pre"==r.whitespace,e=!!r.contentMatch.matchType(r.schema.linebreakReplacement);t&&!e?i=!1:!t&&e&&(i=!0)}!1===i&&USt(t,e,n,o),OSt(t,t.mapping.slice(o).map(n,1),r,void 0,null===i);let s=t.mapping.slice(o),c=s.map(n,1),u=s.map(n+e.nodeSize,1);return t.step(new LSt(c,u,c+1,u-1,new G_t(R_t.from(r.create(a,null,e.marks)),0,0),1,!0)),!0===i&&zSt(t,e,n,o),!1}})}function zSt(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let a,s=/\r?\n|\r/g;while(a=s.exec(i.text)){let i=t.mapping.slice(r).map(n+1+o+a.index);t.replaceWith(i,i+1,e.type.schema.linebreakReplacement.create())}}})}function USt(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+o);t.replaceWith(i,i+1,e.type.schema.text("\n"))}})}function VSt(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function YSt(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let a=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new LSt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new G_t(R_t.from(a),0,0),1,!0))}function GSt(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,l=n-2;u>o;u--,l--){let t=i.node(u),e=i.index(u);if(t.type.spec.isolating)return!1;let n=t.content.cutByIndex(e,t.childCount),o=r&&r[l+1];o&&(n=n.replaceChild(0,o.type.create(o.attrs)));let a=r&&r[l]||t;if(!t.canReplace(e+1,t.childCount)||!a.type.validContent(n))return!1}let s=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(s,s,c?c.type:i.node(o+1).type)}function QSt(t,e,n=1,r){let i=t.doc.resolve(e),o=R_t.empty,a=R_t.empty;for(let s=i.depth,c=i.depth-n,u=n-1;s>c;s--,u--){o=R_t.from(i.node(s).copy(o));let t=r&&r[u];a=R_t.from(t?t.type.create(t.attrs,a):i.node(s).copy(a))}t.step(new MSt(e,e,new G_t(o.append(a),n,n),!0))}function WSt(t,e){let n=t.resolve(e),r=n.index();return qSt(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function KSt(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),a=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(a),!n)return!1;if(!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function qSt(t,e){return!(!t||!e||t.isLeaf||!KSt(t,e))}function XSt(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),a=o.node().type;if(i&&a.inlineContent){let t="pre"==a.whitespace,e=!!a.contentMatch.matchType(i);t&&!e?r=!1:!t&&e&&(r=!0)}let s=t.steps.length;if(!1===r){let r=t.doc.resolve(e+n);USt(t,r.node(),r.before(),s)}a.inlineContent&&OSt(t,e+n-1,a,o.node().contentMatchAt(o.index()),null==r);let c=t.mapping.slice(s),u=c.map(e-n);if(t.step(new MSt(u,c.map(e+n,-1),G_t.empty,!0)),!0===r){let e=t.doc.resolve(u);zSt(t,e.node(),e.before(),t.steps.length)}return t}function $St(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let t=r.index(i);if(r.node(i).canReplaceWith(t,t,n))return r.before(i+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let t=r.indexAfter(i);if(r.node(i).canReplaceWith(t,t,n))return r.after(i+1);if(t<r.node(i).childCount)return null}return null}function JSt(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(0==n.openStart&&n.size?2:1);o++)for(let t=r.depth;t>=0;t--){let e=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,n=r.index(t)+(e>0?1:0),a=r.node(t),s=!1;if(1==o)s=a.canReplace(n,n,i);else{let t=a.contentMatchAt(n).findWrapping(i.firstChild.type);s=t&&a.canReplaceWith(n,n,t[0])}if(s)return 0==e?r.pos:e<0?r.before(t+1):r.after(t+1)}return null}function ZSt(t,e,n=e,r=G_t.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return tCt(i,o,r)?new MSt(e,n,r):new eCt(i,o,r).fit()}function tCt(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}ySt.jsonID("replaceAround",LSt);class eCt{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=R_t.empty;for(let r=0;r<=t.depth;r++){let e=t.node(r);this.frontier.push({type:e.type,match:e.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=R_t.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){while(this.unplaced.size){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(t<0?this.$to:n.doc.resolve(t));if(!r)return null;let i=this.placed,o=n.depth,a=r.depth;while(o&&a&&1==i.childCount)i=i.firstChild.content,o--,a--;let s=new G_t(i,o,a);return t>-1?new LSt(n.pos,t,this.$to.pos,this.$to.end(),s,e):s.size||n.pos!=this.$to.pos?new MSt(n.pos,r.pos,s):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){let i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t,r=null;n?(r=iCt(this.unplaced.content,n-1).firstChild,t=r.content):t=this.unplaced.content;let i=t.firstChild;for(let o=this.depth;o>=0;o--){let t,{type:a,match:s}=this.frontier[o],c=null;if(1==e&&(i?s.matchType(i.type)||(c=s.fillBefore(R_t.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:o,parent:r,inject:c};if(2==e&&i&&(t=s.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:r,wrap:t};if(r&&s.matchType(r.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=iCt(t,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new G_t(t,e+1,Math.max(n,r.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,r=iCt(t,e);if(r.childCount<=1&&e>0){let i=t.size-e<=e+r.size;this.unplaced=new G_t(nCt(t,e-1,1),e-1,i?e-1:n)}else this.unplaced=new G_t(nCt(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:r,wrap:i}){while(this.depth>e)this.closeFrontierNode();if(i)for(let p=0;p<i.length;p++)this.openFrontierNode(i[p]);let o=this.unplaced,a=n?n.content:o.content,s=o.openStart-t,c=0,u=[],{match:l,type:h}=this.frontier[e];if(r){for(let t=0;t<r.childCount;t++)u.push(r.child(t));l=l.matchFragment(r)}let d=a.size+t-(o.content.size-o.openEnd);while(c<a.childCount){let t=a.child(c),e=l.matchType(t.type);if(!e)break;c++,(c>1||0==s||t.content.size)&&(l=e,u.push(oCt(t.mark(h.allowedMarks(t.marks)),1==c?s:0,c==a.childCount?d:-1)))}let f=c==a.childCount;f||(d=-1),this.placed=rCt(this.placed,e,R_t.from(u)),this.frontier[e].match=l,f&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let p=0,m=a;p<d;p++){let t=m.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),m=t.content}this.unplaced=f?0==t?G_t.empty:new G_t(nCt(o.content,t-1,1),t-1,d<0?o.openEnd:t-1):new G_t(nCt(o.content,t,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t,e=this.frontier[this.depth];if(!e.type.isTextblock||!aCt(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);while(n>1&&r==this.$to.end(--n))++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),o=aCt(t,e,r,n,i);if(o){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],i=aCt(t,n,r,e,!0);if(!i||i.childCount)continue t}return{depth:e,fit:o,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;while(this.depth>e.depth)this.closeFrontierNode();e.fit.childCount&&(this.placed=rCt(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=rCt(this.placed,this.depth,R_t.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop(),e=t.match.fillBefore(R_t.empty,!0);e.childCount&&(this.placed=rCt(this.placed,this.frontier.length,e))}}function nCt(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(nCt(t.firstChild.content,e-1,n)))}function rCt(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(rCt(t.lastChild.content,e-1,n)))}function iCt(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function oCt(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,oCt(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(R_t.empty,!0)))),t.copy(r)}function aCt(t,e,n,r,i){let o=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let s=r.fillBefore(o.content,!0,a);return s&&!sCt(n,o.content,a)?s:null}function sCt(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function cCt(t){return t.spec.defining||t.spec.definingForContent}function uCt(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(tCt(i,o,r))return t.step(new MSt(e,n,r));let a=fCt(i,t.doc.resolve(n));0==a[a.length-1]&&a.pop();let s=-(i.depth+1);a.unshift(s);for(let d=i.depth,f=i.pos-1;d>0;d--,f--){let t=i.node(d).type.spec;if(t.defining||t.definingAsContext||t.isolating)break;a.indexOf(d)>-1?s=d:i.before(d)==f&&a.splice(1,0,-d)}let c=a.indexOf(s),u=[],l=r.openStart;for(let d=r.content,f=0;;f++){let t=d.firstChild;if(u.push(t),f==r.openStart)break;d=t.content}for(let d=l-1;d>=0;d--){let t=u[d],e=cCt(t.type);if(e&&!t.sameMarkup(i.node(Math.abs(s)-1)))l=d;else if(e||!t.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let e=(d+l+1)%(r.openStart+1),s=u[e];if(s)for(let u=0;u<a.length;u++){let l=a[(u+c)%a.length],h=!0;l<0&&(h=!1,l=-l);let d=i.node(l-1),f=i.index(l-1);if(d.canReplaceWith(f,f,s.type,s.marks))return t.replace(i.before(l),h?o.after(l):n,new G_t(lCt(r.content,0,r.openStart,e),e,r.openEnd))}}let h=t.steps.length;for(let d=a.length-1;d>=0;d--){if(t.replace(e,n,r),t.steps.length>h)break;let s=a[d];s<0||(e=i.before(s),n=o.after(s))}}function lCt(t,e,n,r,i){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(lCt(i.content,e+1,n,r,i)))}if(e>r){let e=i.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(R_t.empty,!0))}return t}function hCt(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=$St(t.doc,e,r.type);null!=i&&(e=n=i)}t.replaceRange(e,n,new G_t(R_t.from(r),0,0))}function dCt(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=fCt(r,i);for(let a=0;a<o.length;a++){let e=o[a],n=a==o.length-1;if(n&&0==e||r.node(e).type.contentMatch.validEnd)return t.delete(r.start(e),i.end(e));if(e>0&&(n||r.node(e-1).canReplace(r.index(e-1),i.indexAfter(e-1))))return t.delete(r.before(e),i.after(e))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return t.delete(r.before(a),n);t.delete(e,n)}function fCt(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let r=t.start(i);if(r<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(r==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==r-1)&&n.push(i)}return n}class pCt extends ySt{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return bSt.fail("No node at attribute step's position");let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,null,e.marks);return bSt.fromReplace(t,this.pos,this.pos+1,new G_t(R_t.from(r),0,e.isLeaf?0:1))}getMap(){return gSt.empty}invert(t){return new pCt(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new pCt(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new pCt(e.pos,e.attr,e.value)}}ySt.jsonID("attr",pCt);class mCt extends ySt{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let r in t.attrs)e[r]=t.attrs[r];e[this.attr]=this.value;let n=t.type.create(e,t.content,t.marks);return bSt.ok(n)}getMap(){return gSt.empty}invert(t){return new mCt(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new mCt(e.attr,e.value)}}ySt.jsonID("docAttr",mCt);let gCt=class extends Error{};gCt=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},gCt.prototype=Object.create(Error.prototype),gCt.prototype.constructor=gCt,gCt.prototype.name="TransformError";class ACt{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ASt}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new gCt(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=G_t.empty){let r=ZSt(this.doc,t,e,n);return r&&this.step(r),this}replaceWith(t,e,n){return this.replace(t,e,new G_t(R_t.from(n),0,0))}delete(t,e){return this.replace(t,e,G_t.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return uCt(this,t,e,n),this}replaceRangeWith(t,e,n){return hCt(this,t,e,n),this}deleteRange(t,e){return dCt(this,t,e),this}lift(t,e){return ISt(this,t,e),this}join(t,e=1){return XSt(this,t,e),this}wrap(t,e){return RSt(this,t,e),this}setBlockType(t,e=t,n,r=null){return HSt(this,t,e,n,r),this}setNodeMarkup(t,e,n=null,r){return YSt(this,t,e,n,r),this}setNodeAttribute(t,e,n){return this.step(new pCt(t,e,n)),this}setDocAttribute(t,e){return this.step(new mCt(t,e)),this}addNodeMark(t,e){return this.step(new SSt(t,e)),this}removeNodeMark(t,e){if(!(e instanceof V_t)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(e=e.isInSet(n.marks),!e)return this}return this.step(new CSt(t,e)),this}split(t,e=1,n){return QSt(this,t,e,n),this}addMark(t,e,n){return kSt(this,t,e,n),this}removeMark(t,e,n){return ESt(this,t,e,n),this}clearIncompatible(t,e,n){return OSt(this,t,e,n),this}}const vCt=Object.create(null);class yCt{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new bCt(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=G_t.empty){let n=e.content.lastChild,r=null;for(let a=0;a<e.openEnd;a++)r=n,n=n.lastChild;let i=t.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:s,$to:c}=o[a],u=t.mapping.slice(i);t.replaceRange(u.map(s.pos),u.map(c.pos),a?G_t.empty:e),0==a&&ECt(t,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:a}=r[i],s=t.mapping.slice(n),c=s.map(o.pos),u=s.map(a.pos);i?t.deleteRange(c,u):(t.replaceRangeWith(c,u,e),ECt(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new xCt(t):kCt(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let i=t.depth-1;i>=0;i--){let r=e<0?kCt(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):kCt(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(r)return r}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new LCt(t.node(0))}static atStart(t){return kCt(t,t,0,0,1)||new LCt(t)}static atEnd(t){return kCt(t,t,t.content.size,t.childCount,-1)||new LCt(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=vCt[e.type];if(!n)throw new RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in vCt)throw new RangeError("Duplicate use of selection JSON ID "+t);return vCt[t]=e,e.prototype.jsonID=t,e}getBookmark(){return xCt.between(this.$anchor,this.$head).getBookmark()}}yCt.prototype.visible=!0;class bCt{constructor(t,e){this.$from=t,this.$to=e}}let wCt=!1;function _Ct(t){wCt||t.parent.inlineContent||(wCt=!0,console["warn"]("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class xCt extends yCt{constructor(t,e=t){_Ct(t),_Ct(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return yCt.near(n);let r=t.resolve(e.map(this.anchor));return new xCt(r.parent.inlineContent?r:n,n)}replace(t,e=G_t.empty){if(super.replace(t,e),e==G_t.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof xCt&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new SCt(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new xCt(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if(n&&!r||(n=r>=0?1:-1),!e.parent.inlineContent){let t=yCt.findFrom(e,n,!0)||yCt.findFrom(e,-n,!0);if(!t)return yCt.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r?t=e:(t=(yCt.findFrom(t,-n,!0)||yCt.findFrom(t,n,!0)).$anchor,t.pos<e.pos!=r<0&&(t=e))),new xCt(t,e)}}yCt.jsonID("text",xCt);class SCt{constructor(t,e){this.anchor=t,this.head=e}map(t){return new SCt(t.map(this.anchor),t.map(this.head))}resolve(t){return xCt.between(t.resolve(this.anchor),t.resolve(this.head))}}class CCt extends yCt{constructor(t){let e=t.nodeAfter,n=t.node(0).resolve(t.pos+e.nodeSize);super(t,n),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),i=t.resolve(r);return n?yCt.near(i):new CCt(i)}content(){return new G_t(R_t.from(this.node),0,0)}eq(t){return t instanceof CCt&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new MCt(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new CCt(t.resolve(e.anchor))}static create(t,e){return new CCt(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}CCt.prototype.visible=!1,yCt.jsonID("node",CCt);class MCt{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new SCt(n,n):new MCt(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&CCt.isSelectable(n)?new CCt(e):yCt.near(e)}}class LCt extends yCt{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=G_t.empty){if(e==G_t.empty){t.delete(0,t.doc.content.size);let e=yCt.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new LCt(t)}map(t){return new LCt(t)}eq(t){return t instanceof LCt}getBookmark(){return TCt}}yCt.jsonID("all",LCt);const TCt={map(){return this},resolve(t){return new LCt(t)}};function kCt(t,e,n,r,i,o=!1){if(e.inlineContent)return xCt.create(t,n);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let r=e.child(a);if(r.isAtom){if(!o&&CCt.isSelectable(r))return CCt.create(t,n-(i<0?r.nodeSize:0))}else{let e=kCt(t,r,n+i,i<0?r.childCount:0,i,o);if(e)return e}n+=r.nodeSize*i}return null}function ECt(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof MSt||i instanceof LSt))return;let o,a=t.mapping.maps[r];a.forEach((t,e,n,r)=>{null==o&&(o=r)}),t.setSelection(yCt.near(t.doc.resolve(o),n))}const OCt=1,PCt=2,BCt=4;class ICt extends ACt{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|OCt)&~PCt,this.storedMarks=null,this}get selectionSet(){return(this.updated&OCt)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=PCt,this}ensureMarks(t){return V_t.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&PCt)>0}addStep(t,e){super.addStep(t,e),this.updated=this.updated&~PCt,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||V_t.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(yCt.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=BCt,this}get scrolledIntoView(){return(this.updated&BCt)>0}}function DCt(t,e){return e&&t?t.bind(e):t}class NCt{constructor(t,e,n){this.name=t,this.init=DCt(e.init,n),this.apply=DCt(e.apply,n)}}const FCt=[new NCt("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new NCt("selection",{init(t,e){return t.selection||yCt.atStart(e.doc)},apply(t){return t.selection}}),new NCt("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new NCt("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class jCt{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=FCt.slice(),e&&e.forEach(t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new NCt(t.key,t.spec.state,t))})}}class RCt{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=e){let e=this.config.plugins[n];if(e.spec.filterTransaction&&!e.spec.filterTransaction.call(e,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],n=this.applyInner(t),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let s=r?r[o].n:0,c=r?r[o].state:this,u=s<e.length&&a.spec.appendTransaction.call(a,s?e.slice(s):e,c,n);if(u&&n.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",t),!r){r=[];for(let t=0;t<this.config.plugins.length;t++)r.push(t<o?{state:n,n:e.length}:{state:this,n:0})}e.push(u),n=n.applyInner(u),i=!0}r&&(r[o]={state:n,n:e.length})}}if(!i)return{state:n,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let e=new RCt(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];e[i.name]=i.apply(t,this[i.name],this,e)}return e}get tr(){return new ICt(this)}static create(t){let e=new jCt(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new RCt(e);for(let r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n}reconfigure(t){let e=new jCt(this.schema,t.plugins),n=e.fields,r=new RCt(e);for(let i=0;i<n.length;i++){let e=n[i].name;r[e]=this.hasOwnProperty(e)?this[e]:n[i].init(t,r)}return r}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(t=>t.toJSON())),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new jCt(t.schema,t.plugins),i=new RCt(r);return r.fields.forEach(r=>{if("doc"==r.name)i.doc=lxt.fromJSON(t.schema,e.doc);else if("selection"==r.name)i.selection=yCt.fromJSON(i.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(i.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let o in n){let a=n[o],s=a.spec.state;if(a.key==r.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(e,o))return void(i[r.name]=s.fromJSON.call(a,t,e[o],i))}i[r.name]=r.init(t,i)}}),i}}function HCt(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):"handleDOMEvents"==r&&(i=HCt(i,e,{})),n[r]=i}return n}class zCt{constructor(t){this.spec=t,this.props={},t.props&&HCt(t.props,this,this.props),this.key=t.key?t.key.key:VCt("plugin")}getState(t){return t[this.key]}}const UCt=Object.create(null);function VCt(t){return t in UCt?t+"$"+ ++UCt[t]:(UCt[t]=0,t+"$")}class YCt{constructor(t="key"){this.key=VCt(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const GCt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},QCt=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let WCt=null;const KCt=function(t,e,n){let r=WCt||(WCt=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},qCt=function(){WCt=null},XCt=function(t,e,n,r){return n&&(JCt(t,e,n,r,-1)||JCt(t,e,n,r,1))},$Ct=/^(img|br|input|textarea|hr)$/i;function JCt(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:ZCt(t))){let n=t.parentNode;if(!n||1!=n.nodeType||rMt(t)||$Ct.test(t.nodeName)||"false"==t.contentEditable)return!1;e=GCt(t)+(i<0?0:1),t=n}else{if(1!=t.nodeType)return!1;if(t=t.childNodes[e+(i<0?-1:0)],"false"==t.contentEditable)return!1;e=i<0?ZCt(t):0}}}function ZCt(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function tMt(t,e){for(;;){if(3==t.nodeType&&e)return t;if(1==t.nodeType&&e>0){if("false"==t.contentEditable)return null;t=t.childNodes[e-1],e=ZCt(t)}else{if(!t.parentNode||rMt(t))return null;e=GCt(t),t=t.parentNode}}}function eMt(t,e){for(;;){if(3==t.nodeType&&e<t.nodeValue.length)return t;if(1==t.nodeType&&e<t.childNodes.length){if("false"==t.contentEditable)return null;t=t.childNodes[e],e=0}else{if(!t.parentNode||rMt(t))return null;e=GCt(t)+1,t=t.parentNode}}}function nMt(t,e,n){for(let r=0==e,i=e==ZCt(t);r||i;){if(t==n)return!0;let e=GCt(t);if(t=t.parentNode,!t)return!1;r=r&&0==e,i=i&&e==ZCt(t)}}function rMt(t){let e;for(let n=t;n;n=n.parentNode)if(e=n.pmViewDesc)break;return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const iMt=function(t){return t.focusNode&&XCt(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function oMt(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function aMt(t){let e=t.activeElement;while(e&&e.shadowRoot)e=e.shadowRoot.activeElement;return e}function sMt(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(ZCt(r.offsetNode),r.offset)}}catch(r){}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(ZCt(r.startContainer),r.startOffset)}}}const cMt="undefined"!=typeof navigator?navigator:null,uMt="undefined"!=typeof document?document:null,lMt=cMt&&cMt.userAgent||"",hMt=/Edge\/(\d+)/.exec(lMt),dMt=/MSIE \d/.exec(lMt),fMt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(lMt),pMt=!!(dMt||fMt||hMt),mMt=dMt?document.documentMode:fMt?+fMt[1]:hMt?+hMt[1]:0,gMt=!pMt&&/gecko\/(\d+)/i.test(lMt);gMt&&(/Firefox\/(\d+)/.exec(lMt)||[0,0])[1];const AMt=!pMt&&/Chrome\/(\d+)/.exec(lMt),vMt=!!AMt,yMt=AMt?+AMt[1]:0,bMt=!pMt&&!!cMt&&/Apple Computer/.test(cMt.vendor),wMt=bMt&&(/Mobile\/\w+/.test(lMt)||!!cMt&&cMt.maxTouchPoints>2),_Mt=wMt||!!cMt&&/Mac/.test(cMt.platform),xMt=!!cMt&&/Win/.test(cMt.platform),SMt=/Android \d/.test(lMt),CMt=!!uMt&&"webkitFontSmoothing"in uMt.documentElement.style,MMt=CMt?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function LMt(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function TMt(t,e){return"number"==typeof t?t:t[e]}function kMt(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function EMt(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let a=n||t.dom;;a=QCt(a)){if(!a)break;if(1!=a.nodeType)continue;let t=a,n=t==o.body,s=n?LMt(o):kMt(t),c=0,u=0;if(e.top<s.top+TMt(r,"top")?u=-(s.top-e.top+TMt(i,"top")):e.bottom>s.bottom-TMt(r,"bottom")&&(u=e.bottom-e.top>s.bottom-s.top?e.top+TMt(i,"top")-s.top:e.bottom-s.bottom+TMt(i,"bottom")),e.left<s.left+TMt(r,"left")?c=-(s.left-e.left+TMt(i,"left")):e.right>s.right-TMt(r,"right")&&(c=e.right-s.right+TMt(i,"right")),c||u)if(n)o.defaultView.scrollBy(c,u);else{let n=t.scrollLeft,r=t.scrollTop;u&&(t.scrollTop+=u),c&&(t.scrollLeft+=c);let i=t.scrollLeft-n,o=t.scrollTop-r;e={left:e.left-i,top:e.top-o,right:e.right-i,bottom:e.bottom-o}}if(n||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function OMt(t){let e,n,r=t.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,a=i+1;a<Math.min(innerHeight,r.bottom);a+=5){let r=t.root.elementFromPoint(o,a);if(!r||r==t.dom||!t.dom.contains(r))continue;let s=r.getBoundingClientRect();if(s.top>=i-20){e=r,n=s.top;break}}return{refDOM:e,refTop:n,stack:PMt(t.dom)}}function PMt(t){let e=[],n=t.ownerDocument;for(let r=t;r;r=QCt(r))if(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t==n)break;return e}function BMt({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;IMt(n,0==r?0:r-e)}function IMt(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let DMt=null;function NMt(t){if(t.setActive)return t.setActive();if(DMt)return t.focus(DMt);let e=PMt(t);t.focus(null==DMt?{get preventScroll(){return DMt={preventScroll:!0},!0}}:void 0),DMt||(DMt=!1,IMt(e,0))}function FMt(t,e){let n,r,i,o,a=2e8,s=0,c=e.top,u=e.top;for(let l=t.firstChild,h=0;l;l=l.nextSibling,h++){let t;if(1==l.nodeType)t=l.getClientRects();else{if(3!=l.nodeType)continue;t=KCt(l).getClientRects()}for(let d=0;d<t.length;d++){let f=t[d];if(f.top<=c&&f.bottom>=u){c=Math.max(f.bottom,c),u=Math.min(f.top,u);let t=f.left>e.left?f.left-e.left:f.right<e.left?e.left-f.right:0;if(t<a){n=l,a=t,r=t&&3==n.nodeType?{left:f.right<e.left?f.right:f.left,top:e.top}:e,1==l.nodeType&&t&&(s=h+(e.left>=(f.left+f.right)/2?1:0));continue}}else f.top>e.top&&!i&&f.left<=e.left&&f.right>=e.left&&(i=l,o={left:Math.max(f.left,Math.min(f.right,e.left)),top:f.top});!n&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(s=h+1)}}return!n&&i&&(n=i,r=o,a=0),n&&3==n.nodeType?jMt(n,r):!n||a&&1==n.nodeType?{node:t,offset:s}:FMt(n,r)}function jMt(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let n=QMt(r,1);if(n.top!=n.bottom&&RMt(e,n))return{node:t,offset:i+(e.left>=(n.left+n.right)/2?1:0)}}return{node:t,offset:0}}function RMt(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function HMt(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function zMt(t,e,n){let{node:r,offset:i}=FMt(e,n),o=-1;if(1==r.nodeType&&!r.firstChild){let t=r.getBoundingClientRect();o=t.left!=t.right&&n.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function UMt(t,e,n,r){let i=-1;for(let o=e,a=!1;;){if(o==t.dom)break;let e,n=t.docView.nearestDesc(o,!0);if(!n)return null;if(1==n.dom.nodeType&&(n.node.isBlock&&n.parent||!n.contentDOM)&&((e=n.dom.getBoundingClientRect()).width||e.height)&&(n.node.isBlock&&n.parent&&(!a&&e.left>r.left||e.top>r.top?i=n.posBefore:(!a&&e.right<r.left||e.bottom<r.top)&&(i=n.posAfter),a=!0),!n.contentDOM&&i<0&&!n.node.isText)){let t=n.node.isBlock?r.top<(e.top+e.bottom)/2:r.left<(e.left+e.right)/2;return t?n.posBefore:n.posAfter}o=n.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function VMt(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=t.childNodes[o];if(1==n.nodeType){let t=n.getClientRects();for(let r=0;r<t.length;r++){let i=t[r];if(RMt(e,i))return VMt(n,e,i)}}if((o=(o+1)%r)==i)break}return t}function YMt(t,e){let n,r=t.dom.ownerDocument,i=0,o=sMt(r,e.left,e.top);o&&({node:n,offset:i}=o);let a,s=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top);if(!s||!t.dom.contains(1!=s.nodeType?s.parentNode:s)){let n=t.dom.getBoundingClientRect();if(!RMt(e,n))return null;if(s=VMt(t.dom,e,n),!s)return null}if(bMt)for(let u=s;n&&u;u=QCt(u))u.draggable&&(n=void 0);if(s=HMt(s,e),n){if(gMt&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let t,r=n.childNodes[i];"IMG"==r.nodeName&&(t=r.getBoundingClientRect()).right<=e.left&&t.bottom>e.top&&i++}let r;CMt&&i&&1==n.nodeType&&1==(r=n.childNodes[i-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=e.top&&i--,n==t.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(a=UMt(t,n,i,e))}null==a&&(a=zMt(t,s,e));let c=t.docView.nearestDesc(s,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function GMt(t){return t.top<t.bottom||t.left<t.right}function QMt(t,e){let n=t.getClientRects();if(n.length){let t=n[e<0?0:n.length-1];if(GMt(t))return t}return Array.prototype.find.call(n,GMt)||t.getBoundingClientRect()}const WMt=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function KMt(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),a=CMt||gMt;if(3==r.nodeType){if(!a||!WMt.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let t=i,e=i,o=n<0?1:-1;return n<0&&!i?(e++,o=-1):n>=0&&i==r.nodeValue.length?(t--,o=1):n<0?t--:e++,qMt(QMt(KCt(r,t,e),o),o<0)}{let t=QMt(KCt(r,i,i),n);if(gMt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let e=QMt(KCt(r,i-1,i-1),-1);if(e.top==t.top){let n=QMt(KCt(r,i,i+1),-1);if(n.top!=t.top)return qMt(n,n.left<e.left)}}return t}}let s=t.state.doc.resolve(e-(o||0));if(!s.parent.inlineContent){if(null==o&&i&&(n<0||i==ZCt(r))){let t=r.childNodes[i-1];if(1==t.nodeType)return XMt(t.getBoundingClientRect(),!1)}if(null==o&&i<ZCt(r)){let t=r.childNodes[i];if(1==t.nodeType)return XMt(t.getBoundingClientRect(),!0)}return XMt(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==ZCt(r))){let t=r.childNodes[i-1],e=3==t.nodeType?KCt(t,ZCt(t)-(a?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return qMt(QMt(e,1),!1)}if(null==o&&i<ZCt(r)){let t=r.childNodes[i];while(t.pmViewDesc&&t.pmViewDesc.ignoreForCoords)t=t.nextSibling;let e=t?3==t.nodeType?KCt(t,0,a?0:1):1==t.nodeType?t:null:null;if(e)return qMt(QMt(e,-1),!0)}return qMt(QMt(3==r.nodeType?KCt(r):r,-n),n>=0)}function qMt(t,e){if(0==t.width)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function XMt(t,e){if(0==t.height)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function $Mt(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function JMt(t,e,n){let r=e.selection,i="up"==n?r.$from:r.$to;return $Mt(t,e,()=>{let{node:e}=t.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=t.docView.nearestDesc(e,!0);if(!n)break;if(n.node.isBlock){e=n.contentDOM||n.dom;break}e=n.dom.parentNode}let r=KMt(t,i.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=KCt(t,0,t.nodeValue.length).getClientRects()}for(let t=0;t<e.length;t++){let i=e[t];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0})}const ZMt=/[\u0590-\u08ac]/;function tLt(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,s=t.domSelection();return s?ZMt.test(r.parent.textContent)&&s.modify?$Mt(t,e,()=>{let{focusNode:e,focusOffset:i,anchorNode:o,anchorOffset:a}=t.domSelectionRange(),c=s.caretBidiLevel;s.modify("move",n,"character");let u=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:l,focusOffset:h}=t.domSelectionRange(),d=l&&!u.contains(1==l.nodeType?l:l.parentNode)||e==l&&i==h;try{s.collapse(o,a),e&&(e!=o||i!=a)&&s.extend&&s.extend(e,i)}catch(f){}return null!=c&&(s.caretBidiLevel=c),d}):"left"==n||"backward"==n?o:a:r.pos==r.start()||r.pos==r.end()}let eLt=null,nLt=null,rLt=!1;function iLt(t,e,n){return eLt==e&&nLt==n?rLt:(eLt=e,nLt=n,rLt="up"==n||"down"==n?JMt(t,e,n):tLt(t,e,n))}const oLt=0,aLt=1,sLt=2,cLt=3;class uLt{constructor(t,e,n,r){this.parent=t,this.children=e,this.dom=n,this.contentDOM=r,this.dirty=oLt,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;e<this.children.length;e++)t+=this.children[e].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let e=0,n=this.posAtStart;;e++){let r=this.children[e];if(r==t)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){let n,r;if(t==this.contentDOM)n=t.childNodes[e-1];else{while(t.parentNode!=this.contentDOM)t=t.parentNode;n=t.previousSibling}while(n&&(!(r=n.pmViewDesc)||r.parent!=this))n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(t==this.contentDOM)n=t.childNodes[e];else{while(t.parentNode!=this.contentDOM)t=t.parentNode;n=t.nextSibling}while(n&&(!(r=n.pmViewDesc)||r.parent!=this))n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(t==this.dom&&this.contentDOM)r=e>GCt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!1;break}if(e.previousSibling)break}if(null==r&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){r=!0;break}if(e.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let n=!0,r=t;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!e||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==t.nodeType?t:t.parentNode):i==t))return o;n=!1}}}getDesc(t){let e=t.pmViewDesc;for(let n=e;n;n=n.parent)if(n==this)return e}posFromDOM(t,e,n){for(let r=t;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(t,e,n)}return-1}descAt(t){for(let e=0,n=0;e<this.children.length;e++){let r=this.children[e],i=n+r.size;if(n==t&&i!=n){while(!r.border&&r.children.length)r=r.children[0];return r}if(t<i)return r.descAt(t-n-r.border);n=i}}domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let n,r=0,i=0;for(let o=0;r<this.children.length;r++){let e=this.children[r],n=o+e.size;if(n>t||e instanceof gLt){i=t-o;break}o=n}if(i)return this.children[r].domFromPos(i-this.children[r].border,e);for(;r&&!(n=this.children[r-1]).size&&n instanceof lLt&&n.side>=0;r--);if(e<=0){let t,n=!0;for(;;r--,n=!1)if(t=r?this.children[r-1]:null,!t||t.dom.parentNode==this.contentDOM)break;return t&&e&&n&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?GCt(t.dom)+1:0}}{let t,n=!0;for(;;r++,n=!1)if(t=r<this.children.length?this.children[r]:null,!t||t.dom.parentNode==this.contentDOM)break;return t&&n&&!t.border&&!t.domAtom?t.domFromPos(0,e):{node:this.contentDOM,offset:t?GCt(t.dom):this.contentDOM.childNodes.length}}}parseRange(t,e,n=0){if(0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,a=0;;a++){let n=this.children[a],s=o+n.size;if(-1==r&&t<=s){let i=o+n.border;if(t>=i&&e<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(t,e,i);t=o;for(let e=a;e>0;e--){let n=this.children[e-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=GCt(n.dom)+1;break}t-=n.size}-1==r&&(r=0)}if(r>-1&&(s>e||a==this.children.length-1)){e=s;for(let t=a+1;t<this.children.length;t++){let n=this.children[t];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=GCt(n.dom);break}e+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=s}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:i}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)}domAfterPos(t){let{node:e,offset:n}=this.domFromPos(t,0);if(1!=e.nodeType||n==e.childNodes.length)throw new RangeError("No node after pos "+t);return e.childNodes[n]}setSelection(t,e,n,r=!1){let i=Math.min(t,e),o=Math.max(t,e);for(let f=0,p=0;f<this.children.length;f++){let a=this.children[f],s=p+a.size;if(i>p&&o<s)return a.setSelection(t-p-a.border,e-p-a.border,n,r);p=s}let a=this.domFromPos(t,t?-1:1),s=e==t?a:this.domFromPos(e,e?-1:1),c=n.root.getSelection(),u=n.domSelectionRange(),l=!1;if((gMt||bMt)&&t==e){let{node:t,offset:e}=a;if(3==t.nodeType){if(l=!(!e||"\n"!=t.nodeValue[e-1]),l&&e==t.nodeValue.length)for(let n,r=t;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(a=s={node:n.parentNode,offset:GCt(n)+1});break}let t=r.pmViewDesc;if(t&&t.node&&t.node.isBlock)break}}else{let n=t.childNodes[e-1];l=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(gMt&&u.focusNode&&u.focusNode!=s.node&&1==u.focusNode.nodeType){let t=u.focusNode.childNodes[u.focusOffset];t&&"false"==t.contentEditable&&(r=!0)}if(!(r||l&&bMt)&&XCt(a.node,a.offset,u.anchorNode,u.anchorOffset)&&XCt(s.node,s.offset,u.focusNode,u.focusOffset))return;let h=!1;if((c.extend||t==e)&&!l){c.collapse(a.node,a.offset);try{t!=e&&c.extend(s.node,s.offset),h=!0}catch(d){}}if(!h){if(t>e){let t=a;a=s,s=t}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?t<=o&&e>=n:t<o&&e>n){let r=n+i.border,a=o-i.border;if(t>=r&&e<=a)return this.dirty=t==n||e==o?sLt:aLt,void(t!=r||e!=a||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(t-r,e-r):i.dirty=cLt);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?cLt:sLt}n=o}this.dirty=sLt}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let n=1==t?sLt:aLt;e.dirty<n&&(e.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(t){return!1}}class lLt extends uLt{constructor(t,e,n,r){let i,o=e.type.toDOM;if("function"==typeof o&&(o=o(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r)),!e.type.spec.raw){if(1!=o.nodeType){let t=document.createElement("span");t.appendChild(o),o=t}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(t,[],o,null),this.widget=e,this.widget=e,i=this}matchesWidget(t){return this.dirty==oLt&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class hLt extends uLt{constructor(t,e,n,r){super(t,[],e,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class dLt extends uLt{constructor(t,e,n,r,i){super(t,[],n,r),this.mark=e,this.spec=i}static create(t,e,n,r){let i=r.nodeViews[e.type.name],o=i&&i(e,r,n);return o&&o.dom||(o=Zxt.renderSpec(document,e.type.spec.toDOM(e,n),null,e.attrs)),new dLt(t,e,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&cLt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=cLt&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),this.dirty!=oLt){let t=this.parent;while(!t.node)t=t.parent;t.dirty<this.dirty&&(t.dirty=this.dirty),this.dirty=oLt}}slice(t,e,n){let r=dLt.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;e<o&&(i=BLt(i,e,o,n)),t>0&&(i=BLt(i,0,t,n));for(let a=0;a<i.length;a++)i[a].parent=r;return r.children=i,r}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class fLt extends uLt{constructor(t,e,n,r,i,o,a,s,c){super(t,[],i,o),this.node=e,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=a}static create(t,e,n,r,i,o){let a,s=i.nodeViews[e.type.name],c=s&&s(e,i,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:o,n,r),u=c&&c.dom,l=c&&c.contentDOM;if(e.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(e.text);else if(!u){let t=Zxt.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs);({dom:u,contentDOM:l}=t)}l||e.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),e.type.spec.draggable&&(u.draggable=!0));let h=u;return u=SLt(u,n,e),c?a=new ALt(t,e,n,r,u,l||null,h,c,i,o+1):e.isText?new mLt(t,e,n,r,u,h,i):new fLt(t,e,n,r,u,l||null,h,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>R_t.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,n){return this.dirty==oLt&&t.eq(this.node)&&CLt(e,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let n=this.node.inlineContent,r=e,i=t.composing?this.localCompositionInfo(t,e):null,o=i&&i.pos>-1?i:null,a=i&&i.pos<0,s=new LLt(this,o&&o.node,t);ELt(this.node,this.innerDeco,(e,i,o)=>{e.spec.marks?s.syncToMarks(e.spec.marks,n,t):e.type.side>=0&&!o&&s.syncToMarks(i==this.node.childCount?V_t.none:this.node.child(i).marks,n,t),s.placeWidget(e,t,r)},(e,o,c,u)=>{let l;s.syncToMarks(e.marks,n,t),s.findNodeMatch(e,o,c,u)||a&&t.state.selection.from>r&&t.state.selection.to<r+e.nodeSize&&(l=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(e,o,c,l,t)||s.updateNextNode(e,o,c,t,u,r)||s.addNode(e,o,c,t,r),r+=e.nodeSize}),s.syncToMarks([],n,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==sLt)&&(o&&this.protectLocalComposition(t,o),vLt(this.contentDOM,this.children,t),wMt&&OLt(this.dom))}localCompositionInfo(t,e){let{from:n,to:r}=t.state.selection;if(!(t.state.selection instanceof xCt)||n<e||r>e+this.node.content.size)return null;let i=t.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let t=i.nodeValue,o=PLt(this.node.content,t,n-e,r-e);return o<0?null:{node:i,pos:o,text:t}}return{node:i,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:n,text:r}){if(this.getDesc(e))return;let i=e;for(;;i=i.parentNode){if(i.parentNode==this.contentDOM)break;while(i.previousSibling)i.parentNode.removeChild(i.previousSibling);while(i.nextSibling)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new hLt(this,i,e,r);t.input.compositionNodes.push(o),this.children=BLt(this.children,n,n+r.length,t,o)}update(t,e,n,r){return!(this.dirty==cLt||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)}updateInner(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=oLt}updateOuterDeco(t){if(CLt(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=_Lt(this.dom,this.nodeDOM,wLt(this.outerDeco,this.node,e),wLt(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function pLt(t,e,n,r,i){SLt(r,e,t);let o=new fLt(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class mLt extends fLt{constructor(t,e,n,r,i,o,a){super(t,e,n,r,i,null,o,a,0)}parseRule(){let t=this.nodeDOM.parentNode;while(t&&t!=this.dom&&!t.pmIsDeco)t=t.parentNode;return{skip:t||!0}}update(t,e,n,r){return!(this.dirty==cLt||this.dirty!=oLt&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),this.dirty==oLt&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=oLt,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,n){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,n)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,n){let r=this.node.cut(t,e),i=document.createTextNode(r.text);return new mLt(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=cLt)}get domAtom(){return!1}isText(t){return this.node.text==t}}class gLt extends uLt{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==oLt&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ALt extends fLt{constructor(t,e,n,r,i,o,a,s,c,u){super(t,e,n,r,i,o,a,c,u),this.spec=s}update(t,e,n,r){if(this.dirty==cLt)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let i=this.spec.update(t,e,n);return i&&this.updateInner(t,e,n,r),i}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,n,r){this.spec.setSelection?this.spec.setSelection(t,e,n.root):super.setSelection(t,e,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function vLt(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let a=e[o],s=a.dom;if(s.parentNode==t){while(s!=r)r=MLt(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(s,r);if(a instanceof dLt){let e=r?r.previousSibling:t.lastChild;vLt(a.contentDOM,a.children,n),r=e?e.nextSibling:t.firstChild}}while(r)r=MLt(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const yLt=function(t){t&&(this.nodeName=t)};yLt.prototype=Object.create(null);const bLt=[new yLt];function wLt(t,e,n){if(0==t.length)return bLt;let r=n?bLt[0]:new yLt,i=[r];for(let o=0;o<t.length;o++){let a=t[o].type.attrs;if(a){a.nodeName&&i.push(r=new yLt(a.nodeName));for(let t in a){let o=a[t];null!=o&&(n&&1==i.length&&i.push(r=new yLt(e.isInline?"span":"div")),"class"==t?r.class=(r.class?r.class+" ":"")+o:"style"==t?r.style=(r.style?r.style+";":"")+o:"nodeName"!=t&&(r[t]=o))}}}return i}function _Lt(t,e,n,r){if(n==bLt&&r==bLt)return e;let i=e;for(let o=0;o<r.length;o++){let e=r[o],a=n[o];if(o){let n;a&&a.nodeName==e.nodeName&&i!=t&&(n=i.parentNode)&&n.nodeName.toLowerCase()==e.nodeName||(n=document.createElement(e.nodeName),n.pmIsDeco=!0,n.appendChild(i),a=bLt[0]),i=n}xLt(i,a||bLt[0],e)}return i}function xLt(t,e,n){for(let r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let e=0;e<r.length;e++)-1==i.indexOf(r[e])&&t.classList.remove(r[e]);for(let e=0;e<i.length;e++)-1==r.indexOf(i[e])&&t.classList.add(i[e]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;while(n=r.exec(e.style))t.style.removeProperty(n[1])}n.style&&(t.style.cssText+=n.style)}}function SLt(t,e,n){return _Lt(t,t,bLt,wLt(e,n,1!=t.nodeType))}function CLt(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function MLt(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class LLt{constructor(t,e,n){this.lock=e,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=TLt(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,e,n){let r=0,i=this.stack.length>>1,o=Math.min(i,t.length);while(r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&!1!==t[r].type.spec.spanning)r++;while(r<i)this.destroyRest(),this.top.dirty=oLt,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;while(i<t.length){this.stack.push(this.top,this.index+1);let r=-1;for(let e=this.index;e<Math.min(this.index+3,this.top.children.length);e++){let n=this.top.children[e];if(n.matchesMark(t[i])&&!this.isLocked(n.dom)){r=e;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=dLt.create(this.top,t[i],e,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(t,e,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(t,e,n))o=this.top.children.indexOf(i,this.index);else for(let a=this.index,s=Math.min(this.top.children.length,a+5);a<s;a++){let r=this.top.children[a];if(r.matchesNode(t,e,n)&&!this.preMatch.matched.has(r)){o=a;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,e,n,r,i){let o=this.top.children[r];return o.dirty==cLt&&o.dom==o.contentDOM&&(o.dirty=sLt),!!o.update(t,e,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(t){for(;;){let e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let e=t.pmViewDesc;if(e)for(let t=this.index;t<this.top.children.length;t++)if(this.top.children[t]==e)return t;return-1}t=e}}updateNextNode(t,e,n,r,i,o){for(let a=this.index;a<this.top.children.length;a++){let s=this.top.children[a];if(s instanceof fLt){let c=this.preMatch.matched.get(s);if(null!=c&&c!=i)return!1;let u,l=s.dom,h=this.isLocked(l)&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&s.dirty!=cLt&&CLt(e,s.outerDeco));if(!h&&s.update(t,e,n,r))return this.destroyBetween(this.index,a),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!h&&(u=this.recreateWrapper(s,t,e,n,r,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=sLt,u.updateChildren(r,o+1),u.dirty=oLt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,e,n,r,i,o){if(t.dirty||e.isAtom||!t.children.length||!t.node.content.eq(e.content)||!CLt(n,t.outerDeco)||!r.eq(t.innerDeco))return null;let a=fLt.create(this.top,e,n,r,i,o);if(a.contentDOM){a.children=t.children,t.children=[];for(let t of a.children)t.parent=a}return t.destroy(),a}addNode(t,e,n,r,i){let o=fLt.create(this.top,t,e,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(t,e,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){let r=new lLt(this.top,t,e,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let t=this.top.children[this.index-1],e=this.top;while(t instanceof dLt)e=t,t=e.children[e.children.length-1];(!t||!(t instanceof mLt)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((bMt||vMt)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{let n=document.createElement(t);"IMG"==t&&(n.className="ProseMirror-separator",n.alt=""),"BR"==t&&(n.className="ProseMirror-trailingBreak");let r=new gLt(this.top,[],n,null);e!=this.top?e.children.push(r):e.children.splice(this.index++,0,r),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||1==t.nodeType&&t.contains(this.lock.parentNode))}}function TLt(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,a=[];t:while(i>0){let s;for(;;)if(r){let t=n.children[r-1];if(!(t instanceof dLt)){s=t,r--;break}n=t,r=t.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}let c=s.node;if(c){if(c!=t.child(i-1))break;--i,o.set(s,i),a.push(s)}}return{index:i,matched:o,matches:a.reverse()}}function kLt(t,e){return t.type.side-e.type.side}function ELt(t,e,n,r){let i=e.locals(t),o=0;if(0==i.length){for(let n=0;n<t.childCount;n++){let a=t.child(n);r(a,i,e.forChild(o,a),n),o+=a.nodeSize}return}let a=0,s=[],c=null;for(let u=0;;){let l,h,d,f;while(a<i.length&&i[a].to==o){let t=i[a++];t.widget&&(l?(h||(h=[l])).push(t):l=t)}if(l)if(h){h.sort(kLt);for(let t=0;t<h.length;t++)n(h[t],u,!!c)}else n(l,u,!!c);if(c)f=-1,d=c,c=null;else{if(!(u<t.childCount))break;f=u,d=t.child(u++)}for(let t=0;t<s.length;t++)s[t].to<=o&&s.splice(t--,1);while(a<i.length&&i[a].from<=o&&i[a].to>o)s.push(i[a++]);let p=o+d.nodeSize;if(d.isText){let t=p;a<i.length&&i[a].from<t&&(t=i[a].from);for(let e=0;e<s.length;e++)s[e].to<t&&(t=s[e].to);t<p&&(c=d.cut(t-o),d=d.cut(0,t-o),p=t,f=-1)}else while(a<i.length&&i[a].to<p)a++;let m=d.isInline&&!d.isLeaf?s.filter(t=>!t.inline):s.slice();r(d,m,e.forChild(o,d),f),o=p}}function OLt(t){if("UL"==t.nodeName||"OL"==t.nodeName){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function PLt(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let a=t.child(i++),s=o;if(o+=a.nodeSize,!a.isText)continue;let c=a.text;while(i<t.childCount){let e=t.child(i++);if(o+=e.nodeSize,!e.isText)break;c+=e.text}if(o>=n){if(o>=r&&c.slice(r-e.length-s,r-s)==e)return r-e.length;let t=s<r?c.lastIndexOf(e,r-s-1):-1;if(t>=0&&t+e.length+s>=n)return s+t;if(n==r&&c.length>=r+e.length-s&&c.slice(r-s,r-s+e.length)==e)return r}}return-1}function BLt(t,e,n,r,i){let o=[];for(let a=0,s=0;a<t.length;a++){let c=t[a],u=s,l=s+=c.size;u>=n||l<=e?o.push(c):(u<e&&o.push(c.slice(0,e-u,r)),i&&(o.push(i),i=void 0),l>n&&o.push(c.slice(n-u,c.size,r)))}return o}function ILt(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&0==i.size,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let s,c,u=r.resolve(a);if(iMt(n)){s=a;while(i&&!i.node)i=i.parent;let t=i.node;if(i&&t.isAtom&&CCt.isSelectable(t)&&i.parent&&(!t.isInline||!nMt(n.focusNode,n.focusOffset,i.dom))){let t=i.posBefore;c=new CCt(a==t?u:r.resolve(t))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let e=a,i=a;for(let r=0;r<n.rangeCount;r++){let o=n.getRangeAt(r);e=Math.min(e,t.docView.posFromDOM(o.startContainer,o.startOffset,1)),i=Math.max(i,t.docView.posFromDOM(o.endContainer,o.endOffset,-1))}if(e<0)return null;[s,a]=i==t.state.selection.anchor?[i,e]:[e,i],u=r.resolve(a)}else s=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(s<0)return null}let l=r.resolve(s);if(!c){let n="pointer"==e||t.state.selection.head<u.pos&&!o?1:-1;c=GLt(t,l,u,n)}return c}function DLt(t){return t.editable?t.hasFocus():WLt(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function NLt(t,e=!1){let n=t.state.selection;if(VLt(t,n),DLt(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&vMt){let e=t.domSelectionRange(),n=t.domObserver.currentSelection;if(e.anchorNode&&n.anchorNode&&XCt(e.anchorNode,e.anchorOffset,n.anchorNode,n.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)ULt(t);else{let r,i,{anchor:o,head:a}=n;!FLt||n instanceof xCt||(n.$from.parent.inlineContent||(r=jLt(t,n.from)),n.empty||n.$from.parent.inlineContent||(i=jLt(t,n.to))),t.docView.setSelection(o,a,t,e),FLt&&(r&&HLt(r),i&&HLt(i)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&zLt(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const FLt=bMt||vMt&&yMt<63;function jLt(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(bMt&&i&&"false"==i.contentEditable)return RLt(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return RLt(i);if(o)return RLt(o)}}function RLt(t){return t.contentEditable="true",bMt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function HLt(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function zLt(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{DLt(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")},20))})}function ULt(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setStart(r.parentNode,GCt(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&pMt&&mMt<=11&&(r.disabled=!0,r.disabled=!1)}function VLt(t,e){if(e instanceof CCt){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(YLt(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else YLt(t)}function YLt(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function GLt(t,e,n,r){return t.someProp("createSelectionBetween",r=>r(t,e,n))||xCt.between(e,n,r)}function QLt(t){return!(t.editable&&!t.hasFocus())&&WLt(t)}function WLt(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(n){return!1}}function KLt(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return XCt(e.node,e.offset,n.anchorNode,n.anchorOffset)}function qLt(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&yCt.findFrom(o,e)}function XLt(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function $Lt(t,e,n){let r=t.state.selection;if(!(r instanceof xCt)){if(r instanceof CCt&&r.node.isInline)return XLt(t,new xCt(e>0?r.$to:r.$from));{let n=qLt(t.state,e);return!!n&&XLt(t,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:e<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=t.state.doc.resolve(n.pos+i.nodeSize*(e<0?-1:1));return XLt(t,new xCt(r.$anchor,o))}if(!r.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let n=qLt(t.state,e);return!!(n&&n instanceof CCt)&&XLt(t,n)}if(!(_Mt&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=t.docView.descAt(a))&&!n.contentDOM)&&(CCt.isSelectable(o)?XLt(t,new CCt(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):!!CMt&&XLt(t,new xCt(t.state.doc.resolve(e<0?a:a+o.nodeSize))))}}function JLt(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function ZLt(t,e){let n=t.pmViewDesc;return n&&0==n.size&&(e<0||t.nextSibling||"BR"!=t.nodeName)}function tTt(t,e){return e<0?eTt(t):nTt(t)}function eTt(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,a=!1;for(gMt&&1==n.nodeType&&r<JLt(n)&&ZLt(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;{let t=n.childNodes[r-1];if(ZLt(t,-1))i=n,o=--r;else{if(3!=t.nodeType)break;n=t,r=n.nodeValue.length}}}else{if(rTt(n))break;{let e=n.previousSibling;while(e&&ZLt(e,-1))i=n.parentNode,o=GCt(e),e=e.previousSibling;if(e)n=e,r=JLt(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?aTt(t,n,r):i&&aTt(t,i,o)}function nTt(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,a=JLt(n);for(;;)if(r<a){if(1!=n.nodeType)break;let t=n.childNodes[r];if(!ZLt(t,1))break;i=n,o=++r}else{if(rTt(n))break;{let e=n.nextSibling;while(e&&ZLt(e,1))i=e.parentNode,o=GCt(e)+1,e=e.nextSibling;if(e)n=e,r=0,a=JLt(n);else{if(n=n.parentNode,n==t.dom)break;r=a=0}}}i&&aTt(t,i,o)}function rTt(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function iTt(t,e){while(t&&e==t.childNodes.length&&!rMt(t))e=GCt(t)+1,t=t.parentNode;while(t&&e<t.childNodes.length){let n=t.childNodes[e];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=n,e=0}}function oTt(t,e){while(t&&!e&&!rMt(t))e=GCt(t),t=t.parentNode;while(t&&e){let n=t.childNodes[e-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=n,e=t.childNodes.length}}function aTt(t,e,n){if(3!=e.nodeType){let t,r;(r=iTt(e,n))?(e=r,n=0):(t=oTt(e,n))&&(e=t,n=t.nodeValue.length)}let r=t.domSelection();if(!r)return;if(iMt(r)){let t=document.createRange();t.setEnd(e,n),t.setStart(e,n),r.removeAllRanges(),r.addRange(t)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&NLt(t)},50)}function sTt(t,e){let n=t.state.doc.resolve(e);if(!vMt&&!xMt&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let n=t.coordsAtPos(e-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(e<n.end()){let n=t.coordsAtPos(e+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}let r=getComputedStyle(t.dom).direction;return"rtl"==r?"rtl":"ltr"}function cTt(t,e,n){let r=t.state.selection;if(r instanceof xCt&&!r.empty||n.indexOf("s")>-1)return!1;if(_Mt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let n=qLt(t.state,e);if(n&&n instanceof CCt)return XLt(t,n)}if(!i.parent.inlineContent){let n=e<0?i:o,a=r instanceof LCt?yCt.near(n,e):yCt.findFrom(n,e);return!!a&&XLt(t,a)}return!1}function uTt(t,e){if(!(t.state.selection instanceof xCt))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=t.state.tr;return e<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),t.dispatch(r),!0}return!1}function lTt(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function hTt(t){if(!bMt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&1==e.nodeType&&0==n&&e.firstChild&&"false"==e.firstChild.contentEditable){let n=e.firstChild;lTt(t,n,"true"),setTimeout(()=>lTt(t,n,"false"),20)}return!1}function dTt(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function fTt(t,e){let n=e.keyCode,r=dTt(e);if(8==n||_Mt&&72==n&&"c"==r)return uTt(t,-1)||tTt(t,-1);if(46==n&&!e.shiftKey||_Mt&&68==n&&"c"==r)return uTt(t,1)||tTt(t,1);if(13==n||27==n)return!0;if(37==n||_Mt&&66==n&&"c"==r){let e=37==n?"ltr"==sTt(t,t.state.selection.from)?-1:1:-1;return $Lt(t,e,r)||tTt(t,e)}if(39==n||_Mt&&70==n&&"c"==r){let e=39==n?"ltr"==sTt(t,t.state.selection.from)?1:-1:1;return $Lt(t,e,r)||tTt(t,e)}return 38==n||_Mt&&80==n&&"c"==r?cTt(t,-1,r)||tTt(t,-1):40==n||_Mt&&78==n&&"c"==r?hTt(t)||cTt(t,1,r)||tTt(t,1):r==(_Mt?"m":"c")&&(66==n||73==n||89==n||90==n)}function pTt(t,e){t.someProp("transformCopied",n=>{e=n(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;while(i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount){i--,o--;let t=r.firstChild;n.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),r=t.content}let a=t.someProp("clipboardSerializer")||Zxt.fromSchema(t.state.schema),s=CTt(),c=s.createElement("div");c.appendChild(a.serializeFragment(r,{document:s}));let u,l=c.firstChild,h=0;while(l&&1==l.nodeType&&(u=xTt[l.nodeName.toLowerCase()])){for(let t=u.length-1;t>=0;t--){let e=s.createElement(u[t]);while(c.firstChild)e.appendChild(c.firstChild);c.appendChild(e),h++}l=c.firstChild}l&&1==l.nodeType&&l.setAttribute("data-pm-slice",`${i} ${o}${h?" -"+h:""} ${JSON.stringify(n)}`);let d=t.someProp("clipboardTextSerializer",n=>n(e,t))||e.content.textBetween(0,e.content.size,"\n\n");return{dom:c,text:d,slice:e}}function mTt(t,e,n,r,i){let o,a,s=i.parent.type.spec.code;if(!n&&!e)return null;let c=e&&(r||s||!n);if(c){if(t.someProp("transformPastedText",n=>{e=n(e,s||r,t)}),s)return e?new G_t(R_t.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):G_t.empty;let n=t.someProp("clipboardTextParser",n=>n(e,i,r,t));if(n)a=n;else{let n=i.marks(),{schema:r}=t.state,a=Zxt.fromSchema(r);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(t=>{let e=o.appendChild(document.createElement("p"));t&&e.appendChild(a.serializeNode(r.text(t,n)))})}}else t.someProp("transformPastedHTML",e=>{n=e(n,t)}),o=TTt(n),CMt&&kTt(o);let u=o&&o.querySelector("[data-pm-slice]"),l=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let h=+l[3];h>0;h--){let t=o.firstChild;while(t&&1!=t.nodeType)t=t.nextSibling;if(!t)break;o=t}if(!a){let e=t.someProp("clipboardParser")||t.someProp("domParser")||Rxt.fromSchema(t.state.schema);a=e.parseSlice(o,{preserveWhitespace:!(!c&&!l),context:i,ruleFromNode(t){return"BR"!=t.nodeName||t.nextSibling||!t.parentNode||gTt.test(t.parentNode.nodeName)?null:{ignore:!0}}})}if(l)a=ETt(_Tt(a,+l[1],+l[2]),l[4]);else if(a=G_t.maxOpen(ATt(a.content,i),!0),a.openStart||a.openEnd){let t=0,e=0;for(let n=a.content.firstChild;t<a.openStart&&!n.type.spec.isolating;t++,n=n.firstChild);for(let n=a.content.lastChild;e<a.openEnd&&!n.type.spec.isolating;e++,n=n.lastChild);a=_Tt(a,t,e)}return t.someProp("transformPasted",e=>{a=e(a,t)}),a}const gTt=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function ATt(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r,i=e.node(n),o=i.contentMatchAt(e.index(n)),a=[];if(t.forEach(t=>{if(!a)return;let e,n=o.findWrapping(t.type);if(!n)return a=null;if(e=a.length&&r.length&&yTt(n,r,t,a[a.length-1],0))a[a.length-1]=e;else{a.length&&(a[a.length-1]=bTt(a[a.length-1],r.length));let e=vTt(t,n);a.push(e),o=o.matchType(e.type),r=n}}),a)return R_t.from(a)}return t}function vTt(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,R_t.from(t));return t}function yTt(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=yTt(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));let a=r.contentMatchAt(r.childCount);if(a.matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(R_t.from(vTt(n,t,i+1))))}}function bTt(t,e){if(0==e)return t;let n=t.content.replaceChild(t.childCount-1,bTt(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(R_t.empty,!0);return t.copy(n.append(r))}function wTt(t,e,n,r,i,o){let a=e<0?t.firstChild:t.lastChild,s=a.content;return t.childCount>1&&(o=0),i<r-1&&(s=wTt(s,e,n,r,i+1,o)),i>=n&&(s=e<0?a.contentMatchAt(0).fillBefore(s,o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(R_t.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(s))}function _Tt(t,e,n){return e<t.openStart&&(t=new G_t(wTt(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new G_t(wTt(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const xTt={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let STt=null;function CTt(){return STt||(STt=document.implementation.createHTMLDocument("title"))}let MTt=null;function LTt(t){let e=window.trustedTypes;return e?(MTt||(MTt=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),MTt.createHTML(t)):t}function TTt(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n,r=CTt().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t);if((n=i&&xTt[i[1].toLowerCase()])&&(t=n.map(t=>"<"+t+">").join("")+t+n.map(t=>"</"+t+">").reverse().join("")),r.innerHTML=LTt(t),n)for(let o=0;o<n.length;o++)r=r.querySelector(n[o])||r;return r}function kTt(t){let e=t.querySelectorAll(vMt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function ETt(t,e){if(!t.size)return t;let n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(s){return t}let{content:i,openStart:o,openEnd:a}=t;for(let c=n.length-2;c>=0;c-=2){let t=r.nodes[n[c]];if(!t||t.hasRequiredAttrs())break;i=R_t.from(t.create(n[c+1],i)),o++,a++}return new G_t(i,o,a)}const OTt={},PTt={},BTt={touchstart:!0,touchmove:!0};class ITt{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function DTt(t){for(let e in OTt){let n=OTt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=e=>{!HTt(t,e)||RTt(t,e)||!t.editable&&e.type in PTt||n(t,e)},BTt[e]?{passive:!0}:void 0)}bMt&&t.dom.addEventListener("input",()=>null),jTt(t)}function NTt(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function FTt(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function jTt(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=e=>RTt(t,e))})}function RTt(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)})}function HTt(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function zTt(t,e){RTt(t,e)||!OTt[e.type]||!t.editable&&e.type in PTt||OTt[e.type](t,e)}function UTt(t){return{left:t.clientX,top:t.clientY}}function VTt(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function YTt(t,e,n,r,i){if(-1==r)return!1;let o=t.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(t.someProp(e,e=>a>o.depth?e(t,n,o.nodeAfter,o.before(a),i,!0):e(t,n,o.node(a),o.before(a),i,!1)))return!0;return!1}function GTt(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function QTt(t,e){if(-1==e)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&CCt.isSelectable(r))&&(GTt(t,new CCt(n),"pointer"),!0)}function WTt(t,e){if(-1==e)return!1;let n,r,i=t.state.selection;i instanceof CCt&&(n=i.node);let o=t.state.doc.resolve(e);for(let a=o.depth+1;a>0;a--){let t=a>o.depth?o.nodeAfter:o.node(a);if(CCt.isSelectable(t)){r=n&&i.$from.depth>0&&a>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(a);break}}return null!=r&&(GTt(t,CCt.create(t.state.doc,r),"pointer"),!0)}function KTt(t,e,n,r,i){return YTt(t,"handleClickOn",e,n,r)||t.someProp("handleClick",n=>n(t,e,r))||(i?WTt(t,n):QTt(t,n))}function qTt(t,e,n,r){return YTt(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",n=>n(t,e,r))}function XTt(t,e,n,r){return YTt(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",n=>n(t,e,r))||$Tt(t,n,r)}function $Tt(t,e,n){if(0!=n.button)return!1;let r=t.state.doc;if(-1==e)return!!r.inlineContent&&(GTt(t,xCt.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let e=o>i.depth?i.nodeAfter:i.node(o),n=i.before(o);if(e.inlineContent)GTt(t,xCt.create(r,n+1,n+1+e.content.size),"pointer");else{if(!CCt.isSelectable(e))continue;GTt(t,CCt.create(r,n),"pointer")}return!0}}function JTt(t){return skt(t)}PTt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!ekt(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!SMt||!vMt||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!wMt||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",e=>e(t,n))||fTt(t,n)?n.preventDefault():NTt(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",e=>e(t,oMt(13,"Enter"))),t.input.lastIOSEnter=0)},200)}},PTt.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},PTt.keypress=(t,e)=>{let n=e;if(ekt(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||_Mt&&n.metaKey)return;if(t.someProp("handleKeyPress",e=>e(t,n)))return void n.preventDefault();let r=t.state.selection;if(!(r instanceof xCt)||!r.$from.sameParent(r.$to)){let e=String.fromCharCode(n.charCode);/[\r\n]/.test(e)||t.someProp("handleTextInput",n=>n(t,r.$from.pos,r.$to.pos,e))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),n.preventDefault()}};const ZTt=_Mt?"metaKey":"ctrlKey";OTt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=JTt(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&VTt(n,t.input.lastClick)&&!n[ZTt]&&("singleClick"==t.input.lastClick.type?o="doubleClick":"doubleClick"==t.input.lastClick.type&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let a=t.posAtCoords(UTt(n));a&&("singleClick"==o?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new tkt(t,a,n,!!r)):("doubleClick"==o?qTt:XTt)(t,a.pos,a.inside,n)?n.preventDefault():NTt(t,"pointer"))};class tkt{constructor(t,e,n,r){let i,o;if(this.view=t,this.pos=e,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[ZTt],this.allowDefault=n.shiftKey,e.inside>-1)i=t.state.doc.nodeAt(e.inside),o=e.inside;else{let n=t.state.doc.resolve(e.pos);i=n.parent,o=n.depth?n.before():0}const a=r?null:n.target,s=a?t.docView.nearestDesc(a,!0):null;this.target=s&&1==s.dom.nodeType?s.dom:null;let{selection:c}=t.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||c instanceof CCt&&c.from<=o&&c.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!gMt||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),NTt(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>NLt(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(UTt(t))),this.updateAllowDefault(t),this.allowDefault||!e?NTt(this.view,"pointer"):KTt(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||bMt&&this.mightDrag&&!this.mightDrag.node.isAtom||vMt&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(GTt(this.view,yCt.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):NTt(this.view,"pointer")}move(t){this.updateAllowDefault(t),NTt(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function ekt(t,e){return!!t.composing||!!(bMt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}OTt.touchstart=t=>{t.input.lastTouch=Date.now(),JTt(t),NTt(t,"pointer")},OTt.touchmove=t=>{t.input.lastTouch=Date.now(),NTt(t,"pointer")},OTt.contextmenu=t=>JTt(t);const nkt=SMt?5e3:-1;function rkt(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>skt(t),e))}function ikt(t){t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=akt());while(t.input.compositionNodes.length>0)t.input.compositionNodes.pop().markParentsDirty()}function okt(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=tMt(e.focusNode,e.focusOffset),r=eMt(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let e=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!e||!e.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let t=n.pmViewDesc;if(t&&t.isText(n.nodeValue))return r}}return n||r}function akt(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function skt(t,e=!1){if(!(SMt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),ikt(t),e||t.docView&&t.docView.dirty){let n=ILt(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):!t.markCursor&&!e||t.state.selection.empty?t.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0}return!1}}function ckt(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}PTt.compositionstart=PTt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof xCt&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(t=>!1===t.type.spec.inclusive)))t.markCursor=t.state.storedMarks||n.marks(),skt(t,!0),t.markCursor=null;else if(skt(t,!e.selection.empty),gMt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let e=t.domSelectionRange();for(let n=e.focusNode,r=e.focusOffset;n&&1==n.nodeType&&0!=r;){let e=r<0?n.lastChild:n.childNodes[r-1];if(!e)break;if(3==e.nodeType){let n=t.domSelection();n&&n.collapse(e,e.nodeValue.length);break}n=e,r=-1}}t.input.composing=!0}rkt(t,nkt)},PTt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,rkt(t,20))};const ukt=pMt&&mMt<15||wMt&&MMt<604;function lkt(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}function hkt(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?dkt(t,r.value,null,i,e):dkt(t,r.textContent,r.innerHTML,i,e)},50)}function dkt(t,e,n,r,i){let o=mTt(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",e=>e(t,i,o||G_t.empty)))return!0;if(!o)return!1;let a=lkt(o),s=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function fkt(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}OTt.copy=PTt.cut=(t,e)=>{let n=e,r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=ukt?null:n.clipboardData,a=r.content(),{dom:s,text:c}=pTt(t,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",c)):ckt(t,s),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},PTt.paste=(t,e)=>{let n=e;if(t.composing&&!SMt)return;let r=ukt?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&dkt(t,fkt(r),r.getData("text/html"),i,n)?n.preventDefault():hkt(t,n)};class pkt{constructor(t,e,n){this.slice=t,this.move=e,this.node=n}}const mkt=_Mt?"altKey":"ctrlKey";OTt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i,o=t.state.selection,a=o.empty?null:t.posAtCoords(UTt(n));if(a&&a.pos>=o.from&&a.pos<=(o instanceof CCt?o.to-1:o.to));else if(r&&r.mightDrag)i=CCt.create(t.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let e=t.docView.nearestDesc(n.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&(i=CCt.create(t.state.doc,e.posBefore))}let s=(i||t.state.selection).content(),{dom:c,text:u,slice:l}=pTt(t,s);(!n.dataTransfer.files.length||!vMt||yMt>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ukt?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",ukt||n.dataTransfer.setData("text/plain",u),t.dragging=new pkt(l,!n[mkt],i)},OTt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},PTt.dragover=PTt.dragenter=(t,e)=>e.preventDefault(),PTt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(UTt(n));if(!i)return;let o=t.state.doc.resolve(i.pos),a=r&&r.slice;a?t.someProp("transformPasted",e=>{a=e(a,t)}):a=mTt(t,fkt(n.dataTransfer),ukt?null:n.dataTransfer.getData("text/html"),!1,o);let s=!(!r||n[mkt]);if(t.someProp("handleDrop",e=>e(t,n,a||G_t.empty,s)))return void n.preventDefault();if(!a)return;n.preventDefault();let c=a?JSt(t.state.doc,o.pos,a):o.pos;null==c&&(c=o.pos);let u=t.state.tr;if(s){let{node:t}=r;t?t.replace(u):u.deleteSelection()}let l=u.mapping.map(c),h=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,d=u.doc;if(h?u.replaceRangeWith(l,l,a.content.firstChild):u.replaceRange(l,l,a),u.doc.eq(d))return;let f=u.doc.resolve(l);if(h&&CCt.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))u.setSelection(new CCt(f));else{let e=u.mapping.map(c);u.mapping.maps[u.mapping.maps.length-1].forEach((t,n,r,i)=>e=i),u.setSelection(GLt(t,f,u.doc.resolve(e)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))},OTt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&NLt(t)},20))},OTt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},OTt.beforeinput=(t,e)=>{let n=e;if(vMt&&SMt&&"deleteContentBackward"==n.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",e=>e(t,oMt(8,"Backspace"))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let os in PTt)OTt[os]=PTt[os];function gkt(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Akt{constructor(t,e){this.toDOM=t,this.spec=e||_kt,this.side=this.spec.side||0}map(t,e,n,r){let{pos:i,deleted:o}=t.mapResult(e.from+r,this.side<0?-1:1);return o?null:new bkt(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Akt&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&gkt(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class vkt{constructor(t,e){this.attrs=t,this.spec=e||_kt}map(t,e,n,r){let i=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,o=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new bkt(i,o,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof vkt&&gkt(this.attrs,t.attrs)&&gkt(this.spec,t.spec)}static is(t){return t.type instanceof vkt}destroy(){}}class ykt{constructor(t,e){this.attrs=t,this.spec=e||_kt}map(t,e,n,r){let i=t.mapResult(e.from+r,1);if(i.deleted)return null;let o=t.mapResult(e.to+r,-1);return o.deleted||o.pos<=i.pos?null:new bkt(i.pos-n,o.pos-n,this)}valid(t,e){let n,{index:r,offset:i}=t.content.findIndex(e.from);return i==e.from&&!(n=t.child(r)).isText&&i+n.nodeSize==e.to}eq(t){return this==t||t instanceof ykt&&gkt(this.attrs,t.attrs)&&gkt(this.spec,t.spec)}destroy(){}}class bkt{constructor(t,e,n){this.from=t,this.to=e,this.type=n}copy(t,e){return new bkt(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,n){return this.type.map(t,this,e,n)}static widget(t,e,n){return new bkt(t,t,new Akt(e,n))}static inline(t,e,n,r){return new bkt(t,e,new vkt(n,r))}static node(t,e,n,r){return new bkt(t,e,new ykt(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof vkt}get widget(){return this.type instanceof Akt}}const wkt=[],_kt={};class xkt{constructor(t,e){this.local=t.length?t:wkt,this.children=e.length?e:wkt}static create(t,e){return e.length?Okt(e,t,0,_kt):Skt}find(t,e,n){let r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r}findInner(t,e,n,r,i){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=e&&a.to>=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<e&&this.children[o+1]>t){let a=this.children[o]+1;this.children[o+2].findInner(t-a,e-a,n,r+a,i)}}map(t,e,n){return this==Skt||0==t.maps.length?this:this.mapInner(t,e,0,0,n||_kt)}mapInner(t,e,n,r,i){let o;for(let a=0;a<this.local.length;a++){let s=this.local[a].map(t,n,r);s&&s.type.valid(e,s)?(o||(o=[])).push(s):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?Mkt(this.children,o||[],t,e,n,r,i):o?new xkt(o.sort(Pkt),wkt):Skt}add(t,e){return e.length?this==Skt?xkt.create(t,e):this.addInner(t,e,0):this}addInner(t,e,n){let r,i=0;t.forEach((t,o)=>{let a,s=o+n;if(a=kkt(e,t,s)){r||(r=this.children.slice());while(i<r.length&&r[i]<o)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(t,a,s+1):r.splice(i,0,o,o+t.nodeSize,Okt(a,t,s+1,_kt)),i+=3}});let o=Lkt(i?Ekt(e):e,-n);for(let a=0;a<o.length;a++)o[a].type.valid(t,o[a])||o.splice(a--,1);return new xkt(o.length?this.local.concat(o).sort(Pkt):this.local,r||this.children)}remove(t){return 0==t.length||this==Skt?this:this.removeInner(t,0)}removeInner(t,e){let n=this.children,r=this.local;for(let i=0;i<n.length;i+=3){let r,o=n[i]+e,a=n[i+1]+e;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>o&&e.to<a&&(t[n]=null,(r||(r=[])).push(e));if(!r)continue;n==this.children&&(n=this.children.slice());let s=n[i+2].removeInner(r,o+1);s!=Skt?n[i+2]=s:(n.splice(i,3),i-=3)}if(r.length)for(let i,o=0;o<t.length;o++)if(i=t[o])for(let t=0;t<r.length;t++)r[t].eq(i,e)&&(r==this.local&&(r=this.local.slice()),r.splice(t--,1));return n==this.children&&r==this.local?this:r.length||n.length?new xkt(r,n):Skt}forChild(t,e){if(this==Skt)return this;if(e.isLeaf)return xkt.empty;let n,r;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=t){this.children[a]==t&&(n=this.children[a+2]);break}let i=t+1,o=i+e.content.size;for(let a=0;a<this.local.length;a++){let t=this.local[a];if(t.from<o&&t.to>i&&t.type instanceof vkt){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let t=new xkt(r.sort(Pkt),wkt);return n?new Ckt([t,n]):t}return n||Skt}eq(t){if(this==t)return!0;if(!(t instanceof xkt)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return Bkt(this.localsInner(t))}localsInner(t){if(this==Skt)return wkt;if(t.inlineContent||!this.local.some(vkt.is))return this.local;let e=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof vkt||e.push(this.local[n]);return e}forEachSet(t){t(this)}}xkt.empty=new xkt([],[]),xkt.removeOverlap=Bkt;const Skt=xkt.empty;class Ckt{constructor(t){this.members=t}map(t,e){const n=this.members.map(n=>n.map(t,e,_kt));return Ckt.from(n)}forChild(t,e){if(e.isLeaf)return xkt.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(t,e);i!=Skt&&(i instanceof Ckt?n=n.concat(i.members):n.push(i))}return Ckt.from(n)}eq(t){if(!(t instanceof Ckt)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(t);if(i.length)if(e){n&&(e=e.slice(),n=!1);for(let t=0;t<i.length;t++)e.push(i[t])}else e=i}return e?Bkt(n?e:e.sort(Pkt)):wkt}static from(t){switch(t.length){case 0:return Skt;case 1:return t[0];default:return new Ckt(t.every(t=>t instanceof xkt)?t:t.reduce((t,e)=>t.concat(e instanceof xkt?e:e.members),[]))}}forEachSet(t){for(let e=0;e<this.members.length;e++)this.members[e].forEachSet(t)}}function Mkt(t,e,n,r,i,o,a){let s=t.slice();for(let u=0,l=o;u<n.maps.length;u++){let t=0;n.maps[u].forEach((e,n,r,i)=>{let o=i-r-(n-e);for(let a=0;a<s.length;a+=3){let r=s[a+1];if(r<0||e>r+l-t)continue;let i=s[a]+l-t;n>=i?s[a+1]=e<=i?-2:-1:e>=l&&o&&(s[a]+=o,s[a+1]+=o)}t+=o}),l=n.maps[u].map(l,-1)}let c=!1;for(let u=0;u<s.length;u+=3)if(s[u+1]<0){if(-2==s[u+1]){c=!0,s[u+1]=-1;continue}let e=n.map(t[u]+o),l=e-i;if(l<0||l>=r.content.size){c=!0;continue}let h=n.map(t[u+1]+o,-1),d=h-i,{index:f,offset:p}=r.content.findIndex(l),m=r.maybeChild(f);if(m&&p==l&&p+m.nodeSize==d){let r=s[u+2].mapInner(n,m,e+1,t[u]+o+1,a);r!=Skt?(s[u]=l,s[u+1]=d,s[u+2]=r):(s[u+1]=-2,c=!0)}else c=!0}if(c){let c=Tkt(s,t,e,n,i,o,a),u=Okt(c,r,0,a);e=u.local;for(let t=0;t<s.length;t+=3)s[t+1]<0&&(s.splice(t,3),t-=3);for(let t=0,e=0;t<u.children.length;t+=3){let n=u.children[t];while(e<s.length&&s[e]<n)e+=3;s.splice(e,0,u.children[t],u.children[t+1],u.children[t+2])}}return new xkt(e.sort(Pkt),s)}function Lkt(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new bkt(i.from+e,i.to+e,i.type))}return n}function Tkt(t,e,n,r,i,o,a){function s(t,e){for(let o=0;o<t.local.length;o++){let s=t.local[o].map(r,i,e);s?n.push(s):a.onRemove&&a.onRemove(t.local[o].spec)}for(let n=0;n<t.children.length;n+=3)s(t.children[n+2],t.children[n]+e+1)}for(let c=0;c<t.length;c+=3)-1==t[c+1]&&s(t[c+2],e[c]+o+1);return n}function kkt(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o,a=0;a<t.length;a++)(o=t[a])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),t[a]=null);return i}function Ekt(t){let e=[];for(let n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Okt(t,e,n,r){let i=[],o=!1;e.forEach((e,a)=>{let s=kkt(t,e,a+n);if(s){o=!0;let t=Okt(s,e,n+a+1,r);t!=Skt&&i.push(a,a+e.nodeSize,t)}});let a=Lkt(o?Ekt(t):t,-n).sort(Pkt);for(let s=0;s<a.length;s++)a[s].type.valid(e,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||i.length?new xkt(a,i):Skt}function Pkt(t,e){return t.from-e.from||t.to-e.to}function Bkt(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from!=r.from){o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),Ikt(e,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),Ikt(e,i+1,o.copy(r.to,o.to)))}}return e}function Ikt(t,e,n){while(e<t.length&&Pkt(n,t[e])>0)e++;t.splice(e,0,n)}function Dkt(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Skt&&e.push(r)}),t.cursorWrapper&&e.push(xkt.create(t.state.doc,[t.cursorWrapper.deco])),Ckt.from(e)}const Nkt={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Fkt=pMt&&mMt<=11;class jkt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class Rkt{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new jkt,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);pMt&&mMt<=11&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),Fkt&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Nkt)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;e<t.length;e++)this.queue.push(t[e]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(QLt(this.view)){if(this.suppressingSelectionUpdates)return NLt(this.view);if(pMt&&mMt<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&XCt(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e,n=new Set;for(let i=t.focusNode;i;i=QCt(i))n.add(i);for(let i=t.anchorNode;i;i=QCt(i))if(n.has(i)){e=i;break}let r=e&&this.view.docView.nearestDesc(e);return r&&r.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let n=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&QLt(t)&&!this.ignoreSelectionChange(n),i=-1,o=-1,a=!1,s=[];if(t.editable)for(let u=0;u<e.length;u++){let t=this.registerMutation(e[u],s);t&&(i=i<0?t.from:Math.min(t.from,i),o=o<0?t.to:Math.max(t.to,o),t.typeOver&&(a=!0))}if(gMt&&s.length){let e=s.filter(t=>"BR"==t.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;!e||"LI"!=e.nodeName||n&&Gkt(t,n)==e||r.remove()}}}let c=null;i<0&&r&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&iMt(n)&&(c=ILt(t))&&c.eq(yCt.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,NLt(t),this.currentSelection.set(n),t.scrollToSelection()):(i>-1||r)&&(i>-1&&(t.docView.markDirty(i,o),Ukt(t)),this.handleDOMChange(i,o,a,s),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||NLt(t),this.currentSelection.set(n))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(let n=0;n<t.addedNodes.length;n++){let r=t.addedNodes[n];e.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};let r=t.previousSibling,i=t.nextSibling;if(pMt&&mMt<=11&&t.addedNodes.length)for(let e=0;e<t.addedNodes.length;e++){let{previousSibling:n,nextSibling:o}=t.addedNodes[e];(!n||Array.prototype.indexOf.call(t.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(t.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==t.target?GCt(r)+1:0,a=n.localPosFromDOM(t.target,o,-1),s=i&&i.parentNode==t.target?GCt(i):t.target.childNodes.length,c=n.localPosFromDOM(t.target,s,1);return{from:a,to:c}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=t.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let Hkt=new WeakMap,zkt=!1;function Ukt(t){if(!Hkt.has(t)&&(Hkt.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))){if(t.requiresGeckoHackNode=gMt,zkt)return;console["warn"]("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),zkt=!0}}function Vkt(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return XCt(a.node,a.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function Ykt(t,e){if(e.getComposedRanges){let n=e.getComposedRanges(t.root)[0];if(n)return Vkt(t,n)}let n;function r(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Vkt(t,n):null}function Gkt(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let e=t.docView.nearestDesc(n,!0);if(e&&e.node.isBlock)return n}return null}function Qkt(t,e,n){let r,{node:i,fromOffset:o,toOffset:a,from:s,to:c}=t.docView.parseRange(e,n),u=t.domSelectionRange(),l=u.anchorNode;if(l&&t.dom.contains(1==l.nodeType?l:l.parentNode)&&(r=[{node:l,offset:u.anchorOffset}],iMt(u)||r.push({node:u.focusNode,offset:u.focusOffset})),vMt&&8===t.input.lastKeyCode)for(let g=a;g>o;g--){let t=i.childNodes[g-1],e=t.pmViewDesc;if("BR"==t.nodeName&&!e){a=g;break}if(!e||e.size)break}let h=t.state.doc,d=t.someProp("domParser")||Rxt.fromSchema(t.state.schema),f=h.resolve(s),p=null,m=d.parse(i,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:a,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Wkt,context:f});if(r&&null!=r[0].pos){let t=r[0].pos,e=r[1]&&r[1].pos;null==e&&(e=t),p={anchor:t+s,head:e+s}}return{doc:m,sel:p,from:s,to:c}}function Wkt(t){let e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(bMt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}if(t.parentNode.lastChild==t||bMt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Kkt=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function qkt(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let e=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,n=ILt(t,e);if(n&&!t.state.selection.eq(n)){if(vMt&&SMt&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",e=>e(t,oMt(13,"Enter"))))return;let r=t.state.tr.setSelection(n);"pointer"==e?r.setMeta("pointer",!0):"key"==e&&r.scrollIntoView(),o&&r.setMeta("composition",o),t.dispatch(r)}return}let a=t.state.doc.resolve(e),s=a.sharedDepth(n);e=a.before(s+1),n=t.state.doc.resolve(n).after(s+1);let c,u,l=t.state.selection,h=Qkt(t,e,n),d=t.state.doc,f=d.slice(h.from,h.to);8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(c=t.state.selection.to,u="end"):(c=t.state.selection.from,u="start"),t.input.lastKeyCode=null;let p=tEt(f.content,h.doc.content,h.from,c,u);if(p&&t.input.domChangeCount++,(wMt&&t.input.lastIOSEnter>Date.now()-225||SMt)&&i.some(t=>1==t.nodeType&&!Kkt.test(t.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",e=>e(t,oMt(13,"Enter"))))return void(t.input.lastIOSEnter=0);if(!p){if(!(r&&l instanceof xCt&&!l.empty&&l.$head.sameParent(l.$anchor))||t.composing||h.sel&&h.sel.anchor!=h.sel.head){if(h.sel){let e=Xkt(t,t.state.doc,h.sel);if(e&&!e.eq(t.state.selection)){let n=t.state.tr.setSelection(e);o&&n.setMeta("composition",o),t.dispatch(n)}}return}p={start:l.from,endA:l.to,endB:l.to}}t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof xCt&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=h.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=h.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),pMt&&mMt<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>h.from&&"  "==h.doc.textBetween(p.start-h.from-1,p.start-h.from+1)&&(p.start--,p.endA--,p.endB--);let m,g=h.doc.resolveNoCache(p.start-h.from),A=h.doc.resolveNoCache(p.endB-h.from),v=d.resolve(p.start),y=g.sameParent(A)&&g.parent.inlineContent&&v.end()>=p.endA;if((wMt&&t.input.lastIOSEnter>Date.now()-225&&(!y||i.some(t=>"DIV"==t.nodeName||"P"==t.nodeName))||!y&&g.pos<h.doc.content.size&&!g.sameParent(A)&&(m=yCt.findFrom(h.doc.resolve(g.pos+1),1,!0))&&m.head==A.pos)&&t.someProp("handleKeyDown",e=>e(t,oMt(13,"Enter"))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>p.start&&Jkt(d,p.start,p.endA,g,A)&&t.someProp("handleKeyDown",e=>e(t,oMt(8,"Backspace"))))return void(SMt&&vMt&&t.domObserver.suppressSelectionUpdates());vMt&&p.endB==p.start&&(t.input.lastChromeDelete=Date.now()),SMt&&!y&&g.start()!=A.start()&&0==A.parentOffset&&g.depth==A.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==p.endA&&(p.endB-=2,A=h.doc.resolveNoCache(p.endB-h.from),setTimeout(()=>{t.someProp("handleKeyDown",(function(e){return e(t,oMt(13,"Enter"))}))},20));let b,w,_,x=p.start,S=p.endA;if(y)if(g.pos==A.pos)pMt&&mMt<=11&&0==g.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>NLt(t),20)),b=t.state.tr.delete(x,S),w=d.resolve(p.start).marksAcross(d.resolve(p.endA));else if(p.endA==p.endB&&(_=$kt(g.parent.content.cut(g.parentOffset,A.parentOffset),v.parent.content.cut(v.parentOffset,p.endA-v.start()))))b=t.state.tr,"add"==_.type?b.addMark(x,S,_.mark):b.removeMark(x,S,_.mark);else if(g.parent.child(g.index()).isText&&g.index()==A.index()-(A.textOffset?0:1)){let e=g.parent.textBetween(g.parentOffset,A.parentOffset);if(t.someProp("handleTextInput",n=>n(t,x,S,e)))return;b=t.state.tr.insertText(e,x,S)}if(b||(b=t.state.tr.replace(x,S,h.doc.slice(p.start-h.from,p.endB-h.from))),h.sel){let e=Xkt(t,b.doc,h.sel);e&&!(vMt&&t.composing&&e.empty&&(p.start!=p.endB||t.input.lastChromeDelete<Date.now()-100)&&(e.head==x||e.head==b.mapping.map(S)-1)||pMt&&e.empty&&e.head==x)&&b.setSelection(e)}w&&b.ensureMarks(w),o&&b.setMeta("composition",o),t.dispatch(b.scrollIntoView())}function Xkt(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:GLt(t,e.resolve(n.anchor),e.resolve(n.head))}function $kt(t,e){let n,r,i,o=t.firstChild.marks,a=e.firstChild.marks,s=o,c=a;for(let l=0;l<a.length;l++)s=a[l].removeFromSet(s);for(let l=0;l<o.length;l++)c=o[l].removeFromSet(c);if(1==s.length&&0==c.length)r=s[0],n="add",i=t=>t.mark(r.addToSet(t.marks));else{if(0!=s.length||1!=c.length)return null;r=c[0],n="remove",i=t=>t.mark(r.removeFromSet(t.marks))}let u=[];for(let l=0;l<e.childCount;l++)u.push(i(e.child(l)));if(R_t.from(u).eq(t))return{mark:r,type:n}}function Jkt(t,e,n,r,i){if(n-e<=i.pos-r.pos||Zkt(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let t=o.nodeAfter;return null!=t&&n==e+t.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let a=t.resolve(Zkt(o,!0,!0));return!(!a.parent.isTextblock||a.pos>n||Zkt(a,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function Zkt(t,e,n){let r=t.depth,i=e?t.end():t.pos;while(r>0&&(e||t.indexAfter(r)==t.node(r).childCount))r--,i++,e=!1;if(n){let e=t.node(r).maybeChild(t.indexAfter(r));while(e&&!e.isLeaf)e=e.firstChild,i++}return i}function tEt(t,e,n,r,i){let o=t.findDiffStart(e,n);if(null==o)return null;let{a:a,b:s}=t.findDiffEnd(e,n+t.size,n+e.size);if("end"==i){let t=Math.max(0,o-Math.min(a,s));r-=a+t-o}if(a<o&&t.size<e.size){let t=r<=o&&r>=a?o-r:0;o-=t,o&&o<e.size&&eEt(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-a),a=o}else if(s<o){let e=r<=o&&r>=s?o-r:0;o-=e,o&&o<t.size&&eEt(t.textBetween(o-1,o+1))&&(o+=e?1:-1),a=o+(a-s),s=o}return{start:o,endA:a,endB:s}}function eEt(t){if(2!=t.length)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class nEt{constructor(t,e){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ITt,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(uEt),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=oEt(this),iEt(this),this.nodeViews=sEt(this),this.docView=pLt(this.state.doc,rEt(this),Dkt(this),this.dom,this),this.domObserver=new Rkt(this,(t,e,n,r)=>qkt(this,t,e,n,r)),this.domObserver.start(),DTt(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&jTt(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(uEt),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let n in this._props)e[n]=this._props[n];e.state=this.state;for(let n in t)e[n]=t[n];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){var n;let r=this.state,i=!1,o=!1;t.storedMarks&&this.composing&&(ikt(this),o=!0),this.state=t;let a=r.plugins!=t.plugins||this._props.plugins!=e.plugins;if(a||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=sEt(this);cEt(t,this.nodeViews)&&(this.nodeViews=t,i=!0)}(a||e.handleDOMEvents!=this._props.handleDOMEvents)&&jTt(this),this.editable=oEt(this),iEt(this);let s=Dkt(this),c=rEt(this),u=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",l=i||!this.docView.matchesNode(t.doc,c,s);!l&&t.selection.eq(r.selection)||(o=!0);let h="preserve"==u&&o&&null==this.dom.style.overflowAnchor&&OMt(this);if(o){this.domObserver.stop();let e=l&&(pMt||vMt)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&aEt(r.selection,t.selection);if(l){let n=vMt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=okt(this)),!i&&this.docView.update(t.doc,c,s,this)||(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=pLt(t.doc,c,s,this.dom,this)),n&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&KLt(this))?NLt(this,e):(VLt(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==u?this.dom.scrollTop=0:"to selection"==u?this.scrollToSelection():h&&BMt(h)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",t=>t(this)));else if(this.state.selection instanceof CCt){let e=this.docView.domAfterPos(this.state.selection.from);1==e.nodeType&&EMt(this,e.getBoundingClientRect(),t)}else EMt(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;while(t=this.pluginViews.pop())t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let e=0;e<this.pluginViews.length;e++){let n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let e=this.directPlugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let e=this.state.plugins[t];e.spec.view&&this.pluginViews.push(e.spec.view(this))}}}updateDraggedNode(t,e){let n=t.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let t=n.from+(this.state.doc.content.size-e.doc.content.size),i=t>0&&this.state.doc.nodeAt(t);i==n.node&&(r=t)}this.dragging=new pkt(t.slice,t.move,r<0?void 0:CCt.create(this.state.doc,r))}someProp(t,e){let n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;for(let o=0;o<this.directPlugins.length;o++){let r=this.directPlugins[o].props[t];if(null!=r&&(n=e?e(r):r))return n}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let r=i[o].props[t];if(null!=r&&(n=e?e(r):r))return n}}hasFocus(){if(pMt){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;while(t&&this.dom!=t&&this.dom.contains(t)){if("false"==t.contentEditable)return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&NMt(this.dom),NLt(this),this.domObserver.start()}get root(){let t=this._root;if(null==t)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return t||document}updateRoot(){this._root=null}posAtCoords(t){return YMt(this,t)}coordsAtPos(t,e=1){return KMt(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,n=-1){let r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return iLt(this,e||this.state,t)}pasteHTML(t,e){return dkt(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return dkt(this,t,null,!0,e||new ClipboardEvent("paste"))}destroy(){this.docView&&(FTt(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Dkt(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,qCt())}get isDestroyed(){return null==this.docView}dispatchEvent(t){return zTt(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){let t=this.domSelection();return t?bMt&&11===this.root.nodeType&&aMt(this.dom.ownerDocument)==this.dom&&Ykt(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function rEt(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if("function"==typeof n&&(n=n(t.state)),n)for(let t in n)"class"==t?e.class+=" "+n[t]:"style"==t?e.style=(e.style?e.style+";":"")+n[t]:e[t]||"contenteditable"==t||"nodeName"==t||(e[t]=String(n[t]))}),e.translate||(e.translate="no"),[bkt.node(0,t.state.doc.content.size,e)]}function iEt(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:bkt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function oEt(t){return!t.someProp("editable",e=>!1===e(t.state))}function aEt(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function sEt(t){let e=Object.create(null);function n(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function cEt(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function uEt(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}function lEt(t={}){return new zCt({view(e){return new hEt(e,t)}})}class hEt{constructor(t,e){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=e.width)&&void 0!==n?n:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map(e=>{let n=t=>{this[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}})}destroy(){this.handlers.forEach(({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e))}update(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent;if(n){let n=e.nodeBefore,r=e.nodeAfter;if(n||r){let e=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(e){let i=e.getBoundingClientRect(),o=n?i.bottom:i.top;n&&r&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:i.left,right:i.right,top:o-this.width/2,bottom:o+this.width/2}}}}if(!t){let e=this.editorView.coordsAtPos(this.cursorPos);t={left:e.left-this.width/2,right:e.left+this.width/2,top:e.top,bottom:e.bottom}}let r,i,o=this.editorView.dom.offsetParent;if(this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!o||o==document.body&&"static"==getComputedStyle(o).position)r=-pageXOffset,i=-pageYOffset;else{let t=o.getBoundingClientRect();r=t.left-o.scrollLeft,i=t.top-o.scrollTop}this.element.style.left=t.left-r+"px",this.element.style.top=t.top-i+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,e,t):r;if(e&&!i){let t=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=JSt(this.editorView.state.doc,t,this.editorView.dragging.slice);null!=e&&(t=e)}this.setCursor(t),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}for(var dEt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},fEt={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},pEt="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),mEt="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),gEt=0;gEt<10;gEt++)dEt[48+gEt]=dEt[96+gEt]=String(gEt);for(gEt=1;gEt<=24;gEt++)dEt[gEt+111]="F"+gEt;for(gEt=65;gEt<=90;gEt++)dEt[gEt]=String.fromCharCode(gEt+32),fEt[gEt]=String.fromCharCode(gEt);for(var AEt in dEt)fEt.hasOwnProperty(AEt)||(fEt[AEt]=dEt[AEt]);function vEt(t){var e=pEt&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||mEt&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key,n=!e&&t.key||(t.shiftKey?fEt:dEt)[t.keyCode]||t.key||"Unidentified";return"Esc"==n&&(n="Escape"),"Del"==n&&(n="Delete"),"Left"==n&&(n="ArrowLeft"),"Up"==n&&(n="ArrowUp"),"Right"==n&&(n="ArrowRight"),"Down"==n&&(n="ArrowDown"),n}const yEt="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function bEt(t){let e,n,r,i,o=t.split(/-(?!$)/),a=o[o.length-1];"Space"==a&&(a=" ");for(let s=0;s<o.length-1;s++){let t=o[s];if(/^(cmd|meta|m)$/i.test(t))i=!0;else if(/^a(lt)?$/i.test(t))e=!0;else if(/^(c|ctrl|control)$/i.test(t))n=!0;else if(/^s(hift)?$/i.test(t))r=!0;else{if(!/^mod$/i.test(t))throw new Error("Unrecognized modifier name: "+t);yEt?i=!0:n=!0}}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function wEt(t){let e=Object.create(null);for(let n in t)e[bEt(n)]=t[n];return e}function _Et(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function xEt(t){return new zCt({props:{handleKeyDown:SEt(t)}})}function SEt(t){let e=wEt(t);return function(t,n){let r,i=vEt(n),o=e[_Et(i,n)];if(o&&o(t.state,t.dispatch,t))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=e[_Et(i,n,!1)];if(r&&r(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=dEt[n.keyCode])&&r!=i){let i=e[_Et(r,n)];if(i&&i(t.state,t.dispatch,t))return!0}}return!1}}class CEt extends yCt{constructor(t){super(t,t)}map(t,e){let n=t.resolve(e.map(this.head));return CEt.valid(n)?new CEt(n):yCt.near(n)}content(){return G_t.empty}eq(t){return t instanceof CEt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new CEt(t.resolve(e.pos))}getBookmark(){return new MEt(this.anchor)}static valid(t){let e=t.parent;if(e.isTextblock||!LEt(t)||!TEt(t))return!1;let n=e.type.spec.allowGapCursor;if(null!=n)return n;let r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,e,n=!1){t:for(;;){if(!n&&CEt.valid(t))return t;let r=t.pos,i=null;for(let n=t.depth;;n--){let o=t.node(n);if(e>0?t.indexAfter(n)<o.childCount:t.index(n)>0){i=o.child(e>0?t.indexAfter(n):t.index(n)-1);break}if(0==n)return null;r+=e;let a=t.doc.resolve(r);if(CEt.valid(a))return a}for(;;){let o=e>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!CCt.isSelectable(i)){t=t.doc.resolve(r+i.nodeSize*e),n=!1;continue t}break}i=o,r+=e;let a=t.doc.resolve(r);if(CEt.valid(a))return a}return null}}}CEt.prototype.visible=!1,CEt.findFrom=CEt.findGapCursorFrom,yCt.jsonID("gapcursor",CEt);class MEt{constructor(t){this.pos=t}map(t){return new MEt(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return CEt.valid(e)?new CEt(e):yCt.near(e)}}function LEt(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(0!=n)for(let t=r.child(n-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}function TEt(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(let t=r.child(n);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}function kEt(){return new zCt({props:{decorations:IEt,createSelectionBetween(t,e,n){return e.pos==n.pos&&CEt.valid(n)?new CEt(n):null},handleClick:PEt,handleKeyDown:EEt,handleDOMEvents:{beforeinput:BEt}}})}const EEt=SEt({ArrowLeft:OEt("horiz",-1),ArrowRight:OEt("horiz",1),ArrowUp:OEt("vert",-1),ArrowDown:OEt("vert",1)});function OEt(t,e){const n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,i){let o=t.selection,a=e>0?o.$to:o.$from,s=o.empty;if(o instanceof xCt){if(!i.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=t.doc.resolve(e>0?a.after():a.before())}let c=CEt.findGapCursorFrom(a,e,s);return!!c&&(r&&r(t.tr.setSelection(new CEt(c))),!0)}}function PEt(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!CEt.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&CCt.isSelectable(t.state.doc.nodeAt(i.inside)))&&(t.dispatch(t.state.tr.setSelection(new CEt(r))),!0)}function BEt(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof CEt))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=R_t.empty;for(let a=r.length-1;a>=0;a--)i=R_t.from(r[a].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new G_t(i,0,0));return o.setSelection(xCt.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function IEt(t){if(!(t.selection instanceof CEt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",xkt.create(t.doc,[bkt.widget(t.selection.head,e,{key:"gapcursor"})])}const DEt=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function NEt(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const FEt=(t,e,n)=>{let r=NEt(t,n);if(!r)return!1;let i=HEt(r);if(!i){let n=r.blockRange(),i=n&&BSt(n);return null!=i&&(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(eOt(t,i,e,-1))return!0;if(0==r.parent.content.size&&(jEt(o,"end")||CCt.isSelectable(o)))for(let a=r.depth;;a--){let n=ZSt(t.doc,r.before(a),r.after(a),G_t.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(jEt(o,"end")?yCt.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):CCt.create(r.doc,i.pos-o.nodeSize)),e(r.scrollIntoView())}return!0}if(1==a||r.node(a-1).childCount>1)break}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)};function jEt(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}const REt=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=HEt(r)}let a=o&&o.nodeBefore;return!(!a||!CCt.isSelectable(a))&&(e&&e(t.tr.setSelection(CCt.create(t.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function HEt(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function zEt(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const UEt=(t,e,n)=>{let r=zEt(t,n);if(!r)return!1;let i=YEt(r);if(!i)return!1;let o=i.nodeAfter;if(eOt(t,i,e,1))return!0;if(0==r.parent.content.size&&(jEt(o,"start")||CCt.isSelectable(o))){let n=ZSt(t.doc,r.before(),r.after(),G_t.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(jEt(o,"start")?yCt.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):CCt.create(r.doc,r.mapping.map(i.pos))),e(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},VEt=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=YEt(r)}let a=o&&o.nodeAfter;return!(!a||!CCt.isSelectable(a))&&(e&&e(t.tr.setSelection(CCt.create(t.doc,o.pos)).scrollIntoView()),!0)};function YEt(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const GEt=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&BSt(i);return null!=o&&(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},QEt=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)};function WEt(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const KEt=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),a=WEt(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(e){let r=n.after(),i=t.tr.replaceWith(r,r,a.createAndFill());i.setSelection(yCt.near(i.doc.resolve(r),1)),e(i.scrollIntoView())}return!0},qEt=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof LCt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=WEt(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(n,o.createAndFill());a.setSelection(xCt.create(a.doc,n+1)),e(a.scrollIntoView())}return!0},XEt=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(GSt(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&BSt(r);return null!=i&&(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function $Et(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof CCt&&e.selection.node.isBlock)return!(!r.parentOffset||!GSt(e.doc,r.pos))&&(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o,a,s=[],c=!1,u=!1;for(let f=r.depth;;f--){let e=r.node(f);if(e.isBlock){c=r.end(f)==r.pos+(r.depth-f),u=r.start(f)==r.pos-(r.depth-f),a=WEt(r.node(f-1).contentMatchAt(r.indexAfter(f-1)));let e=t&&t(i.parent,c,r);s.unshift(e||(c&&a?{type:a}:null)),o=f;break}if(1==f)return!1;s.unshift(null)}let l=e.tr;(e.selection instanceof xCt||e.selection instanceof LCt)&&l.deleteSelection();let h=l.mapping.map(r.pos),d=GSt(l.doc,h,s.length,s);if(d||(s[0]=a?{type:a}:null,d=GSt(l.doc,h,s.length,s)),l.split(h,s.length,s),!c&&u&&r.node(o).type!=a){let t=l.mapping.map(r.before(o)),e=l.doc.resolve(t);a&&r.node(o-1).canReplaceWith(e.index(),e.index()+1,a)&&l.setNodeMarkup(l.mapping.map(r.before(o)),a)}return n&&n(l.scrollIntoView()),!0}}const JEt=$Et(),ZEt=(t,e)=>(e&&e(t.tr.setSelection(new LCt(t.doc))),!0);function tOt(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!!(r&&i&&r.type.compatibleContent(i.type))&&(!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!(!e.parent.canReplace(o,o+1)||!i.isTextblock&&!WSt(t.doc,e.pos))&&(n&&n(t.tr.join(e.pos).scrollIntoView()),!0))}function eOt(t,e,n,r){let i,o,a=e.nodeBefore,s=e.nodeAfter,c=a.type.spec.isolating||s.type.spec.isolating;if(!c&&tOt(t,e,n))return!0;let u=!c&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(i=(o=a.contentMatchAt(a.childCount)).findWrapping(s.type))&&o.matchType(i[0]||s.type).validEnd){if(n){let r=e.pos+s.nodeSize,o=R_t.empty;for(let t=i.length-1;t>=0;t--)o=R_t.from(i[t].create(null,o));o=R_t.from(a.copy(o));let c=t.tr.step(new LSt(e.pos-1,r,e.pos,r,new G_t(o,1,0),i.length,!0)),u=c.doc.resolve(r+2*i.length);u.nodeAfter&&u.nodeAfter.type==a.type&&WSt(c.doc,u.pos)&&c.join(u.pos),n(c.scrollIntoView())}return!0}let l=s.type.spec.isolating||r>0&&c?null:yCt.findFrom(e,1),h=l&&l.$from.blockRange(l.$to),d=h&&BSt(h);if(null!=d&&d>=e.depth)return n&&n(t.tr.lift(h,d).scrollIntoView()),!0;if(u&&jEt(s,"start",!0)&&jEt(a,"end")){let r=a,i=[];for(;;){if(i.push(r),r.isTextblock)break;r=r.lastChild}let o=s,c=1;for(;!o.isTextblock;o=o.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,o.content)){if(n){let r=R_t.empty;for(let t=i.length-1;t>=0;t--)r=R_t.from(i[t].copy(r));let o=t.tr.step(new LSt(e.pos-i.length,e.pos+s.nodeSize,e.pos+c,e.pos+s.nodeSize-c,new G_t(r,i.length,0),0,!0));n(o.scrollIntoView())}return!0}}return!1}function nOt(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;while(i.node(o).isInline){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(e.tr.setSelection(xCt.create(e.doc,t<0?i.start(o):i.end(o)))),!0)}}const rOt=nOt(-1),iOt=nOt(1);function oOt(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),s=a&&DSt(a,t,e);return!!s&&(r&&r(n.tr.wrap(a,s).scrollIntoView()),!0)}}function aOt(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:r},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(r,a,(r,o)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)i=!0;else{let e=n.doc.resolve(o),r=e.index();i=e.parent.canReplaceWith(r,r+1,t)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[r];i.setBlockType(o,a,t,e)}r(i.scrollIntoView())}return!0}}function sOt(t,e,n,r){for(let i=0;i<e.length;i++){let{$from:o,$to:a}=e[i],s=0==o.depth&&(t.inlineContent&&t.type.allowsMarkType(n));if(t.nodesBetween(o.pos,a.pos,(t,e)=>{if(s||!r&&t.isAtom&&t.isInline&&e>=o.pos&&e+t.nodeSize<=a.pos)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)}),s)return!0}return!1}function cOt(t){let e=[];for(let n=0;n<t.length;n++){let{$from:r,$to:i}=t[n];r.doc.nodesBetween(r.pos,i.pos,(t,n)=>{if(t.isAtom&&t.content.size&&t.isInline&&n>=r.pos&&n+t.nodeSize<=i.pos)return n+1>r.pos&&e.push(new bCt(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+t.content.size),!1}),r.pos<i.pos&&e.push(new bCt(r,i))}return e}function uOt(t,e=null,n){let r=!1!==(n&&n.removeWhenPresent),i=!1!==(n&&n.enterInlineAtoms);return function(n,o){let{empty:a,$cursor:s,ranges:c}=n.selection;if(a&&!s||!sOt(n.doc,c,t,i))return!1;if(o)if(s)t.isInSet(n.storedMarks||s.marks())?o(n.tr.removeStoredMark(t)):o(n.tr.addStoredMark(t.create(e)));else{let a,s=n.tr;i||(c=cOt(c)),a=r?!c.some(e=>n.doc.rangeHasMark(e.$from.pos,e.$to.pos,t)):!c.every(e=>{let n=!1;return s.doc.nodesBetween(e.$from.pos,e.$to.pos,(r,i,o)=>{if(n)return!1;n=!t.isInSet(r.marks)&&!!o&&o.type.allowsMarkType(t)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,e.$from.pos-i),Math.min(r.nodeSize,e.$to.pos-i))))}),!n});for(let n=0;n<c.length;n++){let{$from:r,$to:i}=c[n];if(a){let n=r.pos,o=i.pos,a=r.nodeAfter,c=i.nodeBefore,u=a&&a.isText?/^\s*/.exec(a.text)[0].length:0,l=c&&c.isText?/\s*$/.exec(c.text)[0].length:0;n+u<o&&(n+=u,o-=l),s.addMark(n,o,t.create(e))}else s.removeMark(r.pos,i.pos,t)}o(s.scrollIntoView())}return!0}}function lOt(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let hOt=lOt(DEt,FEt,REt),dOt=lOt(DEt,UEt,VEt);const fOt={Enter:lOt(QEt,qEt,XEt,JEt),"Mod-Enter":KEt,Backspace:hOt,"Mod-Backspace":hOt,"Shift-Backspace":hOt,Delete:dOt,"Mod-Delete":dOt,"Mod-a":ZEt},pOt={"Ctrl-h":fOt["Backspace"],"Alt-Backspace":fOt["Mod-Backspace"],"Ctrl-d":fOt["Delete"],"Ctrl-Alt-Backspace":fOt["Mod-Delete"],"Alt-Delete":fOt["Mod-Delete"],"Alt-d":fOt["Mod-Delete"],"Ctrl-a":rOt,"Ctrl-e":iOt};for(let os in fOt)pOt[os]=fOt[os];const mOt="undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform(),gOt=mOt?pOt:fOt;class AOt{constructor(t,e,n={}){this.match=t,this.match=t,this.handler="string"==typeof e?vOt(e):e,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1}}function vOt(t){return function(e,n,r,i){let o=t;if(n[1]){let t=n[0].lastIndexOf(n[1]);o+=n[0].slice(t+n[1].length),r+=t;let e=r-i;e>0&&(o=n[0].slice(t-e,t)+o,r=i)}return e.tr.insertText(o,r,i)}}const yOt=500;function bOt({rules:t}){let e=new zCt({state:{init(){return null},apply(t,e){let n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput(n,r,i,o){return wOt(n,r,i,o,t,e)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&wOt(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}function wOt(t,e,n,r,i,o){if(t.composing)return!1;let a=t.state,s=a.doc.resolve(e),c=s.parent.textBetween(Math.max(0,s.parentOffset-yOt),s.parentOffset,null,"")+r;for(let u=0;u<i.length;u++){let l=i[u];if(s.parent.type.spec.code){if(!l.inCode)continue}else if("only"===l.inCode)continue;let h=l.match.exec(c),d=h&&l.handler(a,h,e-(h[0].length-r.length),n);if(d)return l.undoable&&d.setMeta(o,{transform:d,from:e,to:n,text:r}),t.dispatch(d),!0}return!1}const _Ot=(t,e)=>{let n=t.plugins;for(let r=0;r<n.length;r++){let i,o=n[r];if(o.spec.isInputRules&&(i=o.getState(t))){if(e){let n=t.tr,r=i.transform;for(let t=r.steps.length-1;t>=0;t--)n.step(r.steps[t].invert(r.docs[t]));if(i.text){let e=n.doc.resolve(i.from).marks();n.replaceWith(i.from,i.to,t.schema.text(i.text,e))}else n.delete(i.from,i.to);e(n)}return!0}}return!1};new AOt(/--$/,"—"),new AOt(/\.\.\.$/,"…"),new AOt(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new AOt(/"$/,"”"),new AOt(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new AOt(/'$/,"’");function xOt(t,e,n=null,r){return new AOt(t,(t,i,o,a)=>{let s=n instanceof Function?n(i):n,c=t.tr.delete(o,a),u=c.doc.resolve(o),l=u.blockRange(),h=l&&DSt(l,e,s);if(!h)return null;c.wrap(l,h);let d=c.doc.resolve(o-1).nodeBefore;return d&&d.type==e&&WSt(c.doc,o-1)&&(!r||r(i,d))&&c.join(o-1),c})}function SOt(t,e,n=null){return new AOt(t,(t,r,i,o)=>{let a=t.doc.resolve(i),s=n instanceof Function?n(r):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),e)?t.tr.delete(i,o).setBlockType(i,i,e,s):null})}
1124
1124
  /*!
1125
1125
  * tiptap-utils v1.13.0
1126
1126
  * (c) 2021 überdosis GbR (limited liability)