"use strict";var e=require("obsidian"); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function t(e,t,i,n){return new(i||(i=Promise))((function(s,r){function o(e){try{h(n.next(e))}catch(e){r(e)}}function a(e){try{h(n.throw(e))}catch(e){r(e)}}function h(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}h((n=n.apply(e,t||[])).next())}))}function i(e,t){const i=Object.keys(t).map((i=>function(e,t,i){const n=e[t],s=e.hasOwnProperty(t);let r=i(n);n&&Object.setPrototypeOf(r,n);return Object.setPrototypeOf(o,r),e[t]=o,a;function o(...i){return r===n&&e[t]===o&&a(),r.apply(this,i)}function a(){e[t]===o&&(s?e[t]=n:delete e[t]),r!==n&&(r=n,Object.setPrototypeOf(o,n||Function))}}(e,i,t[i])));return 1===i.length?i[0]:function(){i.forEach((e=>e()))}}var n={"Open as mindmap board":"Open as mindmap","Create new mindmap":"Create new mindmap","New mindmap board":"New mindmap board","Untitled mindmap":"Untitled mindmap","Open as markdown":"Open as markdown","Sub title":"Sub title","Export to opml":"Export to opml","Export to image":"Export to image","Canvas size":"Canvas size","Canvas size desc":"Width and height of the canvas","Canvas background":"Canvas background","Canvas background desc":"Background color of canvas","Max level of node to markdown head":"Max level of node to create a Heading","Max level of node to markdown head desc":"Specify which Node Level creates a seperate Heading instead of a List-Item","Font size":"Font Size","Font size desc":"Specify the Font Size","Mind map layout direct":"Mindmap Layout","Mind map layout direct desc":"Specify the direction the nodes are placed in your Mindmap",Right:"Right",Left:"Left",Centered:"Centered","Open PDF File":"Open PDF file...","Save Image error,Please try again":"Save image error,please try again","Creating Rect Annotate":"Creating rect annotate...","Cancel Create Rect Annotate":"Cancel create rect annotate","File Is Not Exist":"File is not exist","Open File Error":"Open file error","PDF Cannot Open More Instances":"PDF reader cannot open more instances","Create Rect Annotate":"Created rect annotate","Stroke Array":"Stroke Color","Stroke Array Desc":"Node link color base on this value or random color","PDFJs Plugin Path":"PDF reader path","PDFJs Plugin Path Desc":"If you want to use PDF annotation,You need download pdf js plugin and set up this value","Andriod pdfjs Plugin Path":"Andriod pdf reader path","Ios pdfjs Plugin Path":"Ios pdf reader path","Mac pdfjs Plugin Path":"Mac pdfjs Plugin Path","PDF Path":"PDF store path","PDF Annotate Path":"PDF annotate store path","PDF Image Path":"Image store path of PDF rect annotate","Miss PDF Reader Path":"Miss PDF plugin path,you need download Pdf js plugin,and set up value of PDF reader path","Please Use Rich Mode":"Please change yaml mindmap-plugin basic to rich","The probation period has ended":"The probation period has ended or active code has expired",Rect:"Rect",Circle:"Circle",Pointer:"Pointer","Show MindMap":"Show mind map","Hide MindMap":"Hide mind map","Open Protocol":"Support protocol","Open Protocol Desc":"Support protocol like 'obsidian://{protocol name}' for function of jump to pdf annotate",Protocol:"Protocol","Protocol Desc":"Protocol name",Open:"Open",Close:"Close","Open as outline":"Open as outline","Show Annotate":"Show annotate","Annotation save type":"PDF annotation save type","Annotation save type desc":"The type of save pdf annotation,there are two file types:`annos` and `md`,`annos` as default,`annos` is `json` file in fact ","Export annotate pdf":"Export annotate pdf","Export annotate pdf tip":"This is a time-consuming operation. Please wait patiently","Export annotate pdf success":"Export pdf success","Export annotate pdf error":"Export pdf error","Active Code":"Active code","Active Code Desc":"You can active markmind by use this value. Web site:","Active error":"Active code error","Active success":"Active success","Annotate PDF":"Annotate PDF","Annotate EPUB":"Annotate EPUB","PDF Viewer Theme":"PDF viewer theme","PDF Viewer Theme desc":"Theme of pdf viewer","Copy as markdown":"Copy as markdown","Copy node text":"Copy node text only","Copy node link":"Copy node link","Export as opml":"Export as opml","Mobile app not support":"File not support mobile app","Not support file type":"The file type is not support,please open pdf file","Not find md file":"This pdf has not annotations in valut","Please select another node":"Please select another node","Change layout to mindmap":"Change layout to mindmap","Change layout to right":"Change layout to right","Change layout to left":"Change layout to left","Change layout to tree":"Change layout to tree","Copy mindmap node":"Copy selected node","Paste to node":"Paste to node","Toggle mardkown/mindmap":"Toggle markdown/mindmap mode","Copy node id":"Copy node ID","Mobile Active Code":"Mobile active code","Mobile Active Code Desc":"You can active mobile markmind by use value , it will create if you input active code","Mindmap mode":"Mindmap mode","Mindmap mode desc":"When create mindmap , it will create mode of this value , `basic` mode as default","Pdf screen short":"Folder to save image","Pdf screen short desc":"Save image to this folder when use pdf rect annotate","Set mindmap to center":"Set mindmap to center",save:"Save",cancel:"Cancel","Remove annotate space":"Remove space of pdf annotate","Remove annotate space desc":"In environment of chinese , open this and it will remove spaces between text automatic","Get path of vault":"Get base path of vault","Smooth movement":"Support smooth movement of mindmap nodes","Smooth movement desc":"Smooth movement of mindmap nodes","Support code block":"Support parse code block of mindmap","Support code block desc":"Support parse code block of mindmap in markdown file",toPng:"Export to PNG","Set pdf js path":"Set up pdf js plugin path","Please open a mind map":"Please open a mind map and try this command again","Set up pdf js path success":"Success,please restart obsidian","Create new outline":"Create new outline","Copy node":"Copy","Paste node":"Paste","Fill color":"Fill color","Stroke color":"Stroke color","Text color":"Text color","Text align":"Text align","Stroke width":"Stroke width","Stroke style":"Stroke style",nodeColor:"Setup board color",nodeColorDesc:"Use this to setup node background/stroke/font color","Export to html":"Export to html","Change layout to fishLeft":"Change layout to left fish","Change layout to fishRight":"Change layout to right fish","Open as table":"Open as table","get table html":"Get html code of table","get table markdown":"Get markdown of table","Get pdf annotations":"Import pdf highlight annotations","extract highlight success":"Import pdf highlight success","Change basic mode to rich mode":"Change basic mode to rich mode","Change rich mode to basic mode":"Change rich mode to basic mode","Export pdf annotations":"Export pdf annotations","Format of pdf highlight":"Format of pdf highlight","Format of pdf highlight desc":"When export pdf highights , it will generate file in this format","Use new version of pdfjs":"Toggle to new version of pdfjs","Use old version of pdfjs":"Toggle to old version of pdfjs",searchResult:"Find {{nodeNumber}} nodes contains this word","Toggle search box":"Toggle search box","Fine tune height of annotate":"Fine tune height of annotate","Fine tune height of annotate desc":"Fine tune height of annotate , adjust upward (px)","Fine tune height of annotate desc one":"Fine tune height of annotate , adjust downward (px)","Create hand drawn mindmap":"Create hand drawn mindmap from basic mode","Decode URI pdf link":"Open decode PDF link","Decode URI pdf link desc":"If your `annotate-target` is encode by `encodeURI` , you can open this","Expand to first node level":"Expand to first node level","Expand to second node level":"Expand to second node level","Expand to third node level":"Expand to third node level","Expand to all node level":"Expand to all node level","Expand to fourth node level":"Expand to fourth node level","Expand to fifth node level":"Expand to fifth node level","Auto create node when annotate":"Auto create node when annotate","Auto create node when annotate desc":"Auto create node when create pdf annotate","Add child node":"Add child node","Add brother node":"Add brother node","Edit node":"Edit node","Cancel edit node":"Cancel edit node","Delete node":"Delete node",Undo:"Undo",Redo:"Redo","Use custom short cut":"Use custom short cut","Use custom short cut desc":"You can set up custom short cut of mindmap for add node/delete node/undo/redo/edit node/quit edit node commands in `ctrl + p` board","PDF cache folder":"PDF cache folder","PDF cache folder desc":"When you open pdf in web by use pdf annotator, the pdf will store to this folder","Folder of paste image":"Folder of paste image","Folder of paste image desc":"When paste image , image will store to this folder","Change basic to table mode":"Change basic mindmap to table mode","Change basic to outline mode":"Change basic to outline mode","Saving data":"Saving data ...",Saved:"Saved","Only copy annotate link":"Only copy annotate link","Only copy annotate link desc":"Only copy annotate link when click an pdf annotate","Saving image":"Saving image ...","Auto set node to center when tab node of mindmap":"Auto set node to center when tab node of mindmap","Auto set node to center when tab node of mindmap desc":"Auto set node to center when use up/down/left/right key to tab node of mindmap","Auto open search box":"Auto open mindmap search box","Auto open search box desc":"If obsidian has search text, auto open mindmap search box","Export to pdf":"Export mindmap as a pdf file","Please do this in a separate window":"Please export mindmap to pdf in a independ window","PDF save success":"Save pdf success","Add collapse node mark":"Auto add collapse node ID of basic mode","Add collapse node mark desc":"When save mindmap of basic mode , auto add collapsed node ID in the end of node text","Change theme":"Open change theme box","Close change theme":"Close change theme box","Can not change layout":" Can not change node layout to table because the child of this node have summary, boundary , callout or layout","Only use obsidian folder for pdfjs plugin":"Put pdfjs plugin to .obsidian folder of vault","Only use obsidian folder for pdfjs plugin desc":"Put pdfjs plugin to .obsidian folder of vault in android or ios system","Generate mind maps by chatGTP":"Generate mind maps by chatGTP (outline)","Get inspiration":"Get inspiration by chatGTP",ChatGTPError:"Get text error from chatGTP,please try again",ChatGTPLoading:"AI is getting data , please wait a minute...","ChatGTP appkey":"Please input apikey of chatGPT","ChatGTP appkey desc":"Please input apikey of chatGPT",ProxyServer:"Please input proxy server","ProxyServer desc":"If you can not access website of openai api, you can use a proxy server","Generate mind maps by Q&A of chatGTP":"Generate mind maps by chatGPT (Q&A)","Annotate template":"Annotate template","Annotate template desc":"When click annotate, it will generate text according to this template to copy to clipboard","Support translate":"Support for word translation of pdf annotate","Support translate desc":"When make annotate of pdf, support word translation","Google translate":"Google tranlate","Google translate desc":"Google tranlate","Baidu translate":"Baidu translate","Baidu translate desc":"Baidu translate","Youdao translate":"Youdao translate","Youdao translate desc":"Youdao translate","Translate appid":"Translate appId or token","Translate appid desc":"AppId or token of translate","Translate secret":"Translate secret","Translate secret desc":"Secret of translate, if you use token, the value may be empty","Not have translations of pdf full text":"No full-text translation files available","Translate spend time":"Translating, please be patient and wait...","Translate success":"Translation successful","Parsing PDF structure":"Parsing PDF structuring...","Parsing PDF structure error":"Parsing PDF structure error","Full text translate":"Full text translation","Pdf in vault":"Currently only support PDF in vault","Completed translation":"Completed translation: ","Translation engine":"Translation engine",baidu:"baidu","Copy full text translations":"Copy full text translations to clipboard","Mindmap is in read":"Mind map in read-only mode","Export to pdf (old version)":"Export mindmap to pdf (v0.15.9)","Scale speed of mobile version":"Scale speed of mobile version","Scale speed of mobile version desc":"Scale speed of mobile version","Cover node":"Cover node text","Cancel cover node":"Cancel cover node text"};const s={ar:{},cs:{},da:{},de:{"Open as mindmap board":"Öffne als Mindmap","Create new mindmap":"Erstelle neue Mindmap","New mindmap board":"Neue Mindmap","Untitled mindmap":"Unbenannte Mindmap","Open as markdown":"Öffne als Markdown","Sub title":"Untertitel","Export to opml":"Exportiere als opml","Export to image":"Exportiere als Bild","Canvas size":"Leinwandgröße","Canvas size desc":"Breite und Höhe der Leinwand","Canvas background":"Leinwand Hintergrund","Canvas background desc":"Hintergrundfarbe der Leinwand","Max level of node to markdown head":"Maximale Knotenebene welche eine Überschrift erstellt","Max level of node to markdown head desc":"Angeben, welche Knotenebene eine separate Überschrift anstelle eines Listenelements erstellt.","Font size":"Schriftgröße","Font size desc":"Gebe die Schriftgröße ans","Mind map layout direct":"Mindmap Layout","Mind map layout direct desc":"Geben Sie die Richtung an, in der die Knoten in Ihrer Mindmap platziert werden.",Right:"Rechts",Left:"Links",Centered:"Zentriert"},en:n,"en-gb":{},es:{},fr:{},hi:{},id:{},it:{},ja:{},ko:{},nl:{},nn:{},pl:{},pt:{},"pt-br":{},ro:{},ru:{},tr:{},"zh-cn":{"Open as mindmap board":"打开为思维导图","Create new mindmap":"创建新思维导图","New mindmap board":"新建思维导图","Untitled mindmap":"未命名思维导图","Open as markdown":"打开为 Markdown 文件","Sub title":"新节点","Export to opml":"导出至OPML","Export to image":"导出至图片","Canvas size":"画布尺寸","Canvas size desc":"绘制思维导图画布的宽度和高度","Canvas background":"背景颜色","Canvas background desc":"画布的背景颜色","Max level of node to markdown head":"节点文字转为markdown标题的最大层级","Max level of node to markdown head desc":"将小于该层级的节点文字转为markdown标题,最大层级为6,因为HTML标题支持最大为6级","Font size":"文字大小","Font size desc":"思维导图文字默认大小,单位px","Mind map layout direct":"思维导图布局方向","Mind map layout direct desc":"思维导图的布局方向,分为向两侧发散、仅右侧、仅左侧三个方向","Expand node":"展开节点","Collapse node":"收缩节点","Only show this node":"仅显示该节点","Expand all node":"展开所有节点","Collapse all node":"收缩所有节点","Add relate link":"添加联系线","Remove relate link":"删除联系线","Add summary node":"添加归纳","Remove summary node":"删除归纳","Remove node":"删除节点","Only remove this node":"仅删除该节点","Open PDF File":"正在打开PDF文件...","Save Image error,Please try again":"保存图片失败,请重试","Creating Rect Annotate":"正在创建矩形标注","Cancel Create Rect Annotate":"取消创建矩形标注","File Is Not Exist":"文件不存在","Open File Error":"打开文件失败","PDF Cannot Open More Instances":"不支持多开PDF阅读器","Create Rect Annotate":"创建矩形标注成功","Stroke Array":"颜色组","Stroke Array Desc":"节点连线颜色将按照颜色组生成,否则生成随机颜色","PDFJs Plugin Path":"PDFJs 插件路径","Andriod pdfjs Plugin Path":"安卓 PDFJs 插件路径","Ios pdfjs Plugin Path":"IOS PDFJs 插件路径","Mac pdfjs Plugin Path":"Mac PDFJs 插件路径","PDFJs Plugin Path Desc":"如果您要使用PDF标注功能,您需要下载PDFJS插件,并设置插件路径","PDF Path":"PDF 存储路径","PDF Annotate Path":"PDF 标注存储路径","PDF Image Path":"PDF 矩形标注生成的图片存储路径","Miss PDF Reader Path":"缺少PDF插件,您需要下载PDFJS插件,并在设置中设置PDF插件路径(绝对路径)","Please Use Rich Mode":"目前处于Basic模式或者未激活,无法使用PDF标注功能,请使用Rich模式或者激活软件","The probation period has ended":"免费版本或者激活码已过期,请至markmind.net购买激活码以激活应用",Rect:"矩形",Circle:"圆",Pointer:"点","Show MindMap":"显示思维导图","Hide MindMap":"隐藏思维导图","Open Protocol":"开启协议支持","Open Protocol Desc":"支持类似 obsidian://{Protocol name} 的协议,用于跳转至PDF标注",Protocol:"协议名","Protocol Desc":"协议名称",Open:"开启",Close:"关闭","Open as outline":"打开为大纲","Show Annotate":"展示标注","Annotation save type":"标注保存类型","Annotation save type desc":"当保存PDF标注时保存的文件类型,目前分为保存为annos和markdown两种,默认扩展名为annos(本质是json文件)","Export annotate pdf":"导出标注后的PDF文件","Export annotate pdf tip":"这是一个费时的操作,请耐心等待...","Export annotate pdf success":"导出PDF文件成功","Export annotate pdf error":"导出PDF文件失败","Active Code":"激活码","Active Code Desc":"可以使用该值激活markmind,网站:","Active error":"激活失败,请检查激活码","Active success":"已激活","Annotate PDF":"打开注释PDF","Annotate EPUB":"打开注释EPUB","PDF Viewer Theme":"PDF阅读器主题","PDF Viewer Theme desc":"切换PDF阅读器主题皮肤","Copy as markdown":"复制为markdown","Copy node text":"仅复制该节点文本","Copy node link":"复制节点引用链接","Export as opml":"导出为OPML","Mobile app not support":"移动端不支持打开本地PDF文件","Not support file type":"不支持注释该文件类型,只支持pdf文件","Not find md file":"这是一个外部pdf文件,在文件夹中尚不存在批注信息","Please select another node":"请选择另一个节点","Change layout to mindmap":"切换思维导图布局为默认","Change layout to right":"切换思维导图布局为右侧","Change layout to left":"切换思维导图布局为左侧","Change layout to tree":"切换思维导图布局为树向下布局","Copy mindmap node":"复制节点","Paste to node":"粘贴节点","Toggle mardkown/mindmap":"切换为Markdown或思维导图模式","Copy node id":"获取节点ID","Mobile Active Code":"移动端激活码","Mobile Active Code Desc":"用于激活移动端,当你填入激活码时,该值将自动生成","Mindmap mode":"思维导图模式","Mindmap mode desc":"当创建思维导图时,将按照该值创建思维导图的模式,默认是basic模式","Pdf screen short":"PDF 截图文件夹","Pdf screen short desc":"用于保存PDF矩形标注所截的图片","Set mindmap to center":"居中思维导图",save:"保存",cancel:"取消","Remove annotate space":"自动移除标注文字中的空格","Remove annotate space desc":"在中文环境下,某些pdf文字标注时,文字之间存在空格,可以开启该选项,将自动移除文字之间的空格","Get path of vault":"获取库的基础路径","Smooth movement":"开启支持思维导图节点支持平滑过渡效果","Smooth movement desc":"当点击引用节点时,节点跳转到同一思维导图的其他节点时的过渡效果","Support code block":"开启支持图文混排","Support code block desc":"支持在markdown文档中图文混排效果",toPng:"导出为PNG图片","Set pdf js path":"设置 pdfjs 插件路径","Please open a mind map":"请打开一个思维导图并重新执行此命令","Set up pdf js path success":"设置 pdfjs 插件路径成功,请重新启动 obsidian","Create new outline":"创建大纲","Copy node":"复制","Paste node":"粘贴","Fill color":"背景颜色","Stroke color":"外框颜色","Text color":"文字颜色","Text align":"对齐方式","Stroke width":"外框粗细","Stroke style":"外框样式",nodeColor:"节点设置面板颜色组",nodeColorDesc:"用于改变节点设置面板颜色组","Export to html":"导出思维导图为html文件","Change layout to fishLeft":"切换思维导图布局为左侧鱼骨图","Change layout to fishRight":"切换思维导图布局为右侧鱼骨图","Open as table":"打开为表格","get table html":"获取表格的HTML源码","get table markdown":"获取表格的 markdown 文本","Get pdf annotations":"导入PDF高亮标注","extract highlight success":"导入PDF高亮成功","Change basic mode to rich mode":"将 basic 模式转为 rich 模式","Change rich mode to basic mode":"将 rich 模式转为 basic 模式","Export pdf annotations":"导出 PDF 注释","Format of pdf highlight":"PDF 注释格式设置","Format of pdf highlight desc":"当导出 PDF 注释时,将按照该格式生成文件","Use new version of pdfjs":"切换至新版 pdfjs 插件","Use old version of pdfjs":"切换至旧版 pdfjs 插件",searchResult:"发现到 {{nodeNumber}} 个节点包含该关键字","Toggle search box":"打开或关闭搜索框","Fine tune height of annotate":"微调 PDF 标注高度","Fine tune height of annotate desc":"向上调整的距离 (px)","Fine tune height of annotate desc one":"向下调整的距离 (px)","Create hand drawn mindmap":"生成手绘模式的思维导图","Decode URI pdf link":"是否打开解码PDF链接","Decode URI pdf link desc":"如果你的 `annotate-target`被 `encodeURI`编码 , 可以打开该选项","Expand to first node level":"展开至第一级节点","Expand to second node level":"展开至第二级节点","Expand to third node level":"展开至第三级节点","Expand to all node level":"展开所有节点","Expand to fourth node level":"展开至第四级节点","Expand to fifth node level":"展开至第五级节点","Auto create node when annotate":"标注时自动生成思维导图节点","Auto create node when annotate desc":"当创建 pdf 标注时自动是否自动创建思维导图节点","Add child node":"添加子节点","Add brother node":"添加兄弟节点","Edit node":"编辑节点","Cancel edit node":"退出编辑节点","Delete node":"删除节点",Undo:"撤销",Redo:"恢复","Use custom short cut":"开启自定义快捷键","Use custom short cut desc":"支持思维导图设置自定义快捷键,目前支持如下命令(在 Ctrl + P 面板里):添加节点、删除节点、编辑节点、取消编辑节点、撤销、恢复","PDF cache folder":"PDF 缓存目录","PDF cache folder desc":"当使用 PDF 标注工具打开在线 PDF 时,该 PDF 将自动缓存至该文件夹中,下次打开时将优先从该目录中读取数据","Folder of paste image":"粘贴图片文件夹","Folder of paste image desc":"设置文件夹路径,指向库中的某一文件夹,粘贴的图片将存入该文件夹中","Change basic to table mode":"打开 Basic 模式的思维导图为表格","Change basic to outline mode":"打开 Basic 模式为大纲","Saving data":"正在保存 ...",Saved:"已保存","Only copy annotate link":"开启支持只复制标注链接","Only copy annotate link desc":"当点击一个 PDF 标注时,只会复制链接","Saving image":"正在保存图片...","Auto set node to center when tab node of mindmap":"切换思维导图时自动居中节点","Auto set node to center when tab node of mindmap desc":"当使用上、下、左、右键切换节点时,自动居中节点","Auto open search box":"自动打开思维导图搜索框","Auto open search box desc":"当 obsidian 搜索中存在搜索条件,打开思维导图时自动打开搜索框,并触发思维导图搜索","Export to pdf":"导出思维导图为 PDF 文件","Please do this in a separate window":"请在独立窗口进行此操作,无法在主窗口执行","PDF save success":"PDF 保存成功","Add collapse node mark":"Basic 模式下自动添加折叠节点标记","Add collapse node mark desc":"Basic 模式下,保存思维导图时,自动在折叠的节点最后加入ID,用于下次打开可以恢复折叠原状","Change theme":"打开主题切换框","Close change theme":"关闭主题切换框","Can not change layout":"由于该节点的子节点存在归纳、外框、标注或者布局,所以无法转换为表格布局,防止数据丢失","Only use obsidian folder for pdfjs plugin":"支持 pdfjs 插件放在.obsidian 文件夹","Only use obsidian folder for pdfjs plugin desc":"在安卓或者ios系统支持将 pdfjs 插件放在库内的 .obsidian 文件夹","Generate mind maps by chatGTP":"智能生成思维导图(AI 大纲)","Get inspiration":"获取灵感(AI)",ChatGTPError:"AI 获取文本失败,请检查网络,重新尝试!",ChatGTPLoading:"AI 正在获取数据,请稍等...","ChatGTP appkey":"请输入 ChatGPT 的 apikey","ChatGTP appkey desc":"如果您没有这个Apikey 请至 ChatGPT 官网申请",ProxyServer:"网络代理","ProxyServer desc":"如果无法直接访问 OpenAI 的 api,可以使用网络代理","Generate mind maps by Q&A of chatGTP":"智能生成思维导图(AI 问答)","Annotate template":"标注格式","Annotate template desc":"当标注自动生成节点或者点击标注时,将以此格式生成标注,并复制到粘贴板","Support translate":"支持标注划词翻译","Support translate desc":"当做 pdf 标注时,划词时自动翻译","Google translate":"谷歌翻译","Google translate desc":"谷歌翻译设置","Baidu translate":"百度翻译","Baidu translate desc":"百度翻译设置","Youdao translate":"有道翻译","Youdao translate desc":"有道翻译设置","Translate appid":"翻译 Appid 或者 token","Translate appid desc":"请输入翻译的 AppId 或者 token","Translate secret":"翻译秘钥 secret","Translate secret desc":"请输入翻译秘钥 secret, 如果您是使用 token 之类的请求api,则该值可能不需要填写","Not have translations of pdf full text":"没有全文翻译文件,请重新翻译 PDF","Translate spend time":"正在翻译中,请等待,总共 (条数): ","Translate success":"翻译完成","Parsing PDF structure":"正在解析 PDF 结构...","Parsing PDF structure error":"解析 PDF 出错","Full text translate":"全文翻译","Pdf in vault":"全文翻译暂时只支持库内的 pdf","Completed translation":"翻译已完成: ","Translation engine":"翻译引擎",baidu:"百度","Copy full text translations":"复制全文翻译到剪贴板","Mindmap is in read":"导图处于只读模式","Export to pdf (old version)":"导出导图为 PDF (v0.15.9)","Scale speed of mobile version":"移动端缩放速率","Scale speed of mobile version desc":"可以调整该值,使得移动端双指放大或者缩小变换流畅","Cover node":"遮挡节点文字","Cancel cover node":"取消遮挡节点文字"},"zh-tw":{}}[e.moment.locale()];function r(t){return s||console.error("Error: mindmap locale not found",e.moment.locale()),s&&s[t]||n[t]}const o=/^(---)$.+?^(---)$.+?/ims,a=["---","","mindmap-plugin: basic","","---","",""].join("\n"),h=["---","","mindmap-plugin: rich","","---","",""].join("\n"),l=["---","","mindmap-plugin: basic","display-mode: outline","","---","",""].join("\n");function d(e,i,n,s,r,a,h,l,d,c){var u,p;return t(this,void 0,void 0,(function*(){var t=yield i.vault.adapter.read(n.path),d=s.querySelector(".markdown-embed");if(d){if(t=t.trim().replace(o,"")){const{root:e}=ds.transform(t);(m=ls(e)).isRoot=!0}else var m={id:os(),text:"Basic root",isRoot:!0,main:!0};var f=document.createElement("div");f.classList.add("mm-mindmap-container"),f.style.visibility="hidden",null===(u=s.querySelector(".markdown-embed-content"))||void 0===u||(u.style.display="none"),null===(p=s.querySelector(".markdown-embed-link"))||void 0===p||(p.style.zIndex="20"),d.appendChild(f),m.useScale=!1;var g=new Bi(m,f,h,!1);if(g.path=n.path,g._mode="basic",g.colors=a,g.parent=r,g._plugin=e,c?g.initTable(m):(g.init(),g.refresh()),!r)s.findAll(".internal-embed").forEach((e=>{const t=e.getAttribute("src"),s="string"==typeof t&&i.metadataCache.getFirstLinkpathDest(t,n.path);if(s&&"md"!==s.extension&&g){e.innerText="";var r=i.vault.getResourcePath(s);e.createEl("img",{attr:{src:r}},(t=>{e.hasAttribute("width")&&t.setAttribute("width",e.getAttribute("width")),e.hasAttribute("alt")&&t.setAttribute("alt",e.getAttribute("alt"))})),e.addClasses(["image-embed","is-loaded"])}})),s.querySelectorAll("img").forEach((e=>{e.onload=()=>{var t,i=null===(t=e.closest(".mm-node"))||void 0===t?void 0:t.getAttribute("data-id");if(i){var n=g.getNodeById(i);null==n||n.clearCacheData(),null==n||n.refreshBox(),g.timeOut&&clearTimeout(g.timeOut),g.timeOut=setTimeout((()=>{g.refresh()}),300)}},e.setAttribute("draggble","false")}));setTimeout((()=>{r||(g.refresh(),g.toDiv(!0),f.style.visibility="visible",g.center(),g.root.unSelect()),l&&l(g)}),900)}}))}function c(e,i,n,s,r,o,a,h,l){var d,c;return t(this,void 0,void 0,(function*(){var t=yield i.vault.adapter.read(n.path);if(p=s.querySelector(".markdown-embed")){var l=t.match(/^(\`\`\` json)$.+?^(\`\`\`)$.+?/ims);if(l&&l.length>0)var u=l[0].substring(8,l[0].length-4).trim();else u=JSON.stringify({mindData:[[{id:os(),text:"Root",isRoot:!0,main:!0,x:4e3,y:4e3,isExpand:!0,layout:{layoutName:"mindmap2",direct:"mindmap"}}]]});var p,m=document.createElement("div");if(m.classList.add("mm-mindmap-container"),m.style.visibility="hidden",null===(d=s.querySelector(".markdown-embed-content"))||void 0===d||(d.style.display="none"),null===(c=s.querySelector(".markdown-embed-link"))||void 0===c||(c.style.zIndex="20"),p=s.querySelector(".markdown-embed")){p.appendChild(m);var f=JSON.parse(u);f.useScale=!1;var g=new Bi(f,m,a,!1);if(g.path=n.path,g.colors=o,g.parent=r,g._mode="rich",g._plugin=e,g.initRich(f,{}),!r)s.findAll(".internal-embed").forEach((e=>{const t=e.getAttribute("src"),s="string"==typeof t&&i.metadataCache.getFirstLinkpathDest(t,n.path);if(s&&"md"!==s.extension&&g){e.innerText="";var r=i.vault.getResourcePath(s);e.createEl("img",{attr:{src:r}},(t=>{e.hasAttribute("width")&&t.setAttribute("width",e.getAttribute("width")),e.hasAttribute("alt")&&t.setAttribute("alt",e.getAttribute("alt"))})),e.addClasses(["image-embed","is-loaded"])}})),s.querySelectorAll("img").forEach((e=>{e.onload=()=>{var t,i=null===(t=e.closest(".mm-node"))||void 0===t?void 0:t.getAttribute("data-id");if(i){var n=g.getNodeById(i);n&&(n.clearCacheData(),n.refreshBox()),g.timeOut&&clearTimeout(g.timeOut),g.timeOut=setTimeout((()=>{g.refresh()}),300)}},e.setAttribute("draggble","false")}));setTimeout((()=>{r||(g.refresh(),g.toDiv(!0),m.style.visibility="visible",g.center(),g.root.unSelect()),h&&h(g)}),900)}}}))}function u(e,t,i){if(e&&e.length){const[n,s]=t,r=Math.PI/180*i,o=Math.cos(r),a=Math.sin(r);e.forEach((e=>{const[t,i]=e;e[0]=(t-n)*o-(i-s)*a+n,e[1]=(t-n)*a+(i-s)*o+s}))}}function p(e){const t=e[0],i=e[1];return Math.sqrt(Math.pow(t[0]-i[0],2)+Math.pow(t[1]-i[1],2))}function m(e,t){const i=t.hachureAngle+90;let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);const s=[0,0];if(i)for(const t of e)u(t,s,i);const r=function(e,t){const i=[];for(const t of e){const e=[...t];e[0].join(",")!==e[e.length-1].join(",")&&e.push([e[0][0],e[0][1]]),e.length>2&&i.push(e)}const n=[];t=Math.max(t,.1);const s=[];for(const e of i)for(let t=0;te.ymint.ymin?1:e.xt.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!s.length)return n;let r=[],o=s[0].ymin;for(;r.length||s.length;){if(s.length){let e=-1;for(let t=0;to);t++)e=t;s.splice(0,e+1).forEach((e=>{r.push({s:o,edge:e})}))}if(r=r.filter((e=>!(e.edge.ymax<=o))),r.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),r.length>1)for(let e=0;e=r.length)break;const i=r[e].edge,s=r[t].edge;n.push([[Math.round(i.x),o],[Math.round(s.x),o]])}o+=t,r.forEach((e=>{e.edge.x=e.edge.x+t*e.edge.islope}))}return n}(e,n);if(i){for(const t of e)u(t,s,-i);!function(e,t,i){const n=[];e.forEach((e=>n.push(...e))),u(n,t,i)}(r,s,-i)}return r}class f{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){const i=m(e,t);return{type:"fillSketch",ops:this.renderLines(i,t)}}renderLines(e,t){const i=[];for(const n of e)i.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],t));return i}}class g extends f{fillPolygons(e,t){let i=t.hachureGap;i<0&&(i=4*t.strokeWidth),i=Math.max(i,.1);const n=m(e,Object.assign({},t,{hachureGap:i})),s=Math.PI/180*t.hachureAngle,r=[],o=.5*i*Math.cos(s),a=.5*i*Math.sin(s);for(const[e,t]of n)p([e,t])&&r.push([[e[0]-o,e[1]+a],[...t]],[[e[0]+o,e[1]-a],[...t]]);return{type:"fillSketch",ops:this.renderLines(r,t)}}}class v extends f{fillPolygons(e,t){const i=this._fillPolygons(e,t),n=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),s=this._fillPolygons(e,n);return i.ops=i.ops.concat(s.ops),i}}class y{constructor(e){this.helper=e}fillPolygons(e,t){const i=m(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(i,t)}dotsOnLines(e,t){const i=[];let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);let s=t.fillWeight;s<0&&(s=t.strokeWidth/2);const r=n/4;for(const o of e){const e=p(o),a=e/n,h=Math.ceil(a)-1,l=e-h*n,d=(o[0][0]+o[1][0])/2-n/4,c=Math.min(o[0][1],o[1][1]);for(let e=0;e{const r=p(e),o=Math.floor(r/(i+n)),a=(r+n-o*(i+n))/2;let h=e[0],l=e[1];h[0]>l[0]&&(h=e[1],l=e[0]);const d=Math.atan((l[1]-h[1])/(l[0]-h[0]));for(let e=0;e{const s=p(e),r=Math.round(s/(2*t));let o=e[0],a=e[1];o[0]>a[0]&&(o=e[1],a=e[0]);const h=Math.atan((a[1]-o[1])/(a[0]-o[0]));for(let e=0;en%2?e+i:e+t));r.push({key:"C",data:e}),t=e[4],i=e[5];break}case"Q":r.push({key:"Q",data:[...a]}),t=a[2],i=a[3];break;case"q":{const e=a.map(((e,n)=>n%2?e+i:e+t));r.push({key:"Q",data:e}),t=e[2],i=e[3];break}case"A":r.push({key:"A",data:[...a]}),t=a[5],i=a[6];break;case"a":t+=a[5],i+=a[6],r.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],t,i]});break;case"H":r.push({key:"H",data:[...a]}),t=a[0];break;case"h":t+=a[0],r.push({key:"H",data:[t]});break;case"V":r.push({key:"V",data:[...a]}),i=a[0];break;case"v":i+=a[0],r.push({key:"V",data:[i]});break;case"S":r.push({key:"S",data:[...a]}),t=a[2],i=a[3];break;case"s":{const e=a.map(((e,n)=>n%2?e+i:e+t));r.push({key:"S",data:e}),t=e[2],i=e[3];break}case"T":r.push({key:"T",data:[...a]}),t=a[0],i=a[1];break;case"t":t+=a[0],i+=a[1],r.push({key:"T",data:[t,i]});break;case"Z":case"z":r.push({key:"Z",data:[]}),t=n,i=s}return r}function N(e){const t=[];let i="",n=0,s=0,r=0,o=0,a=0,h=0;for(const{key:l,data:d}of e){switch(l){case"M":t.push({key:"M",data:[...d]}),[n,s]=d,[r,o]=d;break;case"C":t.push({key:"C",data:[...d]}),n=d[4],s=d[5],a=d[2],h=d[3];break;case"L":t.push({key:"L",data:[...d]}),[n,s]=d;break;case"H":n=d[0],t.push({key:"L",data:[n,s]});break;case"V":s=d[0],t.push({key:"L",data:[n,s]});break;case"S":{let e=0,r=0;"C"===i||"S"===i?(e=n+(n-a),r=s+(s-h)):(e=n,r=s),t.push({key:"C",data:[e,r,...d]}),a=d[0],h=d[1],n=d[2],s=d[3];break}case"T":{const[e,r]=d;let o=0,l=0;"Q"===i||"T"===i?(o=n+(n-a),l=s+(s-h)):(o=n,l=s);const c=n+2*(o-n)/3,u=s+2*(l-s)/3,p=e+2*(o-e)/3,m=r+2*(l-r)/3;t.push({key:"C",data:[c,u,p,m,e,r]}),a=o,h=l,n=e,s=r;break}case"Q":{const[e,i,r,o]=d,l=n+2*(e-n)/3,c=s+2*(i-s)/3,u=r+2*(e-r)/3,p=o+2*(i-o)/3;t.push({key:"C",data:[l,c,u,p,r,o]}),a=e,h=i,n=r,s=o;break}case"A":{const e=Math.abs(d[0]),i=Math.abs(d[1]),r=d[2],o=d[3],a=d[4],h=d[5],l=d[6];if(0===e||0===i)t.push({key:"C",data:[n,s,h,l,h,l]}),n=h,s=l;else if(n!==h||s!==l){S(n,s,h,l,e,i,r,o,a).forEach((function(e){t.push({key:"C",data:e})})),n=h,s=l}break}case"Z":t.push({key:"Z",data:[]}),n=r,s=o}i=l}return t}function I(e,t,i){return[e*Math.cos(i)-t*Math.sin(i),e*Math.sin(i)+t*Math.cos(i)]}function S(e,t,i,n,s,r,o,a,h,l){const d=(c=o,Math.PI*c/180);var c;let u=[],p=0,m=0,f=0,g=0;if(l)[p,m,f,g]=l;else{[e,t]=I(e,t,-d),[i,n]=I(i,n,-d);const o=(e-i)/2,l=(t-n)/2;let c=o*o/(s*s)+l*l/(r*r);c>1&&(c=Math.sqrt(c),s*=c,r*=c);const u=s*s,v=r*r,y=u*v-u*l*l-v*o*o,A=u*l*l+v*o*o,x=(a===h?-1:1)*Math.sqrt(Math.abs(y/A));f=x*s*l/r+(e+i)/2,g=x*-r*o/s+(t+n)/2,p=Math.asin(parseFloat(((t-g)/r).toFixed(9))),m=Math.asin(parseFloat(((n-g)/r).toFixed(9))),em&&(p-=2*Math.PI),!h&&m>p&&(m-=2*Math.PI)}let v=m-p;if(Math.abs(v)>120*Math.PI/180){const e=m,t=i,a=n;m=h&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,u=S(i=f+s*Math.cos(m),n=g+r*Math.sin(m),t,a,s,r,o,0,h,[m,e,f,g])}v=m-p;const y=Math.cos(p),A=Math.sin(p),x=Math.cos(m),b=Math.sin(m),w=Math.tan(v/4),k=4/3*s*w,C=4/3*r*w,E=[e,t],D=[e+k*A,t-C*y],N=[i+k*b,n-C*x],B=[i,n];if(D[0]=2*E[0]-D[0],D[1]=2*E[1]-D[1],l)return[D,N,B].concat(u);{u=[D,N,B].concat(u);const e=[];for(let t=0;t2){const s=[];for(let t=0;t2*Math.PI&&(p=0,m=2*Math.PI);const f=2*Math.PI/h.curveStepCount,g=Math.min(f/2,(m-p)/2),v=G(g,l,d,c,u,p,m,1,h);if(!h.disableMultiStroke){const e=G(g,l,d,c,u,p,m,1.5,h);v.push(...e)}return o&&(a?v.push(...q(l,d,l+c*Math.cos(p),d+u*Math.sin(p),h),...q(l,d,l+c*Math.cos(m),d+u*Math.sin(m),h)):v.push({op:"lineTo",data:[l,d]},{op:"lineTo",data:[l+c*Math.cos(p),d+u*Math.sin(p)]})),{type:"path",ops:v}}function _(e,t){const i=[];for(const n of e)if(n.length){const e=t.maxRandomnessOffset||0,s=n.length;if(s>2){i.push({op:"move",data:[n[0][0]+j(e,t),n[0][1]+j(e,t)]});for(let r=1;r500?.4:-.0016668*h+1.233334;let d=s.maxRandomnessOffset||0;d*d*100>a&&(d=h/10);const c=d/2,u=.2+.2*Q(s);let p=s.bowing*s.maxRandomnessOffset*(n-t)/200,m=s.bowing*s.maxRandomnessOffset*(e-i)/200;p=j(p,s,l),m=j(m,s,l);const f=[],g=()=>j(c,s,l),v=()=>j(d,s,l),y=s.preserveVertices;return r&&(o?f.push({op:"move",data:[e+(y?0:g()),t+(y?0:g())]}):f.push({op:"move",data:[e+(y?0:j(d,s,l)),t+(y?0:j(d,s,l))]})),o?f.push({op:"bcurveTo",data:[p+e+(i-e)*u+g(),m+t+(n-t)*u+g(),p+e+2*(i-e)*u+g(),m+t+2*(n-t)*u+g(),i+(y?0:g()),n+(y?0:g())]}):f.push({op:"bcurveTo",data:[p+e+(i-e)*u+v(),m+t+(n-t)*u+v(),p+e+2*(i-e)*u+v(),m+t+2*(n-t)*u+v(),i+(y?0:v()),n+(y?0:v())]}),f}function W(e,t,i){const n=[];n.push([e[0][0]+j(t,i),e[0][1]+j(t,i)]),n.push([e[0][0]+j(t,i),e[0][1]+j(t,i)]);for(let s=1;s3){const r=[],o=1-i.curveTightness;s.push({op:"move",data:[e[1][0],e[1][1]]});for(let t=1;t+21&&s.push(i)}else s.push(i);s.push(e[t+3])}else{const n=.5,r=e[t+0],o=e[t+1],a=e[t+2],h=e[t+3],l=$(r,o,n),d=$(o,a,n),c=$(a,h,n),u=$(l,d,n),p=$(d,c,n),m=$(u,p,n);ee([r,l,u,m],0,i,s),ee([m,p,c,h],0,i,s)}var r,o;return s}function te(e,t){return ie(e,0,e.length,t)}function ie(e,t,i,n,s){const r=s||[],o=e[t],a=e[i-1];let h=0,l=1;for(let n=t+1;nh&&(h=t,l=n)}return Math.sqrt(h)>n?(ie(e,t,l+1,n,r),ie(e,l,i,n,r)):(r.length||r.push(o),r.push(a)),r}function ne(e,t=.15,i){const n=[],s=(e.length-1)/3;for(let i=0;i0?ie(n,0,n.length,i):n}const se="none";class re{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,i){return{shape:e,sets:t||[],options:i||this.defaultOptions}}line(e,t,i,n,s){const r=this._o(s);return this._d("line",[M(e,t,i,n,r)],r)}rectangle(e,t,i,n,s){const r=this._o(s),o=[],a=L(e,t,i,n,r);if(r.fill){const s=[[e,t],[e+i,t],[e+i,t+n],[e,t+n]];"solid"===r.fillStyle?o.push(_([s],r)):o.push(z([s],r))}return r.stroke!==se&&o.push(a),this._d("rectangle",o,r)}ellipse(e,t,i,n,s){const r=this._o(s),o=[],a=O(i,n,r),h=R(e,t,r,a);if(r.fill)if("solid"===r.fillStyle){const i=R(e,t,r,a).opset;i.type="fillPath",o.push(i)}else o.push(z([h.estimatedPoints],r));return r.stroke!==se&&o.push(h.opset),this._d("ellipse",o,r)}circle(e,t,i,n){const s=this.ellipse(e,t,i,i,n);return s.shape="circle",s}linearPath(e,t){const i=this._o(t);return this._d("linearPath",[T(e,!1,i)],i)}arc(e,t,i,n,s,r,o=!1,a){const h=this._o(a),l=[],d=F(e,t,i,n,s,r,o,!0,h);if(o&&h.fill)if("solid"===h.fillStyle){const o=Object.assign({},h);o.disableMultiStroke=!0;const a=F(e,t,i,n,s,r,!0,!1,o);a.type="fillPath",l.push(a)}else l.push(function(e,t,i,n,s,r,o){const a=e,h=t;let l=Math.abs(i/2),d=Math.abs(n/2);l+=j(.01*l,o),d+=j(.01*d,o);let c=s,u=r;for(;c<0;)c+=2*Math.PI,u+=2*Math.PI;u-c>2*Math.PI&&(c=0,u=2*Math.PI);const p=(u-c)/o.curveStepCount,m=[];for(let e=c;e<=u;e+=p)m.push([a+l*Math.cos(e),h+d*Math.sin(e)]);return m.push([a+l*Math.cos(u),h+d*Math.sin(u)]),m.push([a,h]),z([m],o)}(e,t,i,n,s,r,h));return h.stroke!==se&&l.push(d),this._d("arc",l,h)}curve(e,t){const i=this._o(t),n=[],s=P(e,i);if(i.fill&&i.fill!==se&&e.length>=3){const t=ne(function(e,t=0){const i=e.length;if(i<3)throw new Error("A curve must have at least three points.");const n=[];if(3===i)n.push(K(e[0]),K(e[1]),K(e[2]),K(e[2]));else{const i=[];i.push(e[0],e[0]);for(let t=1;t{a.length>=4&&r.push(...ne(a,t)),a=[]},l=()=>{h(),r.length&&(s.push(r),r=[])};for(const{key:e,data:t}of n)switch(e){case"M":l(),o=[t[0],t[1]],r.push(o);break;case"L":h(),r.push([t[0],t[1]]);break;case"C":if(!a.length){const e=r.length?r[r.length-1]:o;a.push([e[0],e[1]])}a.push([t[0],t[1]]),a.push([t[2],t[3]]),a.push([t[4],t[5]]);break;case"Z":h(),r.push([o[0],o[1]])}if(l(),!i)return s;const d=[];for(const e of s){const t=te(e,i);t.length&&d.push(t)}return d}(e,1,o?4-4*i.simplification:(1+i.roughness)/2);return s&&("solid"===i.fillStyle?n.push(_(a,i)):n.push(z(a,i))),r&&(o?a.forEach((e=>{n.push(T(e,!1,i))})):n.push(function(e,t){const i=N(D(E(e))),n=[];let s=[0,0],r=[0,0];for(const{key:e,data:o}of i)switch(e){case"M":{const e=1*(t.maxRandomnessOffset||0),i=t.preserveVertices;n.push({op:"move",data:o.map((n=>n+(i?0:j(e,t))))}),r=[o[0],o[1]],s=[o[0],o[1]];break}case"L":n.push(...q(r[0],r[1],o[0],o[1],t)),r=[o[0],o[1]];break;case"C":{const[e,i,s,a,h,l]=o;n.push(...Y(e,i,s,a,h,l,r,t)),r=[h,l];break}case"Z":n.push(...q(r[0],r[1],s[0],s[1],t)),r=[s[0],s[1]]}return{type:"path",ops:n}}(e,i))),this._d("path",n,i)}opsToPath(e,t){let i="";for(const n of e.ops){const e="number"==typeof t&&t>=0?n.data.map((e=>+e.toFixed(t))):n.data;switch(n.op){case"move":i+=`M${e[0]} ${e[1]} `;break;case"bcurveTo":i+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case"lineTo":i+=`L${e[0]} ${e[1]} `}}return i.trim()}toPaths(e){const t=e.sets||[],i=e.options||this.defaultOptions,n=[];for(const e of t){let t=null;switch(e.type){case"path":t={d:this.opsToPath(e),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:se};break;case"fillPath":t={d:this.opsToPath(e),stroke:se,strokeWidth:0,fill:i.fill||se};break;case"fillSketch":t=this.fillSketch(e,i)}t&&n.push(t)}return n}fillSketch(e,t){let i=t.fillWeight;return i<0&&(i=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||se,strokeWidth:i,fill:se}}}class oe{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new re(t)}draw(e){const t=e.sets||[],i=e.options||this.getDefaultOptions(),n=this.ctx,s=e.options.fixedDecimalPlaceDigits;for(const r of t)switch(r.type){case"path":n.save(),n.strokeStyle="none"===i.stroke?"transparent":i.stroke,n.lineWidth=i.strokeWidth,i.strokeLineDash&&n.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(n.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(n,r,s),n.restore();break;case"fillPath":{n.save(),n.fillStyle=i.fill||"";const t="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(n,r,s,t),n.restore();break}case"fillSketch":this.fillSketch(n,r,i)}}fillSketch(e,t,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2),e.save(),i.fillLineDash&&e.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(e.lineDashOffset=i.fillLineDashOffset),e.strokeStyle=i.fill||"",e.lineWidth=n,this._drawToContext(e,t,i.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,i,n="nonzero"){e.beginPath();for(const n of t.ops){const t="number"==typeof i&&i>=0?n.data.map((e=>+e.toFixed(i))):n.data;switch(n.op){case"move":e.moveTo(t[0],t[1]);break;case"bcurveTo":e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case"lineTo":e.lineTo(t[0],t[1])}}"fillPath"===t.type?e.fill(n):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,i,n,s){const r=this.gen.line(e,t,i,n,s);return this.draw(r),r}rectangle(e,t,i,n,s){const r=this.gen.rectangle(e,t,i,n,s);return this.draw(r),r}ellipse(e,t,i,n,s){const r=this.gen.ellipse(e,t,i,n,s);return this.draw(r),r}circle(e,t,i,n){const s=this.gen.circle(e,t,i,n);return this.draw(s),s}linearPath(e,t){const i=this.gen.linearPath(e,t);return this.draw(i),i}polygon(e,t){const i=this.gen.polygon(e,t);return this.draw(i),i}arc(e,t,i,n,s,r,o=!1,a){const h=this.gen.arc(e,t,i,n,s,r,o,a);return this.draw(h),h}curve(e,t){const i=this.gen.curve(e,t);return this.draw(i),i}path(e,t){const i=this.gen.path(e,t);return this.draw(i),i}}const ae="http://www.w3.org/2000/svg";class he{constructor(e,t){this.svg=e,this.gen=new re(t)}draw(e){const t=e.sets||[],i=e.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,s=n.createElementNS(ae,"g"),r=e.options.fixedDecimalPlaceDigits;for(const o of t){let t=null;switch(o.type){case"path":t=n.createElementNS(ae,"path"),t.setAttribute("d",this.opsToPath(o,r)),t.setAttribute("stroke",i.stroke),t.setAttribute("stroke-width",i.strokeWidth+""),t.setAttribute("fill","none"),i.strokeLineDash&&t.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&t.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":t=n.createElementNS(ae,"path"),t.setAttribute("d",this.opsToPath(o,r)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",i.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(n,o,i)}t&&s.appendChild(t)}return s}fillSketch(e,t,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2);const s=e.createElementNS(ae,"path");return s.setAttribute("d",this.opsToPath(t,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",n+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,i,n,s){const r=this.gen.line(e,t,i,n,s);return this.draw(r)}rectangle(e,t,i,n,s){const r=this.gen.rectangle(e,t,i,n,s);return this.draw(r)}ellipse(e,t,i,n,s){const r=this.gen.ellipse(e,t,i,n,s);return this.draw(r)}circle(e,t,i,n){const s=this.gen.circle(e,t,i,n);return this.draw(s)}linearPath(e,t){const i=this.gen.linearPath(e,t);return this.draw(i)}polygon(e,t){const i=this.gen.polygon(e,t);return this.draw(i)}arc(e,t,i,n,s,r,o=!1,a){const h=this.gen.arc(e,t,i,n,s,r,o,a);return this.draw(h)}curve(e,t){const i=this.gen.curve(e,t);return this.draw(i)}path(e,t){const i=this.gen.path(e,t);return this.draw(i)}}var le={canvas:(e,t)=>new oe(e,t),svg:(e,t)=>new he(e,t),generator:e=>new re(e),newSeed:()=>re.newSeed()};function de(e){if(window.getSelection){e.focus();var t=e.win.getSelection();try{t.selectAllChildren(e),t.collapseToEnd()}catch(e){}}}class ce{constructor(e,t){this.box={x:0,y:0,width:0,height:0},this.name="node",this.isExpand=!0,this.isSelect=!1,this.children=[],this.isHide=!1,this.isEdit=!1,this._barDom=null,this.callout=null,this.wireFrames=[],this.summaries=[],this.induce=null,this.wireFrame=null,this.layout=null,this.wfs=[],this.induces=[],this.belongInduce=null,this._wireFrames=[],this._summaries=[],this._removeLink=null,this.shouldRender=!0,this.containBar=!1,this.tNode=null,this._shapeDom=null,this._mathTime=null,this._noteTab=null,this.coverDom=null,this.data=e,this.mindmap=t,this.data.stroke&&(this.stroke=this.data.stroke),this.data.style&&(this.style=Object.assign({},this.style,this.data.style)),this.initDom()}getId(){return this.data.id}getParent(){return this.parent||null}initDom(){this.containEl=document.createElement("div"),this.containEl.classList.add("mm-node"),this.containEl.setAttribute("contentEditable","false"),this.containEl.setAttribute("tabIndex","-1"),this.containEl.setAttribute("data-id",this.data.id),this.containEl.setAttribute("draggable","false"),this.assistDom=document.createElement("div"),this.assistDom.classList.add("mm-node-assist"),this.contentEl=document.createElement("div"),this.contentEl.classList.add("mm-node-content"),this.containEl.appendChild(this.contentEl),this.contentEl.appendChild(this.assistDom),this.editDom=document.createElement("div"),this.editDom.classList.add("mm-node-edit"),this.contentEl.appendChild(this.editDom),this.plgDom=document.createElement("div"),this.plgDom.classList.add("mm-note-dom"),this.contentEl.appendChild(this.plgDom),this.initNodeBar(),this.updateAnnotate(),this.data.note&&this.updateNote(),this.data.isRoot&&(this.containEl.classList.add("mm-root"),this.isRoot=!0),this.setStyle(),this.parseText(),this.data.cover&&this.createCoverDom()}createCoverDom(){var e=document.createElement("div");this.containEl.appendChild(e),e.classList.add("mm-node-cover"),this.coverDom=e}setCoverText(e){e?(this.data.cover=!0,this.coverDom||this.createCoverDom()):(this.data.cover=!1,this.containEl.contains(this.coverDom)&&(this.containEl.removeChild(this.coverDom),this.coverDom=null))}initNodeBar(){this._barDom=document.createElement("div"),this._barDom.classList.add("mm-node-bar"),this.containEl.appendChild(this._barDom)}parseText(){var t;e.MarkdownRenderer.renderMarkdown(this.data.text,this.editDom,this.mindmap.path||"",this.mindmap._plugin||(null===(t=this.mindmap.view)||void 0===t?void 0:t.plugin)).then((()=>{this.data.mdText=this.editDom.innerHTML,this.refreshBox(),this.mindmap&&this.mindmap.emit("initNode",{}),this._delay()}))}isMindmap(e){if(e&&e.frontmatter){var t=e.frontmatter["mindmap-plugin"];return"rich"==t||"basic"==t}return!1}isMindmapRichMode(e){return!!(e&&e.frontmatter&&e.frontmatter["mindmap-plugin"]&&"rich"==e.frontmatter["mindmap-plugin"])}_deleyRefreshLayout(e,t){if(e&&t){var i=(e=e.tNode?e.tNode:e).getRootLayout()||t.mmLayout,n=t._delayRefresh.filter((e=>e.layout==i));if(n&&n.length)n[0].timeOut&&clearTimeout(n[0].timeOut),n[0].timeOut=setTimeout((()=>{t.emit("renderEditNode",{node:e})}),800);else{if(!i)return;t._delayRefresh.push({node:e,layout:i,timeOut:setTimeout((()=>{t.emit("renderEditNode",{node:e})}),800)})}t._delayRefresh.length>20&&(t._delayRefresh=[])}}_refreshImage(e,t){e.findAll(".internal-embed").forEach((e=>{const i=e.getAttribute("src");if(i.startsWith("http"))return;const n="string"==typeof i&&this.mindmap.view&&this.mindmap.view.app&&this.mindmap.view.app.metadataCache.getFirstLinkpathDest(i,this.mindmap.path);if(n&&"md"!==n.extension&&t){e.innerText="";var s=this.mindmap.view.app.vault.getResourcePath(n);e.createEl("img",{attr:{src:s}},(t=>{e.hasAttribute("width")&&t.setAttribute("width",e.getAttribute("width")),e.hasAttribute("alt")&&t.setAttribute("alt",e.getAttribute("alt"))})),e.addClasses(["image-embed","is-loaded"])}})),e.querySelectorAll("img").forEach((e=>{var i;e.onload||(e.onload=()=>{var i,n=null===(i=e.closest(".mm-node"))||void 0===i?void 0:i.getAttribute("data-id");if(n){var s=t.getNodeById(n);s&&(s.clearCacheData(),s.refreshBox(),this._deleyRefreshLayout(s,t))}}),e.setAttribute("draggble","false");var n=null===(i=e.closest(".mm-node"))||void 0===i?void 0:i.getAttribute("data-id");if(n){var s=t.getNodeById(n);s&&(s.clearCacheData(),s.refreshBox(),this._deleyRefreshLayout(s,t))}}))}_createHandDrawFill(){var e=this.getLevel();if(this.mindmap&&this.mindmap.useHandMode&&e<=1){var t=this.mindmap._rc||le.svg(this.mindmap.draw),i=!!document.querySelector(".theme-dark")||!1;this.shapeSvg&&this.mindmap.draw.node.removeChild(this.shapeSvg);var n=this.getBox(),s=0==e?"solid":"sunburst",r=0==e?"1":"2",o=i?"#fff":"rgb(0, 170, 255)",a=i?"#333":"#000";this.shapeSvg=t.rectangle(n.x,n.y,n.width,n.height,{fill:this.stroke||this.data.stroke||o,fillStyle:s,stroke:this.stroke||this.data.stroke||a,fillWeight:r}),this.mindmap.draw.node.appendChild(this.shapeSvg)}}_delay(){var i=this;this.editDom.style.overflow="",this.editDom.findAll(".internal-embed").forEach((n=>t(this,void 0,void 0,(function*(){var t,s;const r=n.getAttribute("src");if("string"==typeof r){var o=e.parseLinktext(r);if(!o)return;var a="";if(this.mindmap&&this.mindmap.view){var h=this.mindmap.view.app.metadataCache.getFirstLinkpathDest(o.path,this.mindmap.path);if(h instanceof e.TFile&&"md"===h.extension){if(this.editDom.querySelector(`.markdown-embed[data-name="${h.path}"]`))return;var l=this.mindmap.view.app.metadataCache.getFileCache(h);if(this.isMindmap(l)){if((m=document.createElement("div")).classList.add("markdown-embed"),n.appendChild(m),m.setAttribute("data-name",h.path),(f=document.createElement("div")).classList.add("markdown-embed-content"),(g=document.createElement("div")).classList.add("markdown-preview-view"),f.appendChild(g),(v=document.createElement("div")).classList.add("markdown-embed-link"),v.setAttribute("aria-label","Open link"),v.innerHTML=``,this.editDom.style.overflow="auto",m.appendChild(f),m.appendChild(v),this.isMindmapRichMode(l))yield c(null===(t=this.mindmap.view)||void 0===t?void 0:t.plugin,this.mindmap.view.app,h,n,this,this.mindmap.colors,this.mindmap.setting,(e=>{this._refreshImage(n,e),setTimeout((()=>{e.toDiv(!0),e.containerEL.style.visibility="visible",e.center(),e.root.unSelect(),this.clearCacheData(),this.refreshBox(),this.mindmap&&this.mindmap.emit("renderEditNode",{node:i.tNode?i.tNode:i}),this._createHandDrawFill()}),900)}));else{var u=l&&l.frontmatter;if(u)var p=!!u["display-mode"]&&"table"==u["display-mode"];yield d(null===(s=this.mindmap.view)||void 0===s?void 0:s.plugin,this.mindmap.view.app,h,n,this,this.mindmap.colors,this.mindmap.setting,(e=>{this._refreshImage(n,e),setTimeout((()=>{e.toDiv(!0),e.containerEL.style.visibility="visible",e.center(),e.root.unSelect(),this.clearCacheData(),this.refreshBox(),this.mindmap&&this.mindmap.emit("renderEditNode",{node:i.tNode?i.tNode:i}),this._createHandDrawFill()}),900)}),0,p)}}else{if(!(a=yield this.mindmap.view.app.vault.adapter.read(h.path)).trim())return;var m,f,g,v;if((m=document.createElement("div")).classList.add("markdown-embed"),m.setAttribute("data-name",h.path),(f=document.createElement("div")).classList.add("markdown-embed-content"),(g=document.createElement("div")).classList.add("markdown-preview-view"),f.appendChild(g),(v=document.createElement("div")).classList.add("markdown-embed-link"),v.setAttribute("aria-label","Open link"),v.innerHTML=``,n.appendChild(m),m.appendChild(f),m.appendChild(v),o.subpath){var y=this.mindmap.view.app.metadataCache.getFileCache(h),A=e.resolveSubpath(y,o.subpath);if(A&&A.start&&A.end)var x=a.substring(A.start.offset,A.end.offset);else if(A&&A.start&&!A.end)x=a.substr(A.start.offset);else x=a||""}else x=a||"";x&&e.MarkdownRenderer.renderMarkdown(x,g,this.mindmap.path||"",null).then((()=>{this.refreshBox(),this.mindmap&&this.mindmap.emit("renderEditNode",{node:i.tNode?i.tNode:i}),this._createHandDrawFill()}))}}}}})))),setTimeout((()=>{this._refreshImage(this.editDom,this.mindmap),(this.editDom.querySelector("code")||this.editDom.querySelector(".MathJax")||this.editDom.querySelector(".callout"))&&setTimeout((()=>{this.clearCacheData(),this.refreshBox(),this._deleyRefreshLayout(i,this.mindmap),this._createHandDrawFill()}),200),this.editDom.findAll("a.external-link").length&&setTimeout((()=>{this.clearCacheData(),this.refreshBox(),this._createHandDrawFill(),this.mindmap&&(this.mindmap._initTime&&clearTimeout(this.mindmap._initTime),this.mindmap._initTime=setTimeout((()=>{this._deleyRefreshLayout(i,this.mindmap)}),600))}),300),setTimeout((()=>{this.refreshBox(),this._createHandDrawFill()}),1500)}),280)}_delayRefresh(){}getRootLayout(){for(var e=this,t=null;e;)t=e.layout,e=e.belongInduce?e.belongInduce.node:e.parent;return t}select(){this.isSelect=!0,"relateLink"==this.nodeType||"callout"==this.nodeType?this.containEl.setAttribute("draggable","false"):this.containEl.setAttribute("draggable","true"),Object.assign(window,{myNode:this}),this.containEl.classList.contains("mm-node-select")||this.containEl.classList.add("mm-node-select"),this.mindmap.selectNode=this,this.tNode&&this.tNode.select()}unSelect(){this.isSelect=!1,this.containEl.setAttribute("draggable","false"),this.containEl.classList.contains("mm-node-select")&&this.containEl.classList.remove("mm-node-select")}edit(){this.editDom.innerText="",this._oldText=this.data.text,this.editDom.innerText=this._oldText,this.editDom.setAttribute("contentEditable","true"),this.containEl.setAttribute("draggable","false"),this.editDom.focus(),this.mindmap.editNode=this,this.isEdit=!0,this.data.cover&&this.coverDom&&(this.coverDom.style.display="none"),de(this.editDom),this.editDom.innerText!=r("Sub title")&&"callout"!=this.editDom.innerText||this.selectText(),this.containEl.classList.contains("mm-edit-node")||this.containEl.classList.add("mm-edit-node")}selectText(){var e=this.editDom;if(this.editDom.win.getSelection){var t=this.editDom.win.getSelection(),i=this.editDom.doc.createRange();i.selectNodeContents(e),t.removeAllRanges(),t.addRange(i)}}cancelEdit(){var t;if(this.shouldRender){var i=this.editDom.innerText.trim()||"";this.data.text=i,this.editDom.innerText="",this.data.cover&&this.coverDom&&(this.coverDom.style.display=""),e.MarkdownRenderer.renderMarkdown(i,this.editDom,this.mindmap.path||"",null===(t=this.mindmap.view)||void 0===t?void 0:t.plugin).then((()=>{this.data.mdText=this.editDom.innerHTML,this.refreshBox(),this._delay()})),i!=this._oldText&&(this.mindmap.execute("changeNodeText",{node:this.tNode?this.tNode:this,text:i,oldText:this._oldText}),this.callout&&this.callout.refresh()),this.editDom.setAttribute("contentEditable","false"),this.isEdit=!1,this.containEl.classList.contains("mm-edit-node")&&this.containEl.classList.remove("mm-edit-node"),this.mindmap.appEl.focus(),this.mindmap.editNode=null}}getLevel(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e}getChildren(){return this.children}setPosition(e,t){this.box.x=e,this.box.y=t,this.containEl.style.left=e+"px",this.containEl.style.top=t+"px",this.data.x=e,this.data.y=t}getPosition(){return{x:this.box.x,y:this.box.y}}move(e,t){var i=this.getPosition();this.setPosition(i.x+e,i.y+t)}getStyle(){return Object.assign({},this.style)}setStyle(e,t){t&&e?this.style=e:e&&(this.style=Object.assign({},this.style,e));var i=this.style,n="";for(var s in this.style)n+="font-size"==s||"border-width"==s?`${s}:${i[s]}px;`:`${s}:${i[s]};`;this.contentEl.setAttribute("style",n),this.nodeType&&"callout"==this.nodeType&&this.callout&&(this.callout.color=this.style["background-color"]||this.callout.color,this.callout.refresh())}isEmptyObject(e){for(var t in e)return!1;return!0}getData(){var e=Object.assign({},this.data);if(e.mdText&&delete e.mdText,this.layout?e.layout={layoutName:this.layout.layoutName,direct:this.layout.direct}:e.layout=null,"freeNode"==this.nodeType){e.main=!1;var t=this.getPosition();e.x=t.x,e.y=t.y}return this.isExpand&&(e.isExpand=!0),this.parent&&(e.pid=this.parent.getId()),e.children&&delete e.children,e.stroke=this.stroke||"",this.isEmptyObject(this.style)||(e.style=Object.assign({},this.style)),this.belongInduce&&(e.direct=this.direct),JSON.parse(JSON.stringify(e))}refreshBox(){this.box=this.getDomBox()}getBox(){return Object.assign({},this.box)}refreshCBox(){this.box=this.getCBox()}getContainBox(){return this.containBar?this.containBox:this.box}getCBox(e){var t=this.getBox(),i=0,n=0;if(this.callout){var s=this.callout.getBox();s.yt.y+t.height&&(n=s.y+s.height-t.y-t.height)}if(e&&this.wfs.length){var r=0;this.wfs.forEach((e=>{if(e.data&&e.data.text){var t=e.getTextBox().height;r+=t}})),i+=r+3,n+=3}return Object.assign(Object.assign({},t),{th:i,bh:n})}getContainDomBox(){var e=parseInt(this.containEl.style.top);return{x:parseInt(this.containEl.style.left),y:e,width:Math.ceil(this.containEl.offsetWidth),height:Math.ceil(this.containEl.offsetHeight),th:0,bh:0}}getDomBox(){var e=parseInt(this.containEl.style.top);return{x:parseInt(this.containEl.style.left)||0,y:e||0,width:Math.ceil(this.contentEl.offsetWidth),height:Math.ceil(this.contentEl.offsetHeight),th:0,bh:0}}getNodeList(){var e=[];return function t(i){e.push(i),i.children.forEach((e=>{t(e)}))}(this),e}getShowNodeList(){var e=[];return function t(i){i.isShow()&&e.push(i),i.children.forEach((e=>{t(e)}))}(this),e}getSiblings(){return this.parent?this.parent.children.filter((e=>e!=this)):[]}isLeaf(){return!this.children.length}isShow(){return"none"!=this.containEl.style.display}show(){this.containEl.style.display="block",this.isHide=!1}hide(){this.containEl.style.display="none",this.isHide=!0}clearCacheData(){for(var e=this;e;)e.boundingRect=null,e=e.parent||e.belongInduce&&e.belongInduce.node}addChild(e,t){-1==this.children.indexOf(e)&&(t>-1?(t>this.children.length&&(t=this.children.length),this.children.splice(t,0,e)):this.children.push(e),e.parent=this)}removeChild(e){var t=this.children.indexOf(e);return t>-1&&this.children.splice(t,1),t}setText(e){this.data.text=e,this.editDom.innerHTML="",this.parseText()}expand(){this.isExpand=!0,this.data.isExpand=!0,function e(t){t.show(),t.boundingRect=null,t.induces.length&&t.induces.forEach((t=>{e(t.root)})),t.isExpand&&(t.layout&&(t.layout.svgDom&&(t.layout.svgDom.show(),t.layout.isShow=!0),t.layout.group&&(t.layout.group.show(),t.layout.isShow=!0),t.layout.tableDom&&(t.layout.tableDom.style.display="")),t.children.forEach((t=>{e(t)})))}(this),function e(t){t.isShow()||t.show(),t.refreshBox(),t.isExpand&&t.children.forEach((t=>{e(t)})),t.wfs.length&&t.wfs.forEach((e=>{e.show(),e.refreshItems()})),t.induces.length&&t.induces.forEach((t=>{t.show(),t.refreshItems(),e(t.root)}))}(this),this.containEl.classList.contains("mm-node-collapse")&&this.containEl.classList.remove("mm-node-collapse")}collapse(){function e(t){t.hide(),t.setPosition(10,10),t.induces.length&&t.induces.forEach((t=>{e(t.root)})),t.layout&&(t.layout.tableDom&&(t.layout.tableDom.style.display="none"),t.layout.svgDom&&(t.layout.svgDom.hide(),t.layout.isShow=!1),t.layout.group&&(t.layout.group.hide(),t.layout.isShow=!1)),t.isExpand&&t.children.forEach((t=>{e(t)}))}this.children.forEach((t=>{e(t)})),this.isExpand=!1,this.data.isExpand=!1,this.containEl.classList.contains("mm-node-collapse")||this.containEl.classList.add("mm-node-collapse"),this.layout&&(this.layout.tableDom&&(this.layout.tableDom.style.display="none"),this.layout.svgDom&&(this.layout.svgDom.hide(),this.layout.isShow=!1),this.layout.group&&(this.layout.group.hide(),this.layout.isShow=!1)),this.getMind().updateAllAssist()}isFirst(){if(this.parent){var e=this.parent.getChildren();return e&&0==e.indexOf(this)}return!0}isLast(){if(this.parent){var e=this.parent.getChildren();return e.length&&e.indexOf(this)==e.length-1}return!0}getNodeLayout(){return this.layout}getLayout(){for(var e=this,t=null;e;){if(e.layout){t=e.layout;break}e=e.parent}return t}getTopLayout(){if(!this.parent)return this.layout||null;var e=this,t=null,i=this.layout;for(this.layout=null;e;){if(e.layout){t=e.layout;break}e=e.parent}return this.layout=i,this.topLayout=t,t}getMind(){return this.mindmap||null}setAnnotate(e){"highlight"==e.type?(this.editDom.innerHTML=e.selectText,this.editDom.focus(),de(this.editDom)):(this.editDom.innerHTML=`![[${e.path}]]`,this.editDom.focus(),de(this.editDom)),this.data.annotate=e,this.updateAnnotate()}updateAnnotate(){!this.annotateDom&&this.data.annotate&&(this.annotateDom=document.createElement("div"),this.annotateDom.innerHTML='',this.annotateDom.classList.add("mm-node-annotate"),this.assistDom.appendChild(this.annotateDom))}deleteAnnotate(){this.annotateDom&&(this.assistDom.removeChild(this.annotateDom),this.annotateDom=null,this.data.annotate=null)}getAnnotateId(){return this.data.annotate?this.data.annotate.id:null}getAnnotate(){return this.data.annotate?JSON.parse(JSON.stringify(this.data.annotate)):null}updateNote(){if(this.plgDom.innerHTML="",this.data.note){var e=document.createElement("span");this.plgDom.appendChild(e),e.innerHTML='',e.style.display="flex",e.style.alignItems="center",e.style.margin="0 4px",e.style.cursor="pointer",e.classList.add("mm-note-span")}}setNote(e){this.data.note=e,this.updateNote()}}class ue{constructor(e,t){this.children=[],this.hasInit=!1,this.isSelect=!1,this.isExpand=!0,this.isEdit=!1,this.layout=null,this.induces=[],this.wireFrames=[],this.wfs=[],this.summaries=[],this.callout=null,this._tableDom=null,this.style={},this.isHide=!1,this.nodeType="",this.data=e,t&&(this.mindmap=t),e.style&&(this.style=e.style),this.iNode=new ce(e,t),this.iNode.tNode=this}init(e){this.hasInit||(0==this.getLevel()?(this.tdDom=document.createElement("th"),this.tdDom.setAttribute("colspan",e)):this.tdDom=document.createElement("td"),this.tdDom.appendChild(this.iNode.containEl),this.tdDom.setAttribute("data-id",this.data.id),this.hasInit=!0,this.setStyle())}_initTdDom(e){this.hasInit||(0==this.getLevel()?(this.tdDom=document.createElement("th"),this.tdDom.setAttribute("colspan",e)):this.tdDom=document.createElement("td"),this.tdDom.innerText=this.data.text,this.tdDom.setAttribute("data-id",this.data.id),this.hasInit=!0)}getLevel(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e}isLeaf(){return!this.children.length}isFirst(){if(this.parent){var e=this.parent.getChildren();return e&&0==e.indexOf(this)}return!0}isLast(){if(this.parent){var e=this.parent.getChildren();return e.length&&e.indexOf(this)==e.length-1}return!0}getChildren(){return this.children}getId(){return this.data.id}unSelect(){this.isSelect=!1}select(){this.isSelect=!0,this.mindmap.selectNode=this}getOffset(e,t){for(var i=0,n=0;e&&e!=t;)i+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent||e.parentElement||e.parentNode;return{x:i,y:n}}getBox(e){if(this._tableDom)var t=parseInt(this._tableDom.style.left),i=parseInt(this._tableDom.style.top),n=this.getOffset(this.iNode.containEl,this._tableDom);else t=parseInt(this.mindmap.tableDom.style.left),i=parseInt(this.mindmap.tableDom.style.top),n=this.getOffset(this.iNode.containEl,this.mindmap.tableDom);return{x:n.x+t,y:n.y+i,width:this.iNode.containEl.clientWidth,height:this.iNode.containEl.clientHeight}}getDomBox(){return this.getBox()}clearCacheData(){for(var e=this;e;)e.boundingRect=null,e=e.parent||e.belongInduce&&e.belongInduce.node}expand(){this.isExpand=!0,this.data.isExpand=!0,this.layout&&this.layout.tableDom&&(this.layout.tableDom.style.display="")}hide(){this.isHide=!0,this.layout&&this.layout.tableDom&&(this.layout.tableDom.style.display="none")}show(){this.isHide=!1,this.layout&&this.layout.tableDom&&(this.layout.tableDom.style.display="")}isShow(){return!this.isHide}collapse(){this.isExpand=!1,this.data.isExpand=!1,this.layout&&this.layout.tableDom&&(this.layout.tableDom.style.display="none")}refreshBox(){}getAnnotateId(){}addChild(e,t){-1==this.children.indexOf(e)&&(t>-1?(t>this.children.length&&(t=this.children.length),this.children.splice(t,0,e)):this.children.push(e),e.parent=this)}removeChild(e){var t=this.children.indexOf(e);return t>-1&&this.children.splice(t,1),t}getData(){var e=Object.assign({},this.data);return e.mdText&&delete e.mdText,e.isExpand=this.isExpand,this.parent&&(e.pid=this.parent.getId()),e.children&&delete e.children,this.style&&(e.style=Object.assign({},this.style)),this.layout&&(e.layout={layoutName:"table",direct:""}),JSON.parse(JSON.stringify(e))}setStyle(e,t){t&&e?this.style=e:e&&(this.style=Object.assign(Object.assign({},this.style),e));var i=this.style,n="";for(var s in this.style)n+="font-size"==s||"border-width"==s?`${s}:${i[s]}px;`:`${s}:${i[s]};`;this.tdDom.setAttribute("style",n),this.iNode.setStyle(this.style),this.nodeType&&"callout"==this.nodeType&&this.callout&&(this.callout.color=this.style["background-color"]||this.callout.color,this.callout.refresh())}getStyle(){return this.style}setNote(e){this.data.note=e,this.iNode.setNote(e)}edit(){this.isEdit=!0,this.iNode.edit()}cancelEdit(){this.isEdit=!1,this.iNode.cancelEdit()}setText(e){this.data.text=e}selectText(){this.iNode.selectText()}getMind(){return this.mindmap}getShowNodeList(){var e=[];return this.layout&&"table"==this.layout.layoutName&&e.push(this),e}setPosition(e,t){this.data.x=e,this.data.y=t,this.layout&&this.layout.setPosition(e,t)}getPosition(){return this.getBox()}move(e,t){var i=this.getPosition();this.setPosition(i.x+e,i.y+t)}getLayout(){for(var e=this,t=null;e;){if(e.layout){t=e.layout;break}e=e.parent}return t}getNodeLayout(){return this.layout}getRootLayout(){for(var e=this,t=null;e;)t=e.layout,e=e.belongInduce?e.belongInduce.node:e.parent;return t}getTopLayout(){if(!this.parent)return this.layout||null;var e=this,t=null,i=this.layout;for(this.layout=null;e;){if(e.layout){t=e.layout;break}e=e.parent}return this.layout=i,this.topLayout=t,t}refreshCBox(){this.box=this.getCBox()}getContainBox(){return this.containBar?this.containBox:this.box}getCBox(e){var t=this.getBox(),i=0,n=0;if(this.callout){var s=this.callout.getBox();s.yt.y+t.height&&(n=s.y+s.height-t.y-t.height)}if(e&&this.wfs.length){var r=0;this.wfs.forEach((e=>{if(e.data&&e.data.text){var t=e.getTextBox().height;re!=this)):[]}}var pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function me(e){var t={exports:{}};return e(t,t.exports),t.exports}function fe(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ge=me((function(e,t){!function(i,n){var s=function(){var e=null,t={};f();var i=[],n=function(t){if(void 0!==(t=t||{}).seed&&null!==t.seed&&t.seed===parseInt(t.seed,10))e=t.seed;else if("string"==typeof t.seed)e=A(t.seed);else{if(void 0!==t.seed&&null!==t.seed)throw new TypeError("The seed value must be an integer or string");e=null}var h,l;if(null!==t.count&&void 0!==t.count){for(var d=t.count,c=[],u=0;uc.length;){var p=n(t);null!==e&&(t.seed=e),c.push(p)}return t.count=d,c}return a([h=s(t),l=r(h,t),o(h,l,t)],t)};function s(e){if(i.length>0){var t=u(r=x(e.hue)),n=(r[1]-r[0])/i.length,s=parseInt((t-r[0])/n);return!0===i[s]?s=(s+2)%i.length:i[s]=!0,(t=u(r=[(r[0]+s*n)%359,(r[0]+(s+1)*n)%359]))<0&&(t=360+t),t}var r;return(t=u(r=l(e.hue)))<0&&(t=360+t),t}function r(e,t){if("monochrome"===t.hue)return 0;if("random"===t.luminosity)return u([0,100]);var i=d(e),n=i[0],s=i[1];switch(t.luminosity){case"bright":n=55;break;case"dark":n=s-10;break;case"light":s=55}return u([n,s])}function o(e,t,i){var n=h(e,t),s=100;switch(i.luminosity){case"dark":s=n+20;break;case"light":n=(s+n)/2;break;case"random":n=0,s=100}return u([n,s])}function a(e,t){switch(t.format){case"hsvArray":return e;case"hslArray":return y(e);case"hsl":var i=y(e);return"hsl("+i[0]+", "+i[1]+"%, "+i[2]+"%)";case"hsla":var n=y(e),s=t.alpha||Math.random();return"hsla("+n[0]+", "+n[1]+"%, "+n[2]+"%, "+s+")";case"rgbArray":return g(e);case"rgb":return"rgb("+g(e).join(", ")+")";case"rgba":var r=g(e);s=t.alpha||Math.random();return"rgba("+r.join(", ")+", "+s+")";default:return p(e)}}function h(e,t){for(var i=c(e).lowerBounds,n=0;n=s&&t<=o){var h=(a-r)/(o-s);return h*t+(r-h*s)}}return 0}function l(e){if("number"==typeof parseInt(e)){var i=parseInt(e);if(i<360&&i>0)return[i,i]}if("string"==typeof e)if(t[e]){var n=t[e];if(n.hueRange)return n.hueRange}else if(e.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){var s=v(e)[0];return[s,s]}return[0,360]}function d(e){return c(e).saturationRange}function c(e){for(var i in e>=334&&e<=360&&(e-=360),t){var n=t[i];if(n.hueRange&&e>=n.hueRange[0]&&e<=n.hueRange[1])return t[i]}return"Color not found"}function u(t){if(null===e){var i=.618033988749895,n=Math.random();return n+=i,n%=1,Math.floor(t[0]+n*(t[1]+1-t[0]))}var s=t[1]||1,r=t[0]||0,o=(e=(9301*e+49297)%233280)/233280;return Math.floor(r+o*(s-r))}function p(e){var t=g(e);function i(e){var t=e.toString(16);return 1==t.length?"0"+t:t}return"#"+i(t[0])+i(t[1])+i(t[2])}function m(e,i,n){var s=n[0][0],r=n[n.length-1][0],o=n[n.length-1][1],a=n[0][1];t[e]={hueRange:i,lowerBounds:n,saturationRange:[s,r],brightnessRange:[o,a]}}function f(){m("monochrome",null,[[0,0],[100,0]]),m("red",[-26,18],[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]),m("orange",[18,46],[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]),m("yellow",[46,62],[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]),m("green",[62,178],[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]),m("blue",[178,257],[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]),m("purple",[257,282],[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]),m("pink",[282,334],[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]])}function g(e){var t=e[0];0===t&&(t=1),360===t&&(t=359),t/=360;var i=e[1]/100,n=e[2]/100,s=Math.floor(6*t),r=6*t-s,o=n*(1-i),a=n*(1-r*i),h=n*(1-(1-r)*i),l=256,d=256,c=256;switch(s){case 0:l=n,d=h,c=o;break;case 1:l=a,d=n,c=o;break;case 2:l=o,d=n,c=h;break;case 3:l=o,d=a,c=n;break;case 4:l=h,d=o,c=n;break;case 5:l=n,d=o,c=a}return[Math.floor(255*l),Math.floor(255*d),Math.floor(255*c)]}function v(e){e=3===(e=e.replace(/^#/,"")).length?e.replace(/(.)/g,"$1$1"):e;var t=parseInt(e.substr(0,2),16)/255,i=parseInt(e.substr(2,2),16)/255,n=parseInt(e.substr(4,2),16)/255,s=Math.max(t,i,n),r=s-Math.min(t,i,n),o=s?r/s:0;switch(s){case t:return[(i-n)/r%6*60||0,o,s];case i:return[60*((n-t)/r+2)||0,o,s];case n:return[60*((t-i)/r+4)||0,o,s]}}function y(e){var t=e[0],i=e[1]/100,n=e[2]/100,s=(2-i)*n;return[t,Math.round(i*n/(s<1?s:2-s)*1e4)/100,s/2*100]}function A(e){for(var t=0,i=0;i!==e.length&&!(t>=Number.MAX_SAFE_INTEGER);i++)t+=e.charCodeAt(i);return t}function x(e){if(isNaN(e)){if("string"==typeof e)if(t[e]){var i=t[e];if(i.hueRange)return i.hueRange}else if(e.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){return c(v(e)[0]).hueRange}}else{var n=parseInt(e);if(n<360&&n>0)return c(e).hueRange}return[0,360]}return n}();e&&e.exports&&(t=e.exports=s),t.randomColor=s}()}));class ve{constructor(e){this.edges=[],this.isShow=!0,this.lineWeight=!0,this.svgDom=null,this.name=e}layout(e,t){}refresh(){}addEdge(e){this.edges.push(e)}removeEdge(e){var t=this.edges.indexOf(e);t>-1&&this.edges.splice(t,t)}moveNode(e,t,i){e&&e.move(t,i),e.callout&&e.callout.refresh(),e.wfs&&e.wfs.forEach((e=>{e.move(t,i)})),e.induces&&e.induces.forEach((e=>{e.move(t,i),this.moveNode(e.root,t,i)})),e&&e.children.forEach((e=>{this.moveNode(e,t,i)}))}linePoint(e,t){let i=0;var n=Math.ceil;return t%2==1&&(i=.5,n=parseInt),e.map((e=>[n(e[0])+i,n(e[1])+i]))}_updateNodeAssist(e,t){for(var i=e;i;){i.callout&&i.callout.refresh();var n=i.wireFrames,s=i.summaries;if(n.length&&n.forEach((t=>{t.items.indexOf(e)>-1&&(t.refreshNode(),t.refresh())})),s.length&&s.forEach((t=>{t.items.indexOf(e)>-1&&(t.refreshNode(),t.refresh())})),t){if(i==t)break;i=i.parent}else i=i.parent}}_updateRootAssist(){this.root.induce&&(this.root.induce.refreshItems(),this.root.induce.refresh()),this.root.wireFrame&&(this.root.wireFrame.refreshItems(),this.root.wireFrame.refresh())}}class ye extends ve{constructor(e,t,i){super("minder"),this.layoutName="mindmap",this.direct="",this.levelDis=40,this.nodeDis=8,this.firstLevelDis=80,this.firstNodeDis=20,this.isCache=!0,this.lefts=[],this.rights=[],this.colors=[],this.lineWidth=2,this.root=e,this.mind=this.root.mindmap,this.direct=t||"mindmap",this.colors=i||[],this.svgDom=this.mind.edgeGroup.group()}layout(e,t){e&&(this.root=e),this.root.isExpand&&(this.svgDom||(this.svgDom=this.root.mindmap.edgeGroup.group()),this.root.layout=this,t&&(this.direct=t),this.root.nodeType&&"induce"==this.root.nodeType&&(this.firstLevelDis=20,this.firstNodeDis=10),this.root.nodeType&&"freeNode"==this.root.nodeType&&(this.root.containEl.classList.contains("mm-root")||this.root.containEl.classList.add("mm-root")),this.lefts=[],this.rights=[],this.root.isShow()&&(this.setDirect(),this._layoutSecondLevelNode(this.root)),this.createLink())}setDirect(){var e=this,t=this.root.children.length,i=this.root;"right"==this.direct?(this.rights=i.children,this.rights.forEach((e=>{this._setDirect(e,"right")}))):"left"==this.direct?(this.lefts=i.children,this.lefts.forEach((e=>{this._setDirect(e,"left")}))):i.children.forEach((function(i,n){n{this._setDirect(e,t)}))}_layoutSecondLevelNode(e){this._layoutMinder(),"induce"!=this.root.nodeType&&this._doRefresh(),this._updateRootAssist()}_doRefresh(){var e=this.root,t=e.getPosition(),i=e.getBox(),n=t.y+i.height/2,s=e.getChildren(),r=s.filter((e=>"right"==e.direct)),o=s.filter((e=>"left"==e.direct));if(r.length>=2){var a=r[0],h=r[r.length-1],l=a.getPosition(),d=h.getPosition(),c=h.getBox(),u=d.y+c.height-n,p=n-l.y;if(Math.abs(u)!=Math.abs(p)){var m=Math.abs(Math.abs(u)-Math.abs(p))/2;Math.abs(u)>Math.abs(p)?r.forEach((e=>{this.moveNode(e,0,-parseInt(m+""))})):r.forEach((e=>{this.moveNode(e,0,parseInt(m+""))}))}}if(o.length>=2){a=o[0],h=o[o.length-1],l=a.getPosition(),d=h.getPosition(),c=h.getBox(),u=d.y+c.height-n,p=n-l.y;if(Math.abs(u)!=Math.abs(p)){m=Math.abs(Math.abs(u)-Math.abs(p))/2;Math.abs(u)>Math.abs(p)?o.forEach((e=>{this.moveNode(e,0,-parseInt(m+""))})):o.forEach((e=>{this.moveNode(e,0,parseInt(m+""))}))}}}updateRight(){var e=this.root.getPosition(),t=this.root.getBox(),i=this.rights,n=this._getNodesHeight(i),s=[parseInt(e.x+t.width+this.firstLevelDis+""),parseInt(e.y+t.height/2-n/2+"")];i.forEach((e=>{e.setPosition(s[0],s[1]);var t=e.getBox();s[1]+=parseInt(t.height+this.firstNodeDis+"")})),i.forEach((e=>{this._layoutRight(e)}))}updateLeft(){var e=this.root.getPosition(),t=this.root.getBox(),i=this.lefts,n=this._getNodesHeight(i),s=[parseInt(e.x-this.firstLevelDis+""),parseInt(e.y+t.height/2-n/2+"")];i.forEach((e=>{var t=e.getBox();e.setPosition(parseInt(s[0]-t.width+""),parseInt(s[1]+"")),s[1]+=t.height+this.firstNodeDis})),i.forEach((e=>{this._layoutLeft(e)}))}_layoutMinder(){this.updateRight(),this.updateLeft(),this._doLayout(this.root)}_getNodesHeight(e){if(e[0]&&1==e[0].getLevel())var t=this.firstNodeDis;else t=this.nodeDis;var i=0;return e.forEach(((n,s)=>{i+=n.getBox().height,s!=e.length-1&&(i+=t)})),i}_layoutRight(e){if(e.isExpand){var t=e.getPosition(),i=e.getBox(),n=this._getNodesHeight(e.children);e.callout&&e.callout.refresh();var s=[t.x+i.width+this.levelDis,i.y+i.height/2-n/2];if(e.children.forEach((e=>{e.setPosition(s[0],s[1]);var t=e.getBox();s[1]+=t.height+this.nodeDis})),e.layout)if("table"!=e.layout.layoutName){e.layout.layout(e,e.layout.direct||"");t=e.getPosition();i=e.mindmap.getBBox(e);var r=parseInt(Math.abs(t.x-i.x)+"");this.moveNode(e,r,0),e.boundingRect=null,e.direct="right"}else e.boundingRect=null,e.direct="right";else e.children.forEach((e=>{this._layoutRight(e)}))}}_updateNodeAssist(e){e.callout&&e.callout.refresh();var t=e.parent,i={};if(t){var n=t.wireFrames,s=t.summaries;n.length&&n.forEach((t=>{if(t.node==e&&(t.refresh(),t.data&&t.data.text))if(i[e.getId()])i[e.getId()].rangeNode=i[e.getId()].rangeNode.concat(t.rangeNode.slice()),i[e.getId()].rangeNode.unique();else{var n=t.getTextBox().height,s=t.rangeNode.slice();i[e.getId()]={node:e,wf:t,topDy:n+4,rangeNode:s}}})),s.length&&s.forEach((t=>{t.node==e&&t.refresh()}))}this.topInfo=i}_doLayout(e){var t=this,i=e.mindmap;i.traverseDF((e=>{if(e!=t.root&&e.isShow()){if(e.layout){if(e.layout!=t&&e.getTopLayout()!=t)return}else if(e.getLayout()!=t)return;t._updateNodeAssist(e);var n=e.getCBox();if(t.isCache&&e.boundingRect)var s=e.boundingRect;else{var r=e.getShowNodeList(),o=[],a=[],h=[],l=[];if(r.forEach((e=>{e.callout&&e.callout.isShow&&h.push(e.callout);var t=e.wireFrames;e.summaries.forEach((e=>{e.isShow()&&-1==a.indexOf(e)&&a.push(e)})),t.forEach((e=>{e.isHide||-1==o.indexOf(e)&&o.push(e)}))})),r=r.concat(o),a.forEach((e=>{r=r.concat(e.getAllItem()),l=l.concat(e.groups)})),(r=r.concat(h)).length)s=i.getBoundingRect(r)}var d=e.parent;if(d)var c=d.wireFrames,u=d.summaries;if(e.boundingRect)var p=e.boundingRect.topDy,m=e.boundingRect.downDy;else p=Math.abs(s.y-n.y),m=Math.abs(s.y+s.height-n.y-n.height),c&&c.length&&c.forEach((i=>{var n=i.topNode.getCBox();if(i.node==e&&(p+=Math.abs(6+n.th),t.topInfo[e.getId()]&&(p+=t.topInfo[e.getId()].topDy)),i.endNode&&i.endNode==e){var s=i.bottomNode.getCBox();m+=Math.abs(6+s.bh)}})),s.topDy=p,s.downDy=m,e.boundingRect=s;t._adjustNode(e,0,p,m),c&&c.length&&c.forEach((t=>{t.endNode==e&&t.refresh()})),u&&u.length&&u.forEach((t=>{t.endNode==e&&t.refresh()}))}}),e)}_layoutLeft(e){if(e.isExpand){var t=e.getPosition(),i=e.getBox(),n=this._getNodesHeight(e.children);e.callout&&e.callout.refresh();var s=[t.x-this.levelDis,t.y+i.height/2-n/2];if(e.children.forEach((e=>{var t=e.getBox();e.setPosition(s[0]-t.width,s[1]),s[1]+=t.height+this.nodeDis})),e.layout)if("table"!=e.layout.layoutName){e.layout.layout(e,e.layout.direct||"");t=e.getPosition();var r=e.mindmap.getBBox(e),o=Math.abs(t.x+i.width-r.x-r.width);this.moveNode(e,-o,0),e.direct="left",e.boundingRect=null}else e.direct="left",e.boundingRect=null;else e.children.forEach((e=>{this._layoutLeft(e)}))}}_adjustDoNode(e,t,i){if(e)for(var n=e.direct;e&&e!=this.root;){var s=e.getSiblings(),r=e.getPosition();s.forEach((e=>{e.direct==n&&(e.getPosition().y>r.y?this.moveNode(e,0,i):this.moveNode(e,0,-t))})),e=e.parent}}_adjustNode(e,t,i,n){if(e){var s=e.direct;if(e&&e!=this.root){var r=e.getSiblings(),o=e.getPosition();r.forEach((e=>{e.direct==s&&(e.getPosition().y>o.y?this.moveNode(e,t,n):this.moveNode(e,t,-i))}))}}}refresh(e){this.layout(this.root,e||this.direct),this.createLink()}createLink(){var e=this,t=this.root.mindmap;if(this.svgDom&&this.svgDom.clear(),0!=this.root.getChildren().length&&this.svgDom&&this.root.isShow()){var i=this.lineWidth;t.traverseBF((t=>{if(t.isExpand){var n=t.getChildren(),s=t.getBox(),r=t.getPosition(),o=t.getLevel(),a=n.length,h=2,l=1,d=2,c=1;1==a&&(h=4,l=1,d=4,c=3),n.forEach((n=>{var u=n.direct,p=n.getBox(),m=n.getPosition();let f=t.stroke?t.stroke:n.stroke?n.stroke:ge();if("right"==u){if(0==o||1==o){var g=[s.width+r.x,s.height/2+r.y];if(0==o)var v=[m.x,p.height/2+m.y];else v=[p.width+m.x,p.height+m.y]}else g=[s.width+r.x,s.height+r.y],v=[p.width+m.x,p.height+m.y];if(0==o)var y=[(A=[g[0]+this.firstLevelDis/h*l,g[1]])[0],v[1]];else{var A=[g[0]+this.levelDis/h*l,g[1]];y=[g[0]+this.levelDis/d*c,v[1]]}}else{if(0==o||1==o){g=[r.x,s.height/2+r.y];if(0==o)v=[m.x+p.width,p.height/2+m.y];else v=[m.x,p.height+m.y]}else g=[r.x,s.height+r.y],v=[m.x,p.height+m.y];if(0==o)y=[(A=[g[0]-this.firstLevelDis/h*l,g[1]])[0],v[1]];else A=[g[0]-this.levelDis/h*l,g[1]],y=[g[0]-this.levelDis/d*c,v[1]]}if(1==a)if(1==o)var x=[g,A,y,v];else if(Math.abs(g[1]-v[1])>2)x=[g,y,v];else x=[g,v];else if(0==t.getLevel()){var b=[],w=[];if(t.getChildren().forEach((e=>{"right"==e.direct?b.push(e):w.push(e)})),b.length>=2&&0==b.indexOf(n)||b.length>=2&&b.indexOf(n)==b.length-1)if("right"==u){if(v[1]>g[1])var k=[A[0],v[1]-2],C=[A[0]+2,v[1]];else k=[A[0],v[1]+2],C=[A[0]+2,v[1]];x=[g,A,k,C,v]}else{if(v[1]>g[1])k=[A[0],v[1]-2],C=[A[0]-2,v[1]];else k=[A[0],v[1]+2],C=[A[0]-2,v[1]];x=[g,A,k,C,v]}else if(w.length>=2&&0==w.indexOf(n)||w.length>=2&&w.indexOf(n)==w.length-1)if("right"==u){if(v[1]>g[1])k=[A[0],v[1]-2],C=[A[0]+2,v[1]];else k=[A[0],v[1]+2],C=[A[0]+2,v[1]];x=[g,A,k,C,v]}else{if(v[1]>g[1])k=[A[0],v[1]-2],C=[A[0]-2,v[1]];else k=[A[0],v[1]+2],C=[A[0]-2,v[1]];x=[g,A,k,C,v]}else if(b.length>=2&&0!=b.indexOf(n)||b.length>=2&&b.indexOf(n)!=b.length-1||w.length>=2&&0!=w.indexOf(n)||w.length>=2&&w.indexOf(n)!=w.length-1)x=[y,v];if(1==b.length&&1==w.length)x=[g,v];if(b.length>1&&1==w.length)if("right"==u)x=[g,y,v];else x=[g,v]}else if("right"==u)if(n.isFirst()||n.isLast()){if(v[1]>g[1])k=[A[0],v[1]-2],C=[A[0]+2,v[1]];else k=[A[0],v[1]+2],C=[A[0]+2,v[1]];x=[g,A,k,C,v]}else x=[y,v];else if(n.isFirst()||n.isLast()){if(v[1]>g[1])k=[A[0],v[1]-2],C=[A[0]-2,v[1]];else k=[A[0],v[1]+2],C=[A[0]-2,v[1]];x=[g,A,k,C,v]}else x=[y,v];var E=e.svgDom.polyline(e.linePoint(x,i));E.fill("none"),E.stroke({color:f,width:i,linecap:"round",linejoin:"round"}),E.source=t,E.target=n}))}}),this.root)}}}class Ae extends ye{constructor(e,t,i){super(e,t,i),this.firstLevelDis=50,this.levelDis=30,this.nodeDis=10,this.layoutName="mindmap1"}createLink(){var e=this,t=this.levelDis,i=this.direct;this.svgDom&&this.svgDom.clear();var n=this.root;if(this.svgDom&&this.root.isShow()){var s=this.root.getLevel();n.children.forEach(((e,t)=>{e.stroke||(e.stroke=this.colors[t]||ge())})),function n(r){if(r==e.root);else if(r.layout)return;if(r.isExpand){var o=r.getChildren(),a=o.length,h=r.getPosition(),l=r.getBox(),d=r.getLevel();o.length&&o.forEach((function(o){var c=o.direct,u=o.getPosition(),p=o.getBox();let m=r.stroke?r.stroke:o.stroke?o.stroke:ge();if(o.stroke||(o.stroke=m),o._barDom&&(o._barDom.style.backgroundColor=m,o._barDom.style.borderColor=m),d==s)if("minder"==i)if("right"==c)var f={x:h.x+l.width/2,y:h.y+l.height/2},g={x:u.x,y:p.height/2+u.y};else f={x:h.x+l.width/2,y:h.y+l.height/2},g={x:Number.parseInt(u.x+p.width+""),y:Number.parseInt(p.height/2+u.y+"")};else{f={x:h.x+l.width/2,y:h.y+l.height/2};if("right"==c)g={x:u.x,y:p.height/2+u.y};else g={x:u.x+p.width,y:p.height/2+u.y}}else if("right"==c)f={x:h.x+l.width,y:h.y+l.height/2},g={x:u.x,y:p.height/2+u.y};else f={x:h.x,y:h.y+l.height/2},g={x:u.x+p.width,y:p.height/2+u.y};if(d==s)var v=e.svgDom.path();else v=e.svgDom.polyline();if(v.fill("none"),v.stroke({color:m,width:e.lineWidth,linecap:"round",linejoin:"round"}),d==s)if("right"==c){var y=parseInt((f.x+g.x)/2-30+""),A=parseInt(f.y+(g.y-f.y)/1.1+""),x=`M ${f.x} ${f.y} Q ${y} ${A},${g.x} ${g.y} `;v.plot(x)}else{y=parseInt((f.x+g.x)/2+30+""),A=parseInt(f.y+(g.y-f.y)/1.1+""),x=`M ${f.x} ${f.y} Q ${y} ${A},${g.x} ${g.y} `;v.plot(x)}else{var b=g.y{r(e)}))}function r(e){if(e.isExpand){if(e.layout)return void e.layout.createLink();e.children.forEach((e=>{r(e)}))}}}}var xe={mindmap1:Ae,mindmap2:class extends ye{constructor(e,t,i){super(e,t,i),this.firstLevelDis=40,this.levelDis=30,this.nodeDis=10,this.type="minder",this.layoutName="mindmap2"}createLink(){var e=this,t=this.levelDis,i=this.root;if(this.svgDom&&this.svgDom.clear(),this.svgDom&&this.root.isExpand&&this.root.isShow()){var n=this.lineWidth,s=this.rights,r=this.lefts,o=i.getBox(),a=i.getPosition();s.length,r.length,i.children.forEach(((e,t)=>{e.stroke||(e.stroke=this.colors[t]||ge())})),function(){var t=[],h=[];s.forEach((e=>{e.getPosition().y+e.getBox().height/2>o.height/2+a.y?h.push(e):t.push(e)}));var l=t.length,d=h.length,c=parseInt((o.width/2-6)/l+""),u=parseInt((o.width/2-6)/d+"");t.forEach(((t,s)=>{var r=t.getBox(),h=t.getPosition(),l=r.height/2+h.y,d=l-(o.height/2+a.y),u=[a.x+o.width/2+6+c*s,a.y+o.height/2];if(Math.abs(d)>2)var p=[u[0],l-5*d/Math.abs(d)],m=[u[0]+5,l];else p=[u[0],l-d/2],m=[u[0]+Math.abs(d)/2,l];var f=[h.x,l];let g=i.stroke?i.stroke:t.stroke||ge();t.stroke||(t.stroke=g),t._barDom&&(t._barDom.style.backgroundColor=g,t._barDom.style.borderColor=g);var v=e.linePoint([p],n)[0],y=e.linePoint([m],n)[0],A=`M${v[0]} ${v[1]},Q${v[0]} ${y[1]},${y[0]} ${y[1]}`,x=e.svgDom.path().stroke({color:g,width:n+2,linecap:"round",linejoin:"round"});x.plot(A),x.fill("none"),e.svgDom.line(e.linePoint([u,p],n+2)).stroke({color:g,width:n+2,linecap:"round",linejoin:"round"}).fill("none"),e.svgDom.line(e.linePoint([m,f],n+2)).stroke({color:g,width:n+2,linecap:"round",linejoin:"round"}).fill("none")})),h.reverse().forEach(((t,s)=>{var r=t.getBox(),h=t.getPosition(),l=r.height/2+h.y,d=l-(o.height/2+a.y),c=[a.x+o.width/2+6+u*s,a.y+o.height/2];if(Math.abs(d)>2)var p=[c[0],l-5*d/Math.abs(d)],m=[c[0]+5,l];else p=[c[0],l-d/2],m=[c[0]+Math.abs(d)/2,l];var f=[h.x,l];let g=i.stroke?i.stroke:t.stroke||ge();t.stroke||(t.stroke=g),t._barDom&&(t._barDom.style.backgroundColor=g,t._barDom.style.borderColor=g);var v=e.linePoint([p],n)[0],y=e.linePoint([m],n)[0],A=`M${v[0]} ${v[1]},Q${v[0]} ${y[1]},${y[0]} ${y[1]}`,x=e.svgDom.path().stroke({color:g,width:n+2,linecap:"round",linejoin:"round"});x.plot(A),x.fill("none"),e.svgDom.line(e.linePoint([c,p],n+2)).stroke({color:g,width:n+2,linecap:"round",linejoin:"round"}).fill("none"),e.svgDom.line(e.linePoint([m,f],n+2)).stroke({color:g,width:n+2,linecap:"round",linejoin:"round"}).fill("none")}));var p=[],m=[];r.forEach((e=>{e.getPosition().y+e.getBox().height/2>o.height/2+a.y?m.push(e):p.push(e)}));var f=p.length,g=m.length,v=parseInt((o.width/2-12)/f+""),y=parseInt((o.width/2-12)/g+"");p.forEach(((t,s)=>{var r=t.getBox(),h=t.getPosition(),l=r.height/2+h.y,d=l-(o.height/2+a.y),c=[a.x+o.width/2-6-v*s,a.y+o.height/2];if(Math.abs(d)>2)var u=[c[0],l-5*d/Math.abs(d)],p=[c[0]-5,l];else u=[c[0],l-d/2],p=[c[0]-Math.abs(d)/2,l];var m=[h.x+r.width,l];let f=i.stroke?i.stroke:t.stroke||ge();t.stroke||(t.stroke=f),t._barDom&&(t._barDom.style.backgroundColor=f,t._barDom.style.borderColor=f);var g=e.linePoint([u],n)[0],y=e.linePoint([p],n)[0],A=`M${g[0]} ${g[1]},Q${g[0]} ${y[1]},${y[0]} ${y[1]}`,x=e.svgDom.path().stroke({color:f,width:n+2,linecap:"round",linejoin:"round"});x.plot(A),x.fill("none"),e.svgDom.line(e.linePoint([c,u],n+2)).stroke({color:f,width:n+2,linecap:"round",linejoin:"round"}).fill("none"),e.svgDom.line(e.linePoint([p,m],n+2)).stroke({color:f,width:n+2,linecap:"round",linejoin:"round"}).fill("none")})),m.reverse().forEach(((t,s)=>{var r=t.getBox(),h=t.getPosition(),l=r.height/2+h.y,d=l-(o.height/2+a.y),c=[a.x+o.width/2-6-y*s,a.y+o.height/2];if(Math.abs(d)>2)var u=[c[0],l-5*d/Math.abs(d)],p=[c[0]-5,l];else u=[c[0],l-d/2],p=[c[0]-Math.abs(d)/2,l];var m=[h.x+r.width,l];let f=i.stroke?i.stroke:t.stroke||ge();t.stroke||(t.stroke=f),t._barDom&&(t._barDom.style.backgroundColor=f,t._barDom.style.borderColor=f);var g=e.linePoint([u],n)[0],v=e.linePoint([p],n)[0],A=`M${g[0]} ${g[1]},Q${g[0]} ${v[1]},${v[0]} ${v[1]}`,x=e.svgDom.path().stroke({color:f,width:n+2,linecap:"round",linejoin:"round"});x.plot(A),x.fill("none"),e.svgDom.line(e.linePoint([c,u],n+2)).stroke({color:f,width:n+2,linecap:"round",linejoin:"round"}).fill("none"),e.svgDom.line(e.linePoint([p,m],n+2)).stroke({color:f,width:n+2,linecap:"round",linejoin:"round"}).fill("none")}))}(),i.children.forEach(((e,t)=>{h(e),l(e)}))}function h(i){if(!i.layout&&i.isExpand){var s=i.getChildren(),r=s.length,o=i.getPosition(),a=i.getBox();s.length&&s.forEach((function(s){var l=s.direct,d=s.getPosition(),c=s.getBox();let u=i.stroke?i.stroke:s.stroke?s.stroke:ge();if(s.stroke||(s.stroke=u),s._barDom&&(s._barDom.style.backgroundColor=u,s._barDom.style.borderColor=u),"right"==l)var p={x:o.x+a.width,y:o.y+a.height/2},m={x:d.x,y:c.height/2+d.y};else p={x:o.x,y:o.y+a.height/2},m={x:d.x+c.width,y:c.height/2+d.y};if(1==r)var f=[[p.x,p.y],[m.x,m.y]];else{var g=m.y{l(e)}))}}}},mindmap:class extends ve{constructor(e,t,i){super("mindmap"),this.layoutName="mindmap",this.direct="",this.levelDis=50,this.nodeDis=6,this.firstLevelDis=80,this.firstNodeDis=20,this.isCache=!0,this.lefts=[],this.rights=[],this.colors=[],this.lineWidth=2,this.root=e||null,this.mind=(null==e?void 0:e.mindmap)||null,this.direct=t||"mindmap",this.colors=i||[],this.svgDom||(this.svgDom=this.mind.edgeGroup.group()),this.layout()}setDirect(){var e=this,t=this.root.children.length,i=this.root;this.rights=[],this.lefts=[],"right"==this.direct?(this.rights=i.children,this.rights.forEach((e=>{this._setDirect(e,"right")}))):"left"==this.direct?(this.lefts=i.children,this.lefts.forEach((e=>{this._setDirect(e,"left")}))):i.children.forEach((function(i,n){n{this._setDirect(e,t)}))}layout(e,t){e&&(this.root=e),t&&(this.direct=t),this.setDirect(),"right"==this.direct?this.layoutRight():"left"==this.direct?this.layoutLeft():this.layoutMindMap(),this._dolayout(),this._doRefresh(),this.root&&this.root.mindmap.useHandMode?this.createHandDrawLink():this.createLink()}layoutMindMap(){this.layoutRight(),this.layoutLeft()}layoutRight(e,t){var i=e||this.rights,n=t||this.root,s=n.getPosition(),r=n.getBox(),o=n.getLevel();if(0==o)var a=this.firstLevelDis,h=this.firstNodeDis;else a=this.levelDis,h=this.nodeDis;var{disHeight:l,height:d}=this._getNodesHeight(i),c=d/i.length;if(0==o)var u=[parseInt(s.x+r.width+a+""),parseInt(s.y+r.height/2-l/2+"")];else if(1==o)u=[parseInt(s.x+r.width+a+""),parseInt(s.y+r.height/2-l/2-c/2-this.lineWidth/2+"")];else u=[parseInt(s.x+r.width+a+""),parseInt(s.y+r.height-l/2-c/2+"")];i.forEach((e=>{e.setPosition(u[0],u[1]);var t=e.getBox();u[1]+=parseInt(t.height+h+"")})),i.forEach((e=>{e.isExpand&&this.layoutRight(e.children,e)}))}layoutLeft(e,t){var i=e||this.lefts,n=t||this.root,s=n.getPosition(),r=n.getBox(),o=n.getLevel();if(0==o)var a=this.firstLevelDis,h=this.firstNodeDis;else a=this.levelDis,h=this.nodeDis;var{disHeight:l,height:d}=this._getNodesHeight(i),c=d/i.length;if(0==o)var u=[parseInt(s.x-a+""),parseInt(s.y+r.height/2-l/2+"")];else if(1==o)u=[parseInt(s.x-a+""),parseInt(s.y+r.height/2-l/2-c/2-this.lineWidth/2+"")];else u=[parseInt(s.x-a+""),parseInt(s.y+r.height-l/2-c/2+"")];i.forEach((e=>{var t=e.getBox();e.setPosition(parseInt(u[0]-t.width+""),parseInt(u[1]+"")),u[1]+=t.height+h})),i.forEach((e=>{e.isExpand&&this.layoutLeft(e.children,e)}))}_getNodesHeight(e){if(e[0]&&1==e[0].getLevel())var t=this.firstNodeDis;else t=this.nodeDis;var i=0,n=0;return 1==e.length?{disHeight:i=e[0].getBox().height,height:i}:(e.forEach(((s,r)=>{var o=s.getBox().height;i+=o,n+=o,r!=e.length-1&&(i+=t)})),{disHeight:i,height:n})}_doRefresh(){var e=this.root,t=e.getPosition(),i=e.getBox(),n=t.y+i.height/2,s=this.rights,r=this.lefts;if(s.length>=2){var o=s[0],a=s[s.length-1],h=o.getPosition(),l=a.getPosition(),d=a.getBox(),c=l.y+d.height-n,u=n-h.y;if(Math.abs(c)!=Math.abs(u)){var p=Math.abs(Math.abs(c)-Math.abs(u))/2+"";Math.abs(c)>Math.abs(u)?s.forEach((e=>{this.moveNode(e,0,-parseInt(p))})):s.forEach((e=>{this.moveNode(e,0,parseInt(p))}))}}if(r.length>=2){o=r[0],a=r[r.length-1],h=o.getPosition(),l=a.getPosition(),d=a.getBox(),c=l.y+d.height-n,u=n-h.y;if(Math.abs(c)!=Math.abs(u)){p=Math.abs(Math.abs(c)-Math.abs(u))/2+"";Math.abs(c)>Math.abs(u)?r.forEach((e=>{this.moveNode(e,0,-parseInt(p))})):r.forEach((e=>{this.moveNode(e,0,parseInt(p))}))}}}moveNode(e,t,i){e.move(t,i),e&&e.children&&e.children.forEach((e=>{this.moveNode(e,t,i)}))}linePoint(e,t){let i=0;var n;return t%2==1?(i=.5,n=parseInt):n=Math.ceil,e.map((e=>[n(e[0])+i,n(e[1])+i]))}_dolayout(){var e=this,t=this.mind;t.traverseDF((i=>{if(i!=e.root&&i.isExpand){var n=i.getCBox();if(e.isCache&&i.boundingRect)var s=i.boundingRect;else{var r=i.getShowNodeList();r.length&&(s=t.getBoundingRect(r))}if(s){if(i.boundingRect&&e.isCache)var o=s.topDy,a=s.downDy;else o=Math.abs(s.y-n.y),a=Math.abs(s.y+s.height-n.y-n.height),s.topDy=o,s.downDy=a,i.boundingRect=s;e._adjustNode(i,0,o,a)}}}))}_adjustNode(e,t,i,n){if(e){var s=e.direct;if(e&&e!=this.root){var r=e.getSiblings(),o=e.getPosition();r.forEach((e=>{e.direct==s&&(e.getPosition().y>o.y?this.moveNode(e,t,n):this.moveNode(e,t,-i))}))}}}refresh(e,t){this.layout(e,t)}createHandDrawLink(){var e=this;this.svgDom&&this.svgDom.clear();var t=le.svg(this.root.mindmap.draw);if(0!=this.root.getChildren().length){var i=this.levelDis,n=this.root,s=this.lineWidth,r=this.root.getLevel();this.root.children.forEach(((e,t)=>{e.stroke=this.colors[t]||ge()})),function n(o){if(o.isExpand){var a=o.getChildren(),h=o.getPosition(),l=o.getBox();l.height=l.height+s;var d=o.getLevel();a.length&&a.forEach((function(a){var c=a.direct,u=a.getPosition(),p=Object.assign({},a.getBox());p.height=p.height+s;let m=o.stroke?o.stroke:a.stroke?a.stroke:ge();if(a.stroke||(a.stroke=m),a._barDom&&(a._barDom.style.backgroundColor=m,a._barDom.style.borderColor=m),d==r)var f={x:h.x+l.width/2,y:h.y+l.height/2};else f=d==1+r?"right"==c?{x:h.x+l.width,y:h.y+l.height/2}:{x:h.x,y:h.y+l.height/2}:"right"==c?{x:h.x+l.width,y:h.y+l.height}:{x:h.x,y:h.y+l.height};if(d==r)if("right"==c)var g={x:u.x,y:p.height/2+u.y};else g={x:u.x+p.width,y:p.height/2+u.y};else g="right"==c?{x:u.x,y:p.height+u.y}:{x:u.x+p.width,y:p.height+u.y};if(s%2==1)var v=parseInt(f.x+"")-.5,y=parseInt(g.x+"")-.5,A=parseInt(f.y+"")-.5,x=parseInt(g.y+"")-.5;else v=parseInt(f.x+""),A=parseInt(f.y+""),y=parseInt(g.x+""),x=parseInt(g.y+"");if(s%2==1)var b=parseInt(u.x+"")-.5,w=parseInt(u.x+p.width+"")-.5,k=x,C=x;else b=parseInt(u.x+""),k=parseInt(p.height+u.y+""),w=parseInt(u.x+p.width+""),C=parseInt(p.height+u.y+"");if(d==r){var E=`M${v} ${A} C ${parseInt(f.x+"")+(g.x-f.x)/9} ${parseInt(f.y+"")+(g.y-f.y)/9*8}, ${parseInt(f.x+(g.x-f.x)/9*8+"")} ${parseInt(g.y+"")}, ${y} ${x}`,D=t.path(E,{stroke:m,strokeWidth:s+1,fill:"none"});e.svgDom.node.appendChild(D)}else{var N={x:f.x+i/2,y:f.y},I={x:f.x+i/2,y:g.y};"left"==c&&(N.x=f.x-i/2,I.x=f.x-i/2),N.x=parseInt(N.x+""),N.y=parseInt(N.y+""),I.x=parseInt(I.x+""),I.y=parseInt(I.y+"");var S=`M${v} ${A} C${N.x} ${N.y}, ${I.x} ${I.y}, ${y} ${x}`,B=t.path(S,{stroke:m,strokeWidth:d==r?s+1:s,fill:"none",roughness:.4});D=t.line(b-1,k,w+1,C,{stroke:m,strokeWidth:d==r?s+1:s,fill:"none",roughness:.8});e.svgDom.node.appendChild(D),e.svgDom.node.appendChild(B)}n(a)}))}}(n)}}createLink(){var e=this;if(this.svgDom&&this.svgDom.clear(),0!=this.root.getChildren().length){var t=this.levelDis,i=this.root,n=this.lineWidth,s=this.root.getLevel();this.root.children.forEach(((e,t)=>{e.stroke=this.colors[t]||ge()})),function i(r){if(r.isExpand){var o=r.getChildren(),a=r.getPosition(),h=r.getBox();h.height=h.height+n;var l=r.getLevel();o.length&&o.forEach((function(o){var d=o.direct,c=o.getPosition(),u=Object.assign({},o.getBox());u.height=u.height+n;let p=r.stroke?r.stroke:o.stroke?o.stroke:ge();if(o.stroke||(o.stroke=p),o._barDom&&(o._barDom.style.backgroundColor=p,o._barDom.style.borderColor=p),l==s)var m={x:a.x+h.width/2,y:a.y+h.height/2};else m=l==1+s?"right"==d?{x:a.x+h.width,y:a.y+h.height/2}:{x:a.x,y:a.y+h.height/2}:"right"==d?{x:a.x+h.width,y:a.y+h.height}:{x:a.x,y:a.y+h.height};if(l==s)if("right"==d)var f={x:c.x,y:u.height/2+c.y};else f={x:c.x+u.width,y:u.height/2+c.y};else f="right"==d?{x:c.x,y:u.height+c.y}:{x:c.x+u.width,y:u.height+c.y};if(n%2==1)var g=parseInt(m.x+"")-.5,v=parseInt(f.x+"")-.5,y=parseInt(m.y+"")-.5,A=parseInt(f.y+"")-.5;else g=parseInt(m.x+""),y=parseInt(m.y+""),v=parseInt(f.x+""),A=parseInt(f.y+"");if(l==s)var x=e.svgDom.path().stroke({color:p,width:n+1,linecap:"round",linejoin:"round"}).fill("none");else x=e.svgDom.path().stroke({color:p,width:n,linecap:"round",linejoin:"round"}).fill("none");if(n%2==1)var b=parseInt(c.x+"")-.5,w=parseInt(c.x+u.width+"")-.5,k=A,C=A;else b=parseInt(c.x+""),k=parseInt(u.height+c.y+""),w=parseInt(c.x+u.width+""),C=parseInt(u.height+c.y+"");if(l==s){var E=`M${g} ${y} C ${parseInt(m.x+"")+(f.x-m.x)/9} ${parseInt(m.y+"")+(f.y-m.y)/9*8}, ${parseInt(m.x+(f.x-m.x)/9*8+"")} ${parseInt(f.y+"")}, ${v} ${A}`;x.plot(E)}else{e.svgDom.line(b,k,w,C).stroke({color:p,width:n,linecap:"miter",linejoin:"miter"}).fill("none");var D={x:m.x+t/2,y:m.y},N={x:m.x+t/2,y:f.y};"left"==d&&(D.x=m.x-t/2,N.x=m.x-t/2),D.x=parseInt(D.x+""),D.y=parseInt(D.y+""),N.x=parseInt(N.x+""),N.y=parseInt(N.y+"");var I=`M${g} ${y} C ${D.x} ${D.y}, ${N.x} ${N.y}, ${v} ${A}`;x.plot(I)}i(o)}))}}(i)}}},fish:class extends ve{constructor(e,t,i){super("fish"),this.root=null,this.tops=[],this.bottoms=[],this.dis=10,this.levelDis=20,this.firstLevelDis=20,this.layoutName="fish",this.type="fish",this.angle=7*Math.PI/18,this.isCache=!1,this.colors=[],this.fishTail=null,this.stroke="",this.root=e,this.direct=t||"right",this.colors=i||[],this.stroke=ge(),this.svgDom||(this.svgDom=this.root.getMind().edgeGroup.group())}layout(e,t){if(this.direct=t||"right",this.tops=[],this.bottoms=[],this.root=e||this.root,this.root.isExpand){this.svgDom||(this.svgDom=this.root.getMind().edgeGroup.group()),this.root.layout=this,this.root.parent||"induce"==this.root.nodeType||this.root.containEl.classList.add("mm-root");var i=this.root.children.length;this.root.getChildren().forEach(((e,t)=>{t{e.mark="up",e.containEl.classList=[],e.containEl.classList.add("mm-node"),e.containEl.classList.add("mm-node-"+this.direct),e.containEl.classList.add(`mm-${this.layoutName}-node`),e.direct=this.direct,e.isExpand||e.containEl.classList.add("mm-node-collapse"),e.isLeaf()&&!e.containEl.classList.contains("mm-node-leaf")?e.containEl.classList.add("mm-node-leaf"):e.containEl.classList.contains("mm-node-leaf")&&e.containEl.classList.remove("mm-node-leaf")}))):(this.bottoms.push(e),e.getNodeList().forEach((e=>{e.mark="down",e.containEl.classList=[],e.containEl.classList.add("mm-node"),e.containEl.classList.add("mm-node-"+this.direct),e.containEl.classList.add(`mm-${this.layoutName}-node`),e.direct=this.direct,e.isExpand||e.containEl.classList.add("mm-node-collapse"),e.isLeaf()&&!e.containEl.classList.contains("mm-node-leaf")?e.containEl.classList.add("mm-node-leaf"):e.containEl.classList.contains("mm-node-leaf")&&e.containEl.classList.remove("mm-node-leaf")}))),e.containEl.classList.add("mm-node-second"),e.refreshBox()})),"left"==this.direct?this._layoutRight():"right"==this.direct&&this._layoutLeft(),this.root.mindmap.useHandMode?this.createHandDrawLink():this.createLink()}}_layoutLeft(){var e=this,t=this.root,i=t.getMind(),n=t.getBox(),s=t.getPosition(),r=s.y+n.height/2,o=[];this.tops.forEach(((t,i)=>{t.direct="up";var a=t.getCBox();0==i?(t.setPosition(n.width+s.x+40+e.dis/Math.tan(e.angle),r-e.dis-a.height),o=[n.width+s.x+40+e.dis/Math.tan(e.angle)+a.width+e.dis,0]):(t.setPosition(o[0]+e.dis/Math.tan(e.angle),r-e.dis-a.height),o=[o[0]+a.width+e.dis+40,0]),e._layout(t,"top")})),this.bottoms.forEach(((t,i)=>{t.direct="down";var a=t.getBox();if(0==i){var h=n.width+50+(e.dis+a.height)/Math.tan(e.angle)+e.dis;t.setPosition(h+s.x,r+e.dis),o=[h+a.width+e.dis+40,0]}else t.setPosition(o[0]+(e.dis+a.height)/Math.tan(e.angle)+e.dis,r+e.dis),o=[o[0]+a.width+e.dis,0];e._layout(t,"bottom")})),this.tops.forEach(((e,t)=>{if(t>0){var n=i.getBBox(this.tops[t-1]),s=e.getPosition(),r=n.right-s.x+this.dis+40;this.moveNode(e,r,0)}})),this.bottoms.forEach(((e,t)=>{if(t>0){var n=i.getBBox(this.bottoms[t-1]),s=e.getPosition(),r=n.right-s.x+this.dis+40;this.moveNode(e,r,0)}})),this.tops.forEach((e=>{this._updateNodeAssist(e,this.root)})),this.bottoms.forEach((e=>{this._updateNodeAssist(e,this.root)})),this._updateRootAssist()}_layoutRight(){var e=this,t=this.root,i=t.getMind(),n=t.getBox(),s=t.getPosition(),r=s.y+n.height/2,o=[];this.tops.forEach(((t,i)=>{t.direct="up";var n=t.getBox();0==i?(t.setPosition(s.x-n.width-e.dis-e.dis/Math.tan(e.angle)-40,r-e.dis-n.height),o=[s.x-n.width-e.dis-e.dis/Math.tan(e.angle)-40,0]):(t.setPosition(o[0]-n.width-e.dis-e.dis/Math.tan(e.angle)-40,r-e.dis-n.height),o=[o[0]-n.width-e.dis-e.dis/Math.tan(e.angle)-40,0]),e._layout1(t,"top")})),this.bottoms.forEach(((t,i)=>{t.direct="down";var n=t.getBox();if(0==i){var a=s.x-n.width-e.dis-(e.dis+n.height)/Math.tan(e.angle)-40;t.setPosition(a,r+e.dis),o=[a,0]}else t.setPosition(o[0]-n.width-(e.dis+n.height)/Math.tan(e.angle)-e.dis-40,r+e.dis),o=[o[0]-(e.dis+n.height)/Math.tan(e.angle)-e.dis-40,0];e._layout1(t,"bottom")})),this.tops.forEach(((e,t)=>{if(t>0){var n=i.getBBox(this.tops[t-1]),s=e.getPosition(),r=e.getBox(),o=s.x-n.x+this.dis+r.width+40;this.moveNode(e,-o,0)}})),this.bottoms.forEach(((e,t)=>{if(t>0){var n=i.getBBox(this.bottoms[t-1]),s=e.getPosition(),r=e.getBox(),o=s.x-n.x+this.dis+r.width+40;this.moveNode(e,-o,0)}})),this.tops.forEach((e=>{this._updateNodeAssist(e)})),this.bottoms.forEach((e=>{this._updateNodeAssist(e)})),this._updateRootAssist()}_layout(e,t){if(e.isExpand){e.layout&&(e.layout.group&&(e.layout.group.clear(),e.layout.group.remove(),e.layout.group=null),e.layout.svgDom&&(e.layout.svgDom.clear(),e.layout.svgDom.remove(),e.layout.svgDom=null));var i=this,n=e.getMind();if("top"==t){var s=e.getBox(),r=e.getPosition(),o=s.width+r.x+i.dis,a=e.getChildren(),h=0,l=0;a.forEach(((e,d)=>{if(e.isShow()){e.callout&&e.callout.refresh();var c=e.getCBox();if(0==d)l=o+(i.dis+s.height+c.bh)/Math.tan(i.angle),h=r.y-c.height-c.bh-i.dis,e.setPosition(l,h);else{var u=n.getBBox(a[d-1]),p=a[d-1].getCBox(),m=(p.y-u.y+i.dis+c.bh+p.height)/Math.tan(i.angle),f=p.x+m,g=u.y-i.dis-c.height-c.bh;e.setPosition(f,g)}i._updateNodeAssist(e,i.root),i._layout(e,t)}}))}else{s=e.getBox(),r=e.getPosition(),o=s.width+r.x+i.dis,h=0,l=0,a=e.getChildren();e.getChildren().forEach(((e,d)=>{if(e.isShow()){e.callout&&e.callout.refresh();var c=e.getCBox();if(0==d){var u=(i.dis+c.th+c.height)/Math.tan(i.angle);l=o+u,h=r.y+s.height+i.dis+c.th+0,e.setPosition(l,h)}else{var p=n.getBBox(a[d-1]),m=a[d-1].getCBox(),f=(u=(i.dis+c.th+c.height+p.y+p.height-m.y-m.height)/Math.tan(i.angle),m.x+u),g=p.y+p.height+i.dis+c.th;e.setPosition(f,g)}i._updateNodeAssist(e,i.root),i._layout(e,t)}}))}}}_layout1(e,t){if(e.isExpand){e.layout&&(e.layout.group&&(e.layout.group.clear(),e.layout.group.remove(),e.layout.group=null),e.layout.svgDom&&(e.layout.svgDom.clear(),e.layout.svgDom.remove(),e.layout.svgDom=null));var i=this,n=e.getMind(),s=e.getChildren();if("top"==t){var r=e.getBox(),o=(a=e.getPosition()).x-i.dis;s.forEach(((e,h)=>{if(e.isShow()){e.callout&&e.callout.refresh();var l=e.getCBox();if(0==h){var d=o-l.width-(r.height+i.dis+l.bh)/Math.tan(i.angle),c=a.y-l.height-l.bh-i.dis;e.setPosition(d,c)}else{var u=n.getBBox(s[h-1]),p=s[h-1].getBox(),m=(p.y-u.y+i.dis+p.height+l.bh+0)/Math.tan(i.angle),f=p.x+p.width-l.width-m,g=u.y-i.dis-l.height-l.bh-0;e.setPosition(f,g)}i._updateNodeAssist(e,i.root),i._layout1(e,t)}}))}else{var a;r=e.getBox(),o=(a=e.getPosition()).x-i.dis;e.getChildren().forEach(((e,h)=>{if(e.isShow()){e.callout&&e.callout.refresh();var l=e.getCBox();if(0==h){var d=o-l.width-(l.height+i.dis+l.th+0)/Math.tan(i.angle),c=a.y+r.height+i.dis+l.th+0;e.setPosition(d,c)}else{var u=n.getBBox(s[h-1]),p=s[h-1].getBox(),m=u.y+u.height-p.y-p.height,f=(m+i.dis+l.th+0+l.height)/Math.tan(i.angle),g=p.x+p.width-l.width-f,v=p.y+i.dis+m+l.th+0+p.height;e.setPosition(g,v)}i._updateNodeAssist(e,i.root),i._layout1(e,t)}}))}}}adjustNode(e,t){var i=e.getPosition(),n=e.getBBox(),s=e.getParent(),r=s.getPosition(),o=s.getBBox();if("top"==t)var a=r.y-i.y;else a=i.y-r.y-o.height+n.height;for(var h=a/Math.tan(this.angle);s.getLevel()>1;){r=s.getPosition(),s.getSiblings().forEach((e=>{var i=e.getPosition();"top"==t?i.yr.y&&this.moveNode(e,h,a)})),s=s.getParent()}}adjustNode1(e,t){var i=e.getPosition(),n=e.getBBox(),s=e.getParent(),r=s.getPosition(),o=s.getBBox();if("top"==t)var a=r.y-i.y;else a=i.y-r.y-o.height+n.height;for(var h=a/Math.tan(this.angle);s.getLevel()>1;){r=s.getPosition(),s.getSiblings().forEach((e=>{var i=e.getPosition();"top"==t?i.yr.y&&this.moveNode(e,-h,a)})),s=s.getParent()}}createHandDrawLink(){if(this.svgDom&&this.svgDom.clear(),!this.svgDom)return;if(0==this.root.getChildren().length)return;if("left"==this.direct)return void this.createHandDrawLink1();var e=le.svg(this.root.mindmap.draw),t=this;this.dis;var i=this.root.getLevel();function n(s,r){var o=s.getBox(),a=s.getPosition();let h=s.parent.stroke?s.parent.stroke:s.stroke?s.stroke:ge();if(s.stroke||(s.stroke=h),s._barDom&&(s._barDom.style.backgroundColor=h,s._barDom.style.borderColor=h),s.getLevel()==i+1){if("top"==r){var l=[a.x-t.dis/Math.tan(t.angle),parseInt(a.y+o.height+t.dis)],d=[(c=[a.x,a.y+o.height+1])[0]+o.width+1,c[1]];t.svgDom.node.appendChild(e.linearPath(t.linePoint([l,c,d],1),{stroke:h,strokeWidth:1,fill:"none",roughness:.6}))}else if("bottom"==r){var c;l=[a.x-(t.dis+o.height)/Math.tan(t.angle),parseInt(a.y-t.dis)],d=[(c=[a.x,a.y+o.height+1])[0]+o.width+1,c[1]];t.svgDom.node.appendChild(e.linearPath(t.linePoint([l,c,d],1),{stroke:h,strokeWidth:1,fill:"none",roughness:.6}))}}else{var u=s.getParent(),p=u.getPosition(),m=u.getBox();if(s.isLast())var f=[l=[p.x+m.width-1,p.y+m.height+1],[l[0]+t.dis,l[1]],g=[a.x,a.y+o.height+1],d=[g[0]+o.width,g[1]]];else{var g;f=[g=[a.x,a.y+o.height+1],d=[g[0]+o.width,g[1]]]}t.svgDom.node.appendChild(e.linearPath(t.linePoint(f,1),{stroke:h,strokeWidth:1,fill:"none",roughness:.6}))}s.isExpand&&s.getChildren().forEach((e=>{n(e,r)}))}this.root.children.forEach(((e,t)=>{e.stroke||(e.stroke=this.colors[t]||ge())})),this.tops.forEach((e=>{n(e,"top")})),this.bottoms.forEach((e=>{n(e,"bottom")})),this.createHandDrawBone()}createLink(){if(this.svgDom&&this.svgDom.clear(),!this.svgDom)return;if(0==this.root.getChildren().length)return;if("left"==this.direct)return void this.createLink1();var e=this;this.dis;var t=this.root.getLevel();function i(n,s){var r=n.getBox(),o=n.getPosition();let a=n.parent.stroke?n.parent.stroke:n.stroke?n.stroke:ge();if(n.stroke||(n.stroke=a),n._barDom&&(n._barDom.style.backgroundColor=a,n._barDom.style.borderColor=a),n.getLevel()==t+1){if("top"==s){var h=[o.x-e.dis/Math.tan(e.angle),parseInt(o.y+r.height+e.dis)],l=[(d=[o.x,o.y+r.height+1])[0]+r.width+1,d[1]];(c=e.svgDom.polyline(e.linePoint([h,d,l],2))).fill("none"),c.stroke({color:a,width:2,linecap:"round",linejoin:"round"})}else if("bottom"==s){var d;h=[o.x-(e.dis+r.height)/Math.tan(e.angle),parseInt(o.y-e.dis)],l=[(d=[o.x,o.y+r.height+1])[0]+r.width+1,d[1]];(c=e.svgDom.polyline(e.linePoint([h,d,l],2))).fill("none"),c.stroke({color:a,width:2,linecap:"round",linejoin:"round"})}}else{var c,u=n.getParent(),p=u.getPosition(),m=u.getBox();if(n.isLast())var f=[h=[p.x+m.width-1,p.y+m.height+1],[h[0]+e.dis,h[1]],g=[o.x,o.y+r.height+1],l=[g[0]+r.width,g[1]]];else{var g;f=[g=[o.x,o.y+r.height+1],l=[g[0]+r.width,g[1]]]}(c=e.svgDom.polyline(e.linePoint(f,2))).fill("none"),c.stroke({color:a,width:2,linecap:"round",linejoin:"round"})}n.isExpand&&n.getChildren().forEach((e=>{i(e,s)}))}this.root.children.forEach(((e,t)=>{e.stroke||(e.stroke=this.colors[t]||ge())})),this.tops.forEach((e=>{i(e,"top")})),this.bottoms.forEach((e=>{i(e,"bottom")})),this.creatBone()}createHandDrawLink1(){var e=this;if(this.dis,!this.svgDom)return;if(this.svgDom&&this.svgDom.clear(),0==this.root.getChildren().length)return;var t=le.svg(this.root.mindmap.draw);var i=this.root.getLevel();function n(s,r){var o=s.getBox(),a=s.getPosition();let h=s.parent.stroke?s.parent.stroke:s.stroke?s.stroke:ge();if(s.stroke||(s.stroke=h),s._barDom&&(s._barDom.style.backgroundColor=h,s._barDom.style.borderColor=h),s.getChildren().length,s.getLevel()==i+1){if("top"==r){var l=[a.x+o.width+e.dis/Math.tan(e.angle),parseInt(a.y+o.height+e.dis)],d=[a.x+o.width,a.y+o.height+1],c=[a.x-1,d[1]];e.svgDom.node.appendChild(t.linearPath(e.linePoint([l,d,c],1),{stroke:h,strokeWidth:1,fill:"none",roughness:.6}))}else if("bottom"==r){l=[a.x+o.width+(e.dis+o.height)/Math.tan(e.angle),parseInt(a.y-e.dis)],d=[a.x+o.width,a.y+o.height+1],c=[a.x-1,d[1]];e.svgDom.node.appendChild(t.linearPath(e.linePoint([l,d,c],1),{stroke:h,strokeWidth:1,fill:"none",roughness:.6}))}}else{var u=s.getParent(),p=u.getPosition(),m=u.getBox();if(s.isLast())var f=[l=[p.x+1,p.y+m.height+1],[l[0]-e.dis,l[1]],g=[a.x+o.width,a.y+o.height+1],c=[a.x,g[1]]];else{var g;f=[g=[a.x+o.width,a.y+o.height+1],c=[a.x,g[1]]]}e.svgDom.node.appendChild(t.linearPath(e.linePoint(f,1),{stroke:h,strokeWidth:1,fill:"none",roughness:.6}))}s.isExpand&&s.getChildren().forEach((e=>{n(e,r)}))}this.root.children.forEach(((e,t)=>{e.stroke||(e.stroke=this.colors[t]||ge())})),this.tops.forEach((e=>{n(e,"top")})),this.bottoms.forEach((e=>{n(e,"bottom")})),this.createHandDrawBone1()}createLink1(){var e=this;if(this.dis,!this.svgDom)return;if(this.svgDom&&this.svgDom.clear(),0==this.root.getChildren().length)return;var t=this.root.getLevel();function i(n,s){var r=n.getBox(),o=n.getPosition();let a=n.parent.stroke?n.parent.stroke:n.stroke?n.stroke:ge();if(n.stroke||(n.stroke=a),n._barDom&&(n._barDom.style.backgroundColor=a,n._barDom.style.borderColor=a),n.getChildren().length,n.getLevel()==t+1){if("top"==s){var h=[o.x+r.width+e.dis/Math.tan(e.angle),parseInt(o.y+r.height+e.dis)],l=[o.x+r.width,o.y+r.height+1],d=[o.x-1,l[1]];(c=e.svgDom.polyline(e.linePoint([h,l,d],2))).fill("none"),c.stroke({color:a,width:2,linecap:"round",linejoin:"round"})}else if("bottom"==s){h=[o.x+r.width+(e.dis+r.height)/Math.tan(e.angle),parseInt(o.y-e.dis)],l=[o.x+r.width,o.y+r.height+1],d=[o.x-1,l[1]];(c=e.svgDom.polyline(e.linePoint([h,l,d],2))).fill("none"),c.stroke({color:a,width:2,linecap:"round",linejoin:"round"})}}else{var c,u=n.getParent(),p=u.getPosition(),m=u.getBox();if(n.isLast())var f=[h=[p.x+1,p.y+m.height+1],[h[0]-e.dis,h[1]],g=[o.x+r.width,o.y+r.height+1],d=[o.x,g[1]]];else{var g;f=[g=[o.x+r.width,o.y+r.height+1],d=[o.x,g[1]]]}(c=e.svgDom.polyline(e.linePoint(f,2))).fill("none"),c.stroke({color:a,width:2,linecap:"round",linejoin:"round"})}n.isExpand&&n.getChildren().forEach((e=>{i(e,s)}))}this.root.children.forEach(((e,t)=>{e.stroke||(e.stroke=this.colors[t]||ge())})),this.tops.forEach((e=>{i(e,"top")})),this.bottoms.forEach((e=>{i(e,"bottom")})),this.creatBone1()}createHandDrawBone(){var e=this;if(!this.isShow)return;if(!this.svgDom)return;var t=le.svg(this.root.mindmap.draw),i=this.root.getMind(),n=this.root,s=n.getBox(),r=n.getPosition(),o=i.getBoundingRect(n.getShowNodeList());let a=this.stroke;var h=parseInt(r.x+s.width)+.5,l=parseInt(r.y+s.height/2)+.5,d=parseInt(r.x+o.width+30)+.5,c=l;e.svgDom.node.appendChild(t.polygon([[h,l-3],[d,c],[h,l+3]],{stroke:a,strokeWidth:1,fill:a,roughness:.4}));var u=[r.x+o.width+30,l],p=[u[0]+60,u[1]-30],m=[u[0]+60,u[1]+30];e.fishTail=t.polygon([u,p,m],{stroke:a,strokeWidth:1,fill:a,roughness:.6}),e.svgDom.node.appendChild(e.fishTail)}creatBone(){var e=this;if(!this.isShow)return;if(!this.svgDom)return;var t=this.root.getMind(),i=this.root,n=i.getBox(),s=i.getPosition(),r=t.getBoundingRect(i.getShowNodeList());let o=this.root.stroke||this.stroke;this.stroke;var a=parseInt(s.x+n.width),h=parseInt(s.y+n.height/2),l=parseInt(s.x+r.width+30),d=h;e.svgDom.line(a,h,l,d).stroke({color:o,width:2,linecap:"round",linejoin:"round"});var c=[s.x+r.width+30,h],u=[c[0]+60,c[1]-30],p=[c[0]+60,c[1]+30];e.fishTail=e.svgDom.polygon([c,u,p]).fill("lightskyblue").stroke({color:o,width:2,linecap:"round",linejoin:"round"})}createHandDrawBone1(){var e=this;if(!this.svgDom)return;var t=le.svg(this.root.mindmap.draw),i=this.root,n=i.getMind(),s=i.getBox(),r=i.getPosition(),o=n.getBoundingRect(i.getShowNodeList());let a=this.stroke;var h=parseInt(r.x)+.5,l=parseInt(r.y+s.height/2)+.5,d=parseInt(o.x-40)+.5,c=l;e.svgDom.node.appendChild(t.polygon([[h,l-3],[d,c],[h,l+3]],{stroke:a,strokeWidth:1,fill:a,roughness:.4}));var u=[o.x-40,l],p=[u[0]-60,u[1]-30],m=[u[0]-60,u[1]+30];e.fishTail=t.polygon([u,p,m],{stroke:a,strokeWidth:1,fill:a,roughness:.6}),e.svgDom.node.appendChild(e.fishTail)}creatBone1(){var e=this;if(!this.svgDom)return;var t=this.root,i=t.getMind(),n=t.getBox(),s=t.getPosition(),r=i.getBoundingRect(t.getShowNodeList());let o=this.root.stroke||this.stroke;var a=parseInt(s.x),h=parseInt(s.y+n.height/2),l=parseInt(r.x-40),d=h;e.svgDom.line(a,h,l,d).stroke({color:o,width:2,linecap:"round",linejoin:"round"});var c=[r.x-40,h],u=[c[0]-60,c[1]-30],p=[c[0]-60,c[1]+30];e.fishTail=e.svgDom.polygon([c,u,p]).fill("lightskyblue").stroke({color:o,width:2,linecap:"round",linejoin:"round"})}refresh(){this.tops=[],this.bottoms=[],this.layout(this.root,this.direct)}},tree:class extends ve{constructor(e,t,i){super("tree"),this.layoutName="tree",this.direct="down",this.levelDis=20,this.dis=10,this.firstLevel=60,this.firstNodeDis=20,this.isCache=!0,this.lefts=[],this.rights=[],this.colors=[],this.lineWidth=2,this.cache={},this.group=null,this.root=e,"down"!=t&&"up"!=t||(this.direct=t),this.colors=i||[],this.mind=this.root.mindmap,this.group||(this.group=this.mind.edgeGroup.group())}layout(e,t){e&&(this.root=e),this.direct=t&&("down"==t||"up"==t)?t:"down",e.layout=this,this.group||(this.group=this.root.getMind().edgeGroup.group()),this.svgDom=this.group,this.root.isShow()&&(e.children.forEach((e=>{this.setDirect(e)})),this._doLayout(e),this.doLayout(e),this.root.nodeType&&"induce"!=this.root.nodeType&&this.refreshLayout(),this._updateRootAssist()),this.createLink()}setDirect(e){if(e.direct=this.direct,e.containEl){var t=e.containEl.classList.contains("mm-node-second");e.containEl.setAttribute("class",""),e.containEl.classList.add("mm-node"),e.containEl.classList.add("mm-node-"+this.direct),e.belongInduce&&e.containEl.classList.add("mm-node-induce"),e.isLeaf()&&!e.containEl.classList.contains("mm-node-leaf")?e.containEl.classList.add("mm-node-leaf"):e.containEl.classList.contains("mm-node-leaf")&&e.containEl.classList.remove("mm-node-leaf"),0==e.getLevel()&&this.root.nodeType&&"induce"!=this.root.nodeType&&e.containEl.classList.add("mm-root"),1==e.getLevel()&&this.root.nodeType&&"induce"!=this.root.nodeType&&(e.containEl.classList.add("mm-node-second"),e.refreshBox()),t&&e.refreshBox(),e.isExpand||e.containEl.classList.add("mm-node-collapse"),e.isSelect&&e.containEl.classList.add("mm-node-select"),(e===this.root||!e.layout&&e.isExpand)&&e.children.forEach((e=>{this.setDirect(e)}))}}_doLayout(e){var t=this,i=this.levelDis,n=this.dis,s=e.getBox(),r=e.getPosition();0==e.getLevel()&&(i=this.firstLevel,n=this.firstNodeDis);var o=e.getChildren().length-1;let a=0;if(e.getChildren().forEach((function(e,t){let i=e.getBox();a+=i.width,t!=o&&(a+=n)})),"down"==this.direct){let t=r.y+s.height+i,o=r.x+s.width/2-a/2,h=0;e.getChildren().forEach((function(e,i){e.callout&&e.callout.refresh();let s=e.getCBox();var r=t+s.th;0==i?(e.setPosition(o,r),h=o+s.width+n):(e.setPosition(h,r),h=h+s.width+n)}))}else{let t=r.y-i,o=r.x+s.width/2-a/2,h=0;e.getChildren().forEach((function(e,i){e.callout&&e.callout.refresh(),e.wireFrame&&e.wireFrame.refresh();let s=e.getCBox();0==i?(e.setPosition(o,t-s.height-s.bh),h=o+s.width+n):(e.setPosition(h,t-s.height-s.bh),h=h+s.width+n)}))}if("down"==this.direct&&e.layout&&e!=this.root)if("table"!=e.layout.layoutName){e.layout.layout(e,e.layout.direct||""),s=e.getMind().getBBox(e);var h=e.getCBox().th,l=Math.abs(Math.abs(r.y-s.y)-h);this.moveNode(e,0,l),e.boundingRect=null,e.direct="down"}else e.direct="down",e.boundingRect=null;else e.isExpand&&e.getChildren().forEach((function(e,i){t._doLayout(e)}))}doLayout(e){if(e&&e.isExpand){var t=this,i=e.getMind();i.traverseDF((e=>{if(e!=t.root&&e.isShow()){if(e.layout){if(e.layout!=t&&e.getTopLayout()!=t)return}else if(e.getLayout()!=t&&"down"==t.direct)return;e.callout&&e.callout.isShow&&e.callout.refresh();var n={},s=e.parent;if(s){var r=s.wireFrames,o=s.summaries;r.length&&r.forEach((t=>{if(t.node==e&&(t.refreshNode(),t.refresh(),t.data&&t.data.text))if(n[e.getId()])n[e.getId()].rangeNode=n[e.getId()].rangeNode.concat(t.rangeNode.slice()),n[e.getId()].rangeNode.unique();else{var i=t.getTextBox().height,s=t.rangeNode.slice();n[e.getId()]={node:e,wf:t,topDy:i+4,rangeNode:s}}})),o.length&&o.forEach((t=>{t.node==e&&(t.refreshNode(),t.refresh())}))}var a=e.getBox();if(t.isCache&&e.boundingRect)var h=e.boundingRect;else{var l=e.getShowNodeList(),d=[],c=[],u=[],p=[];if(l.forEach((e=>{e.callout&&e.callout.isShow&&-1==u.indexOf(e)&&u.push(e.callout),e.layout&&e.layout.isShow&&-1==p.indexOf(e.layout)&&p.push(e.layout);var t=e.wireFrames;e.summaries.forEach((e=>{e.isShow()&&-1==c.indexOf(e)&&c.push(e)})),t.forEach((e=>{e.isHide||-1==d.indexOf(e)&&d.push(e)}))})),l=l.concat(d).concat(u),c.forEach((e=>{l=l.concat(e.getAllItem())})),l.length){h=i.getBoundingRect(l);p.length&&p.forEach((e=>{if("fish"==e.layoutName&&"down"==t.direct&&("right"==e.direct?e.creatBone():e.creatBone1(),e.fishTail)){var i=e.fishTail.bbox();i.xh.right&&(h.right=i.x+i.width),i.y+i.height>h.bottom&&(h.bottom=i.y+i.height),h.width=h.right-h.x,h.height=h.bottom-h.y}}))}}if(t.isCache&&e.boundingRect)var m=e.boundingRect.leftDx,f=e.boundingRect.rightDx;else{m=Math.abs(h.x-a.x),f=Math.abs(h.right-a.x-a.width);var g={},v={};r&&r.length&&r.forEach((t=>{var i=t.leftNode;if(t.node==e){if(g[i])return;g[i]=!0,m+=6}if(t.endNode&&t.endNode==e){var n=t.rightNode;if(v[n])return;v[n]=!0,f+=6}})),h.leftDx=m,h.rightDx=f,e.boundingRect=h}if(t.adjustNode(e,m,f,0),"top"!==e.direct)for(let e in n)t.adjustNode(n[e].node,0,0,n[e].topDy,n[e]);r&&r.length&&r.forEach((t=>{t.endNode==e&&t.refresh()})),o&&o.length&&o.forEach((t=>{t.endNode==e&&t.refresh()}))}}),e,!1)}}adjustNode(e,t,i,n,s){var r=this;if(s)s.rangeNode.forEach((e=>{"down"==r.direct?r.moveNode(e,0,n):r.moveNode(e,0,-n)}));else if(e&&e!=this.root){var o=e.getPosition();e.getSiblings().forEach((function(e){let n=e.getPosition();if(o.x>n.x){if(0==t)return;r.moveNode(e,-t,0)}else{if(0==i)return;r.moveNode(e,i,0)}}))}}refreshLayout(){var e=this.root,t=e.getPosition(),i=e.getBox(),n=t.x+i.width/2,s=e.getChildren();if(s.length>=2){var r=s[0],o=s[s.length-1],a=r.getPosition(),h=o.getPosition(),l=o.getBox(),d=h.x+l.width-n,c=n-a.x;if(Math.abs(d)!=Math.abs(c)){var u=Math.abs(Math.abs(d)-Math.abs(c))/2;Math.abs(d)>Math.abs(c)?s.forEach((e=>{this.moveNode(e,-u,0)})):s.forEach((e=>{this.moveNode(e,u,0)}))}}}createLink(){"down"==this.direct?this.createDownLink():this.createUpLink()}createDownLink(){var e=this,t=this.root;if(this.group&&this.group.clear(),0==this.root.getChildren().length)return;if(!this.group||!this.root.isShow())return;let i=this.lineWidth;function n(e){if(e.isExpand){if(e.layout)return void e.layout.createLink();e.children.forEach((e=>{n(e)}))}}!function t(n){if((!n.layout||n==e.root)&&n.isExpand){var s=n.getPosition(),r=n.getBox();n==e.root&&(r.height+=1),n.getChildren().forEach((function(o,a){let h=o.getBox(),l=o.getPosition(),d={x:s.x+r.width/2,y:s.y+r.height},c=l.x+h.width/2,u=l.y,p=n.stroke?n.stroke:o.stroke?o.stroke:e.colors[a]||ge();if(o.stroke||(o.stroke=p),o._barDom&&(o._barDom.style.backgroundColor=p,o._barDom.style.borderColor=p),1==n.getChildren().length){if(i%2==1)var m=parseInt(d.x+"")+.5,f=d.y,g=parseInt(c+"")+.5,v=parseInt(u+"")+.5;else m=parseInt(d.x+""),f=d.y,g=parseInt(c+""),v=parseInt(u+"");var y=e.group.line(m,f,g,v).stroke({color:p,width:i,linecap:"round",linejoin:"round"})}else{var A=[s.x+r.width/2,s.y+r.height],x=[l.x+h.width/2,l.y];if(0==n.getLevel())var b=[A[0],A[1]+e.firstLevel/2];else b=[A[0],A[1]+e.levelDis/2];if(l.x+h.width/2>s.x+r.width/2)var w=[x[0]-4,b[1]],k=[x[0],b[1]+4];else w=[x[0]+4,b[1]],k=[x[0],b[1]+4];var C=[A,b,w],E=[k,x];if(C.length>2){(y=e.group.polyline(e.linePoint(C,i))).fill("none"),y.stroke({color:p,width:i,linecap:"round",linejoin:"round"});var D=e.linePoint([k],i)[0],N=e.linePoint([w],i)[0],I=`M${D[0]} ${D[1]},Q${D[0]} ${N[1]},${N[0]} ${N[1]}`,S=e.group.path().stroke({color:p,width:i,linecap:"round",linejoin:"round"});S.plot(I),S.fill("none"),(y=e.group.polyline(e.linePoint(E,i))).fill("none"),y.stroke({color:p,width:i,linecap:"round",linejoin:"round"})}else{(y=e.group.polyline(e.linePoint(C,i))).fill("none"),y.stroke({color:p,width:i,linecap:"round",linejoin:"round"})}}t(o)}))}}(t),t.children.forEach(((e,t)=>{n(e)}))}createUpLink(){var e=this,t=this.root;if(this.group&&this.group.clear(),0==this.root.getChildren().length)return;if(!this.group||!this.root.isShow())return;let i=this.lineWidth;(t=this.root).children.forEach(((e,t)=>{e.stroke||(e.stroke=this.colors[t]||ge())})),function t(n){if(n.layout&&n!=e.root&&n.layout.group&&n.layout.group.clear(),n.isExpand){var s=n.getPosition(),r=n.getBox();n.getLevel(),n.getChildren().forEach((function(o,a){let h=o.getCBox(),l=o.getPosition(),d=parseInt(s.x+r.width/2+""),c=parseInt(s.y+""),u=parseInt(l.x+h.width/2+""),p=parseInt(l.y+h.height+""),m=n.stroke?n.stroke:o.stroke?o.stroke:ge();if(o.stroke||(o.stroke=m),o._barDom&&(o._barDom.style.backgroundColor=m,o._barDom.style.borderColor=m),1==n.getChildren().length){if(i%2==1)var f=parseInt(d+"")+.5,g=parseInt(c+"")+.5,v=parseInt(u+"")+.5,y=parseInt(p+"")+.5;else f=parseInt(d+""),g=parseInt(c+""),v=parseInt(u+""),y=parseInt(p+"");var A=e.group.line(f,g,v,y).stroke({color:m,width:i,linecap:"round",linejoin:"round"})}else{var x=[s.x+r.width/2,s.y],b=[l.x+h.width/2,l.y+h.height],w=[x[0],x[1]-e.levelDis/2];if(o.isFirst()||o.isLast()){if(l.x+h.width/2>s.x+r.width/2)var k=[b[0]-4,w[1]],C=[b[0],w[1]-4];else k=[b[0]+4,w[1]],C=[b[0],w[1]-4];var E=[x,w,k],D=[C,b]}else E=[k=[b[0],w[1]],b];if(E.length>2){(A=e.group.polyline(e.linePoint(E,i))).fill("none"),A.stroke({color:m,width:i,linecap:"round",linejoin:"round"});var N=e.linePoint([C],i)[0],I=e.linePoint([k],i)[0],S=`M${N[0]} ${N[1]},Q${N[0]} ${I[1]},${I[0]} ${I[1]}`,B=e.group.path().stroke({color:m,width:i,linecap:"round",linejoin:"round"});B.plot(S),B.fill("none"),(A=e.group.polyline(e.linePoint(D,i))).fill("none"),A.stroke({color:m,width:i,linecap:"round",linejoin:"round"})}else{(A=e.group.polyline(e.linePoint(E,i))).fill("none"),A.stroke({color:m,width:i,linecap:"round",linejoin:"round"})}}t(o)}))}}(t)}refresh(){var e=this.root;this.layout(e,this.direct),this.createLink()}},multipleTree:class extends ve{constructor(e,t,i){super("multipleTree"),this.mind=null,this.colors=[],this.layoutName="multipleTree",this.type="multipleTree",this.levelDis=20,this.firstLevelDis=40,this.nodeDis=18,this.root=null,this.rootLevel=0,this.rights=[],this.lefts=[],this.isCache=!1,this.name="multipleTree",this.lineWidth=2,this.root=e,this.mind=this.root.mindmap,this.colors=i||[],this.direct=t||"multipleTree",this.svgDom||(this.svgDom=this.mind.edgeGroup.group())}layout(e,t){if(this.rights=[],this.lefts=[],this.root=e||this.root,this.rootLevel=this.root.getLevel(),this.root.layout=this,this.direct=t,this.root.containEl.classList.contains("mm-multipleTree-node")||(this.root.containEl.classList.add("mm-node-down"),this.root.containEl.classList.add("mm-multipleTree-node")),this.svgDom||(this.svgDom=this.root.mindmap.edgeGroup.group()),"right"==this.direct)this.root.children.forEach((e=>{this.rights.push(e),this.setDirect(e,"right")}));else if("left"==this.direct)this.root.children.forEach((e=>{this.lefts.push(e),this.setDirect(e,"left")}));else{var i=this.root.children.length;this.root.children.forEach(((e,t)=>{t{this.setDirect(e,t)}))}}_layoutTow(){this.root.isExpand&&this.root.isShow()&&(this._layoutRight(),this._layoutLeft())}_layoutRight(){var e=this.root.getCBox();this.rights.forEach(((t,i)=>{t.callout&&t.callout.refresh(),this._layoutRightNode(t,i,e,!0,t.getLevel()-1)}))}getParentPos(e){e.getLevel();var t=e.getDomBox();return{x:t.x+t.width/2,y:t.y+t.height}}_layoutRightNode(e,t,i,n,s){var r=this.root.getMind(),o=i.x+i.width/2,a=i.y+i.height;if(0==t){var h=e.getCBox(!0);e.setPosition(o+this.levelDis,a+this.nodeDis+h.th+i.bh)}else{var l=e.getCBox(!0);if(n){let i=this.rights[t-1];if(this.isCache&&i.boundingRect)var d=i.boundingRect;else{d=r.getBBox(i);i.boundingRect=d}var c=i.getPosition();if(i.layout){var{x:u}=this.getParentPos(i.parent);e.setPosition(u+this.levelDis,d.y+d.height+this.nodeDis+l.th)}else e.setPosition(c.x,d.y+d.height+this.nodeDis+l.th)}else{var p=e.parent.children[t-1];let i=p.getPosition();if(this.isCache&&p.boundingRect)d=p.boundingRect;else{d=r.getBBox(p);p.boundingRect=d}if(p.layout){var{x:u}=this.getParentPos(p.parent);e.setPosition(u+this.levelDis,d.y+d.height+this.nodeDis+l.th)}else e.setPosition(i.x,d.y+d.height+this.nodeDis+l.th)}}if(e.layout){if("table"!=e.layout.layoutName){e.layout.layout(e,e.layout.direct||"");let t=e.getPosition();i=r.getBBox(e);e.boundingRect=i;var m=Math.abs(t.x-i.x);if(h)var f=Math.abs(t.y-i.y)-h.th;else f=Math.abs(t.y-i.y);return this.moveNode(e,m,f),e.direct="right",void this._updateNodeAssist(e)}return e.boundingRect=null,e.direct="right",void this._updateNodeAssist(e)}if(this._updateNodeAssist(e),e.isExpand){var g=e.getCBox(!0);e.children.forEach(((e,t)=>{e.callout&&e.callout.refresh(),this._layoutRightNode(e,t,g)}))}}_layoutLeft(){var e=this.root.getCBox();this.lefts.forEach(((t,i)=>{t.callout&&t.callout.refresh(),this._layoutLeftNode(t,i,e,!0,t.getLevel()-1)}))}_layoutLeftNode(e,t,i,n,s){var r=this.root.getMind(),o=i.x+i.width/2,a=i.y+i.height,{width:h,th:l}=e.getCBox(!0);if(0==t){var d=0;s==this.rootLevel&&(d=20),e.setPosition(o-h-this.levelDis,a+this.nodeDis+d+l+i.bh)}else{var c=e.getCBox(!0);if(n){var u=this.lefts[t-1];if(this.isCache&&u.boundingRect)var p=u.boundingRect;else{p=r.getBBox(u);u.boundingRect=p}if(u.layout){var{x:m}=this.getParentPos(u.parent);e.setPosition(m-this.levelDis-h,p.y+p.height+this.nodeDis+c.th)}else{var f=u.getCBox(!0);e.setPosition(f.x+f.width-h,p.y+p.height+this.nodeDis+c.th)}}else{let i=e.parent.children[t-1];p=r.getBBox(i);if(this.isCache&&i.boundingRect)p=i.boundingRect;else{p=r.getBBox(i);i.boundingRect=p}if(i.layout){var{x:m}=this.getParentPos(i.parent);e.setPosition(m-this.levelDis-h,p.y+p.height+this.nodeDis+c.th)}else{let t=i.getCBox(!0);e.setPosition(t.x+t.width-h,p.y+p.height+this.nodeDis+c.th)}}}if(e.layout){if("table"!=e.layout.layoutName){e.layout.layout(e,e.layout.direct||"");var g=e.getPosition(),v=(i=r.getBBox(e),Math.abs(g.x+h-i.x-i.width)),y=Math.abs(g.y-i.y)-l;return this.moveNode(e,-v,y),e.direct="left",void this._updateNodeAssist(e)}g=e.getPosition(),i=r.getBBox(e),v=Math.abs(g.x+h-i.x-i.width),y=Math.abs(g.y-i.y)-l;return this.moveNode(e,-v,y),e.direct="left",e.boundingRect=null,void this._updateNodeAssist(e)}if(this._updateNodeAssist(e),e.isExpand){var A=e.getCBox(!0);e.children.forEach(((e,t)=>{e.callout&&e.callout.refresh(),this._layoutLeftNode(e,t,A)}))}}createLink(){var e=this;if(this.svgDom&&this.svgDom.clear(),this.svgDom&&this.root.isShow()&&0!=this.root.getChildren().length){var t=this.lineWidth;ge(),this.root.children.forEach(((e,t)=>{e.stroke||(e.stroke=this.colors[t]||ge())})),function i(n){if(n.isExpand){var s=Object.assign({},n.getBox());n!=e.root&&(s.height+=1);var r=[s.x+s.width/2,s.y+s.height];n.children.forEach((s=>{var o=Object.assign({},s.getBox());o.height+=1;var a=n.stroke?n.stroke:s.stroke?s.stroke:ge();if(s.stroke||(s.stroke=a),s._barDom&&(s._barDom.style.backgroundColor=a,s._barDom.style.borderColor=a),"right"==s.direct)var h=e.linePoint([[r[0],o.y+o.height-6]],t)[0],l=e.linePoint([[o.x+o.width,o.y+o.height]],t)[0],d=e.linePoint([[h[0]+6,l[1]]],t)[0],c=`M${h[0]} ${h[1]},Q${h[0]} ${h[1]+6},${d[0]} ${d[1]}`;else h=e.linePoint([[r[0],o.y+o.height-6]],t)[0],l=e.linePoint([[o.x,o.y+o.height]],t)[0],d=e.linePoint([[h[0]-6,l[1]]],t)[0],c=`M${h[0]} ${h[1]},Q${h[0]} ${h[1]+6},${d[0]} ${d[1]} `;var u=e.svgDom.path().stroke({color:a,width:t,linecap:"round",linejoin:"round"});u.plot(c),u.fill("none");var p=e.svgDom.line(e.linePoint([r,h],t));p.fill("none"),p.stroke({color:a,width:t,linecap:"round",linejoin:"round"});var m=e.svgDom.line(e.linePoint([d,l],t));m.fill("none"),m.stroke({color:a,width:t,linecap:"round",linejoin:"round"}),s.layout||i(s)}))}}(this.root),this.root.children.forEach(((e,t)=>{i(e)}))}function i(e){if(e.isExpand){if(e.layout)return void e.layout.createLink();e.children.forEach((e=>{i(e)}))}}}refresh(){this.layout(this.root,this.direct),this.createLink()}},vertical:class extends ve{constructor(e,t,i){if(super("vertical"),this.layoutName="vertical",this.type="vertical",this.dis=40,this.direct="vertical",this.isCache=!0,this.root=null,this.colors=[],this.svgDom=null,this.root=e,this.direct=t||"vertical",this.colors=i||[],!e.stroke){var n=ge();e.data.stroke=n,e.stroke=n}}layout(e,t){this.direct=t||"vertical",this.root=e||this.root,this.root.parent||this.root.containEl.classList.contains("mm-root")||this.root.containEl.classList.add("mm-root"),this.svgDom||(this.svgDom=this.root.getMind().edgeGroup.group()),this.root.layout=this,this._layout(this.root,this.direct),this._updateRootAssist(),this.createLink()}_layout(e,t){var i=this;this.root=e,this.direct=t||"vertical";var n=this.root.mindmap,s=this.root.getPosition(),r=this.root.getBox(),o=s.x+r.width/2,a=s.y+r.height;this.root.isExpand&&(this.root.children.forEach(((e,t)=>{var s="right";t%2==0&&(s="left");var r;if(e.stroke)var h=e.stroke;else h=this.colors[t]||ge(),e.data.stroke=h,e.stroke=h;r=new Array(100).fill(h),!e.layout&&(e.layout=new Ae(e,s,r)),e.layout.root=e;var l=e.getBox();if(0==t)e.setPosition(o-l.width/2,a+this.dis);else{var d=this.root.children[t-1],c=n.getBBox(d);e.boundingRect=c;var u=c.bottom;e.setPosition(o-l.width/2,u+this.dis)}e.layout.layout(e,s||this.direct||""),e.callout&&e.callout.refresh();var p=e.getPosition(),m=(l=n.getBBox(e),Math.abs(p.y-l.y));this.moveNode(e,0,m),e.containEl.classList=[],e.containEl.classList.add("mm-node"),e.containEl.classList.add("mm-node-"+s),e.containEl.classList.add("mm-node-second"),e.containEl.classList.add("mm-vertical-node"),e.isLeaf()?e.containEl.classList.contains("mm-node-leaf")||e.containEl.classList.add("mm-node-leaf"):e.containEl.classList.contains("mm-node-leaf")&&e.containEl.classList.remove("mm-node-leaf"),this._updateNodeAssist(e,i.root)})),this._updateNodeAssist(this.root,this.root))}createLink(){var e=this.root.children,t=e.length;if(this.svgDom&&this.svgDom.clear(),!this.svgDom||!this.root.isShow())return;if(0==t)return;let i=this.root.stroke?this.root.stroke:ge();var n=e[t-1];var s=this.root.getPosition(),r=this.root.getCBox();n.getCBox();var o=n.getPosition(),a=s.x+r.width/2,h=a,l=s.y+r.height,d=o.y;this.svgDom.line(a,l,h,d).stroke({color:i,width:2,linecap:"round",linejoin:"round"}),e.forEach((e=>{e.layout.createLink()}))}refresh(){this.layout(this.root,this.direct)}},table:class extends ve{constructor(e,t){super("table"),this.layoutName="table",this.direct="",this.data=null,this.levelDis=50,this.nodeDis=6,this.firstLevelDis=80,this.firstNodeDis=20,this.isCache=!0,this.lefts=[],this.rights=[],this.colors=[],this.lineWidth=2,this.tableDom=null,this.lastNode=null,this.x=0,this.y=0,this.root=e,this.direct=t||"right",this.mind=this.root.getMind();var i=this.getData(e),{x:n,y:s}=e.getPosition();this.x=n,this.y=s,this.initTableDom(),this.initTableNode(i),this.layout()}layout(e,t){var i=document.createElement("table");i.classList.add("mm-table"),i.classList.add("mm-table-bordered"),this.tableDom.innerHTML="",this.tableDom.appendChild(i);var n=this.getMaxlevel(),s=document.createElement("thead"),r=document.createElement("tr");i.appendChild(s),this.root.init(n),this.root.tdDom.setAttribute("colspan",n),r.appendChild(this.root.tdDom),s.appendChild(r);var o=[];this.root.children.forEach((e=>{this.mind.traverseDF((e=>{if(e.init(),e.isLeaf()&&1!=e.getLevel()){var t=document.createElement("tr");e.trDom=t,i.appendChild(t),t.appendChild(e.tdDom),o.push(e),e.tdDom.setAttribute("colspan",n-e.getLevel()+1),e.tdDom.setAttribute("rowspan",1)}}),e)})),o.forEach((e=>{for(var t=e.parent;t&&t!=this.root&&!i.querySelector(`[data-id='${t.data.id}']`);){t.tdDom.setAttribute("colspan",1);var n=t.children[0].trDom;n.insertBefore(t.tdDom,n.firstChild),t.trDom=n;var s=this.getRowspan(t);t.tdDom.setAttribute("rowspan",s),t=t.parent}})),this.root.children.forEach(((e,t)=>{if(!i.querySelector(`[data-id='${e.data.id}']`)){var r=document.createElement("tr");if(r.appendChild(e.tdDom),e.tdDom.setAttribute("colspan",n),e.tdDom.setAttribute("rowspan",1),e.trDom=r,0==t)Di(r,s);else{var o=this.getLastNode(this.root.children[t-1]);o&&Di(r,o.trDom)}}}))}initTableDom(){if(!this.tableDom){var e=document.createElement("div");e.classList.add("mm-table-content"),e.style.position="absolute",e.style.left=this.x+"px",e.style.top=this.y+"px",this.tableDom=e,this.mind.contentEL.appendChild(e)}}initTableNode(e){var t=this;!function e(i,n,s){var r=new ue(i,t.mind);r._tableDom=t.tableDom,n?(t.root=r,r.layout=t):(s.children.push(r),r.parent=s),r.direct=t.direct,t.lastNode=r,i.children&&i.children.length&&i.children.forEach((t=>{e(t,!1,r)}))}(e,!0),this.initTableDom()}getLastNode(e){return function e(t){var i=t.children.length;return i?e(t.children[i-1]):t}(e)}getMaxlevel(e){var t=0;return this.mind.traverseDF((e=>{var i=e.getLevel();te.children&&e.children.length));if(n.length){var s=[i];n.forEach((t=>{var i=e(t);s.push(i)}));var r=0;return s.forEach((e=>{r+=e})),r-n.length}return i}(e)}getData(e){var t=e.getData();return e.getChildren().length&&(t.children=[],e.getChildren().forEach((e=>{t.children.push(this.getData(e))}))),t}createLink(){}refresh(){this.layout()}setPosition(e,t){this.x=e,this.y=t,this.tableDom&&(this.tableDom.style.left=e+"px",this.tableDom.style.top=t+"px")}getBox(){return this.tableDom?{x:this.x,y:this.y,width:this.tableDom.clientWidth,height:this.tableDom.clientHeight}:{x:this.x,y:this.y,width:0,height:0}}}},be=me((function(e,t){!function(t,i){e.exports=t.document?i(t,t.document):function(e){return i(e,e.document)}}("undefined"!=typeof window?window:pe,(function(e,t){var i=(void 0!==this?this:e).SVG=function(e){if(i.supported)return e=new i.Doc(e),i.parser.draw||i.prepare(),e};if(i.ns="http://www.w3.org/2000/svg",i.xmlns="http://www.w3.org/2000/xmlns/",i.xlink="http://www.w3.org/1999/xlink",i.svgjs="http://svgjs.com/svgjs",i.supported=!!t.createElementNS&&!!t.createElementNS(i.ns,"svg").createSVGRect,!i.supported)return!1;i.did=1e3,i.eid=function(e){return"Svgjs"+c(e)+i.did++},i.create=function(e){var i=t.createElementNS(this.ns,e);return i.setAttribute("id",this.eid(e)),i},i.extend=function(){var e,t,n,s;for(t=(e=[].slice.call(arguments)).pop(),s=e.length-1;s>=0;s--)if(e[s])for(n in t)e[s].prototype[n]=t[n];i.Set&&i.Set.inherit&&i.Set.inherit()},i.invent=function(e){var t="function"==typeof e.create?e.create:function(){this.constructor.call(this,i.create(e.create))};return e.inherit&&(t.prototype=new e.inherit),e.extend&&i.extend(t,e.extend),e.construct&&i.extend(e.parent||i.Container,e.construct),t},i.adopt=function(t){return t?t.instance?t.instance:((n="svg"==t.nodeName?t.parentNode instanceof e.SVGElement?new i.Nested:new i.Doc:"linearGradient"==t.nodeName?new i.Gradient("linear"):"radialGradient"==t.nodeName?new i.Gradient("radial"):i[c(t.nodeName)]?new(i[c(t.nodeName)]):new i.Element(t)).type=t.nodeName,n.node=t,t.instance=n,n instanceof i.Doc&&n.namespace().defs(),n.setData(JSON.parse(t.getAttribute("svgjs:data"))||{}),n):null;var n},i.prepare=function(){var e=t.getElementsByTagName("body")[0],n=(e?new i.Doc(e):i.adopt(t.documentElement).nested()).size(2,0);i.parser={body:e||t.documentElement,draw:n.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:n.polyline().node,path:n.path().node,native:i.create("svg")}},i.parser={native:i.create("svg")},t.addEventListener("DOMContentLoaded",(function(){i.parser.draw||i.prepare()}),!1),i.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},i.utils={map:function(e,t){var i,n=e.length,s=[];for(i=0;i1?1:e,new i.Color({r:~~(this.r+(this.destination.r-this.r)*e),g:~~(this.g+(this.destination.g-this.g)*e),b:~~(this.b+(this.destination.b-this.b)*e)})):this}}),i.Color.test=function(e){return e+="",i.regex.isHex.test(e)||i.regex.isRgb.test(e)},i.Color.isRgb=function(e){return e&&"number"==typeof e.r&&"number"==typeof e.g&&"number"==typeof e.b},i.Color.isColor=function(e){return i.Color.isRgb(e)||i.Color.test(e)},i.Array=function(e,t){0==(e=(e||[]).valueOf()).length&&t&&(e=t.valueOf()),this.value=this.parse(e)},i.extend(i.Array,{morph:function(e){if(this.destination=this.parse(e),this.value.length!=this.destination.length){for(var t=this.value[this.value.length-1],i=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(i);for(;this.value.length=0;n--)this.value[n]=[this.value[n][0]+e,this.value[n][1]+t];return this},size:function(e,t){var i,n=this.bbox();for(i=this.value.length-1;i>=0;i--)n.width&&(this.value[i][0]=(this.value[i][0]-n.x)*e/n.width+n.x),n.height&&(this.value[i][1]=(this.value[i][1]-n.y)*t/n.height+n.y);return this},bbox:function(){return i.parser.poly.setAttribute("points",this.toString()),i.parser.poly.getBBox()}});for(var n={M:function(e,t,i){return t.x=i.x=e[0],t.y=i.y=e[1],["M",t.x,t.y]},L:function(e,t){return t.x=e[0],t.y=e[1],["L",e[0],e[1]]},H:function(e,t){return t.x=e[0],["H",e[0]]},V:function(e,t){return t.y=e[0],["V",e[0]]},C:function(e,t){return t.x=e[4],t.y=e[5],["C",e[0],e[1],e[2],e[3],e[4],e[5]]},S:function(e,t){return t.x=e[2],t.y=e[3],["S",e[0],e[1],e[2],e[3]]},Q:function(e,t){return t.x=e[2],t.y=e[3],["Q",e[0],e[1],e[2],e[3]]},T:function(e,t){return t.x=e[0],t.y=e[1],["T",e[0],e[1]]},Z:function(e,t,i){return t.x=i.x,t.y=i.y,["Z"]},A:function(e,t){return t.x=e[5],t.y=e[6],["A",e[0],e[1],e[2],e[3],e[4],e[5],e[6]]}},s="mlhvqtcsaz".split(""),r=0,o=s.length;r=0;s--)"M"==(n=this.value[s][0])||"L"==n||"T"==n?(this.value[s][1]+=e,this.value[s][2]+=t):"H"==n?this.value[s][1]+=e:"V"==n?this.value[s][1]+=t:"C"==n||"S"==n||"Q"==n?(this.value[s][1]+=e,this.value[s][2]+=t,this.value[s][3]+=e,this.value[s][4]+=t,"C"==n&&(this.value[s][5]+=e,this.value[s][6]+=t)):"A"==n&&(this.value[s][6]+=e,this.value[s][7]+=t);return this},size:function(e,t){var i,n,s=this.bbox();for(i=this.value.length-1;i>=0;i--)"M"==(n=this.value[i][0])||"L"==n||"T"==n?(this.value[i][1]=(this.value[i][1]-s.x)*e/s.width+s.x,this.value[i][2]=(this.value[i][2]-s.y)*t/s.height+s.y):"H"==n?this.value[i][1]=(this.value[i][1]-s.x)*e/s.width+s.x:"V"==n?this.value[i][1]=(this.value[i][1]-s.y)*t/s.height+s.y:"C"==n||"S"==n||"Q"==n?(this.value[i][1]=(this.value[i][1]-s.x)*e/s.width+s.x,this.value[i][2]=(this.value[i][2]-s.y)*t/s.height+s.y,this.value[i][3]=(this.value[i][3]-s.x)*e/s.width+s.x,this.value[i][4]=(this.value[i][4]-s.y)*t/s.height+s.y,"C"==n&&(this.value[i][5]=(this.value[i][5]-s.x)*e/s.width+s.x,this.value[i][6]=(this.value[i][6]-s.y)*t/s.height+s.y)):"A"==n&&(this.value[i][1]=this.value[i][1]*e/s.width,this.value[i][2]=this.value[i][2]*t/s.height,this.value[i][6]=(this.value[i][6]-s.x)*e/s.width+s.x,this.value[i][7]=(this.value[i][7]-s.y)*t/s.height+s.y);return this},equalCommands:function(e){var t,n,s;for(e=new i.PathArray(e),s=this.value.length===e.value.length,t=0,n=this.value.length;s&&tl);return r},bbox:function(){return i.parser.path.setAttribute("d",this.toString()),i.parser.path.getBBox()}}),i.Number=i.invent({create:function(e,t){this.value=0,this.unit=t||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(t=e.match(i.regex.numberAndUnit))&&(this.value=parseFloat(t[1]),"%"==t[5]?this.value/=100:"s"==t[5]&&(this.value*=1e3),this.unit=t[5]):e instanceof i.Number&&(this.value=e.valueOf(),this.unit=e.unit)},extend:{toString:function(){return("%"==this.unit?~~(1e8*this.value)/1e6:"s"==this.unit?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(e){return e=new i.Number(e),new i.Number(this+e,this.unit||e.unit)},minus:function(e){return e=new i.Number(e),new i.Number(this-e,this.unit||e.unit)},times:function(e){return e=new i.Number(e),new i.Number(this*e,this.unit||e.unit)},divide:function(e){return e=new i.Number(e),new i.Number(this/e,this.unit||e.unit)},to:function(e){var t=new i.Number(this);return"string"==typeof e&&(t.unit=e),t},morph:function(e){return this.destination=new i.Number(e),e.relative&&(this.destination.value+=this.value),this},at:function(e){return this.destination?new i.Number(this.destination).minus(this).times(e).plus(this):this}}}),i.Element=i.invent({create:function(e){this._stroke=i.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=e)&&(this.type=e.nodeName,this.node.instance=this,this._events=e._events||{},this._stroke=e.getAttribute("stroke")||this._stroke)},extend:{x:function(e){return this.attr("x",e)},y:function(e){return this.attr("y",e)},cx:function(e){return null==e?this.x()+this.width()/2:this.x(e-this.width()/2)},cy:function(e){return null==e?this.y()+this.height()/2:this.y(e-this.height()/2)},move:function(e,t){return this.x(e).y(t)},center:function(e,t){return this.cx(e).cy(t)},width:function(e){return this.attr("width",e)},height:function(e){return this.attr("height",e)},size:function(e,t){var n=p(this,e,t);return this.width(new i.Number(n.width)).height(new i.Number(n.height))},clone:function(e){this.writeDataToDom();var t=v(this.node.cloneNode(!0));return e?e.add(t):this.after(t),t},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(e){return this.after(e).remove(),e},addTo:function(e){return e.put(this)},putIn:function(e){return e.add(this)},id:function(e){return this.attr("id",e)},inside:function(e,t){var i=this.bbox();return e>i.x&&t>i.y&&e/,"").replace(/<\/svg>$/,"");n.innerHTML=""+e.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2>")+"";for(var s=0,r=n.firstChild.childNodes.length;s":function(e){return-Math.cos(e*Math.PI)/2+.5},">":function(e){return Math.sin(e*Math.PI/2)},"<":function(e){return 1-Math.cos(e*Math.PI/2)}},i.morph=function(e){return function(t,n){return new i.MorphObj(t,n).at(e)}},i.Situation=i.invent({create:function(e){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new i.Number(e.duration).valueOf(),this.delay=new i.Number(e.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=e.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),i.FX=i.invent({create:function(e){this._target=e,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(e,t,n){"object"==typeof e&&(t=e.ease,n=e.delay,e=e.duration);var s=new i.Situation({duration:e||1e3,delay:n||0,ease:i.easing[t||"-"]||t});return this.queue(s),this},delay:function(e){var t=new i.Situation({duration:e,delay:0,ease:i.easing["-"]});return this.queue(t)},target:function(e){return e&&e instanceof i.Element?(this._target=e,this):this._target},timeToAbsPos:function(e){return(e-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(e){return this.situation.duration/this._speed*e+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=e.requestAnimationFrame(function(){this.step()}.bind(this))},stopAnimFrame:function(){e.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(e){return("function"==typeof e||e instanceof i.Situation)&&this.situations.push(e),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof i.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var e,t,n,s=this.situation;if(s.init)return this;for(e in s.animations)for(n=this.target()[e](),Array.isArray(n)||(n=[n]),Array.isArray(s.animations[e])||(s.animations[e]=[s.animations[e]]),t=n.length;t--;)s.animations[e][t]instanceof i.Number&&(n[t]=new i.Number(n[t])),s.animations[e][t]=n[t].morph(s.animations[e][t]);for(e in s.attrs)s.attrs[e]=new i.MorphObj(this.target().attr(e),s.attrs[e]);for(e in s.styles)s.styles[e]=new i.MorphObj(this.target().style(e),s.styles[e]);return s.initialTransformation=this.target().matrixify(),s.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(e,t){var i=this.active;return this.active=!1,t&&this.clearQueue(),e&&this.situation&&(!i&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var e=this.situation;this.stop(),this.situation=e,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return!0===this.situation.loops&&(this.situation.loops=this.situation.loop+1),"number"==typeof this.situation.loops?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(e,t){var i=this.situation.duration/this._speed;return this.absPos=e,t||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*i,this.situation.finish=this.situation.start+i,this.step(!0)},speed:function(e){return 0===e?this.pause():e?(this._speed=e,this.at(this.absPos,!0)):this._speed},loop:function(e,t){var i=this.last();return i.loops=null==e||e,i.loop=0,t&&(i.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(e){var t=this.last();return t.reversed=void 0===e?!t.reversed:e,this},progress:function(e){return e?this.situation.ease(this.pos):this.pos},after:function(e){var t=this.last();return this.target().on("finished.fx",(function i(n){n.detail.situation==t&&(e.call(this,t),this.off("finished.fx",i))})),this._callStart()},during:function(e){var t=this.last(),n=function(n){n.detail.situation==t&&e.call(this,n.detail.pos,i.morph(n.detail.pos),n.detail.eased,t)};return this.target().off("during.fx",n).on("during.fx",n),this.after((function(){this.off("during.fx",n)})),this._callStart()},afterAll:function(e){var t=function t(i){e.call(this),this.off("allfinished.fx",t)};return this.target().off("allfinished.fx",t).on("allfinished.fx",t),this._callStart()},duringAll:function(e){var t=function(t){e.call(this,t.detail.pos,i.morph(t.detail.pos),t.detail.eased,t.detail.situation)};return this.target().off("during.fx",t).on("during.fx",t),this.afterAll((function(){this.off("during.fx",t)})),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(e,t,i){return this.last()[i||"animations"][e]=t,this._callStart()},step:function(e){var t,i,n;(e||(this.absPos=this.timeToAbsPos(+new Date)),!1!==this.situation.loops)?(t=Math.max(this.absPos,0),i=Math.floor(t),!0===this.situation.loops||ithis.lastPos&&r<=s&&(this.situation.once[r].call(this.target(),this.pos,s),delete this.situation.once[r]);return this.active&&this.target().fire("during",{pos:this.pos,eased:s,fx:this,situation:this.situation}),this.situation?(this.eachAt(),1==this.pos&&!this.situation.reversed||this.situation.reversed&&0==this.pos?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=s,this):this},eachAt:function(){var e,t,n,s=this,r=this.target(),o=this.situation;for(e in o.animations)n=[].concat(o.animations[e]).map((function(e){return"string"!=typeof e&&e.at?e.at(o.ease(s.pos),s.pos):e})),r[e].apply(r,n);for(e in o.attrs)n=[e].concat(o.attrs[e]).map((function(e){return"string"!=typeof e&&e.at?e.at(o.ease(s.pos),s.pos):e})),r.attr.apply(r,n);for(e in o.styles)n=[e].concat(o.styles[e]).map((function(e){return"string"!=typeof e&&e.at?e.at(o.ease(s.pos),s.pos):e})),r.style.apply(r,n);if(o.transforms.length){for(n=o.initialTransformation,e=0,t=o.transforms.length;e=0;--t)this[x[t]]=null!=e[x[t]]?e[x[t]]:n[x[t]]},extend:{extract:function(){var e=m(this,0,1),t=m(this,1,0),n=180/Math.PI*Math.atan2(e.y,e.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(n*Math.PI/180)+this.f*Math.sin(n*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(n*Math.PI/180)+this.e*Math.sin(-n*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-n,skewY:180/Math.PI*Math.atan2(t.y,t.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:n,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new i.Matrix(this)}},clone:function(){return new i.Matrix(this)},morph:function(e){return this.destination=new i.Matrix(e),this},at:function(e){return this.destination?new i.Matrix({a:this.a+(this.destination.a-this.a)*e,b:this.b+(this.destination.b-this.b)*e,c:this.c+(this.destination.c-this.c)*e,d:this.d+(this.destination.d-this.d)*e,e:this.e+(this.destination.e-this.e)*e,f:this.f+(this.destination.f-this.f)*e}):this},multiply:function(e){return new i.Matrix(this.native().multiply(function(e){e instanceof i.Matrix||(e=new i.Matrix(e));return e}(e).native()))},inverse:function(){return new i.Matrix(this.native().inverse())},translate:function(e,t){return new i.Matrix(this.native().translate(e||0,t||0))},scale:function(e,t,n,s){return 1==arguments.length?t=e:3==arguments.length&&(s=n,n=t,t=e),this.around(n,s,new i.Matrix(e,0,0,t,0,0))},rotate:function(e,t,n){return e=i.utils.radians(e),this.around(t,n,new i.Matrix(Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0))},flip:function(e,t){return"x"==e?this.scale(-1,1,t,0):"y"==e?this.scale(1,-1,0,t):this.scale(-1,-1,e,null!=t?t:e)},skew:function(e,t,n,s){return 1==arguments.length?t=e:3==arguments.length&&(s=n,n=t,t=e),e=i.utils.radians(e),t=i.utils.radians(t),this.around(n,s,new i.Matrix(1,Math.tan(t),Math.tan(e),1,0,0))},skewX:function(e,t,i){return this.skew(e,0,t,i)},skewY:function(e,t,i){return this.skew(0,e,t,i)},around:function(e,t,n){return this.multiply(new i.Matrix(1,0,0,1,e||0,t||0)).multiply(n).multiply(new i.Matrix(1,0,0,1,-e||0,-t||0))},native:function(){for(var e=i.parser.native.createSVGMatrix(),t=x.length-1;t>=0;t--)e[x[t]]=this[x[t]];return e},toString:function(){return"matrix("+A(this.a)+","+A(this.b)+","+A(this.c)+","+A(this.d)+","+A(this.e)+","+A(this.f)+")"}},parent:i.Element,construct:{ctm:function(){return new i.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof i.Nested){var e=this.rect(1,1),t=e.node.getScreenCTM();return e.remove(),new i.Matrix(t)}return new i.Matrix(this.node.getScreenCTM())}}}),i.Point=i.invent({create:function(e,t){var i;i=Array.isArray(e)?{x:e[0],y:e[1]}:"object"==typeof e?{x:e.x,y:e.y}:null!=e?{x:e,y:null!=t?t:e}:{x:0,y:0},this.x=i.x,this.y=i.y},extend:{clone:function(){return new i.Point(this)},morph:function(e,t){return this.destination=new i.Point(e,t),this},at:function(e){return this.destination?new i.Point({x:this.x+(this.destination.x-this.x)*e,y:this.y+(this.destination.y-this.y)*e}):this},native:function(){var e=i.parser.native.createSVGPoint();return e.x=this.x,e.y=this.y,e},transform:function(e){return new i.Point(this.native().matrixTransform(e.native()))}}}),i.extend(i.Element,{point:function(e,t){return new i.Point(e,t).transform(this.screenCTM().inverse())}}),i.extend(i.Element,{attr:function(e,t,n){if(null==e){for(e={},n=(t=this.node.attributes).length-1;n>=0;n--)e[t[n].nodeName]=i.regex.isNumber.test(t[n].nodeValue)?parseFloat(t[n].nodeValue):t[n].nodeValue;return e}if("object"==typeof e)for(t in e)this.attr(t,e[t]);else if(null===t)this.node.removeAttribute(e);else{if(null==t)return null==(t=this.node.getAttribute(e))?i.defaults.attrs[e]:i.regex.isNumber.test(t)?parseFloat(t):t;"stroke-width"==e?this.attr("stroke",parseFloat(t)>0?this._stroke:null):"stroke"==e&&(this._stroke=t),"fill"!=e&&"stroke"!=e||(i.regex.isImage.test(t)&&(t=this.doc().defs().image(t,0,0)),t instanceof i.Image&&(t=this.doc().defs().pattern(0,0,(function(){this.add(t)})))),"number"==typeof t?t=new i.Number(t):i.Color.isColor(t)?t=new i.Color(t):Array.isArray(t)&&(t=new i.Array(t)),"leading"==e?this.leading&&this.leading(t):"string"==typeof n?this.node.setAttributeNS(n,e,t.toString()):this.node.setAttribute(e,t.toString()),!this.rebuild||"font-size"!=e&&"x"!=e||this.rebuild(e,t)}return this}}),i.extend(i.Element,{transform:function(e,t){var n,s,r=this;if("object"!=typeof e)return n=new i.Matrix(r).extract(),"string"==typeof e?n[e]:n;if(n=new i.Matrix(r),t=!!t||!!e.relative,null!=e.a)n=t?n.multiply(new i.Matrix(e)):new i.Matrix(e);else if(null!=e.rotation)g(e,r),n=t?n.rotate(e.rotation,e.cx,e.cy):n.rotate(e.rotation-n.extract().rotation,e.cx,e.cy);else if(null!=e.scale||null!=e.scaleX||null!=e.scaleY){if(g(e,r),e.scaleX=null!=e.scale?e.scale:null!=e.scaleX?e.scaleX:1,e.scaleY=null!=e.scale?e.scale:null!=e.scaleY?e.scaleY:1,!t){var o=n.extract();e.scaleX=1*e.scaleX/o.scaleX,e.scaleY=1*e.scaleY/o.scaleY}n=n.scale(e.scaleX,e.scaleY,e.cx,e.cy)}else if(null!=e.skew||null!=e.skewX||null!=e.skewY){if(g(e,r),e.skewX=null!=e.skew?e.skew:null!=e.skewX?e.skewX:0,e.skewY=null!=e.skew?e.skew:null!=e.skewY?e.skewY:0,!t){o=n.extract();n=n.multiply((new i.Matrix).skew(o.skewX,o.skewY,e.cx,e.cy).inverse())}n=n.skew(e.skewX,e.skewY,e.cx,e.cy)}else e.flip?("x"==e.flip||"y"==e.flip?e.offset=null==e.offset?r.bbox()["c"+e.flip]:e.offset:null==e.offset?(s=r.bbox(),e.flip=s.cx,e.offset=s.cy):e.flip=e.offset,n=(new i.Matrix).flip(e.flip,e.offset)):null==e.x&&null==e.y||(t?n=n.translate(e.x,e.y):(null!=e.x&&(n.e=e.x),null!=e.y&&(n.f=e.y)));return this.attr("transform",n)}}),i.extend(i.FX,{transform:function(e,t){var n,s,r=this.target();return"object"!=typeof e?(n=new i.Matrix(r).extract(),"string"==typeof e?n[e]:n):(t=!!t||!!e.relative,null!=e.a?n=new i.Matrix(e):null!=e.rotation?(g(e,r),n=new i.Rotate(e.rotation,e.cx,e.cy)):null!=e.scale||null!=e.scaleX||null!=e.scaleY?(g(e,r),e.scaleX=null!=e.scale?e.scale:null!=e.scaleX?e.scaleX:1,e.scaleY=null!=e.scale?e.scale:null!=e.scaleY?e.scaleY:1,n=new i.Scale(e.scaleX,e.scaleY,e.cx,e.cy)):null!=e.skewX||null!=e.skewY?(g(e,r),e.skewX=null!=e.skewX?e.skewX:0,e.skewY=null!=e.skewY?e.skewY:0,n=new i.Skew(e.skewX,e.skewY,e.cx,e.cy)):e.flip?("x"==e.flip||"y"==e.flip?e.offset=null==e.offset?r.bbox()["c"+e.flip]:e.offset:null==e.offset?(s=r.bbox(),e.flip=s.cx,e.offset=s.cy):e.flip=e.offset,n=(new i.Matrix).flip(e.flip,e.offset)):null==e.x&&null==e.y||(n=new i.Translate(e.x,e.y)),n?(n.relative=t,this.last().transforms.push(n),this._callStart()):this)}}),i.extend(i.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(i.regex.transforms).slice(0,-1).map((function(e){var t=e.trim().split("(");return[t[0],t[1].split(i.regex.delimiter).map((function(e){return parseFloat(e)}))]})).reduce((function(e,t){return"matrix"==t[0]?e.multiply(f(t[1])):e[t[0]].apply(e,t[1])}),new i.Matrix)},toParent:function(e){if(this==e)return this;var t=this.screenCTM(),i=e.screenCTM().inverse();return this.addTo(e).untransform().transform(i.multiply(t)),this},toDoc:function(){return this.toParent(this.doc())}}),i.Transformation=i.invent({create:function(e,t){if(arguments.length>1&&"boolean"!=typeof t)return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(e))for(var i=0,n=this.arguments.length;i=0},index:function(e){return[].slice.call(this.node.childNodes).indexOf(e.node)},get:function(e){return i.adopt(this.node.childNodes[e])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(e,t){var n,s,r=this.children();for(n=0,s=r.length;ns/r?this.height/r:this.width/s,this.x=t,this.y=n,this.width=s,this.height=r)}else e="string"==typeof e?e.match(u).map((function(e){return parseFloat(e)})):Array.isArray(e)?e:"object"==typeof e?[e.x,e.y,e.width,e.height]:4==arguments.length?[].slice.call(arguments):l,this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(e,t,n,s){return this.destination=new i.ViewBox(e,t,n,s),this},at:function(e){return this.destination?new i.ViewBox([this.x+(this.destination.x-this.x)*e,this.y+(this.destination.y-this.y)*e,this.width+(this.destination.width-this.width)*e,this.height+(this.destination.height-this.height)*e]):this}},parent:i.Container,construct:{viewbox:function(e,t,n,s){return 0==arguments.length?new i.ViewBox(this):this.attr("viewBox",new i.ViewBox(e,t,n,s))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach((function(e){i.Element.prototype[e]=function(t){return null==t?i.off(this,e):i.on(this,e,t),this}})),i.listenerId=0,i.on=function(e,t,n,s,r){var o=n.bind(s||e),a=e instanceof i.Element?e.node:e;a.instance=a.instance||{_events:{}};var h=a.instance._events;n._svgjsListenerId||(n._svgjsListenerId=++i.listenerId),t.split(i.regex.delimiter).forEach((function(e){var t=e.split(".")[0],i=e.split(".")[1]||"*";h[t]=h[t]||{},h[t][i]=h[t][i]||{},h[t][i][n._svgjsListenerId]=o,a.addEventListener(t,o,r||!1)}))},i.off=function(e,t,n,s){var r=e instanceof i.Element?e.node:e;if(r.instance&&("function"!=typeof n||(n=n._svgjsListenerId))){var o=r.instance._events;(t||"").split(i.regex.delimiter).forEach((function(e){var t,a,h=e&&e.split(".")[0],l=e&&e.split(".")[1];if(n)o[h]&&o[h][l||"*"]&&(r.removeEventListener(h,o[h][l||"*"][n],s||!1),delete o[h][l||"*"][n]);else if(h&&l){if(o[h]&&o[h][l]){for(a in o[h][l])i.off(r,[h,l].join("."),a);delete o[h][l]}}else if(l)for(e in o)for(t in o[e])l===t&&i.off(r,[e,l].join("."));else if(h){if(o[h]){for(t in o[h])i.off(r,[h,t].join("."));delete o[h]}}else{for(e in o)i.off(r,e);r.instance._events={}}}))}},i.extend(i.Element,{on:function(e,t,n,s){return i.on(this,e,t,n,s),this},off:function(e,t){return i.off(this.node,e,t),this},fire:function(t,n){return t instanceof e.Event?this.node.dispatchEvent(t):this.node.dispatchEvent(t=new i.CustomEvent(t,{detail:n,cancelable:!0})),this._event=t,this},event:function(){return this._event}}),i.Defs=i.invent({create:"defs",inherit:i.Container}),i.G=i.invent({create:"g",inherit:i.Container,extend:{x:function(e){return null==e?this.transform("x"):this.transform({x:e-this.x()},!0)},y:function(e){return null==e?this.transform("y"):this.transform({y:e-this.y()},!0)},cx:function(e){return null==e?this.gbox().cx:this.x(e-this.gbox().width/2)},cy:function(e){return null==e?this.gbox().cy:this.y(e-this.gbox().height/2)},gbox:function(){var e=this.bbox(),t=this.transform();return e.x+=t.x,e.x2+=t.x,e.cx+=t.x,e.y+=t.y,e.y2+=t.y,e.cy+=t.y,e}},construct:{group:function(){return this.put(new i.G)}}}),i.Doc=i.invent({create:function(e){e&&("svg"==(e="string"==typeof e?t.getElementById(e):e).nodeName?this.constructor.call(this,e):(this.constructor.call(this,i.create("svg")),e.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:i.Container,extend:{namespace:function(){return this.attr({xmlns:i.ns,version:"1.1"}).attr("xmlns:xlink",i.xlink,i.xmlns).attr("xmlns:svgjs",i.svgjs,i.xmlns)},defs:function(){var e;this._defs||((e=this.node.getElementsByTagName("defs")[0])?this._defs=i.adopt(e):this._defs=new i.Defs,this.node.appendChild(this._defs.node));return this._defs},parent:function(){return this.node.parentNode&&"#document"!=this.node.parentNode.nodeName&&"#document-fragment"!=this.node.parentNode.nodeName?this.node.parentNode:null},spof:function(){var e=this.node.getScreenCTM();return e&&this.style("left",-e.e%1+"px").style("top",-e.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,i.parser.draw.parentNode||this.node.appendChild(i.parser.draw),this},clone:function(e){this.writeDataToDom();var t=this.node,i=v(t.cloneNode(!0));return e?(e.node||e).appendChild(i.node):t.parentNode.insertBefore(i.node,t.nextSibling),i}}}),i.extend(i.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var e=this.position()+1,t=this.parent();return t.removeElement(this).add(this,e),t instanceof i.Doc&&t.node.appendChild(t.defs().node),this},backward:function(){var e=this.position();return e>0&&this.parent().removeElement(this).add(this,e-1),this},front:function(){var e=this.parent();return e.node.appendChild(this.node),e instanceof i.Doc&&e.node.appendChild(e.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(e){e.remove();var t=this.position();return this.parent().add(e,t),this},after:function(e){e.remove();var t=this.position();return this.parent().add(e,t+1),this}}),i.Mask=i.invent({create:function(){this.constructor.call(this,i.create("mask")),this.targets=[]},inherit:i.Container,extend:{remove:function(){for(var e=this.targets.length-1;e>=0;e--)this.targets[e]&&this.targets[e].unmask();return this.targets=[],i.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new i.Mask)}}}),i.extend(i.Element,{maskWith:function(e){return this.masker=e instanceof i.Mask?e:this.parent().mask().add(e),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),i.ClipPath=i.invent({create:function(){this.constructor.call(this,i.create("clipPath")),this.targets=[]},inherit:i.Container,extend:{remove:function(){for(var e=this.targets.length-1;e>=0;e--)this.targets[e]&&this.targets[e].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new i.ClipPath)}}}),i.extend(i.Element,{clipWith:function(e){return this.clipper=e instanceof i.ClipPath?e:this.parent().clip().add(e),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),i.Gradient=i.invent({create:function(e){this.constructor.call(this,i.create(e+"Gradient")),this.type=e},inherit:i.Container,extend:{at:function(e,t,n){return this.put(new i.Stop).update(e,t,n)},update:function(e){return this.clear(),"function"==typeof e&&e.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(e,t,n){return"transform"==e&&(e="gradientTransform"),i.Container.prototype.attr.call(this,e,t,n)}},construct:{gradient:function(e,t){return this.defs().gradient(e,t)}}}),i.extend(i.Gradient,i.FX,{from:function(e,t){return"radial"==(this._target||this).type?this.attr({fx:new i.Number(e),fy:new i.Number(t)}):this.attr({x1:new i.Number(e),y1:new i.Number(t)})},to:function(e,t){return"radial"==(this._target||this).type?this.attr({cx:new i.Number(e),cy:new i.Number(t)}):this.attr({x2:new i.Number(e),y2:new i.Number(t)})}}),i.extend(i.Defs,{gradient:function(e,t){return this.put(new i.Gradient(e)).update(t)}}),i.Stop=i.invent({create:"stop",inherit:i.Element,extend:{update:function(e){return("number"==typeof e||e instanceof i.Number)&&(e={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=e.opacity&&this.attr("stop-opacity",e.opacity),null!=e.color&&this.attr("stop-color",e.color),null!=e.offset&&this.attr("offset",new i.Number(e.offset)),this}}}),i.Pattern=i.invent({create:"pattern",inherit:i.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(e){return this.clear(),"function"==typeof e&&e.call(this,this),this},toString:function(){return this.fill()},attr:function(e,t,n){return"transform"==e&&(e="patternTransform"),i.Container.prototype.attr.call(this,e,t,n)}},construct:{pattern:function(e,t,i){return this.defs().pattern(e,t,i)}}}),i.extend(i.Defs,{pattern:function(e,t,n){return this.put(new i.Pattern).update(n).attr({x:0,y:0,width:e,height:t,patternUnits:"userSpaceOnUse"})}}),i.Shape=i.invent({create:function(e){this.constructor.call(this,e)},inherit:i.Element}),i.Bare=i.invent({create:function(e,t){if(this.constructor.call(this,i.create(e)),t)for(var n in t.prototype)"function"==typeof t.prototype[n]&&(this[n]=t.prototype[n])},inherit:i.Element,extend:{words:function(e){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(t.createTextNode(e)),this}}}),i.extend(i.Parent,{element:function(e,t){return this.put(new i.Bare(e,t))}}),i.Symbol=i.invent({create:"symbol",inherit:i.Container,construct:{symbol:function(){return this.put(new i.Symbol)}}}),i.Use=i.invent({create:"use",inherit:i.Shape,extend:{element:function(e,t){return this.attr("href",(t||"")+"#"+e,i.xlink)}},construct:{use:function(e,t){return this.put(new i.Use).element(e,t)}}}),i.Rect=i.invent({create:"rect",inherit:i.Shape,construct:{rect:function(e,t){return this.put(new i.Rect).size(e,t)}}}),i.Circle=i.invent({create:"circle",inherit:i.Shape,construct:{circle:function(e){return this.put(new i.Circle).rx(new i.Number(e).divide(2)).move(0,0)}}}),i.extend(i.Circle,i.FX,{rx:function(e){return this.attr("r",e)},ry:function(e){return this.rx(e)}}),i.Ellipse=i.invent({create:"ellipse",inherit:i.Shape,construct:{ellipse:function(e,t){return this.put(new i.Ellipse).size(e,t).move(0,0)}}}),i.extend(i.Ellipse,i.Rect,i.FX,{rx:function(e){return this.attr("rx",e)},ry:function(e){return this.attr("ry",e)}}),i.extend(i.Circle,i.Ellipse,{x:function(e){return null==e?this.cx()-this.rx():this.cx(e+this.rx())},y:function(e){return null==e?this.cy()-this.ry():this.cy(e+this.ry())},cx:function(e){return null==e?this.attr("cx"):this.attr("cx",e)},cy:function(e){return null==e?this.attr("cy"):this.attr("cy",e)},width:function(e){return null==e?2*this.rx():this.rx(new i.Number(e).divide(2))},height:function(e){return null==e?2*this.ry():this.ry(new i.Number(e).divide(2))},size:function(e,t){var n=p(this,e,t);return this.rx(new i.Number(n.width).divide(2)).ry(new i.Number(n.height).divide(2))}}),i.Line=i.invent({create:"line",inherit:i.Shape,extend:{array:function(){return new i.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(e,t,n,s){return null==e?this.array():(e=void 0!==t?{x1:e,y1:t,x2:n,y2:s}:new i.PointArray(e).toLine(),this.attr(e))},move:function(e,t){return this.attr(this.array().move(e,t).toLine())},size:function(e,t){var i=p(this,e,t);return this.attr(this.array().size(i.width,i.height).toLine())}},construct:{line:function(e,t,n,s){return i.Line.prototype.plot.apply(this.put(new i.Line),null!=e?[e,t,n,s]:[0,0,0,0])}}}),i.Polyline=i.invent({create:"polyline",inherit:i.Shape,construct:{polyline:function(e){return this.put(new i.Polyline).plot(e||new i.PointArray)}}}),i.Polygon=i.invent({create:"polygon",inherit:i.Shape,construct:{polygon:function(e){return this.put(new i.Polygon).plot(e||new i.PointArray)}}}),i.extend(i.Polyline,i.Polygon,{array:function(){return this._array||(this._array=new i.PointArray(this.attr("points")))},plot:function(e){return null==e?this.array():this.clear().attr("points","string"==typeof e?e:this._array=new i.PointArray(e))},clear:function(){return delete this._array,this},move:function(e,t){return this.attr("points",this.array().move(e,t))},size:function(e,t){var i=p(this,e,t);return this.attr("points",this.array().size(i.width,i.height))}}),i.extend(i.Line,i.Polyline,i.Polygon,{morphArray:i.PointArray,x:function(e){return null==e?this.bbox().x:this.move(e,this.bbox().y)},y:function(e){return null==e?this.bbox().y:this.move(this.bbox().x,e)},width:function(e){var t=this.bbox();return null==e?t.width:this.size(e,t.height)},height:function(e){var t=this.bbox();return null==e?t.height:this.size(t.width,e)}}),i.Path=i.invent({create:"path",inherit:i.Shape,extend:{morphArray:i.PathArray,array:function(){return this._array||(this._array=new i.PathArray(this.attr("d")))},plot:function(e){return null==e?this.array():this.clear().attr("d","string"==typeof e?e:this._array=new i.PathArray(e))},clear:function(){return delete this._array,this},move:function(e,t){return this.attr("d",this.array().move(e,t))},x:function(e){return null==e?this.bbox().x:this.move(e,this.bbox().y)},y:function(e){return null==e?this.bbox().y:this.move(this.bbox().x,e)},size:function(e,t){var i=p(this,e,t);return this.attr("d",this.array().size(i.width,i.height))},width:function(e){return null==e?this.bbox().width:this.size(e,this.bbox().height)},height:function(e){return null==e?this.bbox().height:this.size(this.bbox().width,e)}},construct:{path:function(e){return this.put(new i.Path).plot(e||new i.PathArray)}}}),i.Image=i.invent({create:"image",inherit:i.Shape,extend:{load:function(t){if(!t)return this;var n=this,s=new e.Image;return i.on(s,"load",(function(){i.off(s);var e=n.parent(i.Pattern);null!==e&&(0==n.width()&&0==n.height()&&n.size(s.width,s.height),e&&0==e.width()&&0==e.height()&&e.size(n.width(),n.height()),"function"==typeof n._loaded&&n._loaded.call(n,{width:s.width,height:s.height,ratio:s.width/s.height,url:t}))})),i.on(s,"error",(function(e){i.off(s),"function"==typeof n._error&&n._error.call(n,e)})),this.attr("href",s.src=this.src=t,i.xlink)},loaded:function(e){return this._loaded=e,this},error:function(e){return this._error=e,this}},construct:{image:function(e,t,n){return this.put(new i.Image).load(e).size(t||0,n||t||0)}}}),i.Text=i.invent({create:function(){this.constructor.call(this,i.create("text")),this.dom.leading=new i.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",i.defaults.attrs["font-family"])},inherit:i.Shape,extend:{x:function(e){return null==e?this.attr("x"):this.attr("x",e)},y:function(e){var t=this.attr("y"),i="number"==typeof t?t-this.bbox().y:0;return null==e?"number"==typeof t?t-i:t:this.attr("y","number"==typeof e.valueOf()?e+i:e)},cx:function(e){return null==e?this.bbox().cx:this.x(e-this.bbox().width/2)},cy:function(e){return null==e?this.bbox().cy:this.y(e-this.bbox().height/2)},text:function(e){if(void 0===e){e="";for(var t=this.node.childNodes,n=0,s=t.length;n=0;n--)t.childNodes[n]instanceof e.SVGElement&&v(t.childNodes[n]);return i.adopt(t).id(i.eid(t.nodeName))}function y(e){return null==e.x&&(e.x=0,e.y=0,e.width=0,e.height=0),e.w=e.width,e.h=e.height,e.x2=e.x+e.width,e.y2=e.y+e.height,e.cx=e.x+e.width/2,e.cy=e.y+e.height/2,e}function A(e){return Math.abs(e)>1e-37?e:0}["fill","stroke"].forEach((function(e){var t,n={};n[e]=function(n){if(void 0===n)return this;if("string"==typeof n||i.Color.isRgb(n)||n&&"function"==typeof n.fill)this.attr(e,n);else for(t=a[e].length-1;t>=0;t--)null!=n[a[e][t]]&&this.attr(a.prefix(e,a[e][t]),n[a[e][t]]);return this},i.extend(i.Element,i.FX,n)})),i.extend(i.Element,i.FX,{rotate:function(e,t,i){return this.transform({rotation:e,cx:t,cy:i})},skew:function(e,t,i,n){return 1==arguments.length||3==arguments.length?this.transform({skew:e,cx:t,cy:i}):this.transform({skewX:e,skewY:t,cx:i,cy:n})},scale:function(e,t,i,n){return 1==arguments.length||3==arguments.length?this.transform({scale:e,cx:t,cy:i}):this.transform({scaleX:e,scaleY:t,cx:i,cy:n})},translate:function(e,t){return this.transform({x:e,y:t})},flip:function(e,t){return t="number"==typeof e?e:t,this.transform({flip:e||"both",offset:t})},matrix:function(e){return this.attr("transform",new i.Matrix(6==arguments.length?[].slice.call(arguments):e))},opacity:function(e){return this.attr("opacity",e)},dx:function(e){return this.x(new i.Number(e).plus(this instanceof i.FX?0:this.x()),!0)},dy:function(e){return this.y(new i.Number(e).plus(this instanceof i.FX?0:this.y()),!0)},dmove:function(e,t){return this.dx(e).dy(t)}}),i.extend(i.Rect,i.Ellipse,i.Circle,i.Gradient,i.FX,{radius:function(e,t){var n=(this._target||this).type;return"radial"==n||"circle"==n?this.attr("r",new i.Number(e)):this.rx(e).ry(null==t?e:t)}}),i.extend(i.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(e){return this.node.getPointAtLength(e)}}),i.extend(i.Parent,i.Text,i.Tspan,i.FX,{font:function(e,t){if("object"==typeof e)for(t in e)this.font(t,e[t]);return"leading"==e?this.leading(t):"anchor"==e?this.attr("text-anchor",t):"size"==e||"family"==e||"weight"==e||"stretch"==e||"variant"==e||"style"==e?this.attr("font-"+e,t):this.attr(e,t)}}),i.Set=i.invent({create:function(e){e instanceof i.Set?this.members=e.members.slice():Array.isArray(e)?this.members=e:this.clear()},extend:{add:function(){var e,t,i=[].slice.call(arguments);for(e=0,t=i.length;e-1&&this.members.splice(t,1),this},each:function(e){for(var t=0,i=this.members.length;t=0},index:function(e){return this.members.indexOf(e)},get:function(e){return this.members[e]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members},bbox:function(){if(0==this.members.length)return new i.RBox;var e=this.members[0].rbox(this.members[0].doc());return this.each((function(){e=e.merge(this.rbox(this.doc()))})),e}},construct:{set:function(e){return new i.Set(e)}}}),i.FX.Set=i.invent({create:function(e){this.set=e}}),i.Set.inherit=function(){var e=[];for(var t in i.Shape.prototype)"function"==typeof i.Shape.prototype[t]&&"function"!=typeof i.Set.prototype[t]&&e.push(t);for(var t in e.forEach((function(e){i.Set.prototype[e]=function(){for(var t=0,n=this.members.length;t=0;e--)delete this.memory()[arguments[e]];return this},memory:function(){return this._memory||(this._memory={})}}),i.get=function(e){var n=t.getElementById(function(e){var t=(e||"").toString().match(i.regex.reference);if(t)return t[1]}(e)||e);return i.adopt(n)},i.select=function(e,n){return new i.Set(i.utils.map((n||t).querySelectorAll(e),(function(e){return i.adopt(e)})))},i.extend(i.Parent,{select:function(e){return i.select(e,this.node)}});var x="abcdef".split("");if("function"!=typeof e.CustomEvent){var b=function(e,i){i=i||{bubbles:!1,cancelable:!1,detail:void 0};var n=t.createEvent("CustomEvent");return n.initCustomEvent(e,i.bubbles,i.cancelable,i.detail),n};b.prototype=e.Event.prototype,i.CustomEvent=b}else i.CustomEvent=e.CustomEvent;return function(t){for(var i=0,n=["moz","webkit"],s=0;s * @license MIT * * BUILT: Fri Nov 30 2018 10:01:55 GMT+0100 (GMT+01:00) */class we{constructor(e){this.limit=50,this.undos=[],this.redos=[],this.saveCommand=null,this.limit=e||50}execute(e){this.clearRedo(),e.execute(),this.undos.length>=this.limit&&this.undos.shift(),this.undos.push(e),this.change(e)}undo(){if(this.canUndo()){var e=this.undos.pop();this.redos.push(e),e.undo(),this.change(e)}}canUndo(){return!!this.undos.length}redo(){if(this.canRedo()){var e=this.redos.pop();this.undos.push(e),e.redo(),this.change(e)}}canRedo(){return!!this.redos.length}save(){this.saveCommand=this.undos[this.undos.length-1]}dirty(){return this.saveCommand!=this.undos[this.undos.length-1]}clearRedo(){this.redos=[]}clear(){this.undos=[],this.redos=[],this.saveCommand=null,this.change()}change(e){}}class ke{constructor(e,t,i="#666",n){this.name="induce",this.node=e,this.endNode=e,this.root=t||new ce,this.root.containEl.classList.add("mm-node-induce"),this.root.containEl.classList.add("mm-node-leaf"),this.root.direct=this.node.direct,this.root.box={width:48,height:32},this.root.shapeType="bubble",this.lineType=n||"solid",this.stroke=i,this.lineWidth=2,this.type="right",this.lineDash=[0,0],this.visible=!0,this.isHide=!1,this.id=+new Date,this.node.induce=this,this.root.belongInduce=this,this.root.isRoot=!0,this.root.mind=this.node.getMind(),this.root.nodeType="induce",this.box={width:48,height:32},this.position=[],this.node.mindmap.contentEL.contains(this.root.containEl)||(this.node.mindmap.contentEL.appendChild(this.root.containEl),this.root.refreshBox()),this.refreshItems()}getId(){return this.id}init(){this.group&&this.group.remove(),this.group=this.node.getMind().induceGroup.group(),this.createInduceLine(),this.refreshBox(),this.render()}createInduceLine(){this.pl1&&this.pl1.remove()&&this.pl1,this.pl1=this.group.polyline().stroke({color:`${this.stroke}`,width:`${this.lineWidth}`,dasharray:`${this.lineDash}`,linecap:"round",linejoin:"round"}).fill("none"),this.pl2&&this.pl2.remove()&&this.pl2,this.pl2=this.group.polyline().stroke({color:`${this.stroke}`,width:`${this.lineWidth}`,dasharray:`${this.lineDash}`,linecap:"round",linejoin:"round"}).fill("none")}refreshItems(){var e=this.getInduces(),t=this.listNode;e.forEach((e=>{e.isShow()&&(t=t.concat(e.getAllItem()))})),this.items=t,this.node.isHide&&this.endNode.isHide&&this.hide()}render(){this.adjustType();var e=this.getNodeBox();this.renderInduce(e)}adjustType(){this.node.getMind().getRootByNode(this.node);var e="node-"+this.type;this.root.containEl.classList.contains(e)&&this.root.containEl.classList.remove(e),this.type=this.node.direct,this.direct=this.node.direct;var t="node-"+this.type;this.root.containEl.classList.contains(t)||this.root.containEl.classList.add(t)}getInduces(){var e=this,t=[],i=[],n=[],s=[];if(this.rangeNode&&this.rangeNode.length)this.rangeNode.forEach((e=>{t=t.concat(e.getShowNodeList())}));else{this.rangeNode=[];var r=this.node.parent,o=r.children.indexOf(this.node),a=r.children.indexOf(this.endNode);r.children.forEach(((i,n)=>{n>=o&&n<=a&&(e.rangeNode.push(i),t=t.concat(i.getShowNodeList()))})),e.rangeNode=Ei(e.rangeNode)}return t.forEach((e=>{e.summaries.length&&e.summaries.forEach((e=>{e.isShow()&&i.push(e)})),e.callout&&e.callout.isShow&&t.push(e.callout),e.wireFrames.length&&e.wireFrames.forEach((e=>{e.isHide||n.push(e)})),e.layout&&e.layout.isShow&&s.push(e.layout)})),i=Ei(i),n=Ei(n),this.listNode=t.concat(n),this.groups=Ei(s),i}getNodeBox(){var e=this.items,t=this.groups,i=this.node.getMind().getBoundingRect(e);return t.length&&t.forEach((e=>{if("fish"==e.layoutName&&("right"==e.direct?e.creatBone():e.creatBone1(),e.fishTail)){var t=e.fishTail.bbox();t.xi.right&&(i.right=t.x+t.width),t.y+t.height>i.bottom&&(i.bottom=t.y+t.height),i.width=i.right-i.x,i.height=i.bottom-i.y}})),i}getBoxRect(){return this.node.getMind().getBoundingRect(this.getAllItem())}getBBox(){return this.getNodeBox()}refreshBox(){var e=this.node.getMind();this.box=e.getBoundingRect(this.getAllItem())}getBox(){var e=this.group.gbox();if(this.box)var t=this.box;else{t=this.root.getBox();this.box=t}return e.x{t.isHide||e.push(t)})),i.summaries.length&&i.summaries.forEach((t=>{t.isShow()&&(e=e.concat(t.getAllItem()))})),i.isExpand&&i.children.forEach((e=>{t(e)}))}(this.root),this.allItems=Ei(e)}getAllItem(){return this.refreshAllItems(),this.allItems}hide(){this.isHide=!0,this.group&&this.group.hide(),this.root.hide()}isShow(){return!this.isHide}show(){this.isHide=!1,this.group&&this.group.show(),this.root.show()}doLayout(){if(0!=this.root.getChildren().length){var e=this.root.layout.direct;this.root.layout.layout(this.root,e)}}getWireFrame(){var e=[],t=[];return this.rangeNode&&this.rangeNode.length&&this.rangeNode.forEach((e=>{t=t.concat(e.getShowNodeList())})),t.forEach((t=>{t.wireFrames.length&&t.wireFrames.forEach((i=>{i.isHide||(e=e.concat(t.wireFrames))}))})),Ei(e)}setEndNode(e){this.endNode=e,this.refreshNode(),this.refresh()}refreshNode(){var e=this.node.getShowNodeList();this.endNode&&this.endNode!=this.node&&(e=e.concat(this.endNode.getShowNodeList()));var t=this.node.getMind().getBoundingRect(e);this.topNode=t.topNode,this.bottomNode=t.bottomNode,this.leftNode=t.leftNode,this.rightNode=t.rightNode}renderInduce(e){if(e&&this.pl1){if("solid"==this.lineType?this.lineDash=[0]:this.lineDash=[4,2],"right"==this.type){e.x1=e.x+e.width,this.setPosition(parseInt(e.x1)+5,e.y),this.pl1.plot([[4,0],[12,0],[12,parseInt(e.height/2)],[22,parseInt(e.height/2)]]),this.pl2.plot([[22,parseInt(e.height/2)],[12,parseInt(e.height/2)],[12,parseInt(e.height)],[4,parseInt(e.height)]]);var t=this.root.getBox();this.root.setPosition(e.x1+30,e.y+e.height/2-t.height/2)}else if("left"==this.type){t=this.root.getBox();this.setPosition(parseInt(e.x-t.width-26),parseInt(e.y)),this.pl2.plot([[parseInt(t.width+2),parseInt(e.height/2)],[parseInt(t.width+12),parseInt(e.height/2)],[parseInt(t.width+12),parseInt(e.height)],[parseInt(t.width+18),parseInt(e.height)]]),this.pl1.plot([[parseInt(t.width+2),parseInt(e.height/2)],[parseInt(t.width+12),parseInt(e.height/2)],[parseInt(t.width+12),0],[parseInt(t.width+18),0]]),this.root.setPosition(e.x-t.width-28,parseInt(e.y+(e.height-t.height)/2))}else if("top"==this.type||"up"==this.type){t=this.root.getBox();this.setPosition(parseInt(e.x),parseInt(e.y-t.height-30)),this.pl1.plot([[0,parseInt(t.height+20)],[0,parseInt(t.height+12)],[parseInt(e.width/2),parseInt(t.height+12)],[parseInt(e.width/2),parseInt(t.height+4)]]),this.pl2.plot([[parseInt(e.width/2),parseInt(t.height+4)],[parseInt(e.width/2),parseInt(t.height+12)],[parseInt(e.width),parseInt(t.height+12)],[parseInt(e.width),parseInt(t.height+20)]]),this.root.setPosition(parseInt(e.x+(e.width-t.width)/2),e.y-t.height-25)}else{this.setPosition(parseInt(e.x),parseInt(e.y+e.height+5)),this.pl1.plot([[0,4],[0,12],[parseInt(e.width/2),12],[parseInt(e.width/2),20]]),this.pl2.plot([[parseInt(e.width/2),20],[parseInt(e.width/2),12],[parseInt(e.width),12],[parseInt(e.width),4]]);t=this.root.getBox();this.root.setPosition(e.x+(e.width-t.width)/2,e.y+e.height+26)}this.doLayout()}}getPosition(){return{x:this.position[0],y:this.position[1]}}setPosition(e,t){this.group.attr({transform:`translate(${e},${t})`}),this.position=[e,t]}setText(e){}getText(){return this.induceText}getTextBox(){return this.text.getBox()}refresh(){if(this.node.isShow()&&this.endNode&&this.endNode.isShow())!this.isHide&&this.root.isShow()||(this.show(),function e(t){t.show(),t.isExpand&&t.children.forEach((t=>{e(t)}))}(this.root)),this.render(),this.refreshBox();else{if(this.isHide)return;this.hide(),function e(t){t.hide(),t.isExpand&&t.children.forEach((t=>{e(t)}))}(this.root),this.root.layout&&this.root.layout.group&&(this.root.layout.group.clear(),this.root.layout.group.remove(),this.root.layout.group=null)}}active(){this.status="active",this.root.setStyle("stroke","rgb(247,186,134)")}move(e,t){var i=this.getPosition();this.setPosition(i.x+e,i.y+t),this.box&&(this.box.x+=e,this.box.y+=t)}unactive(){this.status="unactive",this.root.setStyle("stroke",this.color)}isactive(){return"active"==this.status}remove(){this.pl1&&this.pl1.remove(),this.pl2&&this.pl2.remove(),this.pl1=null,this.pl2=null,this.root.layout&&this.root.layout.svgDom&&this.root.layout.svgDom.remove()&&(this.root.layout.svgDom=null),this.root.iNode&&this.root.layout&&this.root.mindmap.contentEL.removeChild(this.root.layout.tableDom)}initEvent(){this.pl1.on("click",(e=>{e.induce=this,this.__zr.trigger("touchInduce",e),this.__zr.trigger("selectInduce",e)})),this.pl2.on("click",(e=>{e.induce=this,this.__zr.trigger("touchInduce",e),this.__zr.trigger("selectInduce",e)}))}getData(){if(this.node&&this.endNode){var e=this.node.parent,t=0,i=0;return e&&(t=e.children.indexOf(this.node),i=e.children.indexOf(this.endNode)),{nodeId:this.node.getId(),endNodeId:this.endNode.getId(),stroke:this.stroke,root:this.root.getId(),lineType:this.lineType,id:this.id,range:`${t},${i}`,type:this.type}}return null}setData(e){this.stroke=e.stroke,this.lineType=e.lineType,this.refresh(),this.pl1.attr({stroke:this.stroke,fill:"none"}),this.pl2.attr({stroke:this.stroke,fill:"none"})}judgeNodePos(e,t){if(!t)return"right";var i=e.getPosition(),n=e.getBox(),s=t.getPosition(),r=t.getBox();return"right"==e.direct?i.x>s.x+r.width?"right":"left":s.x>i.x+n.width?"left":"right"}getChildren(){return this.childrens}addChild(e,t){e._parent=this,"number"==typeof t?this.childrens.splice(t,0,e):this.childrens.push(e)}removeChild(e){var t=this.childrens.indexOf(e);return t>-1&&this.childrens.splice(t,1),t}}class Ce{constructor(e){this.name=e}execute(){}undo(){}redo(){this.execute()}refresh(e,t){var i=e||this.mind;i&&(i.emit("renderEditNode",{node:t}),i.emit("mindMapChange",{node:t}))}updateItems(e){for(var t=e;t;)t.wireFrames.length&&t.wireFrames.forEach((e=>{e.refreshItems(),e.refreshNode()})),t.summaries.length&&t.summaries.forEach((e=>{e.refreshItems(),e.refreshNode()})),t=t.belongInduce?t.belongInduce.node:t.parent}initTable(e){e&&(e.initTable(),setTimeout((()=>{e.mindMapChange()}),0))}}class Ee extends Ce{constructor(e,t,i,n,s){super("addNode"),this.parent=null,this.mind=null,this.index=-1,this.isNotEditNode=!0,this.node=e,this.parent=t,this.mind=i||this.node.mindmap,this.isNotEditNode=n||!1,null!=s&&(this.index=s)}execute(){if(this.index>-1?this.mind.addNode(this.node,this.parent,this.index):this.mind.addNode(this.node,this.parent),"table"!=this.mind._mode){if(this.node.iNode){var e=this.node.getLayout();this.node._tableDom=e.tableDom,e.refresh(),e.root.clearCacheData(),e.root.refreshBox()}this.node.refreshBox(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),setTimeout((()=>{this.isNotEditNode||(this.mind.clearSelectNode(),this.node.select(),this.node.edit()),this.isNotEditNode=!1}),0)}else this.initTable(this.mind)}undo(){var e=this.node.parent;if(this.index=this.mind.removeNode(this.node),"table"!=this.mind._mode){if(e)if(e.iNode)e.getLayout().refresh();this.mind.clearSelectNode(),this.updateItems(e),setTimeout((()=>{this.refresh(this.node.mindmap,e),e&&e.select()}),0)}else this.initTable(this.mind)}}class De extends Ce{constructor(e,t){super("removeNode"),this.parent=null,this.mind=null,this.index=-1,this.node=e,this.parent=this.node.parent||null,this.mind=t||this.node.mindmap,this.isFreeRoot="freeNode"==this.node.nodeType,this.isInduce="induce"==this.node.nodeType,this.isRelateLink="relateLink"==this.node.nodeType}execute(){var e=this;if(this.isFreeRoot)this.mind.removeFreeNode(this.node),this.mind.removeNode(this.node),this.node.iNode&&this.mind.contentEL.removeChild(this.node.layout.tableDom),this.refresh(this.mind);else if(this.isInduce)this.relateNode=this.node.belongInduce.node,this.induce=this.node.belongInduce,this.mind.removeInduce(this.induce),this.relateNode.induce=null,this.mind.removeNode(this.node),this.node.iNode&&this.node.layout&&this.node.layout.tableDom&&this.mind.contentEL.removeChild(this.node.layout.tableDom),this.relateNode.clearCacheData(),this.updateItems(this.relateNode),this.refresh(this.relateNode.mindmap),this.relateNode.mindmap.updateAssist();else if(this.isRelateLink)this.mind.removeRelateLink(this.node.relateLink),this.mind.removeNode(this.node);else{this.node.clearCacheData(),this.node.refreshBox();var t=this.parent.wireFrames.slice()||[],i=this.parent.summaries.slice()||[];if(this.cacheInfo={wfs:[],induces:[]},t.forEach((t=>{if(t.node==t.endNode)t.node==e.node&&(e.mind.removeWireFrame(t),e.cacheInfo.wfs.push({item:t,type:"remove"}));else if(t.rangeNode.indexOf(e.node)>-1)if(t.rangeNode[0]==e.node){e.node.wfs.splice(e.node.wfs.indexOf(t),1);var i=t.rangeNode.slice();t.rangeNode.shift(),t.rangeNode[0].wfs.push(t),e.cacheInfo.wfs.push({item:t,type:"changeRangeNode-start",oldRange:i,newRange:t.rangeNode.slice()})}else if(t.rangeNode[t.rangeNode.length-1]==e.node){i=t.rangeNode.slice();t.rangeNode.pop(),e.cacheInfo.wfs.push({item:t,type:"changeRangeNode-end",oldRange:i,newRange:t.rangeNode.slice()})}else{i=t.rangeNode.slice();var n=t.rangeNode.indexOf(e.node);t.rangeNode.splice(n,1),e.cacheInfo.wfs.push({item:t,type:"changeRangeNode",oldRange:i,newRange:t.rangeNode.slice(),num:n})}})),i.forEach((t=>{if(t.node==t.endNode)t.node==e.node&&(e.mind.removeInduce(t),e.cacheInfo.induces.push({item:t,type:"remove"}),e.mind.removeNode(t.root),t.root.iNode&&t.root.layout&&t.root.layout.tableDom&&e.mind.contentEL.removeChild(t.root.layout.tableDom));else if(t.rangeNode.indexOf(e.node)>-1)if(t.rangeNode[0]==e.node){e.node.induces.splice(e.node.induces.indexOf(t),1);var i=t.rangeNode.slice();t.rangeNode.shift(),t.rangeNode[0].induces.push(t),e.cacheInfo.induces.push({item:t,type:"changeRangeNode-start",oldRange:i,newRange:t.rangeNode.slice()})}else if(t.rangeNode[t.rangeNode.length-1]==e.node){i=t.rangeNode.slice();t.rangeNode.pop(),e.cacheInfo.induces.push({item:t,type:"changeRangeNode-end",oldRange:i,newRange:t.rangeNode.slice()})}else{i=t.rangeNode.slice();var n=t.rangeNode.indexOf(e.node);t.rangeNode.splice(n,1),e.cacheInfo.induces.push({item:t,type:"changeRangeNode",oldRange:i,newRange:t.rangeNode.slice(),num:n})}})),this.node.iNode){var n=this.node.getLayout();n&&n.root&&(n.root.boundingRect=null)}if(this.index=this.mind.removeNode(this.node),"table"==this.node.mindmap._mode)return void this.initTable(this.mind);this.node.iNode&&(this.node.layout?this.node.layout.tableDom&&this.mind.contentEL.removeChild(this.node.layout.tableDom):n.refresh()),this.updateItems(this.parent),this.refresh(this.parent.mindmap,this.parent)}setTimeout((()=>{if(this.parent)if(0==this.index)this.parent.children.length?this.parent.children[0].select():this.parent.select();else{var e=this.parent.children[this.index-1];e?e.select():this.parent.select()}}),0)}undo(){var e=this;if(this.isFreeRoot?(this.mind.addFreeNode(this.node),this.node.iNode&&this.node.layout&&this.node.layout.tableDom&&(this.mind.contentEL.appendChild(this.node.layout.tableDom),this.node.layout.refresh())):this.isInduce?(this.relateNode.clearCacheData(),this.relateNode.induce=this.induce,this.mind.addInduce(this.induce),this.induce.init(),this.node.iNode&&this.node.layout&&(this.mind.contentEL.appendChild(this.node.layout.tableDom),this.node.layout.refresh())):this.isRelateLink?this.mind.addRelateLink(this.node.relateLink):this.mind.addNode(this.node,this.parent,this.index),"table"!=this.mind._mode){if(this.node.iNode){var t=this.node.getLayout();this.node.layout&&this.node.layout.tableDom&&this.mind.contentEL.appendChild(this.node.layout.tableDom),t.refresh()}this.mind.traverseDF((e=>{e.layout&&"table"==e.layout.layoutName&&(this.mind.contentEL.contains(e.layout.tableDom)||this.mind.contentEL.appendChild(e.layout.tableDom)),this.mind._addNodeDom(e)}),this.node),this.node._removeLink&&this.node._removeLink.forEach((e=>{this.mind.addRelateLink(e)})),this.node.clearCacheData(),this.node.refreshBox(),this.cacheInfo&&this.cacheInfo.wfs.forEach((t=>{if("remove"==t.type&&(e.mind.addWireFrame(t.item),t.item.init()),"changeRangeNode-start"==t.type){e.node.wfs.push(t.item);var i=t.item.rangeNode[0];i.wfs.splice(i.wfs.indexOf(t.item),1),t.item.rangeNode=t.oldRange}"changeRangeNode-end"!=t.type&&"changeRangeNode"!=t.type||(t.item.rangeNode=t.oldRange)})),this.cacheInfo&&this.cacheInfo.induces.forEach((t=>{if("remove"==t.type&&(e.mind.addInduce(t.item),t.item.init(),t.item.root.iNode&&t.item.root.layout&&t.item.root.layout.tableDom&&(this.mind.contentEL.contains(t.item.root.layout.tableDom)||this.mind.contentEL.appendChild(t.item.root.layout.tableDom)),this.mind.traverseDF((e=>{this.mind._addNodeDom(e)}),t.item.root)),"changeRangeNode-start"==t.type){e.node.induces.push(t.item);var i=t.item.rangeNode[0];i.induces.splice(i.induces.indexOf(t.item),1),t.item.rangeNode=t.oldRange}"changeRangeNode-end"!=t.type&&"changeRangeNode"!=t.type||(t.item.rangeNode=t.oldRange)})),this.updateItems(this.node),this.mind.clearSelectNode(),this.refresh(this.node.mindmap,this.node),setTimeout((()=>{this.node.select()}),0)}else this.initTable(this.mind)}}class Ne extends Ce{constructor(e,t,i){super("changeNodeText"),this._mode="",this.node=e,this.oldText=t,this.text=i,this.isFirst=!0,this._mode=this.node.mindmap._mode}execute(){var e;this.isFirst||(this.node.setText(this.text),this.node.tNode&&this.node.tNode.setText(this.text)),"table"!=this._mode?(this.node.refreshBox(),this.node.clearCacheData(),"wireFrame"!=this.node.nodeType?this.refresh(this.node.mindmap,this.node):this.refresh(this.node.mindmap,null===(e=this.node.wireFrame)||void 0===e?void 0:e.node)):this.initTable(this.node.mindmap)}undo(){var e;this.isFirst=!1,this.node.setText(this.oldText),this.node.tNode&&this.node.tNode.setText(this.oldText),"table"!=this._mode?(this.node.clearCacheData(),this.node.refreshBox(),"wireFrame"!=this.node.nodeType?this.refresh(this.node.mindmap,this.node):this.refresh(this.node.mindmap,null===(e=this.node.wireFrame)||void 0===e?void 0:e.node)):this.initTable(this.node.mindmap)}}class Ie extends Ce{constructor(e){super("moveNode"),this.data={},this.index=-1,this.data=e,this.data.type.indexOf("child")>-1?(this.node=this.data.node,this.oldParent=this.data.oldParent,this.parent=this.data.parent):(this.node=this.data.node,this.oldParent=this.node.parent,this.dropNode=this.data.dropNode,this.newParent=this.dropNode.parent,this.type=this.data.direct),this._wfs=this.node.wfs,this._summary=this.node.induces}execute(){if(this._wfs&&this._wfs.length){var e=this.parent||this.newParent;this._wfs.forEach((t=>{if(this.oldParent&&this.oldParent.wireFrames){var i=this.oldParent.wireFrames.indexOf(t);i>-1&&(this.oldParent.wireFrames.splice(i,1),-1==e.wireFrames.indexOf(t)&&e.wireFrames.push(t))}}))}if(this._summary&&this._summary.length){e=this.parent||this.newParent;this._summary.forEach((t=>{if(this.oldParent&&this.oldParent.summaries){var i=this.oldParent.summaries.indexOf(t);i>-1&&(this.oldParent.summaries.splice(i,1),-1==e.summaries.indexOf(t)&&e.summaries.push(t))}}))}if(this.node.mindmap.clearSelectNode(),this.data.type.indexOf("child")>-1)this.oldParent&&(this.index=this.oldParent.removeChild(this.node)),this.parent.addChild(this.node),this.node.mindmap.traverseBF((e=>{e.boundingRect=null,e.stroke=""}),this.node),this.updateItems(this.node),this.updateItems(this.oldParent),this.node.clearCacheData(),this.oldParent.clearCacheData(),this.refresh(this.node.mindmap,this.node),this.refresh(this.node.mindmap,this.oldParent),this.node.select();else{this.oldParent&&(this.index=this.oldParent.removeChild(this.node)),this.node.mindmap.traverseBF((e=>{e.boundingRect=null,e.stroke=""}),this.node),this.oldParent.clearCacheData();var t=this.newParent.children.indexOf(this.dropNode);"top"==this.type||"left"==this.type?this.newParent.addChild(this.node,t):this.newParent.addChild(this.node,t+1),this.updateItems(this.node),this.updateItems(this.oldParent),this.node.clearCacheData(),this.refresh(this.node.mindmap,this.node),this.refresh(this.node.mindmap,this.oldParent),this.node.select()}}undo(){if(this._wfs&&this._wfs.length){var e=this.parent||this.newParent;this._wfs.forEach((t=>{if(this.oldParent&&this.oldParent.wireFrames){var i=e.wireFrames.indexOf(t);i>-1&&(e.wireFrames.splice(i,1),-1==this.oldParent.wireFrames.indexOf(t)&&this.oldParent.wireFrames.push(t))}}))}if(this._summary&&this._summary.length){e=this.parent||this.newParent;this._summary.forEach((t=>{if(this.oldParent&&this.oldParent.summaries){var i=e.summaries.indexOf(t);i>-1&&(e.summaries.splice(i,1),-1==this.oldParent.summaries.indexOf(t)&&this.oldParent.summaries.push(t))}}))}this.node.mindmap.clearSelectNode(),this.data.type.indexOf("child")>-1?(this.parent.removeChild(this.node),this.oldParent&&this.oldParent.addChild(this.node,this.index),this.node.mindmap.traverseBF((e=>{e.boundingRect=null,e.stroke=""}),this.node),this.updateItems(this.node),this.updateItems(this.parent),this.node.mindmap.updateAssist(),this.parent.clearCacheData(),this.node.clearCacheData(),this.refresh(this.node.mindmap,this.node),this.refresh(this.node.mindmap,this.parent),this.node.select()):(this.newParent.removeChild(this.node),this.dropNode.clearCacheData(),this.oldParent.addChild(this.node,this.index),this.updateItems(this.node),this.updateItems(this.parent),this.node.mindmap.updateAssist(),this.node.clearCacheData(),this.refresh(this.node.mindmap,this.node),this.refresh(this.node.mindmap,this.parent),this.node.select())}}class Se extends Ce{constructor(e){super("moveNodes"),this.data={},this.index=-1,this._wfs=[],this._summary=[],this.data=e,this.data.type.indexOf("child")>-1?(this.nodes=this.data.nodes,this.oldParent=this.data.oldParent,this.parent=this.data.parent):(this.nodes=this.data.nodes,this.oldParent=this.nodes[0].parent,this.dropNode=this.data.dropNode,this.newParent=this.dropNode.parent,this.type=this.data.direct),this.nodes.forEach((e=>{this._wfs=this._wfs.concat(e.wfs),this._summary=this._summary.concat(e.induces)}))}execute(){if(this._wfs&&this._wfs.length){var e=this.parent||this.newParent;this._wfs.forEach((t=>{if(this.oldParent&&this.oldParent.wireFrames){var i=this.oldParent.wireFrames.indexOf(t);i>-1&&(this.oldParent.wireFrames.splice(i,1),-1==e.wireFrames.indexOf(t)&&e.wireFrames.push(t))}}))}if(this._summary&&this._summary.length){e=this.parent||this.newParent;this._summary.forEach((t=>{if(this.oldParent&&this.oldParent.summaries){var i=this.oldParent.summaries.indexOf(t);i>-1&&(this.oldParent.summaries.splice(i,1),-1==e.summaries.indexOf(t)&&e.summaries.push(t))}}))}if(this.nodes[0].mindmap.clearSelectNode(),this.data.type.indexOf("child")>-1)this.nodes.forEach(((e,t)=>{this.oldParent&&(0==t?this.index=this.oldParent.removeChild(e):this.oldParent.removeChild(e)),this.parent.addChild(e),this.nodes[0].mindmap.traverseBF((e=>{e.boundingRect=null,e.stroke=""}),e),e.clearCacheData(),this.updateItems(e),this.updateItems(this.oldParent)})),this.oldParent.clearCacheData(),this.refresh(this.nodes[0].mindmap,this.nodes[0]),this.refresh(this.nodes[0].mindmap,this.oldParent);else{this.nodes.forEach(((e,t)=>{this.oldParent&&(0==t?this.index=this.oldParent.removeChild(e):this.oldParent.removeChild(e)),this.nodes[0].mindmap.traverseBF((e=>{e.boundingRect=null,e.stroke=""}),e),e.clearCacheData(),this.updateItems(e),this.updateItems(this.oldParent)})),this.oldParent.clearCacheData();var t=this.newParent.children.indexOf(this.dropNode);this.nodes.forEach(((e,i)=>{"top"==this.type||"left"==this.type?this.newParent.addChild(e,t):this.newParent.addChild(e,t+1+i),t=this.newParent.children.indexOf(this.dropNode)})),this.refresh(this.nodes[0].mindmap,this.nodes[0]),this.refresh(this.nodes[0].mindmap,this.oldParent)}}undo(){if(this._wfs&&this._wfs.length){var e=this.parent||this.newParent;this._wfs.forEach((t=>{if(this.oldParent&&this.oldParent.wireFrames){var i=e.wireFrames.indexOf(t);i>-1&&(e.wireFrames.splice(i,1),-1==this.oldParent.wireFrames.indexOf(t)&&this.oldParent.wireFrames.push(t))}}))}if(this._summary&&this._summary.length){e=this.parent||this.newParent;this._summary.forEach((t=>{if(this.oldParent&&this.oldParent.summaries){var i=e.summaries.indexOf(t);i>-1&&(e.summaries.splice(i,1),-1==this.oldParent.summaries.indexOf(t)&&this.oldParent.summaries.push(t))}}))}this.nodes[0].mindmap.clearSelectNode(),this.data.type.indexOf("child")>-1?(this.nodes.forEach(((e,t)=>{this.parent.removeChild(e),this.oldParent&&this.oldParent.addChild(e,this.index+t),e.mindmap.traverseBF((e=>{e.boundingRect=null,e.stroke=""}),e),this.updateItems(e)})),this.updateItems(this.parent),this.nodes[0].mindmap.updateAssist(),this.parent.clearCacheData(),this.nodes[0].clearCacheData(),this.refresh(this.nodes[0].mindmap,this.nodes[0]),this.refresh(this.nodes[0].mindmap,this.parent)):(this.nodes.forEach(((e,t)=>{this.newParent.removeChild(e),this.oldParent&&this.oldParent.addChild(e,this.index+t),e.mindmap.traverseBF((e=>{e.boundingRect=null,e.stroke=""}),e),this.updateItems(e)})),this.dropNode.clearCacheData(),this.updateItems(this.parent),this.nodes[0].mindmap.updateAssist(),this.nodes[0].clearCacheData(),this.refresh(this.nodes[0].mindmap,this.nodes[0]),this.refresh(this.nodes[0].mindmap,this.parent))}}class Be extends Ce{constructor(e,t,i){super("movePos"),this.node=e,this.oldPos=t,this.newPos=i}execute(){this.node.setPosition(this.newPos.x,this.newPos.y),this.node.callout?this.refresh(this.node.mindmap,this.node.callout.node):this.refresh(this.node.mindmap,this.node),this.node.mindmap.clearSelectNode()}undo(){this.node.setPosition(this.oldPos.x,this.oldPos.y),this.node.callout?this.refresh(this.node.mindmap,this.node.callout.node):this.refresh(this.node.mindmap,this.node),this.node.mindmap.clearSelectNode()}}class Me extends Ce{constructor(e){super("collapseNOde"),this.node=e,this.node.mindmap.clearSelectNode(),this.node.refreshBox()}execute(){this.node.clearCacheData(),this.node.collapse(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.node.select()}undo(){this.node.clearCacheData(),this.node.expand(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.node.select()}}class Te extends Ce{constructor(e){super("collapseNOde"),this.node=e,this.node.mindmap.clearSelectNode(),this.node.refreshBox()}execute(){this.node.clearCacheData(),this.node.expand(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.node.select()}undo(){this.node.clearCacheData(),this.node.collapse(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.node.select()}}class Le extends Ce{constructor(e,t){super("addInduce"),this.node=e,this.induce=t,this.mind=this.node.getMind(),this.added=!1}execute(){this.added||(this.mind.addInduce(this.induce),this.added=!0),this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node)}undo(){this.added=!1,this.mind.contentEL.removeChild(this.induce.root.containEl),this.mind.removeInduce(this.induce),this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node)}}class Pe extends Ce{constructor(e,t){super("addWireFrame"),this.num=1,this.wireFrame=e,this.mind=t,this.node=this.wireFrame.node,this.num=1}execute(){this.node.clearCacheData(),this.mind.addWireFrame(this.wireFrame),1!=this.num&&(this.node.wireFrame=this.wireFrame,this.wireFrame.init()),this.num++,this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.mind.clearSelectNode()}undo(){this.mind.removeWireFrame(this.wireFrame),this.node.wireFrame=null,this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.mind.clearSelectNode()}}class Oe extends Ce{constructor(e,t){super("remmoveWireFrame"),this.mind=t,this.node=e.node,this.wireFrame=e}execute(){this.mind.removeWireFrame(this.wireFrame),this.node.wireFrame=null,this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.mind.clearSelectNode(),this.mind._dragFrame.style.display="none",this.mind._indicateDom.style.display="none"}undo(){this.node.wireFrame=this.wireFrame,this.node.clearCacheData(),this.mind.addWireFrame(this.wireFrame),this.wireFrame.init(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.mind.clearSelectNode(),this.mind._dragFrame.style.display="none",this.mind._indicateDom.style.display="none"}}class Re extends Ce{constructor(e,t,i){super("changeRangeNode"),this.item=e,this.old=t,this.new=i}pre(){var e=this.old[0];"wireFrame"==this.item.name?e.wfs.splice(e.wfs.indexOf(this.item),1):e.induces.splice(e.induces.indexOf(this.item),1)}execute(){this.pre(),this.item.rangeNode=this.new,this.item.node=this.new[0],this.item.endNode=this.new[this.new.length-1],"wireFrame"==this.item.name?-1==this.new[0].wfs.indexOf(this.item)&&this.new[0].wfs.push(this.item):-1==this.new[0].induces.indexOf(this.item)&&this.new[0].induces.push(this.item),this.old.forEach((e=>{e&&e.clearCacheData()})),this.new.forEach((e=>{e&&e.clearCacheData()})),this.updateItems(this.item.node),this.refresh(this.item.node.mindmap,this.item.node)}undo(){"wireFrame"==this.item.name?this.new[0].wfs.splice(this.new[0].wfs.indexOf(this.item),1):this.new[0].induces.splice(this.new[0].induces.indexOf(this.item),1),this.item.rangeNode=this.old,this.item.node=this.old[0],this.item.endNode=this.old[this.old.length-1],"wireFrame"==this.item.name?this.old[0].wfs.indexOf(this.item)&&this.old[0].wfs.push(this.item):this.old[0].induces.indexOf(this.item)&&this.old[0].induces.push(this.item),this.old.forEach((e=>{e&&e.clearCacheData()})),this.new.forEach((e=>{e&&e.clearCacheData()})),this.updateItems(this.item.node),this.refresh(this.item.node.mindmap,this.item.node)}}class Fe extends Ce{constructor(e){super("addRelate"),this.link=e,this.mind=this.link.startNode.getMind()}execute(){this.mind.addRelateLink(this.link),this.mind.status="",this.link.status="added"}undo(){this.mind.removeRelateLink(this.link)}}class _e extends Ce{constructor(e,t,i){super("relateLinkBox"),this.relateLink=e,this.oldBox=t,this.box=i}execute(){this.relateLink.data=this.box.data,this.relateLink.setBox(Object.assign({},this.box)),this.refresh(this.relateLink.startNode.mindmap,this.relateLink.startNode)}undo(){this.relateLink.data=this.oldBox.data,this.relateLink.setBox(Object.assign({},this.oldBox)),this.refresh(this.relateLink.startNode.mindmap,this.relateLink.startNode)}}class ze extends Ce{constructor(e,t){super("setAnnotate"),this.node=e,this.annotate=t,e.getAnnotateId()&&(this.oldAnnotate=e.getAnnotate())}execute(){this.node.setAnnotate(this.annotate),this.refresh(this.node.mindmap,this.node)}undo(){this.oldAnnotate?this.node.setAnnotate(this.oldAnnotate):this.node.deleteAnnotate(),this.refresh(this.node.mindmap,this.node)}}class Qe extends Ce{constructor(e){super("setAnnotate"),this.node=e,this.annotate=e.getAnnotate()}execute(){this.node.deleteAnnotate(),this.refresh(this.node.mindmap,this.node)}undo(){this.node.setAnnotate(this.annotate),this.refresh(this.node.mindmap,this.node)}}class He extends Ce{constructor(e){super("changeNodeToFreeRoot"),this.node=e,this.mind=e.getMind(),this.pos=this.node.getPosition(),this.parent=this.node.parent,this.node.data.main=!1,this.node.layout&&(this.layout=this.node.layout)}execute(){var e=this;if(this.layout&&(this.node.layout=this.layout),this.node.clearCacheData(),this.node.containEl.classList.contains("mm-root")||this.node.containEl.classList.add("mm-root"),this.node.containEl.classList.contains("mm-freeNode")||this.node.containEl.classList.add("mm-freeNode"),this.node.refreshBox(),this.parent)var t=this.parent.wireFrames,i=this.parent.summaries;this.cacheInfo={wfs:[],induces:[]},t&&t.forEach((t=>{if(t.node==t.endNode){if(t.node==e.node){var i=t.node.parent,n=i.wireFrames.indexOf(t);i.wireFrames.splice(n,1),t.node.wireFrame=t,e.cacheInfo.wfs.push({item:t,type:"toFreeRoot"})}}else if(t.rangeNode.indexOf(e.node)>-1)if(t.rangeNode[0]==e.node){e.node.wfs.splice(e.node.wfs.indexOf(t),1);var s=t.rangeNode.slice();t.rangeNode.shift(),t.rangeNode[0].wfs.push(t),e.cacheInfo.wfs.push({item:t,type:"changeRangeNode-start",oldRange:s,newRange:t.rangeNode.slice()})}else if(t.rangeNode[t.rangeNode.length-1]==e.node){s=t.rangeNode.slice();t.rangeNode.pop(),e.cacheInfo.wfs.push({item:t,type:"changeRangeNode-end",oldRange:s,newRange:t.rangeNode.slice()})}else{s=t.rangeNode.slice();var r=t.rangeNode.indexOf(e.node);t.rangeNode.splice(r,1),e.cacheInfo.wfs.push({item:t,type:"changeRangeNode",oldRange:s,newRange:t.rangeNode.slice(),num:r})}})),i&&i.forEach((t=>{if(t.node==t.endNode)t.node==e.node&&(e.mind.removeInduce(t),e.cacheInfo.induces.push({item:t,type:"remove"}),e.mind.removeNode(t.root));else if(t.rangeNode.indexOf(e.node)>-1)if(t.rangeNode[0]==e.node){e.node.induces.splice(e.node.induces.indexOf(t),1);var i=t.rangeNode.slice();t.rangeNode.shift(),t.rangeNode[0].induces.push(t),e.cacheInfo.induces.push({item:t,type:"changeRangeNode-start",oldRange:i,newRange:t.rangeNode.slice()})}else if(t.rangeNode[t.rangeNode.length-1]==e.node){i=t.rangeNode.slice();t.rangeNode.pop(),e.cacheInfo.induces.push({item:t,type:"changeRangeNode-end",oldRange:i,newRange:t.rangeNode.slice()})}else{i=t.rangeNode.slice();var n=t.rangeNode.indexOf(e.node);t.rangeNode.splice(n,1),e.cacheInfo.induces.push({item:t,type:"changeRangeNode",oldRange:i,newRange:t.rangeNode.slice(),num:n})}})),this.parent&&(this.index=this.parent.removeChild(this.node)),this.node.parent=null,this.mind.addFreeNode(this.node),this.mind.traverseDF((e=>{e.boundingRect=null,e.stroke=""}),this.node),this.node.nodeType="freeNode",this.node.setPosition(this.pos.x,this.pos.y),this.updateItems(this.parent),this.updateItems(this.node),this.parent.clearCacheData(),this.refresh(this.parent.mindmap,this.parent),this.refresh(this.node.mindmap,this.node),this.layout||(this.layout=this.node.layout),this.mind.clearSelectNode()}undo(){var e=this;this.mind.removeFreeNode(this.node),this.node.containEl.classList.contains("mm-root")&&this.node.containEl.classList.remove("mm-root"),this.node.containEl.classList.contains("mm-freeNode")&&this.node.containEl.classList.remove("mm-freeNode"),this.node.refreshBox(),this.node.layout&&(this.node.layout.svgDom&&this.node.layout.svgDom.clear()&&this.node.layout.svgDom.remove(),this.node.layout.group&&this.node.layout.group.clear()&&this.node.layout.group.remove(),this.node.layout.svgDom=null,this.node.layout.group=null,this.node.layout=null),this.node.nodeType="richText",this.parent&&this.parent.addChild(this.node,this.index),this.node.clearCacheData(),this.mind.traverseDF((e=>{e.boundingRect=null,e.stroke=""}),this.node),this.node._isRoot||this.node.layout&&(this.node.layout.svgDom&&this.node.layout.svgDom.remove(),this.node.layout.svgDom=null,this.node.layout=null),this.cacheInfo&&this.cacheInfo.wfs.forEach((t=>{if("toFreeRoot"==t.type){var i=t.item.node.parent;i&&(i.wireFrames.push(t.item),i.wireFrames.unique(),i.wireFrames.sort((function(e,t){return e.rangeNode.length-t.rangeNode.length}))),t.item.node.wireFrame=null}if("remove"==t.type&&(e.mind.addWireFrame(t.item),t.item.init()),"changeRangeNode-start"==t.type){e.node.wfs.push(t.item);var n=t.item.rangeNode[0];n.wfs.splice(n.wfs.indexOf(t.item),1),t.item.rangeNode=t.oldRange}"changeRangeNode-end"!=t.type&&"changeRangeNode"!=t.type||(t.item.rangeNode=t.oldRange)})),this.cacheInfo&&this.cacheInfo.induces.forEach((t=>{if("remove"==t.type&&(e.mind.addInduce(t.item),t.item.init(),this.mind.traverseDF((e=>{this.mind._addNodeDom(e)}),t.item.root)),"changeRangeNode-start"==t.type){e.node.induces.push(t.item);var i=t.item.rangeNode[0];i.induces.splice(i.induces.indexOf(t.item),1),t.item.rangeNode=t.oldRange}"changeRangeNode-end"!=t.type&&"changeRangeNode"!=t.type||(t.item.rangeNode=t.oldRange)})),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.node.layout=null,this.mind.clearSelectNode()}}class je extends Ce{constructor(e,t){super("changeFreeRootToNode"),this.node=e,this.pos=this.node.getPosition(),this.parent=t,this.mind=this.node.getMind(),this.oldLayout=this.node.layout}execute(){if(this.node.containEl.classList.contains("mm-root")&&(this.node.containEl.classList.remove("mm-root"),this.node.containEl.classList.remove("mm-freeNode")),this.node.refreshBox(),this.mind.removeFreeNode(this.node),this.node.layout.svgDom&&this.node.layout.svgDom.clear(),this.node.nodeType="richText",this.parent.addChild(this.node),this.node.clearCacheData(),this.mind.traverseDF((e=>{e.boundingRect=null,e.direct="",e.stroke=this.parent.stroke,e.data.stroke=this.parent.stroke}),this.node),this.node.wfs.length){var e=this.node.parent;e&&(-1==e.wireFrames.indexOf(this.node.wfs[0])&&e.wireFrames.push(this.node.wfs[0]),e.wireFrames.sort((function(e,t){return e.rangeNode.length-t.rangeNode.length}))),this.rootWf=this.node.wfs[0],this.node.wireFrame=null}this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.mind.clearSelectNode()}undo(){if(this.node.layout=this.oldLayout,this.node.clearCacheData(),this.mind.addFreeNode(this.node),this.node.nodeType="freeNode",this.parent.removeChild(this.node),this.node.setPosition(this.pos.x,this.pos.y),this.mind.traverseDF((e=>{e.boundingRect=null,e.direct="",e.stroke="",e.data.stroke=""}),this.node),this.node.containEl.classList.contains("mm-root")||(this.node.containEl.classList.add("mm-root"),this.node.containEl.classList.add("mm-freeNode")),this.node.refreshBox(),this.mind.clearSelectNode(),this.rootWf){var e=this.rootWf.node.parent;e&&e.wireFrames.splice(e.wireFrames.indexOf(this.rootWf),1),this.rootWf.node.wireFrame=this.rootWf,this.rootWf=null}this.updateItems(this.parent),this.updateItems(this.node),this.refresh(this.parent.mindmap,this.parent),this.refresh(this.node.mindmap,this.node)}}class qe extends Ce{constructor(e){super("removeCommand"),this.node=e.node,this.induce=e}execute(){var e=this.node.getMind();e.removeInduce(this.induce),this.induce.root.layout&&this.induce.root.layout.svgDom&&this.induce.root.layout.svgDom.remove()&&(this.induce.root.layout.svgDom=null),function t(i){e.removeNode(i),i.wireFrames&&i.wireFrames.forEach((t=>{e.removeWireFrame(t)})),i.summaries&&i.summaries.forEach((i=>{e.removeInduce(i),i.root.layout&&i.root.layout.svgDom&&i.root.layout.svgDom.remove()&&(i.root.layout.svgDom=null),t(i.root)})),i.getChildren().forEach((e=>{t(e)}))}(this.induce.root),this.node.induce=null,this.node.clearCacheData(),this.updateItems(this.node),this.refresh(e,this.node),e.updateAssist(),e._dragFrame.style.display="none",e._indicateDom.style.display="none"}undo(){var e=this.node.getMind();e.addInduce(this.induce),function t(i){e.addNode(i),i.wireFrames.length&&i.wireFrames.forEach((t=>{e.addWireFrame(t)})),i.summaries.length&&i.summaries.forEach((i=>{e.addInduce(i),t(i.root)})),i.getChildren().forEach((e=>{t(e)}))}(this.induce.root),this.node.induce=this.induce,this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),e._dragFrame.style.display="none",e._indicateDom.style.display="none"}}class Ve extends Ce{constructor(e){super("removeRelateLink"),this.link=e,this.mind=e.startNode.getMind()}execute(){this.mind.removeNode(this.link.textNode),this.mind.removeRelateLink(this.link),this.refresh(this.mind,this.link.startNode)}undo(){this.mind.addRelateLink(this.link),this.refresh(this.mind,this.link.startNode)}}class We extends Ce{constructor(e,t){super("changeLayout"),this.isTable=!1,this.oldNode=null,this.tableLayout=null,this.forceChange=!1,this.newLayout=null,this.node=e,this.mind=this.node.mindmap,this.direct=t}execute(){if(this.mind.traverseDF((e=>{e.boundingRect=null}),this.node),"right"==this.direct||"left"==this.direct||"mindmap"==this.direct||"up"==this.direct||"down"==this.direct){if(s=this.node.getNodeLayout()){if(this.mind.traverseDF((e=>{e.boundingRect=null}),s.root),this.oldLayout=s,"table"==s.layoutName){this.forceChange=!0;var e=s.getData(s.root),t=this.initNode(e,this.direct);t.nodeType=s.root.nodeType,this.oldIndex=this.mind.removeNode(s.root),this.oldIndex>-1&&this.mind.addNode(t,s.root.parent,this.oldIndex),this.mind.traverseBF((e=>{this.mind._addNodeDom(e)}),t),this.mind.contentEL.contains(s.tableDom)&&this.mind.contentEL.removeChild(s.tableDom),t.data.main&&(this.mind.root=t,e.x&&e.y&&t.setPosition(e.x,e.y),this.mind.traverseBF((e=>{e.refreshBox(),e.boundingRect=null}),t)),"freeNode"==s.root.nodeType&&(this.mind.removeFreeNode(s.root),this.mind.addFreeNode(t),e.x&&e.y&&t.setPosition(e.x,e.y),this.mind.traverseBF((e=>{e.refreshBox(),e.boundingRect=null}),t)),"induce"==s.root.nodeType&&(s.root.incuce.root=t,t.incuce=s.root.incuce,t.nodeType,this.mind.traverseBF((e=>{e.refreshBox(),e.boundingRect=null}),t)),this.effect()}s.svgDom&&s.svgDom.clear()&&s.svgDom.remove()&&(s.svgDom=null),s.group&&s.group.clear()&&s.group.remove()&&(s.group=null)}this.node.clearCacheData();var i="up"==this.direct||"down"==this.direct?"tree":"mindmap2",n=new xe[i](t||this.node,this.direct,this.mind.view.colors.slice());(t||this.node).layout=n,this.newLayout=n,this.node.isRoot&&this.node.data.main&&(this.node.mindmap.mmLayout=n)}if("lTree"==this.direct&&this.changeLayout("multipleTree","multipleTree"),"vertical"==this.direct&&this.changeLayout("vertical","vertical"),"fishRight"==this.direct&&this.changeLayout("fish","right"),"fishLeft"==this.direct&&this.changeLayout("fish","left"),"multip"==this.direct&&this.changeLayout("multipleTree","multipleTree"),"multipLeft"==this.direct&&this.changeLayout("multipleTree","left"),"multipRight"==this.direct&&this.changeLayout("multipleTree","right"),"table"==this.direct){var s=this.node.getNodeLayout();this.isTable=!0,s&&"table"!=s.layoutName&&(this.oldLayout=s),this.oldNode=this.node;n=new xe.table(this.node,"");var r=this.node.parent;n.root.parent=r,this.oldIndex=this.mind.removeNode(this.node,!1),this.mind.addNode(n.root,n.root.parent,this.oldIndex),this.tableLayout=n,this.oldNode&&this.oldNode.isRoot&&this.oldNode.data.main&&(this.mind.root=n.root,this.mind.mmLayout=n),this.oldNode&&"freeNode"==this.oldNode.nodeType&&(this.mind.removeFreeNode(this.oldNode),this.mind.addFreeNode(n.root),n.root.nodeType),this.oldNode&&"induce"==this.oldNode.nodeType&&this.oldNode.incuce&&(this.oldNode.incuce.root=n.root,n.root.induce=this.oldNode.induce,n.root.nodeType),this.effect()}this.oldLayout?(this.newLayout&&this.refresh(this.mind,this.newLayout.root),this.refresh(this.mind,this.oldLayout.root)):this.refresh(this.mind,this.node)}changeLayout(e,t){var i=this.node.getNodeLayout();if(i){if(this.mind.traverseDF((e=>{e.boundingRect=null,e.refreshBox(),e.direct=""}),i.root),this.oldLayout=i,"table"==i.layoutName){this.forceChange=!0;var n=i.getData(i.root),s=this.initNode(n,this.direct);s.nodeType=i.root.nodeType,this.oldIndex=this.mind.removeNode(i.root),this.oldIndex>-1&&this.mind.addNode(s,i.root.parent,this.oldIndex),this.mind.traverseBF((e=>{this.mind._addNodeDom(e)}),s),s.data.main&&(this.mind.root=s,n.x&&n.y&&s.setPosition(n.x,n.y),this.mind.traverseBF((e=>{e.refreshBox(),e.boundingRect=null}),s)),"freeNode"==i.root.nodeType&&(this.mind.removeFreeNode(i.root),this.mind.addFreeNode(s),s.nodeType,n.x&&n.y&&s.setPosition(n.x,n.y),this.mind.traverseBF((e=>{e.refreshBox(),e.boundingRect=null}),s)),"induce"==i.root.nodeType&&(i.root.incuce.root=s,s.incuce=i.root.incuce,s.nodeType,this.mind.traverseBF((e=>{e.refreshBox(),e.boundingRect=null}),s)),this.mind.contentEL.contains(i.tableDom)&&this.mind.contentEL.removeChild(i.tableDom),this.effect()}i.svgDom&&i.svgDom.clear()&&i.svgDom.remove()&&(i.svgDom=null),i.group&&i.group.clear()&&i.group.remove()&&(i.group=null)}this.node.clearCacheData();var r=new xe[e](s||this.node,t,this.mind.view.colors.slice());(s||this.node).layout=r,this.newLayout=r,this.node.isRoot&&this.node.data.main&&(this.node.mindmap.mmLayout=r)}undo(){this.oldLayout&&!this.isTable?this.forceChange?(this.oldIndex>-1&&(this.mind.removeNode(this.newLayout.root),this.mind.addNode(this.oldLayout.root,this.oldLayout.root.parent,this.oldIndex)),this.newLayout&&this.newLayout.root.data.main&&(this.mind.root=this.oldLayout.root,this.mind._removeChildDom(this.newLayout.root),this.mind.mmLayout=this.oldLayout),this.newLayout&&"freeNode"==this.newLayout.root.nodeType&&(this.mind.removeFreeNode(this.newLayout.root),this.mind.addFreeNode(this.oldLayout.root),this.oldLayout.root.nodeType,this.mind._removeChildDom(this.newLayout.root)),this.newLayout&&"induce"==this.newLayout.root.nodeType&&(this.oldLayout.root.nodeType,this.mind._removeChildDom(this.newLayout.root),this.oldLayout.root.induce.root=this.oldLayout.root),this.oldLayout.tableDom&&(this.mind.contentEL.contains(this.oldLayout.tableDom)||this.mind.contentEL.appendChild(this.oldLayout.tableDom)),this.effect()):(this.oldLayout.root.layout.svgDom&&this.oldLayout.root.layout.svgDom.clear()&&this.oldLayout.root.layout.svgDom.remove()&&(this.oldLayout.root.layout.svgDom=null),this.oldLayout.root.layout.group&&this.oldLayout.root.layout.group.clear()&&this.oldLayout.root.layout.group.remove()&&(this.oldLayout.root.layout.group=null),this.mind.traverseDF((e=>{e.boundingRect=null,e.refreshBox(),e.direct=""}),this.oldLayout.root),this.oldLayout.root.layout=this.oldLayout,this.oldLayout.svgDom&&(this.oldLayout.svgDom=null),this.oldLayout.group&&(this.oldLayout.group=null),this.oldLayout.layout(this.oldLayout.root,this.oldLayout.direct)):this.oldLayout&&this.isTable?(this.mind.removeNode(this.tableLayout.root),this.mind.addNode(this.oldNode,this.oldNode.parent,this.oldIndex),this.mind.traverseBF((e=>{this.mind._addNodeDom(e),e.refreshBox(),e.boundingRect=null}),this.oldNode),this.mind.contentEL.removeChild(this.tableLayout.tableDom),this.oldNode&&this.oldNode.data.main&&(this.mind.root=this.oldNode,this.mind.mmLayout=this.oldLayout),this.oldNode&&"freeNode"==this.tableLayout.root.nodeType&&(this.mind.removeFreeNode(this.tableLayout.root),this.mind.addFreeNode(this.oldNode),this.mind.traverseBF((e=>{e.refreshBox(),e.boundingRect=null}),this.oldNode)),this.oldNode&&"induce"==this.tableLayout.root.nodeType&&this.oldNode.incuce&&(this.oldNode.incuce.root=this.oldNode,this.mind.traverseBF((e=>{e.refreshBox(),e.boundingRect=null}),this.oldNode)),this.tableLayout.tableDom=null,this.tableLayout=null,this.effect()):this.isTable?(this.mind.removeNode(this.tableLayout.root),this.mind.addNode(this.oldNode,this.oldNode.parent,this.oldIndex),this.mind.traverseBF((e=>{this.mind._addNodeDom(e),e.boundingRect=null,e.refreshBox()}),this.oldNode),this.mind.contentEL.contains(this.tableLayout.tableDom)&&this.mind.contentEL.removeChild(this.tableLayout.tableDom),this.tableLayout.tableDom=null,this.tableLayout=null,this.effect()):this.node.layout&&(this.mind.traverseDF((e=>{e.boundingRect=null,e.refreshBox(),e.direct=""}),this.node.layout.root),this.node.layout.svgDom&&this.node.layout.svgDom.clear()&&this.node.layout.svgDom.remove()&&(this.node.layout.svgDom=null),this.node.layout.group&&this.node.layout.group.clear()&&this.node.layout.group.remove()&&(this.node.layout.group=null),this.node.layout=null,this.node.clearCacheData()),this.oldLayout?(this.newLayout&&this.refresh(this.mind,this.newLayout.root),this.refresh(this.mind,this.oldLayout.root)):this.refresh(this.mind,this.node),this.node.isRoot&&this.node.data.main&&(this.node.mindmap.mmLayout=this.oldLayout)}initNode(e,t){var i=this,n=null;return function e(s,r,o){var a=new ce(s,i.mind);s.isRoot&&s.main&&(i.mind.root=a,a.isRoot=!0),r?n=a:(o.children.push(a),a.parent=o),a.direct=t||s.direct,s.children&&s.children.length&&s.children.forEach((t=>{t.x=100,t.y=100,e(t,!1,a)}))}(e,!0),n}effect(){var e=this.mind.induces,t=this.mind.wireFrames,i=this.mind.relateLinks;e.concat(t).forEach((e=>{var t=e.node,i=e.endNode;if(t){var n=t.getId();(s=this.mind.getNodeById(n))!=t&&(e.node=s,e.rangeNode=[s,i],"wireFrame"==e.name?(s.wfs||(s.wfs=[]),-1==s.wfs.indexOf(e)&&s.wfs.push(e)):(s.induces||(s.induces=[]),-1==s.induces.indexOf(e)&&s.induces.push(e)))}if(i){var s;n=i.getId();(s=this.mind.getNodeById(n))!=i&&(e.endNode=s,e.rangeNode=[e.node,s])}e.refreshNode(),e.refreshItems()})),i.forEach((e=>{var t=e.startNode,i=e.endNode;if(t){var n=t.getId();(s=this.mind.getNodeById(n))!=t&&(e.startNode=s)}if(i){var s;n=i.getId();(s=this.mind.getNodeById(n))!=i&&(e.endNode=s)}}))}}class Ue extends Ce{constructor(e,t){super("changeSummary"),this.summary=e,this.stroke=t,this.oldStroke=e.stroke}execute(){this.summary.setData({stroke:this.stroke,lineType:"solid"});var e=this.summary.node;this.refresh(e.mindmap,e)}undo(){this.summary.setData({stroke:this.oldStroke,lineType:"solid"});var e=this.summary.node;this.refresh(e.mindmap,e)}}class Xe extends Ce{constructor(e,t,i){super("ChangeWireframe"),this.wf=e,this.stroke=t,this.oldStroke=e.stroke,this.background=i,this.oldBackground=e.fill}execute(){this.wf.fill=this.background,this.wf.stroke=this.stroke,this.wf.refresh();var e=this.wf.node;this.refresh(e.mindmap,e)}undo(){this.wf.fill=this.oldBackground,this.wf.stroke=this.oldStroke;var e=this.wf.node;this.refresh(e.mindmap,e)}}class Ge extends Ce{constructor(e,t){super("changeLinkStroke"),this.link=e,this.stroke=t,this.oldStroke=e.data.color}execute(){this.link.data.color=this.stroke,this.link.refresh(),this.refresh(this.link.mind,this.link.startNode)}undo(){this.link.data.color=this.oldStroke,this.link.refresh(),this.refresh(this.link.mind,this.link.startNode)}}class Ye extends Ce{constructor(e,t){super("changeLinkType"),this.link=e,this.type=t,this.oldType=e.data.type}execute(){this.link.data.type=this.type,this.link.bs&&(this.link.bs.remove(),this.link._createLine(),this.link._addLineEvent()),this.link.refresh(),this.refresh(this.link.mind,this.link.startNode)}undo(){this.link.data.type=this.oldType,this.link.bs&&(this.link.bs.remove(),this.link._createLine(),this.link._addLineEvent()),this.link.refresh(),this.refresh(this.link.mind,this.link.startNode)}}class Ke extends Ce{constructor(e,t){super("note"),this.node=e,this.note=t,this.oldNote=e.data.note}execute(){this.node.setNote(this.note),this.node.refreshBox(),this.node.clearCacheData(),this.refresh(this.node.mindmap,this.node)}undo(){this.node.setNote(this.oldNote),this.node.refreshBox(),this.node.clearCacheData(),this.refresh(this.node.mindmap,this.node)}}class Ze extends Ce{constructor(e){super("addFreeNode"),this.node=e}execute(){this.node.mindmap.addFreeNode(this.node),this.refresh(this.node.mindmap,this.node)}undo(){this.node.mindmap.removeFreeNode(this.node),this.node.mindmap.removeNode(this.node),this.refresh(this.node.mindmap,this.node)}}class Je extends Ce{constructor(e,t,i){super("copyNode"),this.waitCollapse=[],this.summary=[],this.node=e,this.data=t,this.mind=this.node.mindmap,this.waitCollapse=[],this.summary=i}execute(){this.paste()}undo(){this.firstNode&&(this.mind.removeNode(this.firstNode),this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node))}paste(){var e=this;this.data.forEach(((e,t)=>{var i=new ce(e,this.mind);if(i.mindmap=this.mind,e.isExpand||this.waitCollapse.push(i),0==t)i.data.pid=this.node.getId(),this.mind.addNode(i,this.node),this.firstNode=i,i.setPosition(0,0),i.refreshBox();else{var n=this.mind.getNodeById(e.pid);n&&(this.mind.addNode(i,n),i.setPosition(0,0),i.refreshBox())}t==this.data.length-1&&(i.clearCacheData(),this.updateItems(i),this.refresh(this.mind,i))}));var t=null;this.summary.sort(((e,t)=>e.index-t.index)),this.summary.forEach((i=>{var n=i.range,s=this.mind.getNodeById(i.nodeId);console.log(s),t=s;var r=s.parent,o=[];if(n){var a=n.split(",");r.children.forEach(((e,t)=>{t>=a[0]&&t<=a[1]&&o.push(e)}));var h=o[o.length-1]}else{h=s;o=[s]}i.nodeArr.forEach(((t,n)=>{if(0==n){var r=new ce(t,e.mind),a=new ke(s,r,i.stroke,i.lineType);a.endNode=h,a.rangeNode=o,a.refreshItems(),a.refreshNode(),a.type=i.type,e.mind.addInduce(a)}else{r=new ce(t,e.mind);var l=e.mind.getNodeById(t.pid);e.mind.contentEL.appendChild(r.containEl),l&&(l.children.push(r),r.setPosition(0,0),r.parent=l)}if(t.x&&t.y&&r.setPosition(t.x,t.y),t.boundingRect&&(r.boundingRect=t.boundingRect),r.refreshBox(),t.layout){var d=new Array(100).fill(o[0].stroke||o[0].data.stroke);r.layout=new xe[t.layout.layoutName](s,t.layout.layoutDirect,d),r.layout.direct=t.layout.layoutDirect,r.layout.root=r}}))})),t&&(t.clearCacheData(),this.updateItems(t),this.refresh(this.mind,t))}}class $e extends Ce{constructor(e,t){super("setNodeStyle"),this.oldStyles={},this.nodes=e,this.newStyle=t}execute(){var e,t=[];this.nodes.forEach((e=>{var i=e.getStyle();this.oldStyles[e.getId()]=JSON.stringify(i);var n=Object.assign({},i,this.newStyle);e.setStyle(n),e.clearCacheData(),e.refreshBox();var s=e.getTopLayout();-1==t.indexOf(s)&&t.push(s),e.callout&&e.callout.refresh()})),t.length&&t.forEach((e=>{e&&e.refresh()})),1==this.nodes.length&&"wireFrame"==this.nodes[0].nodeType?this.refresh(this.nodes[0].mindmap,null===(e=this.nodes[0].wireFrame)||void 0===e?void 0:e.node):this.refresh(this.nodes[0].mindmap,this.nodes[0])}undo(){var e=[];this.nodes.forEach((t=>{var i=t.getId(),n=JSON.parse(this.oldStyles[i]);t.setStyle(n,!0),t.clearCacheData(),t.refreshBox();var s=t.getTopLayout();-1==e.indexOf(s)&&e.push(s),t.callout&&t.callout.refresh()})),e.length&&e.forEach((e=>{e&&e.refresh()})),this.refresh(this.nodes[0].mindmap,this.nodes[0])}}class et extends Ce{constructor(e,t){super("addCallout"),this.node=e,this.callout=t,this.mind=e.getMind(),this.num=1}execute(){this.mind.addCallout(this.callout),1!=this.num&&(this.callout.init(),this.mind.contentEL.appendChild(this.callout.root.containEl)),this.callout.node.callout=this.callout,this.num++,this.updateItems(this.callout.node),this.node.clearCacheData(),this.refresh(this.mind,this.callout.node)}undo(){this.mind.removeCallout(this.callout),this.mind.contentEL.removeChild(this.callout.root.containEl),this.callout.off(),this.callout.remove(),this.node.callout=null,this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.mind,this.node)}}class tt extends Ce{constructor(e){super("RemoveCallout"),this.callout=e,this.mind=e.node.getMind()}execute(){this.mind.contentEL.removeChild(this.callout.root.containEl),this.mind.removeCallout(this.callout),this.callout.node.clearCacheData(),this.callout.off(),this.callout.node.callout=null,this.updateItems(this.callout.node),this.refresh(this.mind,this.callout.node)}undo(){this.mind.addCallout(this.callout),this.mind.contentEL.appendChild(this.callout.root.containEl),this.callout.init(),this.callout.node.callout=this.callout,this.callout.node.clearCacheData(),this.updateItems(this.callout.node),this.refresh(this.mind,this.callout.node)}}class it extends Ce{constructor(e){super("removeNodeLayout"),this.node=e,this.mind=this.node.getMind(),this.layout=e.layout}execute(){if(this.layout){if("table"!=this.layout.layoutName)this.layout.svgDom&&this.layout.svgDom.clear()&&this.layout.svgDom.remove()&&(this.layout.svgDom=null),this.layout.group&&this.layout.group.clear()&&this.layout.group.remove()&&(this.layout.group=null),this.node.getMind().traverseDF((e=>{e.boundingRect=null,e.direct=""}),this.node),this.node.layout=null;else{var e=this.initNode(this.layout.getData(this.node)),t=this.node.parent;this.iNode=e,this.index=this.node.getMind().removeNode(this.node),this.node.getMind().addNode(e,t,this.index),this.mind.traverseBF((e=>{this.mind._addNodeDom(e),e.refreshBox()}),e),this.mind.contentEL.removeChild(this.layout.tableDom),this.effect()}this.refresh(this.mind,e||this.node)}}undo(){this.layout&&("table"!=this.layout.layoutName?(this.node.layout=this.layout,this.node.getMind().traverseDF((e=>{e.boundingRect=null,e.direct=""}),this.node)):(this.iNode&&this.mind.removeNode(this.iNode),this.mind.addNode(this.node,this.node.parent,this.index),this.mind.contentEL.contains(this.node.layout.tableDom)||this.mind.contentEL.appendChild(this.node.layout.tableDom),this.effect()),this.refresh(this.mind,this.node))}initNode(e,t){var i=this,n=null;return function e(s,r,o){var a=new ce(s,i.mind);r?n=a:(o.children.push(a),a.parent=o),a.direct=t||s.direct||"",s.children&&s.children.length&&s.children.forEach((t=>{t.x=100,t.y=100,e(t,!1,a)}))}(e,!0),n}effect(){var e=this.mind.induces,t=this.mind.wireFrames,i=this.mind.relateLinks;e.concat(t).forEach((e=>{var t=e.node,i=e.endNode;if(t){var n=t.getId();(s=this.mind.getNodeById(n))!=t&&(e.node=s,e.rangeNode=[s,i],"wireFrame"==e.name?(s.wfs||(s.wfs=[]),-1==s.wfs.indexOf(e)&&s.wfs.push(e)):(s.induces||(s.induces=[]),-1==s.induces.indexOf(e)&&s.induces.push(e)))}if(i){var s;n=i.getId();(s=this.mind.getNodeById(n))!=i&&(e.endNode=s,e.rangeNode=[e.node,s])}e.refreshNode(),e.refreshItems()})),i.forEach((e=>{var t=e.startNode,i=e.endNode;if(t){var n=t.getId();(s=this.mind.getNodeById(n))!=t&&(e.startNode=s)}if(i){var s;n=i.getId();(s=this.mind.getNodeById(n))!=i&&(e.endNode=s)}}))}}class nt extends Ce{constructor(e,t){super("removeNodes"),this.realCmds=[],this.nodes=e.sort(((e,t)=>e.getLevel()-t.getLevel())),this.mind=t}execute(){this.nodes.forEach(((e,t)=>{if(0==t){(i=new De(e,e.mindmap)).execute(),this.realCmds.push(i)}else{var i,n=e.getId(),s=this.mind.getNodeById(n);if(s)(i=new De(s,s.mindmap)).execute(),this.realCmds.push(i)}}))}undo(){this.realCmds.length&&this.realCmds.reverse().forEach((e=>{e.undo()}))}}class st extends Ce{constructor(e,t){super("changeBoundaryName"),this.wireFrame=null,this.text="",this.oldText="",this.wireFrame=e,this.oldText=this.wireFrame.getGroupName(),this.text=t}execute(){this.wireFrame.setGroupName(this.text),this.wireFrame.refreshBox(),this.refresh(this.wireFrame.node.mindmap,this.wireFrame.node)}undo(){this.wireFrame.setGroupName(this.oldText),this.wireFrame.refreshBox(),this.refresh(this.wireFrame.node.mindmap,this.wireFrame.node)}}class rt extends Ce{constructor(e,t){super("setTextCover"),this.node=null,this.flag=null,this.node=e,this.flag=t}execute(){this.node.setCoverText(this.flag),this.refresh(this.node.mindmap,this.node)}undo(){this.node.setCoverText(!this.flag),this.refresh(this.node.mindmap,this.node)}}class ot{constructor(){this.history=new we(100)}execute(e,t){var i;switch(e){case"addChildNode":case"addSiblingNode":if(t){var n={id:os(),text:t.text||r("Sub title")},s=t.data;s&&(s.text&&(n.text=s.text),s.note&&(n.note=s.note));var o=t.parent;if(n.stroke=o.stroke,o.mindmap.isRead&&!s)return;if(o.belongInduce&&!o.layout){for(var a=o.direct,h=[],l=0;l<50;l++)h.push(o.belongInduce.node.stroke);o.layout="right"==a||"left"==a?new xe.mindmap1(o,a,h):new xe.tree(o,a,h)}if(o.isExpand||o.expand(),"table"==o.mindmap._mode||o.iNode)var d=t.node||new ue(n,o.mindmap);else d=t.node||new ce(n,o.mindmap);if(t.hasOwnProperty("index"))var c=t.index;this.history.execute(new Ee(d,t.parent,o.mindmap,!!s,c))}break;case"deleteNodeAndChild":if(t){if((d=t.node).mindmap.isRead)return;this.history.execute(new De(d,d.mindmap))}break;case"deleteNodes":var u=t.nodes;this.history.execute(new nt(u,u[0].mindmap));break;case"deleteNodeExcludeChild":break;case"changeNodeText":if(t){if((d=t.node).mindmap.isRead)return;"wireFrame"==d.nodeType?this.history.execute(new st(d.wireFrame,t.text)):this.history.execute(new Ne(t.node,t.oldText,t.text))}break;case"moveNode":t&&this.history.execute(new Ie(t));break;case"moveNodes":t&&this.history.execute(new Se(t));break;case"movePosition":t&&this.history.execute(new Be(t.node,t.oldPos,t.newPos));break;case"expandNode":t&&this.history.execute(new Te(t.node));break;case"collapseNode":t&&this.history.execute(new Me(t.node));break;case"addSummary":if(t){if((d=t.node).mindmap.isRead)return;this.history.execute(new Le(t.node,t.summary))}break;case"addWireFrame":if(t){if((d=t.node).mindmap.isRead)return;this.history.execute(new Pe(t.wireFrame,t.node.mindmap))}break;case"changeRangeNode":this.history.execute(new Re(t.item,t.oldRangeNode,t.newRangeNode));break;case"addRelateLink":this.history.execute(new Fe(t.link));break;case"changeRelateLink":this.history.execute(new _e(t.link,t.oldBox,t.box));break;case"setAnnotate":this.history.execute(new ze(t.node,t.annotate));break;case"deleteAnnotate":if((d=t.node).mindmap.isRead)return;this.history.execute(new Qe(t.node));break;case"changeNodeToFreeRoot":if((d=t.node).mindmap.isRead)return;this.history.execute(new He(t.node));break;case"changeFreeRootToNode":if((d=t.node).mindmap.isRead)return;this.history.execute(new je(t.node,t.parent));break;case"deleteInduce":if((d=t.summary.node).mindmap.isRead)return;this.history.execute(new qe(t.summary));break;case"deleteWireFrame":if((d=t.wireFrame.node).mindmap.isRead)return;this.history.execute(new Oe(t.wireFrame,t.wireFrame.node.mindmap));break;case"deleteRelateLink":if((d=t.link.startNode).mindmap.isRead)return;this.history.execute(new Ve(t.link));break;case"changeLayout":d=t.node;if("table"==(n=t.direct)||"up"==n){var p=!0;d.mindmap.traverseBF((e=>{e!=d&&"table"==n?(e.callout&&(p=!1),e.layout&&(p=!1),e.wfs&&e.wfs.length&&(p=!1),e.induces&&e.induces.length&&(p=!1)):e!=d&&"up"==n&&e.layout&&(p=!1)}),d),p?this.history.execute(new We(t.node,t.direct)):null===(i=d.mindmap.view)||void 0===i||i.showChangelayoutMessage()}else this.history.execute(new We(t.node,t.direct));break;case"changeSummary":this.history.execute(new Ue(t.summary,t.stroke));break;case"changeWireFrame":this.history.execute(new Xe(t.wireFrame,t.stroke,t.background));break;case"changeLinkStroke":this.history.execute(new Ge(t.link,t.stroke));break;case"changeLinkType":this.history.execute(new Ye(t.link,t.type));break;case"note":d=t.node;var m=t.note;d&&this.history.execute(new Ke(d,m));break;case"addFreeNode":this.history.execute(new Ze(t.node));break;case"pasteNode":this.history.execute(new Je(t.node,t.data,t.summary));break;case"setNodeStyle":this.history.execute(new $e(t.nodes,t.style));break;case"addCallout":this.history.execute(new et(t.node,t.callout));break;case"removeCallout":this.history.execute(new tt(t.callout));break;case"removeNodeLayout":this.history.execute(new it(t.node));break;case"changeWireFrameName":this.history.execute(new st(t.wireFrame,t.text));break;case"setTextCover":this.history.execute(new rt(t.node,t.flag))}}undo(){this.history.undo()}redo(){this.history.redo()}}class at{constructor(e,t="rgba(213,233,252,.1)",i="rgb(42,122,194)",n={text:"",nodeType:"wireFrame"}){this.node=e,this.endNode=e,this.node.clearCacheData(),this.stroke=i,this.fill=t,this.lineDash=[6,2],this.data=n,this.status="",this.shapeType="rect",this.lineWidth=1,this.radius=10,this.node.wireFrame=this,this.mind=this.node.getMind(),this.name="wireFrame",this.isHide=!1,this.rangeNode=[],this.refreshNode(),this.refreshItems(),this.init()}init(){this.direct=this.node.direct,this.beforeCreate(),this.create()}setEndNode(e){this.endNode=e,this.refreshNode(),this.refresh()}refreshNode(){var e=this.node.getShowNodeList();this.endNode&&this.endNode!=this.node&&(e=e.concat(this.endNode.getShowNodeList()));var t=this.node.getMind().getBoundingRect(e);this.topNode=t.topNode,this.bottomNode=t.bottomNode,this.leftNode=t.leftNode,this.rightNode=t.rightNode,this.node.refreshCBox(),this.endNode&&this.endNode.refreshCBox()}beforeCreate(){if(this.group||(this.group=this.mind.wireFrameGroup.group()),this.data.text){if(!this.t)if(this._t)this.t=this._t,this._t=null;else{var e=this.data.nodeData||{id:os(),text:this.data.text,nodeType:"wireFrame",style:{"padding-left":6,"padding-right":6,"padding-bottom":4,"padding-top":4,"background-color":"rgb(16, 151, 232)",color:"#333",fontSize:12}};this.t=new ce(e,this.mind),this.t.wireFrame=this,this.t.containEl.setAttribute("draggable",!1),this.t.nodeType="wireFrame"}this.t.containEl.classList.contains("node-wireFrame")||this.t.containEl.classList.add("node-wireFrame"),this.mind.contentEL.contains(this.t.containEl)||this.mind.contentEL.appendChild(this.t.containEl),this.t.mindmap=this.mind}else this.t&&(this.mind.contentEL.removeChild(this.t.containEl),this._t=this.t,this.t=null);this.rect||("rect"==this.shapeType?this.rect=this.group.rect().fill(this.fill).stroke(`color:${this.stroke},width:${this.lineWidth},dasharray:${this.lineDash}`).radius(this.radius):this.rect=this.group.polygon().stroke(`color:${this.stroke},width:${this.lineWidth||2},dasharray:${this.lineDash}`)),this.rect.off("click").on("click",(e=>{e.preventDefault(),e.stopPropagation(),this.node.getMind().emit("showWireFrame",{wf:this})}))}getTextBox(){return this.data.text?this.t.getDomBox():{x:0,y:0,width:0,height:0}}move(e,t){e=parseInt(e),t=parseInt(t);var i=this.position.slice();if(this.setPosition(i[0]+e,i[1]+t),this.t){var n=this.t.getPosition();this.t.setPosition(n.x+e,n.y+t)}this.refreshBox()}refreshItems(){var e=this,t=[],i=[],n=[];if(this.rangeNode&&this.rangeNode.length)this.rangeNode.forEach((e=>{n=n.concat(e.getShowNodeList())})),this.node.isHide&&this.endNode.isHide&&this.hide();else{this.rangeNode=[];var s=this.node.parent;if(s){var r=s.children.indexOf(this.node),o=s.children.indexOf(this.endNode);s.children.forEach(((t,i)=>{i>=r&&i<=o&&(e.rangeNode.push(t),n=n.concat(t.getShowNodeList()))})),e.rangeNode=Ei(e.rangeNode)}else e.rangeNode=[this.node],n=n.concat(this.node.getShowNodeList())}n.forEach((e=>{i.push(e),e.containBar=!1,e.isExpand||(e.containBar=!0),e.layout&&e.layout.isShow&&e.layout.group&&t.push(e.layout),e.callout&&e.callout.isShow&&i.push(e.callout),e.layout&&e.layout.isShow&&e.layout.group&&t.push(e.layout),e.wireFrames.length&&e.wireFrames.forEach((e=>{e.isHide||i.push(e)})),e.summaries.length&&e.summaries.forEach((e=>{e.isShow()&&(i=i.concat(e.getAllItem()))}))}));var a=this.node.mindmap.wireFrames,h=[];a.forEach((e=>{e&&e!=this&&e.node.parent==this.node.parent&&h.push(e)}));var l=[],d=this.node.parent;if(d){var c=d.children.indexOf(this.node);if(this.endNode)var u=d.children.indexOf(this.endNode);else u=c;Ei(h).forEach((e=>{if(e){var t=d.children.indexOf(e.node);if(e.endNode)var i=d.children.indexOf(e.endNode);else i=t;if(t==c&&i==u)return;t>=c&&i<=u&&l.push(e)}}))}this.items=Ei(i.concat(l)),this._wfs=l,this.groups=Ei(t)}create(){if(this.group)if(this.node.isShow()&&this.endNode.isShow()&&!this.isShow){this.show();var e=this.items,t=this.groups,i=this.mind.getBoundingRect(e);if(t.length&&t.forEach((e=>{if("fish"==e.layoutName&&("right"==e.direct?e.creatBone():e.creatBone1(),e.fishTail)){var t=e.fishTail.bbox();t.xi.right&&(i.right=t.x+t.width),t.y+t.height>i.bottom&&(i.bottom=t.y+t.height),i.width=i.right-i.x,i.height=i.bottom-i.y}})),i){var n=parseInt(i.width+12),s=parseInt(i.height+12);if("rect"==this.shapeType)this.rect.attr({width:n,height:s,fill:this.fill,cursor:"pointer"}).stroke({color:this.stroke,width:this.lineWidth,dasharray:this.lineDash}).radius(this.radius).move(0,0);else{var r=this.node.getBox(),o=this.node.getPosition(),a=[0,Math.abs(o.y-i.y-6)],h=[0,Math.abs(i.y-o.y-r.height-6)],l=[r.width,0],d=[r.width,i.height+12],c=[i.width+12,0],u=[i.width+12,i.height+12];this.rect.plot([a,l,c,u,d,h]).attr({fill:this.fill,stroke:this.stroke,dasharray:this.lineDash,cursor:"pointer"}).move(0,0)}this.position=[];var p=0;if(this.lineWidth%2==1&&(p=.5),this.setPosition(parseInt(i.x-6)+p,parseInt(i.y-6)+p),this.t)if("rect"==this.shapeType){this.t.isShow()||this.t.show();var m=this.t.getDomBox();this.textBox=m,this.t.setPosition(i.x,i.y-m.height-5-this.lineWidth),this.t.containEl.style.maxWidth=i.width-30+"px"}else this.t.isShow()&&this.t.hide();this.refreshBox()}}else this.hide()}refresh(){this.init()}setPosition(e,t){this.group&&(e||t)&&(this.position=[e,t],this.group.attr({transform:`translate(${e},${t})`}))}getPosition(){return{x:this.position.slice()[0],y:this.position.slice()[1]}}show(){this.group.show(),this.t&&this.t.show(),this.isHide=!1}hide(){this.group.hide(),this.t&&this.t.hide(),this.isHide=!0}remove(){this.group&&this.group.clear()&&this.group.remove(),this.rect&&this.rect.remove(),this.t&&this.mind.contentEL.removeChild(this.t.containEl),this.rect=null,this.t=null,this.group=null}off(){this.rect.off()}active(){this.status="active",this.rect.setStyle("stroke","orange")}unactive(){this.status="unactive",this.rect.setStyle("stroke",this.stroke)}isactive(){return"active"==this.status}getData(){var e=this.node.parent,t=0,i=0;e&&(t=e.children.indexOf(this.node),i=e.children.indexOf(this.endNode));var n={stroke:this.stroke,fill:this.fill,lineDash:this.lineDash.slice(),data:{...this.data},radius:this.radius,lineWidth:this.lineWidth,nodeId:this.node.getId(),endNodeId:this.endNode.getId(),range:`${t},${i}`};if(this.t){var s=this.t.getData();n.nodeData=s,n.text=s.text}return n}setData(e){this.stroke=e.stroke,this.fill=e.fill,this.lineDash=e.lineDash,this.data=e.data,this.lineWidth=e.lineWidth,this.radius=e.radius,this.refresh()}setGroupName(e){this.data.text=e,this.t&&e&&this.t.setText(e),this.refresh()}getGroupName(){return this.t&&this.t.getData().text||""}refreshBox(){var e=this.rect.bbox();this.box={...e,x:this.position[0],y:this.position[1]}}getBox(){return this.box}getBBox(){if(this.t){var e={...this.getBox()},t=this.t.getDomBox(),i=this.t.getPosition();e.y=i.y,e.height=e.height+t.height}else e=this.getBox();return e}}const ht=function(e,t){return[e[0]+t[0],e[1]+t[1]]},lt=function(e,t){return[e[0]*t,e[1]*t]},dt=function(e,t){return e[0]*t[1]-e[1]*t[0]==0},ct=function(e,t){return e[0]*t[0]+e[1]*t[1]};function ut(e,t){return e.find((e=>e!=t))}function pt(e){return(0!=e[0]||0!=e[1])&&(0==e[0]?[0,e[1]/Math.abs(e[1])]:0==e[1]?[e[0]/Math.abs(e[0]),0]:function(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}(e))}function mt(e){return function(e,t){var i,n=t/2,s=0,r=0;for(i=0;iMath.abs(t[1])?[t[0]/Math.abs(t[0]),0]:[0,t[1]/Math.abs(t[1])]}var a,h;let l=ht(e,lt(t,i)),d=ht(n,lt(s,r));s=lt(s,-1);let c,u,p=[[d[0]-l[0],0],[0,d[1]-l[1]]],m=p.find((e=>dt(e,t)));c=ct(m,t)>0?m:ut(p,m);let f=p.find((e=>dt(e,s)));u=ct(f,s)>0?f:ut(p,f);let g=ct(c,u)>0?2:1,v=ut(p,u),y=[];if(y.push({position:e,direction:null},{position:l,direction:t}),1==g){let e=ht(l,c),t=pt(c),i=ht(e,u),n=pt(u);y.push({position:e,direction:t},{position:i,direction:n})}else{let e=ht(l,lt(c,o)),t=pt(c),i=ht(e,v),n=pt(v),s=ht(i,lt(u,1-o)),r=pt(u);y.push({position:e,direction:t},{position:i,direction:n,type:"pathMiddleP"},{position:s,direction:r})}return y.push({position:n,direction:s}),y.filter((e=>!1!==e.direction))}({entryPoint:[this.box.x,this.box.y],exitPoint:[this.box.x1,this.box.y1],entryDirection:this.entryDirection,exitDirection:this.exitDirection,entryExt:this.entryExt,exitExt:this.exitExt}),o=[];r.forEach((e=>{o.push(e.position)})),this.data.width%2==1?o.forEach((e=>{e[0]=parseInt(e[0])+.5,e[1]=parseInt(e[1])+.5})):o.forEach((e=>{e[0]=parseInt(e[0]),e[1]=parseInt(e[1])}));var a=mt(o);i=this.textNode.getDomBox();this.textNode.setPosition(a[0]-i.width/2,a[1]-i.height/2),this.bs.plot(o)}this.bs.stroke({color:this.data.color,width:this.data.width,dasharray:this.data.dashArray,linecap:"round",linejoin:"round"}).fill("none"),this.createMarker(),this.bs.attr("cursor","pointer"),this.corl1.style.left=this.box.cpx1-5+"px",this.corl1.style.top=this.box.cpy1-5+"px",this.corl2.style.left=this.box.cpx2-5+"px",this.corl2.style.top=this.box.cpy2-5+"px",this.line1.plot(this.box.x,this.box.y,this.box.cpx1,this.box.cpy1),this.line2.plot(this.box.x1,this.box.y1,this.box.cpx2,this.box.cpy2)}select(){this.isSelect=!0}unSelect(){this.isSelect=!1}calcPos(e,t){return t.x<=e.x&&t.y<=e.y?"lefttop":t.x<=e.x&&t.y>e.y?"leftbottom":t.x>e.x&&t.y<=e.y?"righttop":"rightbotom"}move(e,t){this.box.x1=e,this.box.y1=t,this.calcPoint(),this.refresh()}setEndNode(e){this.endNode=e,this.calcLimit(),this.calcDirect()}setStartPoint(e,t){if(e&&t)this.box.x=e,this.box.y=t;else{var i=this.startNode.getBox();this.box.x=i.x+i.width/2,this.box.y=i.y+i.height/2}}setEndPoint(e,t){this.box.x1=e,this.box.y1=t}setBox(e){this.box=e,this.refresh()}getData(){this.data.nodeData=this.textNode.getData();var e={startNodeId:this.startNode.getId(),endNodeId:this.endNode.getId(),...this.data,box:{...this.box}};return e.entryDirection=this.entryDirection,e.exitDirection=this.exitDirection,e.box&&e.box.data&&delete e.box.data,e}_mouseDown(e){e.preventDefault(),e.stopPropagation(),this.func1&&(this.mind.isMobile?document.removeEventListener("touchmove",this.func1,!1):document.removeEventListener("mousemove",this.func1)),this.func2&&(this.mind.isMobile?document.removeEventListener("touchend",this.func2):document.removeEventListener("mouseup",this.func2)),this.mind=this.startNode.getMind(),this.mind.isMobile?(this.sx=e.touches[0].pageX,this.sy=e.touches[0].pageY,this.pageX=e.touches[0].pageX,this.pageY=e.touches[0].pageY):(this.sx=e.pageX,this.sy=e.pageY,this.pageX=e.pageX,this.pageY=e.pageY),this.dx=0,this.dy=0,this.drag=!0,this.status="changeRelate",this.target=e.target,this.oldBox=JSON.parse(JSON.stringify({...this.box}));var t=JSON.parse(JSON.stringify(this.data));this.oldBox.data=t,this.func1=this._mouseMove.bind(this),this.func2=this._mouseUp.bind(this),this.mind.isMobile?(document.addEventListener("touchmove",this.func1,!1),document.addEventListener("touchend",this.func2)):(document.addEventListener("mousemove",this.func1),document.addEventListener("mouseup",this.func2))}_mouseUp(){this.drag=!1,this.sx=0,this.sy=0,this.dx=0,this.dy=0,this.mind=this.startNode.getMind();var e=JSON.parse(JSON.stringify({...this.box})),t=JSON.parse(JSON.stringify(this.data));e.data=t,this.mind.execute("changeRelateLink",{link:this,oldBox:this.oldBox,box:e,type:"changeRelateLinkBox"}),this.target=null,this.mind.isMobile?(document.removeEventListener("touchmove",this.func1,!1),document.removeEventListener("touchend",this.func2)):(document.removeEventListener("mousemove",this.func1),document.removeEventListener("mouseup",this.func2))}_mouseMove(e){if("addRelate"==this.status)this.mind.isMobile||this.move(e.offsetX-8,e.offsetY);else{if(!this.drag)return;if(this.target){if(e.preventDefault(),e.stopPropagation(),this.mind.isMobile)var t=e.touches[0].pageX,i=e.touches[0].pageY;else t=e.pageX,i=e.pageY;var n=t-this.pageX,s=i-this.pageY;this.dx=t-this.sx,this.dy=i-this.sy,this.pageX=t,this.pageY=i;var r=this.target.getAttribute("direct");if(this.calcLimit(),"start"==r){this.box.cpx1=this.oldBox.cpx1+this.dx,this.box.cpy1=this.oldBox.cpy1+this.dy;var o=this.calcStroke({x:this.box.x,y:this.box.y},this.startBox);if(this.startBox.width>400)var a=1.2;else if(this.startBox.width>200)a=1.5;else a=2;switch(o){case"left":this.entryDirection=[-1,0],this.box.y>=this.startLimit.y&&this.box.y<=this.startLimit.y1?this.box.y+=s/a:(this.box.ythis.startLimit.y1&&(this.box.y=this.startLimit.y1));break;case"right":this.entryDirection=[1,0],this.box.y>=this.startLimit.y&&this.box.y<=this.startLimit.y1?this.box.y+=s/a:(this.box.ythis.startLimit.y1&&(this.box.y=this.startLimit.y1));break;case"top":this.entryDirection=[0,-1],this.box.x>=this.startLimit.x&&this.box.x<=this.startLimit.x1?this.box.x+=n/a:(this.box.xthis.startLimit.x1&&(this.box.x=this.startLimit.x1));break;case"bottom":this.entryDirection=[0,1],this.box.x>=this.startLimit.x&&this.box.x<=this.startLimit.x1?this.box.x+=n/a:(this.box.xthis.startLimit.x1&&(this.box.x=this.startLimit.x1));break;default:this.box.x>=this.startLimit.x&&this.box.x<=this.startLimit.x1?this.box.x+=n/a:(this.box.xthis.startLimit.x1&&(this.box.x=this.startLimit.x1)),this.box.y>=this.startLimit.y&&this.box.y<=this.startLimit.y1?this.box.y+=s/a:(this.box.ythis.startLimit.y1&&(this.box.y=this.startLimit.y1))}}else{switch(this.box.cpx2=this.oldBox.cpx2+this.dx,this.box.cpy2=this.oldBox.cpy2+this.dy,o=this.calcStroke({x:this.box.x1,y:this.box.y1},this.endBox)){case"left":this.exitDirection=[-1,0],this.box.y1>=this.endLimit.y&&this.box.y1<=this.endLimit.y1?this.box.y1+=s/3:(this.box.y1this.endLimit.y1&&(this.box.y1=this.endLimit.y1));break;case"right":this.exitDirection=[1,0],this.box.y1>=this.endLimit.y&&this.box.y1<=this.endLimit.y1?this.box.y1+=s/3:(this.box.y1this.endLimit.y1&&(this.box.y1=this.endLimit.y1));break;case"top":this.exitDirection=[0,-1],this.box.x1>=this.endLimit.x&&this.box.x1<=this.endLimit.x1?this.box.x1+=n/3:(this.box.x1this.endLimit.x1&&(this.box.x1=this.endLimit.x1));break;case"bottom":this.exitDirection=[0,1],this.box.x1>=this.endLimit.x&&this.box.x1<=this.endLimit.x1?this.box.x1+=n/3:(this.box.x1this.endLimit.x1&&(this.box.x1=this.endLimit.x1));break;default:this.box.x1>=this.endLimit.x&&this.box.x1<=this.endLimit.x1?this.box.x1+=n/3:(this.box.x1this.endLimit.x1&&(this.box.x1=this.endLimit.x1)),this.box.y1>=this.endLimit.y&&this.box.y1<=this.endLimit.y1?this.box.y1+=s/3:(this.box.y1this.endLimit.y1&&(this.box.y1=this.endLimit.y1))}}this.clacDD(),this.refresh()}}}_clickFn(e){e.preventDefault(),e.stopPropagation()}_addEvent(){this.drawFunc1=this._mouseMove.bind(this),this.drawFunc2=this._mouseUp.bind(this),this.mind.isMobile?this.mind.draw.on("touchend",this.drawFunc2):(this.mind.draw.on("mousemove",this.drawFunc1),this.mind.draw.on("mouseup",this.drawFunc2)),this._addLineEvent()}_addLineEvent(){this.bs.off("click"),this.bs.off("dblclick");var e=this;this.bs.dblclick((()=>{this.textNode.data.text||this.textNode.data.isImageNode||(this.data.nodeHide=!1,this.startNode.mindmap.clearSelectNode(),this.startNode.mindmap.updateRelateLink(),this.textNode.edit())})),this.bs.click((t=>{t.preventDefault(),t.stopPropagation();var i=t.offsetX,n=t.offsetY;e.active(),e.mind._changeAssistItem=e,e.mind.emit("showRelateLink",{x:i,y:n,relateLink:e})}))}addEvent(){this.func=this._mouseDown.bind(this),this.clickFn=this._clickFn.bind(this),this.mind.isMobile?(this.corl1.addEventListener("touchstart",this.func),this.corl2.addEventListener("touchstart",this.func)):(this.corl1.addEventListener("mousedown",this.func),this.corl2.addEventListener("mousedown",this.func)),this.corl1.addEventListener("click",this.clickFn),this.corl2.addEventListener("click",this.clickFn)}}class vt{constructor(e,t={id:os(),text:"callout",nodeType:"callout",style:{"background-color":"#f06",color:"#fff","font-size":"12px"}}){this.node=e,this.data=t,t.style?this.color=t.style["background-color"]||"#f06":this.color="#f06",this.root=new ce(t,this.node.getMind()),this.root.nodeType="callout",this.group=this.node.getMind().calloutGroup,this.node.getMind().contentEL.appendChild(this.root.containEl),this.root.mind=this.node.getMind(),this.root.refreshBox(),this.node.clearCacheData(),this.node.callout=this,this.root.callout=this,this.direct=this.data.direct||"top",this.name="callout",this.init()}init(){this.calcLimit(),this.create(),this.initEvent()}off(){e.Platform.isDesktopApp?this.root.containEl.removeEventListener("mousedown",this._mouseDown):e.Platform.isMobileApp&&this.root.containEl.removeEventListener("touchstart",this._mouseDown)}remove(){this.polygon&&this.polygon.remove(),this.polygon=null}move(e,t){this.point={x:this.point.x+e,y:this.point.y+t},this.root.move(e,t),this.refresh()}calcLimit(){var e=this.node.getBox();this.limit={x:e.x,y:e.y,width:e.width,height:e.height,cx:e.x+e.width/2,cy:e.y+e.height/2,x1:e.x+e.width,y1:e.y+e.height}}beforeCreate(){!this.polygon&&(this.polygon=this.group.polygon().fill(this.color)),this.root.containEl.setAttribute("draggable",!1),this.root.containEl.classList.add("mm-node-callout")}create(){if(this.beforeCreate(),this.data.x&&this.data.y)this.root.setPosition(this.data.x,this.data.y),this.data.box&&(this.box=this.data.box);else{var e=this.root.getBox();this.root.setPosition(this.limit.x+this.limit.width/2-e.width/2,this.limit.y-e.height-10)}if(this.data.point?this.point=this.data.point:this.point={x:this.limit.cx,y:this.limit.y},!this.box){var t=this.root.getPosition();this.box={dx:(t.x-this.limit.x)/this.limit.width,dy:(t.y-this.limit.y)/this.limit.height,px:(this.point.x-this.limit.x)/this.limit.width,py:(this.point.y-this.limit.y)/this.limit.height}}this.refresh(!0)}refresh(e){if(this.polygon)if(this.node.isShow()){this.show(),this.calcLimit(),e||(this.point.x=this.box.px*this.limit.width+this.limit.x,this.point.y=this.box.py*this.limit.height+this.limit.y,this.root.setPosition(this.box.dx*this.limit.width+this.limit.x,this.box.dy*this.limit.height+this.limit.y));var t=this.root.getBox(),i=t.x+t.width/2,n=t.y+t.height/2;(this.point.x||this.point.y)&&("top"==this.direct||"bottom"==this.direct?this.polygon.plot(`${this.point.x},${this.point.y} ${i-8},${n} ${i+8},${n}`).fill(this.color):this.polygon.plot(`${this.point.x},${this.point.y} ${i},${n-8} ${i},${n+8}`).fill(this.color))}else this.hide()}hide(){this.isShow=!1,this.root.hide(),this.polygon.hide()}show(){this.isShow=!0,this.root.show(),this.polygon.show()}getData(){var e=this.root.getData();return e.point=this.point,e.box=this.box,{nodeId:this.node.getId(),rootData:e,color:this.color,direct:this.direct}}setData(e){this.color=e.color}getBox(){var e=this.polygon.bbox(),t=this.root.getBox(),i=Math.min(e.x,t.x),n=Math.min(e.y,t.y),s=Math.max(e.x2,t.x+t.width),r=Math.max(e.y2,t.y+t.height);return{x:i,y:n,x1:s,y1:r,width:s-i,height:r-n}}initEvent(){var t,i,n,s,r,o,a,h=!1;this._mouseDown=function(n){if(!this.root.isEdit){h=!0,e.Platform.isDesktopApp?(t=n.pageX,i=n.pageY,this.px=n.pageX,this.py=n.pageY):(t=n.touches[0].pageX,i=n.touches[0].pageY,this.px=t,this.py=i),a=this.root.getPosition();var s={...this.box};a.direct=this.direct,a.box=s,e.Platform.isDesktopApp?(document.addEventListener("mousemove",this._mouseMove),document.addEventListener("mouseup",this._mouseUp)):(document.addEventListener("touchmove",this._mouseMove,{passive:!1}),document.addEventListener("touchend",this._mouseUp))}}.bind(this),e.Platform.isDesktopApp?this.root.containEl.addEventListener("mousedown",this._mouseDown):this.root.containEl.addEventListener("touchstart",this._mouseDown),this._mouseMove=function(e){h&&(e.touches?(e.preventDefault(),r=e.touches[0].pageX-this.px,o=e.touches[0].pageY-this.py,n=e.touches[0].pageX-t,s=e.touches[0].pageY-i):(r=e.pageX-this.px,o=e.pageY-this.py,n=e.pageX-t,s=e.pageY-i),this.point.x<=this.limit.x||this.point.x>=this.limit.x1?this.point.y+=o/4:this.point.x+=r/4,this.point.y<=this.limit.y||this.point.y>=this.limit.y1?this.point.x+=r/4:this.point.y+=o/4,this.point.x<=this.limit.x&&(this.point.x=this.limit.x,this.direct="left"),this.point.x>=this.limit.x1&&(this.point.x=this.limit.x1,this.direct="right"),this.point.y<=this.limit.y&&(this.point.y=this.limit.y,this.direct="top"),this.point.y>=this.limit.y1&&(this.point.y=this.limit.y1,this.direct="bottom"),this.root.setPosition(a.x+n,a.y+s),this.box={dx:(a.x+n-this.limit.x)/this.limit.width,dy:(a.y+s-this.limit.y)/this.limit.height,px:(this.point.x-this.limit.x)/this.limit.width,py:(this.point.y-this.limit.y)/this.limit.height},this.refresh(!0),e.touches?(this.px=e.touches[0].pageX,this.py=e.touches[0].pageY):(this.px=e.pageX,this.py=e.pageY))}.bind(this),this._mouseUp=function(t){h=!1,this.node.clearCacheData(),this.refresh(),this.node.refreshCBox();var i=this.root.getPosition();i.box={...this.box},i.direct=this.direct,this.node.getMind().execute("movePosition",{node:this.root,oldPos:a,newPos:i}),e.Platform.isDesktopApp?(document.removeEventListener("mousemove",this._mouseMove),document.removeEventListener("mouseup",this._mouseUp)):(document.removeEventListener("touchmove",this._mouseMove,{passive:!1}),document.removeEventListener("touchend",this._mouseUp))}.bind(this)}}function yt(e){return Array.isArray?Array.isArray(e):"[object Array]"===Et(e)}function At(e){return"string"==typeof e}function xt(e){return"number"==typeof e}function bt(e){return!0===e||!1===e||function(e){return wt(e)&&null!==e}(e)&&"[object Boolean]"==Et(e)}function wt(e){return"object"==typeof e}function kt(e){return null!=e}function Ct(e){return!e.trim().length}function Et(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Dt=Object.prototype.hasOwnProperty;class Nt{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let i=It(e);t+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function It(e){let t=null,i=null,n=null,s=1;if(At(e)||yt(e))n=e,t=St(e),i=Bt(e);else{if(!Dt.call(e,"name"))throw new Error((e=>`Missing ${e} property in key`)("name"));const r=e.name;if(n=r,Dt.call(e,"weight")&&(s=e.weight,s<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(r));t=St(r),i=Bt(r)}return{path:t,id:i,weight:s,src:n}}function St(e){return yt(e)?e:e.split(".")}function Bt(e){return yt(e)?e.join("."):e}var Mt={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx{if(kt(e))if(t[r]){const o=e[t[r]];if(!kt(o))return;if(r===t.length-1&&(At(o)||xt(o)||bt(o)))i.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(o));else if(yt(o)){n=!0;for(let e=0,i=o.length;e{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,At(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();At(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,i=this.size();t{let s=this.getFn(e,t.path);if(kt(s))if(yt(s)){let e=[];const t=[{nestedArrIndex:-1,value:s}];for(;t.length;){const{nestedArrIndex:i,value:n}=t.pop();if(kt(n))if(At(n)&&!Ct(n)){let t={v:n,i:i,n:this.norm.get(n)};e.push(t)}else yt(n)&&n.forEach(((e,i)=>{t.push({nestedArrIndex:i,value:e})}))}i.$[n]=e}else if(!Ct(s)){let e={v:s,n:this.norm.get(s)};i.$[n]=e}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function Pt(e,t,{getFn:i=Mt.getFn}={}){const n=new Lt({getFn:i});return n.setKeys(e.map(It)),n.setSources(t),n.create(),n}function Ot(e,{errors:t=0,currentLocation:i=0,expectedLocation:n=0,distance:s=Mt.distance,ignoreLocation:r=Mt.ignoreLocation}={}){const o=t/e.length;if(r)return o;const a=Math.abs(n-i);return s?o+a/s:a?1:o}function Rt(e,t,i,{location:n=Mt.location,distance:s=Mt.distance,threshold:r=Mt.threshold,findAllMatches:o=Mt.findAllMatches,minMatchCharLength:a=Mt.minMatchCharLength,includeMatches:h=Mt.includeMatches,ignoreLocation:l=Mt.ignoreLocation}={}){if(t.length>32)throw new Error(`Pattern length exceeds max of ${32}.`);const d=t.length,c=e.length,u=Math.max(0,Math.min(n,c));let p=r,m=u;const f=a>1||h,g=f?Array(c):[];let v;for(;(v=e.indexOf(t,m))>-1;){let e=Ot(t,{currentLocation:v,expectedLocation:u,distance:s,ignoreLocation:l});if(p=Math.min(e,p),m=v+d,f){let e=0;for(;e=h;r-=1){let o=r-1,a=i[e.charAt(o)];if(f&&(g[o]=+!!a),w[r]=(w[r+1]<<1|1)&a,n&&(w[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),w[r]&b&&(A=Ot(t,{errors:n,currentLocation:o,expectedLocation:u,distance:s,ignoreLocation:l}),A<=p)){if(p=A,m=o,m<=u)break;h=Math.max(1,2*u-m)}}if(Ot(t,{errors:n+1,currentLocation:u,expectedLocation:u,distance:s,ignoreLocation:l})>p)break;y=w}const w={isMatch:m>=0,score:Math.max(.001,A)};if(f){const e=function(e=[],t=Mt.minMatchCharLength){let i=[],n=-1,s=-1,r=0;for(let o=e.length;r=t&&i.push([n,s]),n=-1)}return e[r-1]&&r-n>=t&&i.push([n,r-1]),i}(g,a);e.length?h&&(w.indices=e):w.isMatch=!1}return w}function Ft(e){let t={};for(let i=0,n=e.length;i{this.chunks.push({pattern:e,alphabet:Ft(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0;const t=d%32,i=d-t;for(;e{const{isMatch:m,score:f,indices:g}=Rt(e,t,u,{location:n+p,distance:s,threshold:r,findAllMatches:o,minMatchCharLength:a,includeMatches:i,ignoreLocation:h});m&&(c=!0),d+=f,m&&g&&(l=[...l,...g])}));let u={isMatch:c,score:c?d/this.chunks.length:1};return c&&i&&(u.indices=l),u}}class zt{constructor(e){this.pattern=e}static isMultiMatch(e){return Qt(e,this.multiRegex)}static isSingleMatch(e){return Qt(e,this.singleRegex)}search(){}}function Qt(e,t){const i=e.match(t);return i?i[1]:null}class Ht extends zt{constructor(e,{location:t=Mt.location,threshold:i=Mt.threshold,distance:n=Mt.distance,includeMatches:s=Mt.includeMatches,findAllMatches:r=Mt.findAllMatches,minMatchCharLength:o=Mt.minMatchCharLength,isCaseSensitive:a=Mt.isCaseSensitive,ignoreLocation:h=Mt.ignoreLocation}={}){super(e),this._bitapSearch=new _t(e,{location:t,threshold:i,distance:n,includeMatches:s,findAllMatches:r,minMatchCharLength:o,isCaseSensitive:a,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class jt extends zt{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,i=0;const n=[],s=this.pattern.length;for(;(t=e.indexOf(this.pattern,i))>-1;)i=t+s,n.push([t,i-1]);const r=!!n.length;return{isMatch:r,score:r?0:1,indices:n}}}const qt=[class extends zt{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},jt,class extends zt{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends zt{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends zt{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends zt{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends zt{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},Ht],Vt=qt.length,Wt=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;const Ut=new Set([Ht.type,jt.type]);class Xt{constructor(e,{isCaseSensitive:t=Mt.isCaseSensitive,includeMatches:i=Mt.includeMatches,minMatchCharLength:n=Mt.minMatchCharLength,ignoreLocation:s=Mt.ignoreLocation,findAllMatches:r=Mt.findAllMatches,location:o=Mt.location,threshold:a=Mt.threshold,distance:h=Mt.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:i,minMatchCharLength:n,findAllMatches:r,ignoreLocation:s,location:o,threshold:a,distance:h},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map((e=>{let i=e.trim().split(Wt).filter((e=>e&&!!e.trim())),n=[];for(let e=0,s=i.length;e!(!e[Kt]&&!e[Zt]),ti=e=>({[Kt]:Object.keys(e).map((t=>({[t]:e[t]})))});function ii(e,t,{auto:i=!0}={}){const n=e=>{let s=Object.keys(e);const r=(e=>!!e[Jt])(e);if(!r&&s.length>1&&!ei(e))return n(ti(e));if((e=>!yt(e)&&wt(e)&&!ei(e))(e)){const n=r?e[Jt]:s[0],o=r?e[$t]:e[n];if(!At(o))throw new Error((e=>`Invalid value for key ${e}`)(n));const a={keyId:Bt(n),pattern:o};return i&&(a.searcher=Yt(o,t)),a}let o={children:[],operator:s[0]};return s.forEach((t=>{const i=e[t];yt(i)&&i.forEach((e=>{o.children.push(n(e))}))})),o};return ei(e)||(e=ti(e)),n(e)}function ni(e,t){const i=e.matches;t.matches=[],kt(i)&&i.forEach((e=>{if(!kt(e.indices)||!e.indices.length)return;const{indices:i,value:n}=e;let s={indices:i,value:n};e.key&&(s.key=e.key.src),e.idx>-1&&(s.refIndex=e.idx),t.matches.push(s)}))}function si(e,t){t.score=e.score}class ri{constructor(e,t={},i){this.options={...Mt,...t},this.options.useExtendedSearch,this._keyStore=new Nt(this.options.keys),this.setCollection(e,i)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Lt))throw new Error("Incorrect 'index' type");this._myIndex=t||Pt(this.options.keys,this._docs,{getFn:this.options.getFn})}add(e){kt(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let i=0,n=this._docs.length;i{let i=1;e.matches.forEach((({key:e,norm:n,score:s})=>{const r=e?e.weight:null;i*=Math.pow(0===s&&r?Number.EPSILON:s,(r||1)*(t?1:n))})),e.score=i}))}(a,{ignoreFieldNorm:o}),s&&a.sort(r),xt(t)&&t>-1&&(a=a.slice(0,t)),function(e,t,{includeMatches:i=Mt.includeMatches,includeScore:n=Mt.includeScore}={}){const s=[];return i&&s.push(ni),n&&s.push(si),e.map((e=>{const{idx:i}=e,n={item:t[i],refIndex:i};return s.length&&s.forEach((t=>{t(e,n)})),n}))}(a,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(e){const t=Yt(e,this.options),{records:i}=this._myIndex,n=[];return i.forEach((({v:e,i:i,n:s})=>{if(!kt(e))return;const{isMatch:r,score:o,indices:a}=t.searchIn(e);r&&n.push({item:e,idx:i,matches:[{score:o,value:e,norm:s,indices:a}]})})),n}_searchLogical(e){const t=ii(e,this.options),i=(e,t,n)=>{if(!e.children){const{keyId:i,searcher:s}=e,r=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:s});return r&&r.length?[{idx:n,item:t,matches:r}]:[]}switch(e.operator){case Kt:{const s=[];for(let r=0,o=e.children.length;r{if(kt(e)){let o=i(t,e,n);o.length&&(s[n]||(s[n]={idx:n,item:e,matches:[]},r.push(s[n])),o.forEach((({matches:e})=>{s[n].matches.push(...e)})))}})),r}_searchObjectList(e){const t=Yt(e,this.options),{keys:i,records:n}=this._myIndex,s=[];return n.forEach((({$:e,i:n})=>{if(!kt(e))return;let r=[];i.forEach(((i,n)=>{r.push(...this._findMatches({key:i,value:e[n],searcher:t}))})),r.length&&s.push({idx:n,item:e,matches:r})})),s}_findMatches({key:e,value:t,searcher:i}){if(!kt(t))return[];let n=[];if(yt(t))t.forEach((({v:t,i:s,n:r})=>{if(!kt(t))return;const{isMatch:o,score:a,indices:h}=i.searchIn(t);o&&n.push({score:a,key:e,value:t,idx:s,norm:r,indices:h})}));else{const{v:s,n:r}=t,{isMatch:o,score:a,indices:h}=i.searchIn(s);o&&n.push({score:a,key:e,value:s,norm:r,indices:h})}return n}}ri.version="6.4.6",ri.createIndex=Pt,ri.parseIndex=function(e,{getFn:t=Mt.getFn}={}){const{keys:i,records:n}=e,s=new Lt({getFn:t});return s.setKeys(i),s.setIndexRecords(n),s},ri.config=Mt,ri.parseQuery=ii,function(...e){Gt.push(...e)}(Xt); /*! * jQuery JavaScript Library v3.6.0 * https://jquery.com/ * * Includes Sizzle.js * https://sizzlejs.com/ * * Copyright OpenJS Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2021-03-02T17:08Z */ var oi=me((function(e){!function(t,i){e.exports=t.document?i(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return i(e)}}("undefined"!=typeof window?window:pe,(function(e,t){var i=[],n=Object.getPrototypeOf,s=i.slice,r=function(e){return i.concat.apply([],e)},o=i.push,a=i.indexOf,h={},l=h.toString,d=h.hasOwnProperty,c=d.toString,u=c.call(Object),p={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},f=function(e){return null!=e&&e===e.window},g=e.document,v={type:!0,src:!0,nonce:!0,noModule:!0};function y(e,t,i){var n,s,r=(i=i||g).createElement("script");if(r.text=e,t)for(n in v)(s=t[n]||t.getAttribute&&t.getAttribute(n))&&r.setAttribute(n,s);i.head.appendChild(r).parentNode.removeChild(r)}function A(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?h[l.call(e)]||"object":typeof e}var x="3.6.0",b=function(e,t){return new b.fn.init(e,t)};function w(e){var t=!!e&&"length"in e&&e.length,i=A(e);return!m(e)&&!f(e)&&("array"===i||0===t||"number"==typeof t&&t>0&&t-1 in e)}b.fn=b.prototype={jquery:x,constructor:b,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return b.each(this,e)},map:function(e){return this.pushStack(b.map(this,(function(t,i){return e.call(t,i,t)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(b.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(b.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,i=+e+(e<0?t:0);return this.pushStack(i>=0&&i+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),W=new RegExp(F+"|>"),U=new RegExp(Q),X=new RegExp("^"+_+"$"),G={ID:new RegExp("^#("+_+")"),CLASS:new RegExp("^\\.("+_+")"),TAG:new RegExp("^("+_+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,K=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),ie=function(e,t){var i="0x"+e.slice(1)-65536;return t||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},ne=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,se=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){u()},oe=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{L.apply(B=P.call(b.childNodes),b.childNodes),B[b.childNodes.length].nodeType}catch(e){L={apply:B.length?function(e,t){T.apply(e,P.call(t))}:function(e,t){for(var i=e.length,n=0;e[i++]=t[n++];);e.length=i-1}}}function ae(e,t,n,s){var r,a,l,d,c,m,v,y=t&&t.ownerDocument,b=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==b&&9!==b&&11!==b)return n;if(!s&&(u(t),t=t||p,f)){if(11!==b&&(c=$.exec(e)))if(r=c[1]){if(9===b){if(!(l=t.getElementById(r)))return n;if(l.id===r)return n.push(l),n}else if(y&&(l=y.getElementById(r))&&A(t,l)&&l.id===r)return n.push(l),n}else{if(c[2])return L.apply(n,t.getElementsByTagName(e)),n;if((r=c[3])&&i.getElementsByClassName&&t.getElementsByClassName)return L.apply(n,t.getElementsByClassName(r)),n}if(i.qsa&&!N[e+" "]&&(!g||!g.test(e))&&(1!==b||"object"!==t.nodeName.toLowerCase())){if(v=e,y=t,1===b&&(W.test(e)||V.test(e))){for((y=ee.test(e)&&ve(t.parentNode)||t)===t&&i.scope||((d=t.getAttribute("id"))?d=d.replace(ne,se):t.setAttribute("id",d=x)),a=(m=o(e)).length;a--;)m[a]=(d?"#"+d:":scope")+" "+Ae(m[a]);v=m.join(",")}try{return L.apply(n,y.querySelectorAll(v)),n}catch(t){N(e,!0)}finally{d===x&&t.removeAttribute("id")}}}return h(e.replace(j,"$1"),t,n,s)}function he(){var e=[];return function t(i,s){return e.push(i+" ")>n.cacheLength&&delete t[e.shift()],t[i+" "]=s}}function le(e){return e[x]=!0,e}function de(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ce(e,t){for(var i=e.split("|"),s=i.length;s--;)n.attrHandle[i[s]]=t}function ue(e,t){var i=t&&e,n=i&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(n)return n;if(i)for(;i=i.nextSibling;)if(i===t)return-1;return e?1:-1}function pe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function me(e){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===e}}function fe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&oe(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return le((function(t){return t=+t,le((function(i,n){for(var s,r=e([],i.length,t),o=r.length;o--;)i[s=r[o]]&&(i[s]=!(n[s]=i[s]))}))}))}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in i=ae.support={},r=ae.isXML=function(e){var t=e&&e.namespaceURI,i=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||i&&i.nodeName||"HTML")},u=ae.setDocument=function(e){var t,s,o=e?e.ownerDocument||e:b;return o!=p&&9===o.nodeType&&o.documentElement?(m=(p=o).documentElement,f=!r(p),b!=p&&(s=p.defaultView)&&s.top!==s&&(s.addEventListener?s.addEventListener("unload",re,!1):s.attachEvent&&s.attachEvent("onunload",re)),i.scope=de((function(e){return m.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),i.attributes=de((function(e){return e.className="i",!e.getAttribute("className")})),i.getElementsByTagName=de((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),i.getElementsByClassName=J.test(p.getElementsByClassName),i.getById=de((function(e){return m.appendChild(e).id=x,!p.getElementsByName||!p.getElementsByName(x).length})),i.getById?(n.filter.ID=function(e){var t=e.replace(te,ie);return function(e){return e.getAttribute("id")===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var i=t.getElementById(e);return i?[i]:[]}}):(n.filter.ID=function(e){var t=e.replace(te,ie);return function(e){var i=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return i&&i.value===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var i,n,s,r=t.getElementById(e);if(r){if((i=r.getAttributeNode("id"))&&i.value===e)return[r];for(s=t.getElementsByName(e),n=0;r=s[n++];)if((i=r.getAttributeNode("id"))&&i.value===e)return[r]}return[]}}),n.find.TAG=i.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):i.qsa?t.querySelectorAll(e):void 0}:function(e,t){var i,n=[],s=0,r=t.getElementsByTagName(e);if("*"===e){for(;i=r[s++];)1===i.nodeType&&n.push(i);return n}return r},n.find.CLASS=i.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&f)return t.getElementsByClassName(e)},v=[],g=[],(i.qsa=J.test(p.querySelectorAll))&&(de((function(e){var t;m.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+R+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),de((function(e){e.innerHTML="";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),m.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(i.matchesSelector=J.test(y=m.matches||m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&de((function(e){i.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),v.push("!=",Q)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=J.test(m.compareDocumentPosition),A=t||J.test(m.contains)?function(e,t){var i=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},I=t?function(e,t){if(e===t)return c=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!i.sortDetached&&t.compareDocumentPosition(e)===n?e==p||e.ownerDocument==b&&A(b,e)?-1:t==p||t.ownerDocument==b&&A(b,t)?1:d?O(d,e)-O(d,t):0:4&n?-1:1)}:function(e,t){if(e===t)return c=!0,0;var i,n=0,s=e.parentNode,r=t.parentNode,o=[e],a=[t];if(!s||!r)return e==p?-1:t==p?1:s?-1:r?1:d?O(d,e)-O(d,t):0;if(s===r)return ue(e,t);for(i=e;i=i.parentNode;)o.unshift(i);for(i=t;i=i.parentNode;)a.unshift(i);for(;o[n]===a[n];)n++;return n?ue(o[n],a[n]):o[n]==b?-1:a[n]==b?1:0},p):p},ae.matches=function(e,t){return ae(e,null,null,t)},ae.matchesSelector=function(e,t){if(u(e),i.matchesSelector&&f&&!N[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var n=y.call(e,t);if(n||i.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return ae(t,p,null,[e]).length>0},ae.contains=function(e,t){return(e.ownerDocument||e)!=p&&u(e),A(e,t)},ae.attr=function(e,t){(e.ownerDocument||e)!=p&&u(e);var s=n.attrHandle[t.toLowerCase()],r=s&&S.call(n.attrHandle,t.toLowerCase())?s(e,t,!f):void 0;return void 0!==r?r:i.attributes||!f?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},ae.escape=function(e){return(e+"").replace(ne,se)},ae.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ae.uniqueSort=function(e){var t,n=[],s=0,r=0;if(c=!i.detectDuplicates,d=!i.sortStable&&e.slice(0),e.sort(I),c){for(;t=e[r++];)t===e[r]&&(s=n.push(r));for(;s--;)e.splice(n[s],1)}return d=null,e},s=ae.getText=function(e){var t,i="",n=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)i+=s(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[n++];)i+=s(t);return i},(n=ae.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ie),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ie),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ae.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ae.error(e[0]),e},PSEUDO:function(e){var t,i=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":i&&U.test(i)&&(t=o(i,!0))&&(t=i.indexOf(")",i.length-t)-i.length)&&(e[0]=e[0].slice(0,t),e[2]=i.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ie).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"("+F+"|$)"))&&C(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,i){return function(n){var s=ae.attr(n,e);return null==s?"!="===t:!t||(s+="","="===t?s===i:"!="===t?s!==i:"^="===t?i&&0===s.indexOf(i):"*="===t?i&&s.indexOf(i)>-1:"$="===t?i&&s.slice(-i.length)===i:"~="===t?(" "+s.replace(H," ")+" ").indexOf(i)>-1:"|="===t&&(s===i||s.slice(0,i.length+1)===i+"-"))}},CHILD:function(e,t,i,n,s){var r="nth"!==e.slice(0,3),o="last"!==e.slice(-4),a="of-type"===t;return 1===n&&0===s?function(e){return!!e.parentNode}:function(t,i,h){var l,d,c,u,p,m,f=r!==o?"nextSibling":"previousSibling",g=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!h&&!a,A=!1;if(g){if(r){for(;f;){for(u=t;u=u[f];)if(a?u.nodeName.toLowerCase()===v:1===u.nodeType)return!1;m=f="only"===e&&!m&&"nextSibling"}return!0}if(m=[o?g.firstChild:g.lastChild],o&&y){for(A=(p=(l=(d=(c=(u=g)[x]||(u[x]={}))[u.uniqueID]||(c[u.uniqueID]={}))[e]||[])[0]===w&&l[1])&&l[2],u=p&&g.childNodes[p];u=++p&&u&&u[f]||(A=p=0)||m.pop();)if(1===u.nodeType&&++A&&u===t){d[e]=[w,p,A];break}}else if(y&&(A=p=(l=(d=(c=(u=t)[x]||(u[x]={}))[u.uniqueID]||(c[u.uniqueID]={}))[e]||[])[0]===w&&l[1]),!1===A)for(;(u=++p&&u&&u[f]||(A=p=0)||m.pop())&&((a?u.nodeName.toLowerCase()!==v:1!==u.nodeType)||!++A||(y&&((d=(c=u[x]||(u[x]={}))[u.uniqueID]||(c[u.uniqueID]={}))[e]=[w,A]),u!==t)););return(A-=s)===n||A%n==0&&A/n>=0}}},PSEUDO:function(e,t){var i,s=n.pseudos[e]||n.setFilters[e.toLowerCase()]||ae.error("unsupported pseudo: "+e);return s[x]?s(t):s.length>1?(i=[e,e,"",t],n.setFilters.hasOwnProperty(e.toLowerCase())?le((function(e,i){for(var n,r=s(e,t),o=r.length;o--;)e[n=O(e,r[o])]=!(i[n]=r[o])})):function(e){return s(e,0,i)}):s}},pseudos:{not:le((function(e){var t=[],i=[],n=a(e.replace(j,"$1"));return n[x]?le((function(e,t,i,s){for(var r,o=n(e,null,s,[]),a=e.length;a--;)(r=o[a])&&(e[a]=!(t[a]=r))})):function(e,s,r){return t[0]=e,n(t,null,r,i),t[0]=null,!i.pop()}})),has:le((function(e){return function(t){return ae(e,t).length>0}})),contains:le((function(e){return e=e.replace(te,ie),function(t){return(t.textContent||s(t)).indexOf(e)>-1}})),lang:le((function(e){return X.test(e||"")||ae.error("unsupported lang: "+e),e=e.replace(te,ie).toLowerCase(),function(t){var i;do{if(i=f?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(i=i.toLowerCase())===e||0===i.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var i=e.location&&e.location.hash;return i&&i.slice(1)===t.id},root:function(e){return e===m},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:fe(!1),disabled:fe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!n.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return K.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge((function(){return[0]})),last:ge((function(e,t){return[t-1]})),eq:ge((function(e,t,i){return[i<0?i+t:i]})),even:ge((function(e,t){for(var i=0;it?t:i;--n>=0;)e.push(n);return e})),gt:ge((function(e,t,i){for(var n=i<0?i+t:i;++n1?function(t,i,n){for(var s=e.length;s--;)if(!e[s](t,i,n))return!1;return!0}:e[0]}function we(e,t,i,n,s){for(var r,o=[],a=0,h=e.length,l=null!=t;a-1&&(r[l]=!(o[l]=c))}}else v=we(v===o?v.splice(m,v.length):v),s?s(null,o,v,h):L.apply(o,v)}))}function Ce(e){for(var t,i,s,r=e.length,o=n.relative[e[0].type],a=o||n.relative[" "],h=o?1:0,d=xe((function(e){return e===t}),a,!0),c=xe((function(e){return O(t,e)>-1}),a,!0),u=[function(e,i,n){var s=!o&&(n||i!==l)||((t=i).nodeType?d(e,i,n):c(e,i,n));return t=null,s}];h1&&be(u),h>1&&Ae(e.slice(0,h-1).concat({value:" "===e[h-2].type?"*":""})).replace(j,"$1"),i,h0,s=e.length>0,r=function(r,o,a,h,d){var c,m,g,v=0,y="0",A=r&&[],x=[],b=l,k=r||s&&n.find.TAG("*",d),C=w+=null==b?1:Math.random()||.1,E=k.length;for(d&&(l=o==p||o||d);y!==E&&null!=(c=k[y]);y++){if(s&&c){for(m=0,o||c.ownerDocument==p||(u(c),a=!f);g=e[m++];)if(g(c,o||p,a)){h.push(c);break}d&&(w=C)}i&&((c=!g&&c)&&v--,r&&A.push(c))}if(v+=y,i&&y!==v){for(m=0;g=t[m++];)g(A,x,o,a);if(r){if(v>0)for(;y--;)A[y]||x[y]||(x[y]=M.call(h));x=we(x)}L.apply(h,x),d&&!r&&x.length>0&&v+t.length>1&&ae.uniqueSort(h)}return d&&(w=C,l=b),A};return i?le(r):r}(r,s))).selector=e}return a},h=ae.select=function(e,t,i,s){var r,h,l,d,c,u="function"==typeof e&&e,p=!s&&o(e=u.selector||e);if(i=i||[],1===p.length){if((h=p[0]=p[0].slice(0)).length>2&&"ID"===(l=h[0]).type&&9===t.nodeType&&f&&n.relative[h[1].type]){if(!(t=(n.find.ID(l.matches[0].replace(te,ie),t)||[])[0]))return i;u&&(t=t.parentNode),e=e.slice(h.shift().value.length)}for(r=G.needsContext.test(e)?0:h.length;r--&&(l=h[r],!n.relative[d=l.type]);)if((c=n.find[d])&&(s=c(l.matches[0].replace(te,ie),ee.test(h[0].type)&&ve(t.parentNode)||t))){if(h.splice(r,1),!(e=s.length&&Ae(h)))return L.apply(i,s),i;break}}return(u||a(e,p))(s,t,!f,i,!t||ee.test(e)&&ve(t.parentNode)||t),i},i.sortStable=x.split("").sort(I).join("")===x,i.detectDuplicates=!!c,u(),i.sortDetached=de((function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))})),de((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||ce("type|href|height|width",(function(e,t,i){if(!i)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),i.attributes&&de((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||ce("value",(function(e,t,i){if(!i&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),de((function(e){return null==e.getAttribute("disabled")}))||ce(R,(function(e,t,i){var n;if(!i)return!0===e[t]?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null})),ae}(e);b.find=k,b.expr=k.selectors,b.expr[":"]=b.expr.pseudos,b.uniqueSort=b.unique=k.uniqueSort,b.text=k.getText,b.isXMLDoc=k.isXML,b.contains=k.contains,b.escapeSelector=k.escape;var C=function(e,t,i){for(var n=[],s=void 0!==i;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(s&&b(e).is(i))break;n.push(e)}return n},E=function(e,t){for(var i=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i},D=b.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var I=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function S(e,t,i){return m(t)?b.grep(e,(function(e,n){return!!t.call(e,n,e)!==i})):t.nodeType?b.grep(e,(function(e){return e===t!==i})):"string"!=typeof t?b.grep(e,(function(e){return a.call(t,e)>-1!==i})):b.filter(t,e,i)}b.filter=function(e,t,i){var n=t[0];return i&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?b.find.matchesSelector(n,e)?[n]:[]:b.find.matches(e,b.grep(t,(function(e){return 1===e.nodeType})))},b.fn.extend({find:function(e){var t,i,n=this.length,s=this;if("string"!=typeof e)return this.pushStack(b(e).filter((function(){for(t=0;t1?b.uniqueSort(i):i},filter:function(e){return this.pushStack(S(this,e||[],!1))},not:function(e){return this.pushStack(S(this,e||[],!0))},is:function(e){return!!S(this,"string"==typeof e&&D.test(e)?b(e):e||[],!1).length}});var B,M=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(b.fn.init=function(e,t,i){var n,s;if(!e)return this;if(i=i||B,"string"==typeof e){if(!(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:M.exec(e))||!n[1]&&t)return!t||t.jquery?(t||i).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof b?t[0]:t,b.merge(this,b.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:g,!0)),I.test(n[1])&&b.isPlainObject(t))for(n in t)m(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return(s=g.getElementById(n[2]))&&(this[0]=s,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==i.ready?i.ready(e):e(b):b.makeArray(e,this)}).prototype=b.fn,B=b(g);var T=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}b.fn.extend({has:function(e){var t=b(e,this),i=t.length;return this.filter((function(){for(var e=0;e-1:1===i.nodeType&&b.find.matchesSelector(i,e))){r.push(i);break}return this.pushStack(r.length>1?b.uniqueSort(r):r)},index:function(e){return e?"string"==typeof e?a.call(b(e),this[0]):a.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(b.uniqueSort(b.merge(this.get(),b(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return C(e,"parentNode")},parentsUntil:function(e,t,i){return C(e,"parentNode",i)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return C(e,"nextSibling")},prevAll:function(e){return C(e,"previousSibling")},nextUntil:function(e,t,i){return C(e,"nextSibling",i)},prevUntil:function(e,t,i){return C(e,"previousSibling",i)},siblings:function(e){return E((e.parentNode||{}).firstChild,e)},children:function(e){return E(e.firstChild)},contents:function(e){return null!=e.contentDocument&&n(e.contentDocument)?e.contentDocument:(N(e,"template")&&(e=e.content||e),b.merge([],e.childNodes))}},(function(e,t){b.fn[e]=function(i,n){var s=b.map(this,t,i);return"Until"!==e.slice(-5)&&(n=i),n&&"string"==typeof n&&(s=b.filter(n,s)),this.length>1&&(L[e]||b.uniqueSort(s),T.test(e)&&s.reverse()),this.pushStack(s)}}));var O=/[^\x20\t\r\n\f]+/g;function R(e){return e}function F(e){throw e}function _(e,t,i,n){var s;try{e&&m(s=e.promise)?s.call(e).done(t).fail(i):e&&m(s=e.then)?s.call(e,t,i):t.apply(void 0,[e].slice(n))}catch(e){i.apply(void 0,[e])}}b.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return b.each(e.match(O)||[],(function(e,i){t[i]=!0})),t}(e):b.extend({},e);var t,i,n,s,r=[],o=[],a=-1,h=function(){for(s=s||e.once,n=t=!0;o.length;a=-1)for(i=o.shift();++a-1;)r.splice(i,1),i<=a&&a--})),this},has:function(e){return e?b.inArray(e,r)>-1:r.length>0},empty:function(){return r&&(r=[]),this},disable:function(){return s=o=[],r=i="",this},disabled:function(){return!r},lock:function(){return s=o=[],i||t||(r=i=""),this},locked:function(){return!!s},fireWith:function(e,i){return s||(i=[e,(i=i||[]).slice?i.slice():i],o.push(i),t||h()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!n}};return l},b.extend({Deferred:function(t){var i=[["notify","progress",b.Callbacks("memory"),b.Callbacks("memory"),2],["resolve","done",b.Callbacks("once memory"),b.Callbacks("once memory"),0,"resolved"],["reject","fail",b.Callbacks("once memory"),b.Callbacks("once memory"),1,"rejected"]],n="pending",s={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},catch:function(e){return s.then(null,e)},pipe:function(){var e=arguments;return b.Deferred((function(t){b.each(i,(function(i,n){var s=m(e[n[4]])&&e[n[4]];r[n[1]]((function(){var e=s&&s.apply(this,arguments);e&&m(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[n[0]+"With"](this,s?[e]:arguments)}))})),e=null})).promise()},then:function(t,n,s){var r=0;function o(t,i,n,s){return function(){var a=this,h=arguments,l=function(){var e,l;if(!(t=r&&(n!==F&&(a=void 0,h=[e]),i.rejectWith(a,h))}};t?d():(b.Deferred.getStackHook&&(d.stackTrace=b.Deferred.getStackHook()),e.setTimeout(d))}}return b.Deferred((function(e){i[0][3].add(o(0,e,m(s)?s:R,e.notifyWith)),i[1][3].add(o(0,e,m(t)?t:R)),i[2][3].add(o(0,e,m(n)?n:F))})).promise()},promise:function(e){return null!=e?b.extend(e,s):s}},r={};return b.each(i,(function(e,t){var o=t[2],a=t[5];s[t[1]]=o.add,a&&o.add((function(){n=a}),i[3-e][2].disable,i[3-e][3].disable,i[0][2].lock,i[0][3].lock),o.add(t[3].fire),r[t[0]]=function(){return r[t[0]+"With"](this===r?void 0:this,arguments),this},r[t[0]+"With"]=o.fireWith})),s.promise(r),t&&t.call(r,r),r},when:function(e){var t=arguments.length,i=t,n=Array(i),r=s.call(arguments),o=b.Deferred(),a=function(e){return function(i){n[e]=this,r[e]=arguments.length>1?s.call(arguments):i,--t||o.resolveWith(n,r)}};if(t<=1&&(_(e,o.done(a(i)).resolve,o.reject,!t),"pending"===o.state()||m(r[i]&&r[i].then)))return o.then();for(;i--;)_(r[i],a(i),o.reject);return o.promise()}});var z=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;b.Deferred.exceptionHook=function(t,i){e.console&&e.console.warn&&t&&z.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,i)},b.readyException=function(t){e.setTimeout((function(){throw t}))};var Q=b.Deferred();function H(){g.removeEventListener("DOMContentLoaded",H),e.removeEventListener("load",H),b.ready()}b.fn.ready=function(e){return Q.then(e).catch((function(e){b.readyException(e)})),this},b.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--b.readyWait:b.isReady)||(b.isReady=!0,!0!==e&&--b.readyWait>0||Q.resolveWith(g,[b]))}}),b.ready.then=Q.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?e.setTimeout(b.ready):(g.addEventListener("DOMContentLoaded",H),e.addEventListener("load",H));var j=function(e,t,i,n,s,r,o){var a=0,h=e.length,l=null==i;if("object"===A(i))for(a in s=!0,i)j(e,t,a,i[a],!0,r,o);else if(void 0!==n&&(s=!0,m(n)||(o=!0),l&&(o?(t.call(e,n),t=null):(l=t,t=function(e,t,i){return l.call(b(e),i)})),t))for(;a1,null,!0)},removeData:function(e){return this.each((function(){K.remove(this,e)}))}}),b.extend({queue:function(e,t,i){var n;if(e)return t=(t||"fx")+"queue",n=Y.get(e,t),i&&(!n||Array.isArray(i)?n=Y.access(e,t,b.makeArray(i)):n.push(i)),n||[]},dequeue:function(e,t){t=t||"fx";var i=b.queue(e,t),n=i.length,s=i.shift(),r=b._queueHooks(e,t);"inprogress"===s&&(s=i.shift(),n--),s&&("fx"===t&&i.unshift("inprogress"),delete r.stop,s.call(e,(function(){b.dequeue(e,t)}),r)),!n&&r&&r.empty.fire()},_queueHooks:function(e,t){var i=t+"queueHooks";return Y.get(e,i)||Y.access(e,i,{empty:b.Callbacks("once memory").add((function(){Y.remove(e,[t+"queue",i])}))})}}),b.fn.extend({queue:function(e,t){var i=2;return"string"!=typeof e&&(t=e,e="fx",i--),arguments.length\x20\t\r\n\f]*)/i,fe=/^$|^module$|\/(?:java|ecma)script/i;ce=g.createDocumentFragment().appendChild(g.createElement("div")),(ue=g.createElement("input")).setAttribute("type","radio"),ue.setAttribute("checked","checked"),ue.setAttribute("name","t"),ce.appendChild(ue),p.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",p.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",p.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var i;return i=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?b.merge([e],i):i}function ye(e,t){for(var i=0,n=e.length;i",""]);var Ae=/<|&#?\w+;/;function xe(e,t,i,n,s){for(var r,o,a,h,l,d,c=t.createDocumentFragment(),u=[],p=0,m=e.length;p-1)s&&s.push(r);else if(l=se(r),o=ve(c.appendChild(r),"script"),l&&ye(o),i)for(d=0;r=o[d++];)fe.test(r.type||"")&&i.push(r);return c}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function ke(){return!1}function Ce(e,t){return e===function(){try{return g.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,i,n,s,r){var o,a;if("object"==typeof t){for(a in"string"!=typeof i&&(n=n||i,i=void 0),t)Ee(e,a,i,n,t[a],r);return e}if(null==n&&null==s?(s=i,n=i=void 0):null==s&&("string"==typeof i?(s=n,n=void 0):(s=n,n=i,i=void 0)),!1===s)s=ke;else if(!s)return e;return 1===r&&(o=s,(s=function(e){return b().off(e),o.apply(this,arguments)}).guid=o.guid||(o.guid=b.guid++)),e.each((function(){b.event.add(this,t,s,n,i)}))}function De(e,t,i){i?(Y.set(e,t,!1),b.event.add(e,t,{namespace:!1,handler:function(e){var n,r,o=Y.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(b.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=s.call(arguments),Y.set(this,t,o),n=i(this,t),this[t](),o!==(r=Y.get(this,t))||n?Y.set(this,t,!1):r={},o!==r)return e.stopImmediatePropagation(),e.preventDefault(),r&&r.value}else o.length&&(Y.set(this,t,{value:b.event.trigger(b.extend(o[0],b.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,t)&&b.event.add(e,t,we)}b.event={global:{},add:function(e,t,i,n,s){var r,o,a,h,l,d,c,u,p,m,f,g=Y.get(e);if(X(e))for(i.handler&&(i=(r=i).handler,s=r.selector),s&&b.find.matchesSelector(ne,s),i.guid||(i.guid=b.guid++),(h=g.events)||(h=g.events=Object.create(null)),(o=g.handle)||(o=g.handle=function(t){return void 0!==b&&b.event.triggered!==t.type?b.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(O)||[""]).length;l--;)p=f=(a=be.exec(t[l])||[])[1],m=(a[2]||"").split(".").sort(),p&&(c=b.event.special[p]||{},p=(s?c.delegateType:c.bindType)||p,c=b.event.special[p]||{},d=b.extend({type:p,origType:f,data:n,handler:i,guid:i.guid,selector:s,needsContext:s&&b.expr.match.needsContext.test(s),namespace:m.join(".")},r),(u=h[p])||((u=h[p]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(e,n,m,o)||e.addEventListener&&e.addEventListener(p,o)),c.add&&(c.add.call(e,d),d.handler.guid||(d.handler.guid=i.guid)),s?u.splice(u.delegateCount++,0,d):u.push(d),b.event.global[p]=!0)},remove:function(e,t,i,n,s){var r,o,a,h,l,d,c,u,p,m,f,g=Y.hasData(e)&&Y.get(e);if(g&&(h=g.events)){for(l=(t=(t||"").match(O)||[""]).length;l--;)if(p=f=(a=be.exec(t[l])||[])[1],m=(a[2]||"").split(".").sort(),p){for(c=b.event.special[p]||{},u=h[p=(n?c.delegateType:c.bindType)||p]||[],a=a[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=r=u.length;r--;)d=u[r],!s&&f!==d.origType||i&&i.guid!==d.guid||a&&!a.test(d.namespace)||n&&n!==d.selector&&("**"!==n||!d.selector)||(u.splice(r,1),d.selector&&u.delegateCount--,c.remove&&c.remove.call(e,d));o&&!u.length&&(c.teardown&&!1!==c.teardown.call(e,m,g.handle)||b.removeEvent(e,p,g.handle),delete h[p])}else for(p in h)b.event.remove(e,p+t[l],i,n,!0);b.isEmptyObject(h)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,i,n,s,r,o,a=new Array(arguments.length),h=b.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[h.type]||[],d=b.event.special[h.type]||{};for(a[0]=h,t=1;t=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(r=[],o={},i=0;i-1:b.find(s,this,null,[l]).length),o[s]&&r.push(n);r.length&&a.push({elem:l,handlers:r})}return l=this,h\s*$/g;function Be(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")&&b(e).children("tbody")[0]||e}function Me(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Te(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var i,n,s,r,o,a;if(1===t.nodeType){if(Y.hasData(e)&&(a=Y.get(e).events))for(s in Y.remove(t,"handle events"),a)for(i=0,n=a[s].length;i1&&"string"==typeof g&&!p.checkClone&&Ie.test(g))return e.each((function(s){var r=e.eq(s);v&&(t[0]=g.call(this,s,r.html())),Oe(r,t,i,n)}));if(u&&(o=(s=xe(t,e[0].ownerDocument,!1,e,n)).firstChild,1===s.childNodes.length&&(s=o),o||n)){for(h=(a=b.map(ve(s,"script"),Me)).length;c0&&ye(o,!h&&ve(e,"script")),a},cleanData:function(e){for(var t,i,n,s=b.event.special,r=0;void 0!==(i=e[r]);r++)if(X(i)){if(t=i[Y.expando]){if(t.events)for(n in t.events)s[n]?b.event.remove(i,n):b.removeEvent(i,n,t.handle);i[Y.expando]=void 0}i[K.expando]&&(i[K.expando]=void 0)}}}),b.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return j(this,(function(e){return void 0===e?b.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Oe(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Be(this,e).appendChild(e)}))},prepend:function(){return Oe(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Be(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Oe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Oe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(b.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return b.clone(this,e,t)}))},html:function(e){return j(this,(function(e){var t=this[0]||{},i=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!ge[(me.exec(e)||["",""])[1].toLowerCase()]){e=b.htmlPrefilter(e);try{for(;i=0&&(h+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-r-h-a-.5))||0),h}function $e(e,t,i){var n=_e(e),s=(!p.boxSizingReliable()||i)&&"border-box"===b.css(e,"boxSizing",!1,n),r=s,o=He(e,t,n),a="offset"+t[0].toUpperCase()+t.slice(1);if(Fe.test(o)){if(!i)return o;o="auto"}return(!p.boxSizingReliable()&&s||!p.reliableTrDimensions()&&N(e,"tr")||"auto"===o||!parseFloat(o)&&"inline"===b.css(e,"display",!1,n))&&e.getClientRects().length&&(s="border-box"===b.css(e,"boxSizing",!1,n),(r=a in e)&&(o=e[a])),(o=parseFloat(o)||0)+Je(e,t,i||(s?"border":"content"),r,n,o)+"px"}function et(e,t,i,n,s){return new et.prototype.init(e,t,i,n,s)}b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=He(e,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,i,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var s,r,o,a=U(t),h=Ge.test(t),l=e.style;if(h||(t=Ue(a)),o=b.cssHooks[t]||b.cssHooks[a],void 0===i)return o&&"get"in o&&void 0!==(s=o.get(e,!1,n))?s:l[t];"string"===(r=typeof i)&&(s=te.exec(i))&&s[1]&&(i=ae(e,t,s),r="number"),null!=i&&i==i&&("number"!==r||h||(i+=s&&s[3]||(b.cssNumber[a]?"":"px")),p.clearCloneStyle||""!==i||0!==t.indexOf("background")||(l[t]="inherit"),o&&"set"in o&&void 0===(i=o.set(e,i,n))||(h?l.setProperty(t,i):l[t]=i))}},css:function(e,t,i,n){var s,r,o,a=U(t);return Ge.test(t)||(t=Ue(a)),(o=b.cssHooks[t]||b.cssHooks[a])&&"get"in o&&(s=o.get(e,!0,i)),void 0===s&&(s=He(e,t,n)),"normal"===s&&t in Ke&&(s=Ke[t]),""===i||i?(r=parseFloat(s),!0===i||isFinite(r)?r||0:s):s}}),b.each(["height","width"],(function(e,t){b.cssHooks[t]={get:function(e,i,n){if(i)return!Xe.test(b.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?$e(e,t,n):ze(e,Ye,(function(){return $e(e,t,n)}))},set:function(e,i,n){var s,r=_e(e),o=!p.scrollboxSize()&&"absolute"===r.position,a=(o||n)&&"border-box"===b.css(e,"boxSizing",!1,r),h=n?Je(e,t,n,a,r):0;return a&&o&&(h-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(r[t])-Je(e,t,"border",!1,r)-.5)),h&&(s=te.exec(i))&&"px"!==(s[3]||"px")&&(e.style[t]=i,i=b.css(e,t)),Ze(0,i,h)}}})),b.cssHooks.marginLeft=je(p.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(He(e,"marginLeft"))||e.getBoundingClientRect().left-ze(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),b.each({margin:"",padding:"",border:"Width"},(function(e,t){b.cssHooks[e+t]={expand:function(i){for(var n=0,s={},r="string"==typeof i?i.split(" "):[i];n<4;n++)s[e+ie[n]+t]=r[n]||r[n-2]||r[0];return s}},"margin"!==e&&(b.cssHooks[e+t].set=Ze)})),b.fn.extend({css:function(e,t){return j(this,(function(e,t,i){var n,s,r={},o=0;if(Array.isArray(t)){for(n=_e(e),s=t.length;o1)}}),b.Tween=et,et.prototype={constructor:et,init:function(e,t,i,n,s,r){this.elem=e,this.prop=i,this.easing=s||b.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=r||(b.cssNumber[i]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,i=et.propHooks[this.prop];return this.options.duration?this.pos=t=b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):et.propHooks._default.set(this),this}},et.prototype.init.prototype=et.prototype,et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=b.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):1!==e.elem.nodeType||!b.cssHooks[e.prop]&&null==e.elem.style[Ue(e.prop)]?e.elem[e.prop]=e.now:b.style(e.elem,e.prop,e.now+e.unit)}}},et.propHooks.scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},b.fx=et.prototype.init,b.fx.step={};var tt,it,nt=/^(?:toggle|show|hide)$/,st=/queueHooks$/;function rt(){it&&(!1===g.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(rt):e.setTimeout(rt,b.fx.interval),b.fx.tick())}function ot(){return e.setTimeout((function(){tt=void 0})),tt=Date.now()}function at(e,t){var i,n=0,s={height:e};for(t=t?1:0;n<4;n+=2-t)s["margin"+(i=ie[n])]=s["padding"+i]=e;return t&&(s.opacity=s.width=e),s}function ht(e,t,i){for(var n,s=(lt.tweeners[t]||[]).concat(lt.tweeners["*"]),r=0,o=s.length;r1)},removeAttr:function(e){return this.each((function(){b.removeAttr(this,e)}))}}),b.extend({attr:function(e,t,i){var n,s,r=e.nodeType;if(3!==r&&8!==r&&2!==r)return void 0===e.getAttribute?b.prop(e,t,i):(1===r&&b.isXMLDoc(e)||(s=b.attrHooks[t.toLowerCase()]||(b.expr.match.bool.test(t)?dt:void 0)),void 0!==i?null===i?void b.removeAttr(e,t):s&&"set"in s&&void 0!==(n=s.set(e,i,t))?n:(e.setAttribute(t,i+""),i):s&&"get"in s&&null!==(n=s.get(e,t))?n:null==(n=b.find.attr(e,t))?void 0:n)},attrHooks:{type:{set:function(e,t){if(!p.radioValue&&"radio"===t&&N(e,"input")){var i=e.value;return e.setAttribute("type",t),i&&(e.value=i),t}}}},removeAttr:function(e,t){var i,n=0,s=t&&t.match(O);if(s&&1===e.nodeType)for(;i=s[n++];)e.removeAttribute(i)}}),dt={set:function(e,t,i){return!1===t?b.removeAttr(e,i):e.setAttribute(i,i),i}},b.each(b.expr.match.bool.source.match(/\w+/g),(function(e,t){var i=ct[t]||b.find.attr;ct[t]=function(e,t,n){var s,r,o=t.toLowerCase();return n||(r=ct[o],ct[o]=s,s=null!=i(e,t,n)?o:null,ct[o]=r),s}}));var ut=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function mt(e){return(e.match(O)||[]).join(" ")}function ft(e){return e.getAttribute&&e.getAttribute("class")||""}function gt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(O)||[]}b.fn.extend({prop:function(e,t){return j(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[b.propFix[e]||e]}))}}),b.extend({prop:function(e,t,i){var n,s,r=e.nodeType;if(3!==r&&8!==r&&2!==r)return 1===r&&b.isXMLDoc(e)||(t=b.propFix[t]||t,s=b.propHooks[t]),void 0!==i?s&&"set"in s&&void 0!==(n=s.set(e,i,t))?n:e[t]=i:s&&"get"in s&&null!==(n=s.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=b.find.attr(e,"tabindex");return t?parseInt(t,10):ut.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),p.optSelected||(b.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),b.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){b.propFix[this.toLowerCase()]=this})),b.fn.extend({addClass:function(e){var t,i,n,s,r,o,a,h=0;if(m(e))return this.each((function(t){b(this).addClass(e.call(this,t,ft(this)))}));if((t=gt(e)).length)for(;i=this[h++];)if(s=ft(i),n=1===i.nodeType&&" "+mt(s)+" "){for(o=0;r=t[o++];)n.indexOf(" "+r+" ")<0&&(n+=r+" ");s!==(a=mt(n))&&i.setAttribute("class",a)}return this},removeClass:function(e){var t,i,n,s,r,o,a,h=0;if(m(e))return this.each((function(t){b(this).removeClass(e.call(this,t,ft(this)))}));if(!arguments.length)return this.attr("class","");if((t=gt(e)).length)for(;i=this[h++];)if(s=ft(i),n=1===i.nodeType&&" "+mt(s)+" "){for(o=0;r=t[o++];)for(;n.indexOf(" "+r+" ")>-1;)n=n.replace(" "+r+" "," ");s!==(a=mt(n))&&i.setAttribute("class",a)}return this},toggleClass:function(e,t){var i=typeof e,n="string"===i||Array.isArray(e);return"boolean"==typeof t&&n?t?this.addClass(e):this.removeClass(e):m(e)?this.each((function(i){b(this).toggleClass(e.call(this,i,ft(this),t),t)})):this.each((function(){var t,s,r,o;if(n)for(s=0,r=b(this),o=gt(e);t=o[s++];)r.hasClass(t)?r.removeClass(t):r.addClass(t);else void 0!==e&&"boolean"!==i||((t=ft(this))&&Y.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Y.get(this,"__className__")||""))}))},hasClass:function(e){var t,i,n=0;for(t=" "+e+" ";i=this[n++];)if(1===i.nodeType&&(" "+mt(ft(i))+" ").indexOf(t)>-1)return!0;return!1}});var vt=/\r/g;b.fn.extend({val:function(e){var t,i,n,s=this[0];return arguments.length?(n=m(e),this.each((function(i){var s;1===this.nodeType&&(null==(s=n?e.call(this,i,b(this).val()):e)?s="":"number"==typeof s?s+="":Array.isArray(s)&&(s=b.map(s,(function(e){return null==e?"":e+""}))),(t=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,s,"value")||(this.value=s))}))):s?(t=b.valHooks[s.type]||b.valHooks[s.nodeName.toLowerCase()])&&"get"in t&&void 0!==(i=t.get(s,"value"))?i:"string"==typeof(i=s.value)?i.replace(vt,""):null==i?"":i:void 0}}),b.extend({valHooks:{option:{get:function(e){var t=b.find.attr(e,"value");return null!=t?t:mt(b.text(e))}},select:{get:function(e){var t,i,n,s=e.options,r=e.selectedIndex,o="select-one"===e.type,a=o?null:[],h=o?r+1:s.length;for(n=r<0?h:o?r:0;n-1)&&(i=!0);return i||(e.selectedIndex=-1),r}}}}),b.each(["radio","checkbox"],(function(){b.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=b.inArray(b(e).val(),t)>-1}},p.checkOn||(b.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),p.focusin="onfocusin"in e;var yt=/^(?:focusinfocus|focusoutblur)$/,At=function(e){e.stopPropagation()};b.extend(b.event,{trigger:function(t,i,n,s){var r,o,a,h,l,c,u,p,v=[n||g],y=d.call(t,"type")?t.type:t,A=d.call(t,"namespace")?t.namespace.split("."):[];if(o=p=a=n=n||g,3!==n.nodeType&&8!==n.nodeType&&!yt.test(y+b.event.triggered)&&(y.indexOf(".")>-1&&(A=y.split("."),y=A.shift(),A.sort()),l=y.indexOf(":")<0&&"on"+y,(t=t[b.expando]?t:new b.Event(y,"object"==typeof t&&t)).isTrigger=s?2:3,t.namespace=A.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+A.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),i=null==i?[t]:b.makeArray(i,[t]),u=b.event.special[y]||{},s||!u.trigger||!1!==u.trigger.apply(n,i))){if(!s&&!u.noBubble&&!f(n)){for(h=u.delegateType||y,yt.test(h+y)||(o=o.parentNode);o;o=o.parentNode)v.push(o),a=o;a===(n.ownerDocument||g)&&v.push(a.defaultView||a.parentWindow||e)}for(r=0;(o=v[r++])&&!t.isPropagationStopped();)p=o,t.type=r>1?h:u.bindType||y,(c=(Y.get(o,"events")||Object.create(null))[t.type]&&Y.get(o,"handle"))&&c.apply(o,i),(c=l&&o[l])&&c.apply&&X(o)&&(t.result=c.apply(o,i),!1===t.result&&t.preventDefault());return t.type=y,s||t.isDefaultPrevented()||u._default&&!1!==u._default.apply(v.pop(),i)||!X(n)||l&&m(n[y])&&!f(n)&&((a=n[l])&&(n[l]=null),b.event.triggered=y,t.isPropagationStopped()&&p.addEventListener(y,At),n[y](),t.isPropagationStopped()&&p.removeEventListener(y,At),b.event.triggered=void 0,a&&(n[l]=a)),t.result}},simulate:function(e,t,i){var n=b.extend(new b.Event,i,{type:e,isSimulated:!0});b.event.trigger(n,null,t)}}),b.fn.extend({trigger:function(e,t){return this.each((function(){b.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var i=this[0];if(i)return b.event.trigger(e,t,i,!0)}}),p.focusin||b.each({focus:"focusin",blur:"focusout"},(function(e,t){var i=function(e){b.event.simulate(t,e.target,b.event.fix(e))};b.event.special[t]={setup:function(){var n=this.ownerDocument||this.document||this,s=Y.access(n,t);s||n.addEventListener(e,i,!0),Y.access(n,t,(s||0)+1)},teardown:function(){var n=this.ownerDocument||this.document||this,s=Y.access(n,t)-1;s?Y.access(n,t,s):(n.removeEventListener(e,i,!0),Y.remove(n,t))}}}));var xt=e.location,bt={guid:Date.now()},wt=/\?/;b.parseXML=function(t){var i,n;if(!t||"string"!=typeof t)return null;try{i=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return n=i&&i.getElementsByTagName("parsererror")[0],i&&!n||b.error("Invalid XML: "+(n?b.map(n.childNodes,(function(e){return e.textContent})).join("\n"):t)),i};var kt=/\[\]$/,Ct=/\r?\n/g,Et=/^(?:submit|button|image|reset|file)$/i,Dt=/^(?:input|select|textarea|keygen)/i;function Nt(e,t,i,n){var s;if(Array.isArray(t))b.each(t,(function(t,s){i||kt.test(e)?n(e,s):Nt(e+"["+("object"==typeof s&&null!=s?t:"")+"]",s,i,n)}));else if(i||"object"!==A(t))n(e,t);else for(s in t)Nt(e+"["+s+"]",t[s],i,n)}b.param=function(e,t){var i,n=[],s=function(e,t){var i=m(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==i?"":i)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,(function(){s(this.name,this.value)}));else for(i in e)Nt(i,e[i],t,s);return n.join("&")},b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&Dt.test(this.nodeName)&&!Et.test(e)&&(this.checked||!pe.test(e))})).map((function(e,t){var i=b(this).val();return null==i?null:Array.isArray(i)?b.map(i,(function(e){return{name:t.name,value:e.replace(Ct,"\r\n")}})):{name:t.name,value:i.replace(Ct,"\r\n")}})).get()}});var It=/%20/g,St=/#.*$/,Bt=/([?&])_=[^&]*/,Mt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Tt=/^(?:GET|HEAD)$/,Lt=/^\/\//,Pt={},Ot={},Rt="*/".concat("*"),Ft=g.createElement("a");function _t(e){return function(t,i){"string"!=typeof t&&(i=t,t="*");var n,s=0,r=t.toLowerCase().match(O)||[];if(m(i))for(;n=r[s++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(i)):(e[n]=e[n]||[]).push(i)}}function zt(e,t,i,n){var s={},r=e===Ot;function o(a){var h;return s[a]=!0,b.each(e[a]||[],(function(e,a){var l=a(t,i,n);return"string"!=typeof l||r||s[l]?r?!(h=l):void 0:(t.dataTypes.unshift(l),o(l),!1)})),h}return o(t.dataTypes[0])||!s["*"]&&o("*")}function Qt(e,t){var i,n,s=b.ajaxSettings.flatOptions||{};for(i in t)void 0!==t[i]&&((s[i]?e:n||(n={}))[i]=t[i]);return n&&b.extend(!0,e,n),e}Ft.href=xt.href,b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:xt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(xt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Rt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Qt(Qt(e,b.ajaxSettings),t):Qt(b.ajaxSettings,e)},ajaxPrefilter:_t(Pt),ajaxTransport:_t(Ot),ajax:function(t,i){"object"==typeof t&&(i=t,t=void 0),i=i||{};var n,s,r,o,a,h,l,d,c,u,p=b.ajaxSetup({},i),m=p.context||p,f=p.context&&(m.nodeType||m.jquery)?b(m):b.event,v=b.Deferred(),y=b.Callbacks("once memory"),A=p.statusCode||{},x={},w={},k="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(l){if(!o)for(o={};t=Mt.exec(r);)o[t[1].toLowerCase()+" "]=(o[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=o[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return l?r:null},setRequestHeader:function(e,t){return null==l&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==l&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)C.always(e[C.status]);else for(t in e)A[t]=[A[t],e[t]];return this},abort:function(e){var t=e||k;return n&&n.abort(t),E(0,t),this}};if(v.promise(C),p.url=((t||p.url||xt.href)+"").replace(Lt,xt.protocol+"//"),p.type=i.method||i.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(O)||[""],null==p.crossDomain){h=g.createElement("a");try{h.href=p.url,h.href=h.href,p.crossDomain=Ft.protocol+"//"+Ft.host!=h.protocol+"//"+h.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),zt(Pt,p,i,C),l)return C;for(c in(d=b.event&&p.global)&&0==b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Tt.test(p.type),s=p.url.replace(St,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(It,"+")):(u=p.url.slice(s.length),p.data&&(p.processData||"string"==typeof p.data)&&(s+=(wt.test(s)?"&":"?")+p.data,delete p.data),!1===p.cache&&(s=s.replace(Bt,"$1"),u=(wt.test(s)?"&":"?")+"_="+bt.guid+++u),p.url=s+u),p.ifModified&&(b.lastModified[s]&&C.setRequestHeader("If-Modified-Since",b.lastModified[s]),b.etag[s]&&C.setRequestHeader("If-None-Match",b.etag[s])),(p.data&&p.hasContent&&!1!==p.contentType||i.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Rt+"; q=0.01":""):p.accepts["*"]),p.headers)C.setRequestHeader(c,p.headers[c]);if(p.beforeSend&&(!1===p.beforeSend.call(m,C,p)||l))return C.abort();if(k="abort",y.add(p.complete),C.done(p.success),C.fail(p.error),n=zt(Ot,p,i,C)){if(C.readyState=1,d&&f.trigger("ajaxSend",[C,p]),l)return C;p.async&&p.timeout>0&&(a=e.setTimeout((function(){C.abort("timeout")}),p.timeout));try{l=!1,n.send(x,E)}catch(e){if(l)throw e;E(-1,e)}}else E(-1,"No Transport");function E(t,i,o,h){var c,u,g,x,w,k=i;l||(l=!0,a&&e.clearTimeout(a),n=void 0,r=h||"",C.readyState=t>0?4:0,c=t>=200&&t<300||304===t,o&&(x=function(e,t,i){for(var n,s,r,o,a=e.contents,h=e.dataTypes;"*"===h[0];)h.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(s in a)if(a[s]&&a[s].test(n)){h.unshift(s);break}if(h[0]in i)r=h[0];else{for(s in i){if(!h[0]||e.converters[s+" "+h[0]]){r=s;break}o||(o=s)}r=r||o}if(r)return r!==h[0]&&h.unshift(r),i[r]}(p,C,o)),!c&&b.inArray("script",p.dataTypes)>-1&&b.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),x=function(e,t,i,n){var s,r,o,a,h,l={},d=e.dataTypes.slice();if(d[1])for(o in e.converters)l[o.toLowerCase()]=e.converters[o];for(r=d.shift();r;)if(e.responseFields[r]&&(i[e.responseFields[r]]=t),!h&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),h=r,r=d.shift())if("*"===r)r=h;else if("*"!==h&&h!==r){if(!(o=l[h+" "+r]||l["* "+r]))for(s in l)if((a=s.split(" "))[1]===r&&(o=l[h+" "+a[0]]||l["* "+a[0]])){!0===o?o=l[s]:!0!==l[s]&&(r=a[0],d.unshift(a[1]));break}if(!0!==o)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+h+" to "+r}}}return{state:"success",data:t}}(p,x,C,c),c?(p.ifModified&&((w=C.getResponseHeader("Last-Modified"))&&(b.lastModified[s]=w),(w=C.getResponseHeader("etag"))&&(b.etag[s]=w)),204===t||"HEAD"===p.type?k="nocontent":304===t?k="notmodified":(k=x.state,u=x.data,c=!(g=x.error))):(g=k,!t&&k||(k="error",t<0&&(t=0))),C.status=t,C.statusText=(i||k)+"",c?v.resolveWith(m,[u,k,C]):v.rejectWith(m,[C,k,g]),C.statusCode(A),A=void 0,d&&f.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?u:g]),y.fireWith(m,[C,k]),d&&(f.trigger("ajaxComplete",[C,p]),--b.active||b.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,i){return b.get(e,t,i,"json")},getScript:function(e,t){return b.get(e,void 0,t,"script")}}),b.each(["get","post"],(function(e,t){b[t]=function(e,i,n,s){return m(i)&&(s=s||n,n=i,i=void 0),b.ajax(b.extend({url:e,type:t,dataType:s,data:i,success:n},b.isPlainObject(e)&&e))}})),b.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),b._evalUrl=function(e,t,i){return b.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){b.globalEval(e,t,i)}})},b.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=b(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return m(e)?this.each((function(t){b(this).wrapInner(e.call(this,t))})):this.each((function(){var t=b(this),i=t.contents();i.length?i.wrapAll(e):t.append(e)}))},wrap:function(e){var t=m(e);return this.each((function(i){b(this).wrapAll(t?e.call(this,i):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){b(this).replaceWith(this.childNodes)})),this}}),b.expr.pseudos.hidden=function(e){return!b.expr.pseudos.visible(e)},b.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},b.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Ht={0:200,1223:204},jt=b.ajaxSettings.xhr();p.cors=!!jt&&"withCredentials"in jt,p.ajax=jt=!!jt,b.ajaxTransport((function(t){var i,n;if(p.cors||jt&&!t.crossDomain)return{send:function(s,r){var o,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];for(o in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest"),s)a.setRequestHeader(o,s[o]);i=function(e){return function(){i&&(i=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?r(0,"error"):r(a.status,a.statusText):r(Ht[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=i(),n=a.onerror=a.ontimeout=i("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout((function(){i&&n()}))},i=i("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(i)throw e}},abort:function(){i&&i()}}})),b.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),b.ajaxTransport("script",(function(e){var t,i;if(e.crossDomain||e.scriptAttrs)return{send:function(n,s){t=b("